Last modified: 2014-03-24 05:09:24 UTC
Say I have the page https://secure.wikimedia.org/wikipedia/en/wiki/Septic_equation then I create a PDF from it via "Print/export, Download as PDF". In the generated document the formulas are obviously embedded as bitmap images. How about using LaTeX formulas directly (that is enclosed in $..$)? What we have in <math>..</math> Wikipedia markup are actually LaTeX formulas.
This is not possible since the PDFs are generated using a toolkit that can not render LaTeX forumulas - therefore embedding them as images is the only solution.
Then I propose that PDFs are generated from LaTeX code that is generated from Wiki markup. I assumed, that it works already this way.
Hmm, well really it *ought* to be possible to render the latex to EPS and then embed that into the PDF output, or some such. I don't know how hard that'd be to plug into the current mwlib & friends export arch though (might still need bitmaps for other formats?)
Problems with embedding EPS: You have to ensure that font size of text and formulas match and you should certainly avoid that math fonts are embedded in every EPS formula. All this is easily avoided by generating PDF from LaTeX in one go.
I have found a LaTeX style called 'wiki.sty' that allows to typeset (currently very simple) Wiki markup by LaTeX: http://www.latex-community.org/index.php?option=com_content&view=article&id=279:wikipedia-markup-for-latex&catid=44:news-latex&Itemid=111
I'm reopening this as I agree that the bitmap math is not really very nice. It looks like the PDF output gets something circa 150dpi, which may be ok for on-screen reading (depending on how the viewer scales them), but looks pretty bad when zoomed in or blown up.
I found the project wb2pdf, that might solve the problem. http://de.wikibooks.org/wiki/Benutzer:Dirk_Huenniger/wb2pdf
Well my tool (wb2pdf) didn't work yesterday because there was a change in the mediawiki software. Now I have taken this into account, thus it works and you can generate LaTeX documents from wikis using the tool, found at the link given above. Especially you get the formulas embedded as vector graphics in the pdf file.
There are extensions which convert wikitext to LaTeX (and from there to pdf if needed). http://www.mediawiki.org/wiki/Extension:Wiki2LaTeX http://www.mediawiki.org/wiki/Extension:WikiPDF
Note that we're also looking into switching our main math rendering to using MathJax (bug 32696) which uses MathML or HTML+CSS to render lovely equations in client-side web goodness.
My tool is now part of debian sid. The package is called mediawiki2latex. So this problem is actually solved. The question is do you want to integrate into mediawiki. Currently its a standalone command line version. A GUI version for windows is also provided.