TrueLatex-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments and Discussions
2010-01-29 - Trevor - Hey, I'm a really big fan of this recipe, and am using it extensively for my class notes. I just wanted to make note of an issue I had today. Basically, I was writing a big long eqnarray
and while there were no LaTeX parse errors, the output still was not being produced. This turned out to be because the resulting PDF was long enough to take up two pages, so convert
was failing. The simple workaround was to split the eqnarray
into two separate eqnarray
s, and it worked just fine. Just a note in case someone runs into the same error.
paperheight
(which is set to 5in
by default) in the default.tmpl
file. The default.tmpl
file is essentially the .tex template file that the recipe uses for rendering the LaTeX code. Making the page too large may slow down the rendering though. In the future versions I will add this (and others) as optional parameters that can be passes on from the markup itself.
paperwidth
and paperheight
parameters from within the (:latex:)
markup: (:latex ... paperwidth=15 paperheight=8:) ... (:latexend:)
. (The default values of these two parameters are 10 and 5 respectively - units in inches)
2010-02-11 - Matt - Hi, I'm also a fan of this recipe. I just switched my server to Fedora Core 12 with TeXLive 2009 today, and I'm having trouble rendering LaTeX. No matter what I try, I always get "ERROR in parsing LaTeX". I made a .tex file with the default template and used pdflatex on it, and it generated a pdf. Do you think this is an issue with FC12, or TeXLive, or something else? By the way, I switched from gentoo linux, so I don't know much about fedora.
/pub/latexcache
and given it the proper permissions (server can read/write to it, the world can read it - chmod 755)? If this doesn't solve the problem, can you please post the complete error message you are getting (including the ones from PHP at the top of the wiki page). I know the error messages are presently not very informative. Will make them so in the next version. Also will be great if you can tell me what the folder
/pub/latexcache
contains after you have got the error.
2010-03-09 - Matt - I modified your script to turn on Verbose when it encounters an error. When editing pages, this makes noticing/fixing syntax errors easier and faster. On the other hand, I doubt you would want it to go verbose when someone is trying to read a page that has some issues. It's nice for editing though. Thanks again for your work on this!
$TrueLatex->AutoVerbose = true
variable will now do the trick (it's set so by default)
2010-04-29 - Matt - I think it would be helpful to define a shorthand markup for TrueLatex. I don't know how most people are using this, but I usually have lots of small LaTeX snippets all over my documents. So typing the full syntax out every time is a little tiring. On my machine, I added the markup ~text~ as a shorthand for truelatex with no options, since with verbose enabling upon an error I very rarely need to specify options. I don't know anything about pmwiki or its conventions, so ~ might be a bad choice, it was just the first thing I found that worked. Anyway, thanks again, I use your work here all the time. How easy/hard would it be to modify TrueLatex to work with XeLaTeX as well as LaTeX? I use XeLaTeX to typeset Japanese, and as far as I know it's not something I can do (easily) in LaTeX, but I might be wrong about that.
($ latex code goes here without dollar sign $)
. So now you can do something like ($ 2^3 = 8 $)
. Also, I have included support for XeLaTex. Just set $TrueLatex->RenderMethod="xelatex:convert"
or $TrueLatex->RenderMethod="xelatex-xdvipdfmx:convert"
in config.php. I will include support for xetex
in future versions.
2010-05-06 - Martijn - Hi, just wanted to throw in my 2c about making this recipe work on Windows. Although I doubt many would run a wiki under windows, my home dev machine is (for now) and only a few changes were necessary to make it run well. By default MiKTeX operates in errorstopmode, which causes execution to hang and stall PHP. Similarly, if it encounters an unfamiliar package, by default it opens a GUI and stalls, which is also undesirable. I therefore use pdflatex --interaction=nonstopmode --disable-installer
to get the desired behaviour. Secondly, under Windows the command separator within the shell_exec
statements needs to be changed from ;
to &&
, which is also valid in (most?) Linux shells and prevents execution of following commands if the earlier one fails; which would fail anyway in this case. There were some other minor adjustments I made for personal preference, so perhaps config variables for latex/convert arguments might be useful? Great code by the way, and I hope my suggestions are helpful.
(Just adding a clarification for people who were evaluating this recipe to decide whether or not to use it: This does not effect whether the visitor to a site is using a Mac, Windows or Linux machine. This discussion was completely about Linux vs Windows server, i.e. the machine on which the web-site is running. FYI, most good servers are Linux based.)
2019-01-06 - TDS - I finally migrated my pmwiki to a 7.1 php server but had some hiccups (mainly because I lost a common stylesheet in the migration). I had to tweak the truelatex.php file to provide clearer errors (page rendering would hang if there was a latex error) and then converting the pdf to png would fail if the rendered latex pdf was multi-page. This patch fixed both those issues for me:
-322,7 +326,7
function TrueLatex_parseTeX($dirname, $filename) case "pdflatex": $TrueLatex->OutMsg = array_merge($TrueLatex->OutMsg, explode("\n", shell_exec( "cd ".$dirname ." 2>&1 ; ". - "pdflatex ".$filename." 2>&1" + "pdflatex -interaction nonstopmode -halt-on-error -file-line-error ".$filename." 2>&1" ))); return $filename.'.pdf';-363,8 +377,10
function TrueLatex_extractPNG($dirname, $name_in, $name_out) // trim $TrueLatex->OutMsg = array_merge($TrueLatex->OutMsg, explode("\n", shell_exec( "cd ".$dirname ." 2>&1; ". - "convert ".$name_in." -trim ".$name_out." 2>&1" + "convert ".$name_in." -append -trim ".$name_out." 2>&1" ))); if ($TrueLatex->UsePDFColors) break; // make transparent background
Go back to TrueLatex main page.