DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:latex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:latex [2016-02-06 10:52] – [Installation] 188.32.185.15plugin:latex [2024-03-16 03:12] (current) – The latex plugin makes a kaos instance fail KaiMartin
Line 7: Line 7:
 type       : syntax, admin type       : syntax, admin
 lastupdate : 2011-04-29 lastupdate : 2011-04-29
-compatible : Anteater, Rincewind+compatible : Anteater, Rincewind, Elenor of Tsort, !Hogfather, !Kaos
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : format, math, math2, jsmath, mimetex, mathjax similar    : format, math, math2, jsmath, mimetex, mathjax
 tags       : math, latex, formula tags       : math, latex, formula
-downloadurl: https://github.com/marklundeberg/dokuwiki-plugin-latex/tarball/master 
-bugtracker : https://github.com/marklundeberg/dokuwiki-plugin-latex/issues 
-sourcerepo : https://github.com/marklundeberg/dokuwiki-plugin-latex/ 
-screenshot_img : http://img251.imageshack.us/img251/4784/unled2yn.png 
----- 
  
-This plugin uses [[http://www.latex-project.org/|LaTeX]]+[[http://www.imagemagick.org/|ImageMagick]] to render mathematical formulae embedded within a DokuWiki page. This gives a professional look to equations, and the syntax allows almost copy-paste conversion between DokuWiki and LaTeX manuscripts. For example, you may simply type **''$ a + b = c $''** into your wiki code and it will automatically be shown as {{http://img703.imageshack.us/img703/6269/imga9993cf52d7782506688.png?nolink}}.((vertical alignment is a bit better in practice.))+downloadurl: https://github.com/fsi-hska/dokuwiki-plugin-latex/tarball/master 
 +bugtracker : https://github.com/fsi-hska/dokuwiki-plugin-latex/issues 
 +sourcerepo : https://github.com/fsi-hska/dokuwiki-plugin-latex
  
 +screenshot_img : https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455316e7e1bfc0f89b3e4e7/download/dokuwiki-plugin-latex_screenshot.png
 +----
 +
 +This plugin uses [[http://www.latex-project.org/|LaTeX]]+[[http://www.imagemagick.org/|ImageMagick]] to render mathematical formulae embedded within a DokuWiki page. This gives a professional look to equations, and the syntax allows almost copy-paste conversion between DokuWiki and LaTeX manuscripts. For example, you may simply type **''%%$ a + b = c $%%''** into your wiki code and it will automatically be shown as {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455318a2ac2f6292f56654b/download/dokuwiki-plugin-latex_a-b-c.png?recache|$ a + b = c $}}.((vertical alignment is a bit better in practice.))
  
  
 ===== Installation ===== ===== Installation =====
  
-Follow the usual [[:plugin installation instructions]] to download and install the [[https://github.com/marklundeberg/dokuwiki-plugin-latex/tarball/master|plugin]].+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 :!: **External requirements:** This plugin requires the following software to be installed on the server hosting your wiki. If you do not have root access, contact your administrator.((or consider installing the simpler [[plugin:mimetex|MimeTeX plugin]] which requires no external software)) :!: **External requirements:** This plugin requires the following software to be installed on the server hosting your wiki. If you do not have root access, contact your administrator.((or consider installing the simpler [[plugin:mimetex|MimeTeX plugin]] which requires no external software))
Line 33: Line 34:
 :!: **This plugin will not work in PHP safe mode.** - unless your server administrator has specifically allowed access to the software this plugin needs. :!: **This plugin will not work in PHP safe mode.** - unless your server administrator has specifically allowed access to the software this plugin needs.
  
 +:!: This plugin does not work with PHP 7 and disables DokuWiki (blank screen) with an entry in error.log: ''%%PHP Fatal error:  Class syntax_plugin_latex_common contains 1 abstract method and mu
 +st therefore be declared abstract or implement the remaining methods (dokuwiki\\Extension\\SyntaxPlugin::handle)%%''
 +
 +This can be fixed by adding the lines at the end of latexinc.php
 +<code php>
 +function handle($match, $state, $pos, Doku_Handler $handler){
 +    return array();
 +}
 +</code>
 +See: https://github.com/fsiwi-hka/dokuwiki-plugin-latex/pull/1/commits/02507d33bccded74e60143355aad7ca683011739
  
 ==== Systems ==== ==== Systems ====
Line 39: Line 50:
  
   * **Ubuntu/Debian** (works: March 2011) <code>apt-get install texlive-latex-base imagemagick ghostscript</code>   * **Ubuntu/Debian** (works: March 2011) <code>apt-get install texlive-latex-base imagemagick ghostscript</code>
-  * **CentOS 5**((http://www.wikidot.org/doc:centos-howto))((http://www.barik.net/archive/2010/12/19/162449/)) <code>yum install tetex tetex-fonts tetex-dvips tetex-latex ghostscript ImageMagick+  * **CentOS 5**(( http://www.wikidot.org/doc:centos-howtohttp://www.barik.net/archive/2010/12/19/162449/)) <code>yum install tetex tetex-fonts tetex-dvips tetex-latex ghostscript ImageMagick
 fmtutil-sys --all</code> fmtutil-sys --all</code>
   * **Fedora Core 3** <code>yum install tetex-latex ImageMagick</code>   * **Fedora Core 3** <code>yum install tetex-latex ImageMagick</code>
Line 46: Line 57:
     * Download and install the plugin. For some reason, plugin manager has troubles doing automatic installation on my machine. No mattery, just unpack it manually.     * Download and install the plugin. For some reason, plugin manager has troubles doing automatic installation on my machine. No mattery, just unpack it manually.
     * You will need to download a LaTeX installation ([[http://miktex.org/|MikTex]] works), and [[http://www.imagemagick.org/script/binary-releases.php#windows|ImageMagick]]. You will also need ghostscript, but this may already be provided by MikTex or some other software you have (some feedback here, anybody?). AndrewC: I needed to install GhostScript independently, as it did not come bundled with MikTex.     * You will need to download a LaTeX installation ([[http://miktex.org/|MikTex]] works), and [[http://www.imagemagick.org/script/binary-releases.php#windows|ImageMagick]]. You will also need ghostscript, but this may already be provided by MikTex or some other software you have (some feedback here, anybody?). AndrewC: I needed to install GhostScript independently, as it did not come bundled with MikTex.
-    * Make sure that the LaTeX and ImageMagick binaries are in the PATH variable (and restart your webserver to absorb the change), or use the plugin's configuration to set the full paths -- note that you will need quotes around filenames with spaces, such as ''"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\latex"''.+    * Make sure that the LaTeX and ImageMagick binaries are in the PATH variable (and restart your webserver to absorb the change), or use the plugin's configuration to set the full paths -- note that you will need quotes around filenames with spaces, such as ''%%"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\latex"%%''.
       * The ImageMagick path must be at the beginning of the PATH variable, since the ''convert'' binary has the same name as a Microsoft-supplied program.       * The ImageMagick path must be at the beginning of the PATH variable, since the ''convert'' binary has the same name as a Microsoft-supplied program.
     * Should be good to go; give it a try!     * Should be good to go; give it a try!
Line 58: Line 69:
   * **VERY IMPORTANT DETAIL for Windows users** --Noomen, 3 Nov 2015   * **VERY IMPORTANT DETAIL for Windows users** --Noomen, 3 Nov 2015
     * I have done all of the above and it still didn't work for me after days trying to fix this //'latex failed to render'// issue. What made it finally work, and I don't know why this very important detail was not mentioned above, is using **the correct path format** for the different latex executables used by this plugin. Here is how windows users should enter the path to the //'latex.exe'// executable for example (depending on the specific path in your case): <code>"C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/latex"</code>that is using forward slash and **primary quotation marks** (these **"** not these **'**).     * I have done all of the above and it still didn't work for me after days trying to fix this //'latex failed to render'// issue. What made it finally work, and I don't know why this very important detail was not mentioned above, is using **the correct path format** for the different latex executables used by this plugin. Here is how windows users should enter the path to the //'latex.exe'// executable for example (depending on the specific path in your case): <code>"C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/latex"</code>that is using forward slash and **primary quotation marks** (these **"** not these **'**).
-    * and by the way to enter/change those paths you do not have to edit the //'default.php'// file in the //'DokuWikiStick\dokuwiki\lib\plugins\latex\conf'// folder. In the version which I have, i.e. the '2015-08-10a "Detritus"' version, you can easily do that directly in the "configuration manager". I'm using DokuWikiStick and in this case the url to the config manager is :"http://localhost:8800/doku.php?id=start&do=admin&page=config".+    * and by the way to enter/change those paths you do not have to edit the //'default.php'// file in the //'DokuWikiStick\dokuwiki\lib\plugins\latex\conf'// folder. In the version which I have, i.e. the '2015-08-10a "Detritus"' version, you can easily do that directly in the "configuration manager". I'm using DokuWikiStick and in this case the url to the config manager is: %%"http://localhost:8800/doku.php?id=start&do=admin&page=config"%%. 
 +  * **ImageMagic setup for Windows users** --Liu620, 5/27/2018 
 +    * I have no idea about the history of ImageMagic, but ''identify'' and ''convert'' are not commands of ImageMagic-7.0.7; rather they are options for the ''magick'' command ImageMagic.  
 +    * As a result, the setups for ''identify'' and ''convert'' should be ''magick identify'' and ''magick convert'', respectively. 
 +  * **Windows portable version of ImageMagick (convert.exe and identify.exe)** --arthur, 8th June 2018 
 +    * After hours of struggle installing this on Windows 7, I found that downloading the **portable** version (ImageMagick-7.0.7-38-portable-Q16-x86.zip) of Imagemagick contains both identify.exe and convert.exe. Extracting this zip file and pointing to these files in the configuration path settings resolved this for me <code>"C:/Program Files (x86)/ImageMagick-7.0.7-Q16/convert"</code> 
 + 
 ===== Examples ===== ===== Examples =====
  
-^ wiki code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^ result                                                                          +^ wiki code  ^ result  
-<code>$ a + b = c $</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | {{http://img703.imageshack.us/img703/6269/imga9993cf52d7782506688.png?nolink}}  | +''%%$ a + b = c $%%''  | {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455318a2ac2f6292f56654b/download/dokuwiki-plugin-latex_a-b-c.png?recache|}}  | 
-<code><latex>\begin{algorithm}[H]  \KwData{this text}  \KwResult{how to write algorithm with \LaTeX2e }  initialization\;  \While{not at end of this document}{   read current\;   \eIf{understand}{    go to next section\;    current section becomes this one\;    }{    go back to the beginning of current section\;    }  \caption{How to write algorithms} \end{algorithm}</latex></code>                                                                                                                                                                                                                                                                                                                                                 | {{http://img843.imageshack.us/img843/2010/imgaf16d001ee08de5c3ca7.png?nolink}}  | +''%%<latex>\begin{algorithm}[H]  \KwData{this text}  \KwResult{how to write algorithm with \LaTeX2e }  initialization\;  \While{not at end of this document}{   read current\;   \eIf{understand}{    go to next section\;    current section becomes this one\;    }{    go back to the beginning of current section\;    }  \caption{How to write algorithms} \end{algorithm}</latex>%%''  | {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455317d3b6c4882e32bcdca/download/dokuwiki-plugin-latex_i-m-latex.png?recache|}} it's not working properly!  | 
-<code>\begin{eqnarray*} & & \frac{3}{4 \pi}   \sqrt{4 \cdot x^2   12}\\ & & \lim_{n \to \infty}   \sum_{k=1}^n \frac{1}{k^2} = \frac{\pi^2}{6}\\ & & {\it f}(x) = \frac{1}{\sqrt{x} x^2}\\ & & e^{i \pi} + 1 = 0\; \end{eqnarray*}</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | {{http://img96.imageshack.us/img96/4658/imge7752af4b4fb7cac868f.png?nolink}}    +''%%\begin{eqnarray*} & & \frac{3}{4 \pi}   \sqrt{4 \cdot x^2   12}\\ & & \lim_{n \to \infty}   \sum_{k=1}^n \frac{1}{k^2} = \frac{\pi^2}{6}\\ & & {\it f}(x) = \frac{1}{\sqrt{x} x^2}\\ & & e^{i \pi} + 1 = 0\; \end{eqnarray*}%%''  | {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455462f8c351a7f093aa035/download/dokuwiki-plugin-latex_e.png?recache|}}  
-| from [[http://www.ursoswald.ch/LaTeXGraphics/picture/picture.html|here]]:<code><latex>\setlength{\unitlength}{1mm} \begin{picture}(93,46)   \put( 0,14){\vector(1,0){60}}    \put(61,13){$x$}   \put(20,4){\vector(0,1){37}}    \put(19,43){$y$}   \put(50,34){\circle*{2}}    \put(52,35){$P$}   \multiput(20,34)(4,0){8}{\line(1,0){2}}    \put(14.5,33.5){$y_P$}   \multiput(50,14)(0,4){5}{\line(0,1){2}}    \put(48,11){$x_P$}   \put( 2,8){\vector(3,1){56}}    \put(59,26.5){$x'$}   \multiput(50,34)(1.9,-5.7){2}     {\line(1,-3){1.2}}        \put(52,22){$x_P'$}   \multiput(50,34)(-5.8,-1.933){6}     {\line(-3,-1){3.6}}    \put(12,21){$y_P'$}   \put(22,8){\vector(-1,3){10.5}}    \put(10,41){$y'$} \end{picture}</latex></code>  | {{http://img64.imageshack.us/img64/1405/img597398a2f3c2eeaf96a8.png?nolink}}    |+| from [[http://www.ursoswald.ch/LaTeXGraphics/picture/picture.html|ursoswald.ch]]\\ \\ ''%%<latex>\setlength{\unitlength}{1mm} \begin{picture}(93,46)   \put( 0,14){\vector(1,0){60}}    \put(61,13){$x$}   \put(20,4){\vector(0,1){37}}    \put(19,43){$y$}   \put(50,34){\circle*{2}}    \put(52,35){$P$}   \multiput(20,34)(4,0){8}{\line(1,0){2}}    \put(14.5,33.5){$y_P$}   \multiput(50,14)(0,4){5}{\line(0,1){2}}    \put(48,11){$x_P$}   \put( 2,8){\vector(3,1){56}}    \put(59,26.5){$x'$}   \multiput(50,34)(1.9,-5.7){2}     {\line(1,-3){1.2}}        \put(52,22){$x_P'$}   \multiput(50,34)(-5.8,-1.933){6}     {\line(-3,-1){3.6}}    \put(12,21){$y_P'$}   \put(22,8){\vector(-1,3){10.5}}    \put(10,41){$y'$} \end{picture}</latex>%%''  | {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/6455318470f8d8b23c938dee/download/dokuwiki-plugin-latex_d.png?recache|}}  |
  
 ===== Syntax ===== ===== Syntax =====
Line 80: Line 98:
  
 ==== Caveats ==== ==== Caveats ====
 +
   * Although the numbered-equation styles are available, the numbers do not carry over between equations. You can hard code them by including a LaTeX command like ''\setcounter{equation}{5}'', which will reset the equation counter to start at 5.   * Although the numbered-equation styles are available, the numbers do not carry over between equations. You can hard code them by including a LaTeX command like ''\setcounter{equation}{5}'', which will reset the equation counter to start at 5.
   * The symbol %%$%% can no longer be used for currency, so use ''<nowiki>%%$%%</nowiki>'' instead in wiki text.   * The symbol %%$%% can no longer be used for currency, so use ''<nowiki>%%$%%</nowiki>'' instead in wiki text.
-  * Certain words are blacklisted from being included in LaTeX code -- for example ''$ L_{\rm name} $'' will show as {{http://img163.imageshack.us/img163/1674/renderfail.png?nolink|Fail: triggered security filter; contains blacklisted LaTeX tags.}} because "name" is blacklisted (I am not sure why, but I'm keeping the old blacklist just in case --Mark). The image title tag (tooltip) will indicate that this is the case, emulated here: {{http://img163.imageshack.us/img163/1674/renderfail.png?nolink|Fail: triggered security filter; contains blacklisted LaTeX tags.}}.+  * Certain words are blacklisted from being included in LaTeX code -- for example ''$ L_{\rm name} $'' will show as {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/645531764ee66864e9267908/download/dokuwiki-plugin-latex_latex-render-failed.png?recache&nolink|Fail: triggered security filter; contains blacklisted LaTeX tags.}} because "name" is blacklisted (I am not sure why, but I'm keeping the old blacklist just in case --Mark). The image title tag (tooltip) will indicate that this is the case, emulated here: {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/645531764ee66864e9267908/download/dokuwiki-plugin-latex_latex-render-failed.png?recache&nolink|Fail: triggered security filter; contains blacklisted LaTeX tags.}}.
  
 ===== Configuration/Settings ===== ===== Configuration/Settings =====
Line 94: Line 113:
   * Options to ''convert'' program, to control image size, transparency.   * Options to ''convert'' program, to control image size, transparency.
   * The LaTeX template used for each rendered block: add ''\usepackage{}'' statements here, change color, etc.   * The LaTeX template used for each rendered block: add ''\usepackage{}'' statements here, change color, etc.
 +    * Please give an example as how and where to add ''\usepackage{}''. For example, add the ''algorithm2e'' package used in a previous example. Thanks a lot--Liu620, 5/27/2018.
 +      * Ok, got this figured out. For details see the next paragraph. Liu620, 5/28/2018.
 +
 +To use your favorite LaTex packages, you need to add them using ''\\usepackage{...}'' to the ''default.php'' file located in the ''...\dokuwiki\lib\plugins\latex\conf'' folder. You can put the "use package" statements any where in the block of existing "use package" statements. After adding ''\\usepackage{tikz}'' and ''\\usepackage{algorithm2e}'', drawings and algorithms produced using ''TikZ'' and ''algorithm2e'', respectively, all work nicely. Some other packages should work as well.
  
 ==== Admin plugin ==== ==== Admin plugin ====
Line 103: Line 126:
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
-  * If the plugin settings are incorrect (or you are missing some external software), you will see {{http://img163.imageshack.us/img163/1674/renderfail.png?nolink}} instead of the image. The image will have a tooltip (html ''title'' tag) indicating the particular error.+  * If the plugin settings are incorrect (or you are missing some external software), you will see {{https://trello.com/1/cards/645531296a41b47b6960dce1/attachments/645531764ee66864e9267908/download/dokuwiki-plugin-latex_latex-render-failed.png?recache&nolink}} instead of the image. The image will have a tooltip (html ''title'' tag) indicating the particular error.
   * **Try a test run of your LaTeX installation** from the admin panel of the LaTeX plugin. Besides a tooltip, you will see information on:   * **Try a test run of your LaTeX installation** from the admin panel of the LaTeX plugin. Besides a tooltip, you will see information on:
     * Existence and versions of ''latex'', ''dvips'', ''convert'', and ''identify'' binaries.     * Existence and versions of ''latex'', ''dvips'', ''convert'', and ''identify'' binaries.
Line 111: Line 134:
   * This LaTeX plugin is similar in operation to the LaTeX plugins of other wiki software. Check the [[http://www.mediawiki.org/wiki/Manual:Troubleshooting_math_display_errors|MediaWiki LaTeX troubleshooting guide]] for possible solutions, though note for example that the DokuWiki plugin does not use ''texvc''.   * This LaTeX plugin is similar in operation to the LaTeX plugins of other wiki software. Check the [[http://www.mediawiki.org/wiki/Manual:Troubleshooting_math_display_errors|MediaWiki LaTeX troubleshooting guide]] for possible solutions, though note for example that the DokuWiki plugin does not use ''texvc''.
   * In php.ini "exec" should not appear in the disable_functions list   * In php.ini "exec" should not appear in the disable_functions list
 +
 ==== Specific issues ==== ==== Specific issues ====
-  * Some ancient LaTeX installations may work only  if you remove the ''inputenc'' package from the preamble, but this is not the preferred method since [[:utf-8|Dokuwiki uses UTF-8]].+ 
 +  * Some ancient LaTeX installations may work only  if you remove the ''inputenc'' package from the preamble, but this is not the preferred method since [[:utf-8|DokuWiki uses UTF-8]].
   * ''**Missing latex.fmt**''. This is a bug found in CentOS 5, due to the packages failing to update the proper files. Quite confusingly, normal users are able to use LaTeX with no problems but all web-invoked LaTeX will fail (the ''apache'' user cannot write to its home directory ''/var/www/''.). You can either:   * ''**Missing latex.fmt**''. This is a bug found in CentOS 5, due to the packages failing to update the proper files. Quite confusingly, normal users are able to use LaTeX with no problems but all web-invoked LaTeX will fail (the ''apache'' user cannot write to its home directory ''/var/www/''.). You can either:
     * Run the following command as ''root''((http://www.barik.net/archive/2010/12/19/162449/)) <code>fmtutil-sys --all</code> or, if that does not work,     * Run the following command as ''root''((http://www.barik.net/archive/2010/12/19/162449/)) <code>fmtutil-sys --all</code> or, if that does not work,
-    * Run LaTeX as a normal user allowing LaTeX to generate its own ''latex.fmt'' in your home directory, then copy that ''latex.fmt'' into your temporary directory where the DokuWiki LaTeX plugin can find it.((http://cse.csusb.edu/turner/centos/mediawiki.php)) You can find the file at ''$HOME/.texmf-var/web2c/latex.fmt''. You may want to relocate the temporary folder to be inside your Dokuwiki installation, so that ''latex.fmt'' is not wiped out by a temporary files cleaner.+    * Run LaTeX as a normal user allowing LaTeX to generate its own ''latex.fmt'' in your home directory, then copy that ''latex.fmt'' into your temporary directory where the DokuWiki LaTeX plugin can find it.((http://cse.csusb.edu/turner/centos/mediawiki.php)) You can find the file at ''$HOME/.texmf-var/web2c/latex.fmt''. You may want to relocate the temporary folder to be inside your DokuWiki installation, so that ''latex.fmt'' is not wiped out by a temporary files cleaner.
   * ''**Invalid drive specification**''. This error appears in the troubleshooter's program versions test in Windows. The plugin attempts to call ''convert'' but it gets Microsoft's program rather than the ImageMagick one. Adjust your PATH environment variable or configure the plugin to use an absolute path.   * ''**Invalid drive specification**''. This error appears in the troubleshooter's program versions test in Windows. The plugin attempts to call ''convert'' but it gets Microsoft's program rather than the ImageMagick one. Adjust your PATH environment variable or configure the plugin to use an absolute path.
 +
 ===== Development ===== ===== Development =====
  
Line 130: Line 156:
     * added support for \begin{equation} and \begin{equation*}.     * added support for \begin{equation} and \begin{equation*}.
     * uploaded the plugin here where other people can find it.     * uploaded the plugin here where other people can find it.
- 
   * March 6 2011   * March 6 2011
     * added admin page for cache wiping/cleaning.     * added admin page for cache wiping/cleaning.
Line 138: Line 163:
     * added a minimal ODT render mode.     * added a minimal ODT render mode.
     * added informative tooltip text on images of failed renders.     * added informative tooltip text on images of failed renders.
- 
   * March 9 2011   * March 9 2011
     * added troubleshooter to admin panel     * added troubleshooter to admin panel
- 
   * April 24 2011   * April 24 2011
     * Changed image namespace to :wiki:latex (avoids polluting root namespace)     * Changed image namespace to :wiki:latex (avoids polluting root namespace)
     * Changed temporaries to a media namespace: :wiki:latex:tmp (allows access to temporary files, through the wiki itself!)     * Changed temporaries to a media namespace: :wiki:latex:tmp (allows access to temporary files, through the wiki itself!)
- 
   * April 28/29 2011   * April 28/29 2011
     * Removed keep_tmp option and removed program options from configuration (only paths specified now).     * Removed keep_tmp option and removed program options from configuration (only paths specified now).
     * Made compatible with Windows -- works with [[install:dokuwiki_on_a_stick|DokuWiki on a Stick]], MikTex, and ImageMagick official binaries, essentially out-of-the-box.     * Made compatible with Windows -- works with [[install:dokuwiki_on_a_stick|DokuWiki on a Stick]], MikTex, and ImageMagick official binaries, essentially out-of-the-box.
 +
 ===== Discussion ===== ===== Discussion =====
 +
 ==== Local with MacTeX: LaTeX compilation failed ==== ==== Local with MacTeX: LaTeX compilation failed ====
 +
 On OS X 10.8, I have a local and up to date DokuWiki installation, which works fine. Further, I have installed the latex plugin and a standard MacTeX (up to date) installation. LaTeX works fine when I compile the tex code provided the plugin. On OS X 10.8, I have a local and up to date DokuWiki installation, which works fine. Further, I have installed the latex plugin and a standard MacTeX (up to date) installation. LaTeX works fine when I compile the tex code provided the plugin.
  
-Using the latex plugin in Dokuwiki instead produces "LaTeX render failed" with the hint "LaTeX compilation failed".+Using the latex plugin in DokuWiki instead produces "LaTeX render failed" with the hint "LaTeX compilation failed".
  
 Could you please give me a hand for making the plugin work? Christian Could you please give me a hand for making the plugin work? Christian
Line 175: Line 200:
 $conf['image_format'] = 'png'; $conf['image_format'] = 'png';
 $conf['latex_namespace'] = 'wiki:latex';</code> $conf['latex_namespace'] = 'wiki:latex';</code>
- 
- 
  
  
Line 184: Line 207:
  
 ==== Control over the Images ==== ==== Control over the Images ====
 +
 If the embedded images are not perfectly aligned, you can gain more control by adding 'media_latex' to the class in syntax.php lines 91 and 96. After that create an style.css with 'img.media_latex{ ... }'. If the embedded images are not perfectly aligned, you can gain more control by adding 'media_latex' to the class in syntax.php lines 91 and 96. After that create an style.css with 'img.media_latex{ ... }'.
  
Line 189: Line 213:
  
 ==== Color settings ==== ==== Color settings ====
 +
 After installation, the default color is dark red. After installation, the default color is dark red.
  
Line 201: Line 226:
  
 Click "Save", and you're done. Click "Save", and you're done.
 +
 ==== Dollar Signs ==== ==== Dollar Signs ====
 +
 > Maybe a stupid question but how can I display the Dollars symbol ($) on the page ? The plugin replace all my $ by the message "Latex render failed" It's not very easy to use ''<nowiki>%%$%%</nowiki>'' ! > Maybe a stupid question but how can I display the Dollars symbol ($) on the page ? The plugin replace all my $ by the message "Latex render failed" It's not very easy to use ''<nowiki>%%$%%</nowiki>'' !
  
Line 208: Line 235:
 >>>Well, why don't you try %%<nowiki>%%? -Di >>>Well, why don't you try %%<nowiki>%%? -Di
  
-=== mask $*Dollar*$ as in /* comment */ plugin+=== mask $*Dollar*$ as in /* comment */ plugin  
 >>>Instead of a space add an ''*'' to the ''EntryPattern'' and the ''ExitPattern'' in ''dollar.php''. \\ 1. This is a very rare combination and \\ 2. it will work for all those languages which have a currency symbol after the ammount. E.g. in many european countries we are used to write 2.000,00$  \\ 3. It will not break all existing pages. \\ So change dolar.php to: <code>$this->Lexer->addEntryPattern('\$\*(?=.*\$)',$mode,'plugin_latex_dollar');  </code> and also add an ''*'' to the ExitPattern: <code>function postConnect() { $this->Lexer->addExitPattern('\*\$','plugin_latex_dollar'); }</code> The syntax will change to ''$* a + b = c *$'' which is close to the comment-plugin Syntax (''/%%%%* a comment *%%%%/''. And $2000, 2.000,00$ and a $ alone will work as before. \\ -TT, 2013-02-28 >>>Instead of a space add an ''*'' to the ''EntryPattern'' and the ''ExitPattern'' in ''dollar.php''. \\ 1. This is a very rare combination and \\ 2. it will work for all those languages which have a currency symbol after the ammount. E.g. in many european countries we are used to write 2.000,00$  \\ 3. It will not break all existing pages. \\ So change dolar.php to: <code>$this->Lexer->addEntryPattern('\$\*(?=.*\$)',$mode,'plugin_latex_dollar');  </code> and also add an ''*'' to the ExitPattern: <code>function postConnect() { $this->Lexer->addExitPattern('\*\$','plugin_latex_dollar'); }</code> The syntax will change to ''$* a + b = c *$'' which is close to the comment-plugin Syntax (''/%%%%* a comment *%%%%/''. And $2000, 2.000,00$ and a $ alone will work as before. \\ -TT, 2013-02-28
  
  
 ==== ReadOnly-Access  ==== ==== ReadOnly-Access  ====
 +
 > If i give the group @ALL an "Read"-Permission to read the page, they can access and read the normal Text...but the Latex-Image are not there! What to do? > If i give the group @ALL an "Read"-Permission to read the page, they can access and read the normal Text...but the Latex-Image are not there! What to do?
 >> Solved! Need to give "Read"-Permission to "wiki:latex:*" >> Solved! Need to give "Read"-Permission to "wiki:latex:*"
Line 218: Line 247:
 ==== Toolbar buttons disappear ==== ==== Toolbar buttons disappear ====
  
-The Dokuwiki toolbar buttons were not visible anymore after installation of the Latex plug-in (Using a fresh install with QuickPHP / Firefox12 / Dokuwiki Angua / default template / default settings). As a solution, I disabled and then enabled the Latex plug-in (This does not "prove" that this plug-in is the actual cause). Can anybody confirm this?+The DokuWiki toolbar buttons were not visible anymore after installation of the Latex plug-in (Using a fresh install with QuickPHP / Firefox12 / DokuWiki Angua / default template / default settings). As a solution, I disabled and then enabled the Latex plug-in (This does not "prove" that this plug-in is the actual cause). Can anybody confirm this?
  
 ==== Latex syntax in tables ==== ==== Latex syntax in tables ====
Line 231: Line 260:
  
 >> Strange, it works here! \\ -TT, 2013-02.28 >> Strange, it works here! \\ -TT, 2013-02.28
 +
 ==== Not rendering Latex Code ==== ==== Not rendering Latex Code ====
  
 Plugin does not render any latex code in dokuwiki pages, displays only the text as if not recognizing the syntax. No images in corresponding image folder. With admin tool everything is working fine. Found no error messages or anything. Any hints? Plugin does not render any latex code in dokuwiki pages, displays only the text as if not recognizing the syntax. No images in corresponding image folder. With admin tool everything is working fine. Found no error messages or anything. Any hints?
  
 +See [[https://github.com/marklundeberg/dokuwiki-plugin-latex/issues/9|Latex Render Failure #9]] on the GitHub page of the plugin : permission problem with ImageMagick policies. "They can be set in /etc/ImageMagick-6/policy.xml. In particular you should change the line <policy domain="coder" rights="none" pattern="PS" /> to <policy domain="coder" rights="read" pattern="PS" />"
  
 ==== Converting to PDF ==== ==== Converting to PDF ====
Line 250: Line 281:
  
 ==== Blacklist ==== ==== Blacklist ====
 +
 It is mentioned above that some words are blacklisted and that the blacklist is kept "just in case". The presence of blacklisted words causes the error "Fail: triggered security filter; contains blacklisted LaTeX tags". Where can one find the blacklist? It is mentioned above that some words are blacklisted and that the blacklist is kept "just in case". The presence of blacklisted words causes the error "Fail: triggered security filter; contains blacklisted LaTeX tags". Where can one find the blacklist?
  --- [[user>krichter|krichter]] //2014-08-13 14:43//  --- [[user>krichter|krichter]] //2014-08-13 14:43//
 +
 === From class.latexrender.php === === From class.latexrender.php ===
 +
 <code> <code>
 var $_latex_tags_blacklist = array( var $_latex_tags_blacklist = array(
Line 264: Line 298:
 This would be my guess. This would be my guess.
 --- //[[user>Chris_P|Chris_P]]// --- //[[user>Chris_P|Chris_P]]//
 +
 +==== Blacklist ====
 +
 +Maintained (patched) version of this plugin can be found at [[plugin:latex-was]].
plugin/latex.1454752368.txt.gz · Last modified: 2016-02-06 10:52 by 188.32.185.15

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki