INSTALL
- download the latest version
- rename it to latex.py
- copy it to the parser directory of your moin 1.3 installation or your wiki instance
- probably you have to check the variables used in this file. The path is relative to where moin.cgi of your wiki instance is
config_latex_cache_dir = "./data" config_latex_cache_url = "./data" config_latex_header = "\documentclass[a4paper,12pt]{article}\n\pagestyle{empty}" config_latex_vartmp_dir = "./data/tmp"
- you need to have Attachment enabled in your moin_config.py
e.g. allowed_actions = [ 'AttachFile']
- check if in the data dir of your wiki a directory tmp is created with write permissions to the httpd_user name. e.g.
/usr/share/moin/mywiki/data/tmp drwxr-xr-x 2 wwwrun nogroup 48 2004-04-09 18:57 tmp
Example
{ { {#!latex \begin{equation} x^3 =\int_{0}^{\infty} f(x,y) dy \end{equation} } } }
The space in { { { and } } } must be removed!
Result
If the processor is installed you see the following result instead of the code above.
Changes
MoinMoin - Processor for a LaTeX syntax @license: GNU GPL, see COPYING for details. @copyright: 2002 by Won-kyu Park <wkpark@kldp.org> @copyright: 2003 by Benny Siegert (added config.latex_header) Modified: 2004-03-22 R.Bauer replaced config. by config_ and imported AttachFile 2004-04-09 imported patch from Daniel Hottinger (pagestyle{empty}, -E switch of dvips, input of latex text replaced) 2004-04-09 R.Bauer improvement in speed, because only if the image name is different a new image must be created 2004-07-31 imported patch from Phil West (imgname = imgname + "_latex") 2004-07-31 R.Bauer improvement to handle multipage postscript files as result of dvips. The number of pages is read from the resulting postscript file The last extension must be png to show the resulting image files. Therefore we need to move/rename the png files given from convert. 2004-08-16 R.Bauer bug removed if only wiki text is changed in previous version a single page latex image was not shown again; reported first by Peter Kleiweg. 2004-08-16 R.Bauer added break to the for loop 2004-11-07 R.Bauer changed to PARSER 2004-12-22 R.Bauer patch for unicode names
Discussion
I just deleted the attachment and edited the equation, but a new attachment was not created. -- NirSoffer 2004-07-12 21:06:28
Do you already have refreshed the page cache ? -- ReimarBauer 2004-07-31 10:18:41
I have this in a page, without the space in { { { and } } }:
{ { { #!latex $$x^3 =\int_{0}^{\infty} f(x,y) dy + c$$ } } }
This works fine. I save the page, and the formula appears in the page. But if I make another change to the page, without changing the formula, the formula no longer appears. I have to change the formula to have it reappear. -- PeterKleiweg 2004-08-09 16:35:39
Thanks for this hint I'll fix this. It was easy to fix only a missing else condition. -- ReimarBauer 2004-08-16 11:04:34
I needed to change the filename from latex-1.2.3.py to latex.py to make it work (took me some time to figure out!) Also, the image produced looks really bad for me, I don't know why. -- StefanLangerman
Yes thats right always rename the filename. The -bla.bla.bla is only the version number. Please give some more information. which version of the programs are you using. -- ReimarBauer 2004-09-17 06:58:05
Is there a way to use your latex processor to process bibtex entries? I would like to have my wiki reference a .bib file and print the entries in the file. is this possible? Thanks a lot... Douglas F. Calvert dfc@anize.org
I will check this, in ProcessorMarket is a bibtex processor. I believe later on this will be available for 1.3 too. -- ReimarBauer 2004-11-12 08:20:55
Just a note. When install, it might be necessary to change the path configuration in latex.py:
config_latex_cache_dir = "./data" config_latex_cache_url = "./data" config_latex_header = "\documentclass[a4paper,12pt]{article}\n\pagestyle{empty}" config_latex_vartmp_dir = "./data/tmp"
The path is relative to where moin.cgi is. In my case it is in cgi-bin and I have to change the data dir to ../data. -- JunHu 2004-12-06 22:16:40
I'm new to MoinMoin so it may just be me - but I don't think the parser works on pages where the page name contains a / thus it works on page Test but not page Test/Test.
I will check this later -- ReimarBauer 2004-12-27 09:03:26
Hi everybody, your code is good but I've came accross a bug, that's the bad news, but I've corrected it, that's the good one ;).
I'm making a french wiki, and it seems that when the name of the page uses unicode characters , latex can't be processed. After a lot of try I've found the location of the bug.
latex.py:92
-os.system("%(convert)s -crop 0x0 -density 120x120 %(vartmp)s/%(imgname)s.ps %(outpath)s" +os.system('%(convert)s -crop 0x0 -density 120x120 "%(vartmp)s/%(imgname)s".ps "%(outpath)s"'
latex.py:131
-cmd="%(config_external_mv)s %(old_img_name)s %(new_img_name)s " %{ +cmd='%(config_external_mv)s "%(old_img_name)s" "%(new_img_name)s" ' %{
just some quotes to make convert happy when outpath is like Toto(c3a9) (TotoƩ).
It is patched -- ReimarBauer 2004-12-22 08:38:53
I'm not getting any results following the instructions here -- I also noticed that no latex.pyc is ever getting made (I'm not sure that it necessarily should, but I'd expect it to). What should the permissions on the plugin folder be?
-- LazloFruvous
I have never tested it copied into the data/plugin dir. I know it works if it is copied to
lib/python/site-packages/MoinMoin/parser
. I got aware by this data/plugin dir during the upgrade processs from 1.2 to 1.3. At the moment I have not much time to work on the code but if you find a solution I will implement it. If the owner is the same as for wiki data it should be accessible. I think rx rights of the dir for the user the wiki runs on is enough -- ReimarBauer DateTime(2005-02-24T19:43:39Z)You should also try to switch to JohannesBerg latex parser if possible and report if this works -- ReimarBauer 2005-02-25 09:50:48