Last modified: 2014-10-19 18:56:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9208, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7208 - Change font for texvc-generated images
Change font for texvc-generated images
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-02 17:31 UTC by Markus Krötzsch
Modified: 2014-10-19 18:56 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Markus Krötzsch 2006-09-02 17:31:44 UTC
It has been discussed earlier how to make the math font nicer in appearance (Bug
4915). I strongly suggest to switch the math font to Times in order to achieve
this. I will explain details below, but basically this is best done (IMHO) by
loading the package "txfonts" at the *end* of the preamble. It is necessary to
load it after any AMS package since it overwrites some AMS commands.

So why is Times better here? The standard font used by TeX is "Computer Modern"
(CM) -- a nice font which is *a lot* wider than most fonts and which uses very
light strokes for its letters. E.g. the capital "C" is almost shaped like a
circle. This property causes CM to combine badly with narrower fonts, such as
Times or Helvetica (or their MS-clones), as used in most browsers. Times is less
elegant than CM, but due to this also more readable in small scales.

Try it and you will see that the 12pt Times is very well readable and still more
friendly towards the rest of the text. In fact, you could easily choose 11pt
with Times and still get a very readable result. I also uploaded a sample at
http://ontoworld.org/wiki/Image:TeX_Font_Example.png (containing two versions of
"Times," see below). Take some distance from your screen and judge which line
has the best letters compared to the HTML text, where the Greeks are most
readable, and where the Greek and Roman letters fit together in size and shape.

So why do I suggest "txfonts"? Indeed, there are other ways to use Times, esp.
the package "mathptmx" (just the package "times" is not doing anything with the
math, which is one reason why it is long deprecated). While equivalent on Roman
text, txfonts is nicer for Greek letters, and most importantly, mathptmx has the
distressing property of using a completely different font for \mathcal, which is
not acceptable as a substitute of the current version. The sans-serif font for
txfonts is slightly overscaled as compared to mathptmx; this can be fixed by
writing \usepackage[scaled=.9]{helvet} after the point where txfonts was
included. The sans-serif then looks exactly like the one for mathptmx.

Both mathptmx and txfonts are part of standard LaTeX installations (e.g. of
package tetex-extra on Debian). Of course, there might be LaTeX installations
without them (but I think both require helvet to be available too).

-- Markus Krötzsch
Comment 1 Markus Krötzsch 2006-09-02 17:51:56 UTC
Correction: I was wrong about the rescaling of helvet. This does not have any
effect on math symbols when using txfonts. So the only way to get the fonts
slightly smaller is to use 11pt, which is still very readable, I think. --
Markus Krötzsch
Comment 2 Peter Thoeny 2006-10-16 23:13:24 UTC
I noticed the recent change on Wikipedia of using a smaller font size. Please
revert that, already before the change the font was kind of smallish, now I find
it hard to read content. Of corse I can increase the font size in FireFox, but
then the layout is suffering. Why not stick to web standards and use a font that
is readable by the majority of people?

-- Peter Thoeny
Comment 3 Brion Vibber 2006-10-16 23:46:06 UTC
No such change was made.
Comment 4 Markus Krötzsch 2006-10-17 13:24:58 UTC
Brion's comment and the according change of status to "Resolved Invalid" seems
to refer to Peter's comment, and not to the original suggestion for enhancement.
I reopen the original wish, since it does not appear to have been addressed or
generally denied.

What I suggested was a change of font, not necessarily a change in size (though
I think the Times font can work in smaller sizes, since it is often more
readable on computer screens).

If there is dispute about the chosen font, a small config switch to select
either font would be a simple solution.
Comment 5 Christopher Yeleighton 2007-07-02 11:34:11 UTC
The correct strategy to fix this issue is to wrap all HTML output in <span class="texform" >; this adds structure to the result and takes the burden of the user interface off the markup generator.  Font for formulae should be specified in the the standard style sheet.  I would recommend .texform { font-family:serif }; this is the most portable specification to get Times New Roman.
Comment 6 Markus Krötzsch 2007-07-02 15:12:13 UTC
I am fine with the HTML-output, and I think this can well inherit its major properties from the page's serif font (whatever this is). 

My problem is that the generated *bitmaps* do use a font which is very much different from most common desktop fonts people use in their browsers. Hence it will always stand out of the page, even if the size would be approximately the same. I think that the normal web fonts in use are Times/TimesNewRoman and Helvetica/Arial, and it would be easy to configure MW-math to use a free standard LaTeX font that better fits to those.
Comment 7 Miraceti 2009-06-11 09:02:54 UTC
I would also like to see some solution of this problem. The font used in a text is about "small" (css keyword) nowadays, as it is common in the Web. The font used for generating formulas in png is significantly larger and it is a serif font. This breaks the whole page often and special style guide-lines are to be kept if the page should be at least a bit readable. The problem is nicely illustrated in existence of http://en.wikipedia.org/wiki/Template:Bigmath . If the formulas were displayed well, no such template would be necessary.

There are two possible solutions:
1) Leave a common Web font habits and start to use "medium" size fonts in common text. Medium size is closer (for most users) to the font size used in png formulas.

2) Change the font size in png formulas to smaller. Unfortunately, this can affect the readability of the formulas.

I understand the solution will never be perfect for everybody and it will always have drawbacks. Users use different font size as their defaults. But let's make the problem at least smaller if it cannot be solved completely.

Another, let's say "half solution", would be allowing editors to change the font in png formulas at least in cases when formula is inline. "\textstyle" in TeX changes the way how the formula is typed but does not change the font size. Math template ( http://en.wikipedia.org/wiki/Template:Math ) is not always the solution and it is quite difficult to use (and the template itself must be implemented in every project separately).

As a plus, it would be nice if the user of Wikimedia projects could easily switch between serif and sans-serif fonts in their settings. "Serif font mode" would also make math articles more readable. I am not sure if png formulas in sans-serif fonts would be the best idea.
Comment 8 Nemo 2013-09-17 09:56:40 UTC
Is font hardcoded in the extension? If not, are you sure this bug shouldn't be in Wikimedia product rather than this MediaWiki component?
Comment 9 Markus Krötzsch 2013-09-19 08:37:21 UTC
The font is specified in the preamble of the LaTeX document that is compiled to create the PNG images that MediaWiki uses to display math. This preamble used to be a fixed part of the source code, which was not configurable. Maybe this changed (the bug is 6 years old now ...).

(Side remark: today there seem to be better solutions for Web math use, especially MathJax, http://www.mathjax.org/; using this might solve font issues in a more general way.)
Comment 10 Nemo 2013-09-19 09:37:23 UTC
(In reply to comment #9)
> The font is specified in the preamble of the LaTeX document that is compiled
> to
> create the PNG images that MediaWiki uses to display math. This preamble used
> to be a fixed part of the source code, which was not configurable. Maybe this
> changed (the bug is 6 years old now ...).

Thanks for the clarification, this needs to be checked but it's definitely easier with this pointer.

> (Side remark: today there seem to be better solutions for Web math use,
> especially MathJax, http://www.mathjax.org/; using this might solve font
> issues
> in a more general way.)

Indeed; that's bug 36496.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links