|
Cookbook /
LinuxTexSummary: Enable TeX markup
Version:
Prerequisites:
Status:
Maintainer:
Note: You may want to have a look at JsMath, which offers (almost?) the same functionality but renders the latex on client side which is faster, since slow picture loads are avoided. ThomasP March 26, 2007, at 09:17 PM
DescriptionI've just adapted Cookbook-V1.LinuxTex to PmWiki v2. This is my strongified version. Features
See also
Files
Install
UsageFrom Cookbook-V1: The script assumes that you have a /pub/img/latex/ directory the webserver user has write permissions to.
Put useful settings for these tags in your local.css or another appropriate place:
TroubleshootingArised problems together with their solutions can be found here. DevelopmentOnce-issues that are resolved by now and have found their way into the code, and discussion about future features etc. can be found here. CommentsPlease, when adding a comment, give the date and your name and place a horizontal separator for better readibility. Place open issues here on the page, solutions rather at this page. ThomasP August 21, 2006, at 04:46 AM In the code it says EQ(label) can be used anywhere on the page as an anchor to the equation
but this is seemingly not the case. The reference has to come after the equation for it to work. - Matthijs Sypkens Smit Still to incorporate into the code:Allowing environmentsA bug report: can not display matrix formulas. Although I has used linuxtexsb, all scripts of linuxtex may have the matrix problem. It contains two problem, 1) to translate from \begin{pmatrix} to \begin{nothing{}pmatrix} and 2) to translate from & to & ;. I resolved first problem to eliminate line 135 from linuxtexsb.php line 135 of linuxtexsb.php // $tex = preg_replace('/{([^ ]+})/','{\nothing{}$1',$tex); # Obfuscate potential filenames
- Yasuto Environments: As currently written, the pattern replacement that obscures filenames also prevents the use of environments in math mode, such as matrix environments and the AMS multi-equation building blocks $tex = preg_replace('/(?<!\bbegin|\bend){([^ ]+})/','{\nothing{}$1',$tex); # Obfuscate potential filenames
--nbk Chdir issue when having safe_mode onI had a problem with PHP safe_mode. All of the commands are in safe_mode_exec_dir, however it still doesn't like the call exec("cd $ImgCacheDir && $latexPath work.tex"), I assume because the call to "cd" requires a shell, which is in /bin, not /usr/bin. As a workaround, I modified my local version to do $olddir=getcwd(); chdir($ImgCacheDir); exec("$latexPath work.tex"); chdir($olddir); (and the same for the other exec() calls). But this is really ugly, is there a better way? --Ian See also
WikipublisherThose who need to produce print versions of equation pages may like to investigate the PublishPDF library, which includes the Latexrender class library to support equation markup. For a working example, see http://www.wikipublisher.org/wiki/index.php?n=Wikipublisher.LatexEquations and click the pdf icon. It adds the following markups to pmwiki: {$ latex equation code $} for unnumbered equations
{$label, latex equation code $} for numbered equations
EQ(label) to refer to a numbered equation
In print, the EQ markup finds references anywhere on the page. On the web, it only finds references above and the one immediately after the EQ. An advantage of using the latexrender library is that its authors appear to have put some effort into catching latex commands which pose a security risk. |