Improve quality of Latex equations published to .html with publish()

Suppose you have this in a blank .m file:

%%
% I was writing something $x^2+e^{\pi i}$ 

Now, hit the publish button and you will see that the equation comes out blurred. I would like to improve the rendering of the latex expression (not to mention that it is not properly aligned with the text).

Here's a snapshot

I tried to play a bit with the publish() function (see lines 160, 702 and 795) but to no avail and honestly I cannot start rewriting the function for a report that I wanted to finish by today (I guess I will revert to beamer again...until TMW provides readable Latex embedding)

6 件のコメント

Mark
Mark 2013 年 12 月 11 日
I also find the LaTeX rendering unacceptable for any kind of distribution. Its quite horrible, so why add such a capability? Might as well have staid with the extended ASCII publishing (super/sub script, etc).
Oleg Komarov
Oleg Komarov 2013 年 12 月 22 日
A workaround is to integrate Mathjax: http://www.mathworks.com/matlabcentral/answers/93851
Andrew Newell
Andrew Newell 2014 年 10 月 27 日
Oleg, do you see any difference using Mathjax? I don't.
Oleg Komarov
Oleg Komarov 2014 年 10 月 28 日
編集済み: Oleg Komarov 2014 年 10 月 28 日
Yes, there is a huge difference but you need to delete the already created .png to let MathJax kick in.
Mark K
Mark K 2015 年 3 月 24 日
You can improve the resolution of the rendered LaTex images according to: <http://stackoverflow.com/questions/21948601/how-to-set-the-font-settings-in-pdf-publish-via-matlab-and-latex>
Andrew Roscoe
Andrew Roscoe 2016 年 6 月 9 日
Unfortunately the method used to modify 'FontSize' from 22 to a bigger number in "publish.m" seems to have stopped working, somewhere between R2015a and R2016a. Now I can't make the equations any bigger.. They are too small for students to read on the page.

サインインしてコメントする。

回答 (1 件)

Amro
Amro 2014 年 2 月 3 日

1 投票

the reason it comes out blurred is that publish will first render the text at double-size, capture the image (indirectly calls the undocumented function: hardcopy(figHandle,'-dzbuffer','-r0')), then downsample the result to half the size (a cheap way of doing anti-aliasing). Other post-processing is performed to remove whitespace around the captured text...
The text object is initially created with a FontSize=22 (so the output image has text equivalent to font size 11).
See edit publish>getRenderingFigure for the details.

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2012 年 10 月 5 日

コメント済み:

2016 年 6 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by