Why is the math output hard to read sometimes?

  • Context: Suggestion 
  • Thread starter Thread starter squidsoft
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
128 replies · 19K views
squidsoft
Messages
56
Reaction score
0
May I suggest improving the format of the math output in the forum.

Consider the following code:

[tex] \mathop\textnormal{Res}\limits_{z=-n}\left\{\frac{\pi}{x^s\sin(\pi s)}\right\}=(-x)^n,\quad n=0,-1,-2,\cdots[/tex]

The equal sign is not well displayed under the Res symbol and the "s" in sine is broken up. I've noticed other problems like this in general. I think PF would look more polished if the math output was nicer looking.
 
Physics news on Phys.org
If I recall correctly, it used to be better. I'm not sure when or why the change occurred.
 
I suspect the problem might be that the LaTeX renderer (which generates the equation images) may work on the assumption that the equations will be displayed on a white background. On a grey background, some of the pixels are too faint. Is it possible to tweak the LaTeX renderer to take account of the grey background?
 
Hey all,

A year ago or so, something changed in the fonts included in the normal LaTeX distributions that come with most Linux distributions. Along with it were a number of other changes that broke PF's latex system. I rewrote some of it, but never really figured out the problem with the fonts.

I will look into it more. I don't actually think it has anything to do with anti-aliasing. The images are currently anti-aliased to white, and then white is dropped out as transparent. If the strokes look correct when anti-aliased to white, it seems that changing the surrounding white pixels to transparent would not affect them. It's worth a shot, though.

- Warren
 
chroot said:
Hey all,

A year ago or so, something changed in the fonts included in the normal LaTeX distributions that come with most Linux distributions. Along with it were a number of other changes that broke PF's latex system. I rewrote some of it, but never really figured out the problem with the fonts.

I will look into it more. I don't actually think it has anything to do with anti-aliasing. The images are currently anti-aliased to white, and then white is dropped out as transparent. If the strokes look correct when anti-aliased to white, it seems that changing the surrounding white pixels to transparent would not affect them. It's worth a shot, though.

- Warren

For what it's worth, I took the PNG image in post #1, on its default white background, and decreased the brightness until its background matched this thread's grey background. I think the result (attached) is therefore what you'd get if anti-aliased to grey. Slightly more legible, I think, but still not great, and I guess that's down to a poor choice of font. Or something.
 

Attachments

  • 2201627-0 darkened.png
    2201627-0 darkened.png
    959 bytes · Views: 606
Can the font be made bold, either in a default setting or when typed by the user (I never use LaTex, so don't know the ins and outs of this)? It just looks like the font is a bit thin and loses something, so if there's a way to make it bold, that might be enough to improve readability.
 
Moonbear said:
Can the font be made bold, either in a default setting or when typed by the user (I never use LaTex, so don't know the ins and outs of this)? It just looks like the font is a bit thin and loses something, so if there's a way to make it bold, that might be enough to improve readability.
That wouldn't be a solution as such, because some equations use both bold and plain font, e.g.

[tex]\mathbf{z} = a\mathbf{x} + b\mathbf{y}[/tex]​

although personally I prefer

[tex]\textbf{z} = a\textbf{x} + b\textbf{y}[/tex]​

However, if you have a greater choice of font weights than just "plain" and "bold", then some slightly heavier fonts might help.
 
Okay, guys... I changed some of the antialiasing behavior in Ghostscript (I turned it down!), and I think the output looks a little better now. If you could, post some troublesome LaTeX here and see if it renders better now.

- Warren
 
I'm not really sure I've found a solution. I'll have to keep hunting.

[tex] <br /> \mathop\textnormal{Res}\limits_{z=-n}\left\{\frac{\pi}{x^s\sin(\pi s)}\right\}=(-x)^n,\quad n=0,-1,-2,\cdots<br /> [/tex]

- Warren
 
[tex]\begin{pmatrix}1 & 0 & 0\\ 0 & \frac{u_x}{u} & \frac{u_y}{u}\\ 0 & -\frac{u_y}{u} & \frac{u_x}{u} \end{pmatrix}[/tex]

Hm, both the parentheses and the zeroes look better than they did here. They used to look like the pixel size was bigger in the LaTeX font. I'm not a big fan of the new [tex]\sum[/tex] though, and x and y are still just barely legible. Have you tried a slightly bigger font size?

It would also be nice if the \dot code would make a slightly bigger dot: [tex]\dot{\vec r}[/tex] (but I realize of course that you can't do anything that changes only that symbol).
 
Could it be an issue with the number of colors in the rendered image?

It seems that many of the old LaTeX images were 8-bit images (up to 256 colors) but the new ones are 4-bit (up to 16 colors) [which have smaller file sizes]. (To save, I right-click on the image then save to my desktop.)

When counting colors in some of the new images, I get 4 colors.
 
I'm playing with it again, so expect a little weirdness.

robphy, the images are being generated explicitly as 8-bit. If they're somehow being down-converted, I'll have to figure out where...

- Warren
 
Strange brackets (I'm seeing the right bracket much thicker at the top :redface:):

[tex]\frac{dr}{d\tau}\ =\ \pm\sqrt{E^2\ -\ \left(1 - \frac{2M}{r}\right)\left(m^2\ +\ \frac{L^2}{r^2}\right)}[/tex]

and don't the r and the tau look very similar?
 
tiny-tim said:
Strange brackets (I'm seeing the right bracket much thicker at the top :redface:):

[tex]\frac{dr}{d\tau}\ =\ \pm\sqrt{E^2\ -\ \left(1 - \frac{2M}{r}\right)\left(m^2\ +\ \frac{L^2}{r^2}\right)}[/tex]

and don't the r and the tau look very similar?

Yes, the r and tau are too similar, IMO. But the brackets have a nice calligraphy look to them.
 
I don't know how they did it but mathlinks has very readable equations without cranking up the resolution higher than PF
 
qntty said:
I don't know how they did it but mathlinks has very readable equations without cranking up the resolution higher than PF

Impressive indeed:

http://alt2.mathlinks.ro/latexrender/pictures/e/6/f/e6f7873e4868755812ca60c34dd13a22e4ea785b.gif

Gif images with alpha anti-aliasing, so I presume they map to 32 bit ARGB colors...

Maybe one of these?

http://packages.debian.org/search?keywords=mimetex

Regards, Hans.
 
Last edited by a moderator:
Hans de Vries said:
Impressive indeed:

http://alt2.mathlinks.ro/latexrender/pictures/e/6/f/e6f7873e4868755812ca60c34dd13a22e4ea785b.gif

Gif images with alpha anti-aliasing, so I presume they map to 32 bit ARGB colors...

That image is 8-bit with about 27 indexed-colors...with transparency.
I suspect one can do fine with 4-bit grey images if it uses up to 16 indexed-colors.
Some of the images I found have been 4-bit with only 4 colors.

When PF first supported [tex]\LaTeX[/tex], it also was and has been impressive.
It's just recently that something seems to have changed.
 
Last edited by a moderator: