User:Austin J. Che/Extensions/LatexDoc

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
** If you wish to use a different location, add <tt>$wgLatexDoc->latexmk = "/path/to/latexmk";</tt> in LocalSettings.php after requiring/including LatexDoc.php.
** If you wish to use a different location, add <tt>$wgLatexDoc->latexmk = "/path/to/latexmk";</tt> in LocalSettings.php after requiring/including LatexDoc.php.
* Removed DVI output (not useful on web)
* Removed DVI output (not useful on web)
-
* Removed filter for "obviously dangerous control words" as it isn't a good security mechanism. Instead, change texmf.cnf so that shell_escape=f, openout_any=p, and openin_any=p. You may also want to run latex under a chroot jail.
+
* '''Security''': Removed filter for "obviously dangerous control words" as it isn't a good security mechanism.  
-
** texmf.cnf is located in /usr/share/texmf/web2c/texmf.cnf on tetex distributions. Debian users should edit /etc/texmf/texmf.d/95NonPath.cnf and run update-texmf as root.
+
** Instead, change texmf.cnf so that shell_escape=f, openout_any=p, and openin_any=p. This disallows running system commands and reading or writing any files not under the directory of the tex file.
 +
*** texmf.cnf is located in /usr/share/texmf/web2c/texmf.cnf on tetex distributions. Debian users should edit /etc/texmf/texmf.d/95NonPath.cnf and run update-texmf as root.
 +
** You may also want to run latex under a chroot jail.
 +
** If anyone notices any other security issues, please let me know.
* Added link to get the log file
* Added link to get the log file

Revision as of 09:38, 7 November 2006

The LatexDoc extension in MediaWiki SVN has been modified as follows:

  • The biggest change is to allow use of other files on the wiki so that bibtex and graphics works.
  • Requires latexmk
    • The default location for latexmk is in the extensions directory of your mediawiki installation.
    • If you wish to use a different location, add $wgLatexDoc->latexmk = "/path/to/latexmk"; in LocalSettings.php after requiring/including LatexDoc.php.
  • Removed DVI output (not useful on web)
  • Security: Removed filter for "obviously dangerous control words" as it isn't a good security mechanism.
    • Instead, change texmf.cnf so that shell_escape=f, openout_any=p, and openin_any=p. This disallows running system commands and reading or writing any files not under the directory of the tex file.
      • texmf.cnf is located in /usr/share/texmf/web2c/texmf.cnf on tetex distributions. Debian users should edit /etc/texmf/texmf.d/95NonPath.cnf and run update-texmf as root.
    • You may also want to run latex under a chroot jail.
    • If anyone notices any other security issues, please let me know.
  • Added link to get the log file

Usage:

Any wiki page that looks like a latex document will automatically have links for added to the top. The Get PDF link will generate a PDF or grab it from the cache if it exists and the Regenerate PDF forces the PDF file to be regenerated.

The special command \usewikifile{Wiki Page Name}{texfilename} can be used. All such commands are stripped before being passed to latexmk for generation of pdf. In addition, the contents of Wiki Page Name are saved as texfilename in the same directory as the page. Thus, you can include graphics or use bibtex where the graphics and .bib file are stored on the wiki.

See an example.


Send bugs and comments to Austin Che. Other extensions including sources can be found at User:Austin J. Che/Extensions.

Personal tools