LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]()
|
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LatexModePluginThis LaTeX Mode TWiki Plugin allows you to include LaTeX mark up commands within a TWiki page. It uses external programs (specifically latex, dvipng or dvips-and-convert, or mimetex) to generatepng or gif images from the mark up. These images are then included in the rendered TWiki page. The first time a particular image is generated, there may be a significant lag in page rendering as the images are generated on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
This plugin expands the functionality provided by the TWiki:Plugins.MathModePlugin![]() Syntax RulesThe plugin interprets a number of delimiters to declare LaTeX markup strings. For example, if the LatexModePlugin is successfully installed, the string\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}} will render as an image
, when enclosed within the defined delimiters.
Standard SyntaxThis plugin has two standard modes:
Example
![]() Extended SyntaxFor those that are well familiar with LaTeX, a multi-line syntax allowing more complicated markup commands can be declared using%BEGINLATEX% \begin{<environment>} _latex markup_ \end{<environment>} %ENDLATEX%Typically, the declared <environment> will be displaymath , although there is no limitation.
Additional options can be included to modify the rendered result. These include
%BEGINLATEX{label="eq1" density="175" color="red"}% latex markup %ENDLATEX%HTML references to LaTeX equations with a defined <label> can be generated using %REFLATEX{<label>}%.
Rendering optionsBoth DENSITY and SCALE alter the rendered image size and quality. For example, if one doubles the DENSITY and halves the SCALE, the rendered image resolution will improve but keep the same image size on the rendered page. (Note: DENSITY * SCALE is the same in both cases)
Font ColorAs of v1.3, one can now directly control the foreground font color in the rendered mathematics. This is achieved through use of thecolor.sty
package in the intermediate latex file.
Latex is able to render colors defined in 3 color spaces: gray , rgb , and
cmyk . A limited number of colors are predefined in Latex. These include:
\definecolor{Red}{rgb}{1,0,0} \definecolor{Blue}{rgb}{0,0,1} \definecolor{Yellow}{rgb}{1,1,0} \definecolor{Orange}{rgb}{1,0.4,0} \definecolor{Pink}{rgb}{1,0,1} \definecolor{Purple}{rgb}{0.5,0,0.5} \definecolor{Teal}{rgb}{0,0.5,0.5} \definecolor{Navy}{rgb}{0,0,0.5} \definecolor{Aqua}{rgb}{0,1,1} \definecolor{Lime}{rgb}{0,1,0} \definecolor{Green}{rgb}{0,0.5,0} \definecolor{Olive}{rgb}{0.5,0.5,0} \definecolor{Maroon}{rgb}{0.5,0,0} \definecolor{Brown}{rgb}{0.6,0.4,0.2} \definecolor{Black}{gray}{0} \definecolor{Gray}{gray}{0.5} \definecolor{Silver}{gray}{0.75} \definecolor{White}{gray}{1}To use additional colors, they need to be defined in the Latex preamble, as described in the next section. Including images in LaTeX markupv3.0 introduced the ability to include attachments in the latex markup processing. This is most useful for graphics, e.g.%BEGINLATEX{attachment="fig1.eps"}% \includegraphics{fig1.eps} %ENDLATEX%It is common practice in LaTeX, however, to not specify the filename extension. This is implemented in the Plugin as well, so one could type: %BEGINLATEX{attachment="fig1"}% \includegraphics{fig1} %ENDLATEX%and the plugin will search for an attachment with extension '.eps', '.eps.gz', '.pdf', '.png', or '.jpg'. The first extension match will be used, and the rendering engine that can recognize the attachment will also be automatically determined. So for the example above, if a file 'fig1.eps' is attached to the topic, it will be used as the attachment and dvips+convert will be automatically chosen as the rendering engine. Switching the rendering on the flyv3.3 introduced the ability to switch rendering dynamically betweendvipng , dvips+convert , and pdflatex+convert . Some latex packages are not supported by the preferred
method dvipng , for example
TikZ and PGF![]()
graphicx package.
Note that the package must be declared in the LaTeX preamble.
Tables, Figures, and cross-referencesTo round out the functionality available in standard LaTeX, the automatic generation of Figure and Table reference links is also available. These are declared using
eq: or eqn: , fig: , and tbl: as the first characters in any declared label.
The span option is used only by TWiki:Plugins.GenPDFLatex![]() \begin{figure*} ... \end{figure*} .) The default span is one-column.
Sections can be numbered and labeled, for easy cross-referencing. To label
a section, add a %SECLABEL{_label_}% tag after the TWiki section
command. E.g.,
---++ %SECLABEL{sec:intro}% IntroductionCross-references to the label can be generated using %REFLATEX{sec:intro}%. To add automatic numbering to the sections, set the following parameter to a non-zero number. Sections up to this depth will be numbered. The default setting is '0', which disables the numbering and section labels. Defining the LaTeX preambleIn LaTeX, the preamble is used to customize the latex processing, allowing one to add custom styles and declare new commands. In TWiki, the preamble can be set as either a web or topic preference variable* #Set PREAMBLE = \usepackage{color} \definecolor{Aqua}{rgb}{0,1,1}or as a multi-line declaration, using the tags: %BEGINLATEXPREAMBLE% ... %ENDLATEXPREAMBLE%One critical difference between the two exists. With the exception of the color declarations above, the TWiki preference setting will override the default settings, and is intended to provide site administrators a central point to set preamble settings globally. In contrast, the tag declaration will add to the preamble defined by either the default settings or the preference setting, allowing TWiki users to amend the preamble. Common SymbolsSince the LatexModePlugin is not installed on TWiki.org the above external html reference is given so that you can see what the symbols are. For those who do use Latex in your TWiki install, you can copy the tables formatted for TWiki from the following topics (the symbols won't actually display without the plugin). What to type to get a variety of symbols using Latex. Due to page loading constraints, the symbols tables are split up into 5 different topics.
Plugin SettingsPlugin settings are stored as preferences variables. To reference these plugin settings write%<plugin>_<setting>% , i.e. %LATEXMODEPLUGIN_SHORTDESCRIPTION%
LATEXMODEPLUGIN_ . E.g. to the set the font density default for a specific web, WEB, use:
Plugin Installation InstructionsFirst, confirm that the external software needed by the plugin is installed on the TWiki server. This includes:
latex and dvipng ) or (latex and dvips
and convert ) or (pdflatex and convert ) or (mimetex ). The first
three options allow one to include almost any LaTeX markup in a TWiki
topic, whereas mimetex has very limited functionality. Among the first
three options, dvipng is the fastest by a significant margin. The
tweakinline processing (v2.5 and above) to align the baseline of LaTeX
expressions with HTML text uses convert .
mimetex can be used in server environments where a full LaTeX
installation is impractical (e.g. TWiki:Codev.TWikiOnMemoryStick![]()
SecurityAside from providing beautiful rendering of mathematics, LaTeX is fundamentally a programming language. Before installation of this plugin, one should consider the implications of exposing access to a programming language on a web server. TWiki's use of access control can mitigate some of the risk, by limiting access to trusted users. Complementary to this approach, one can prevent certain commands from being rendered using the{donotrenderlist} configuration setting.
To start, before installing the Plugin, one should modify the texmf.cnf
file on the sever to the following variables:
shell_escape = f openout_any = p openin_any = p % note this won't work on WindowsNext, one should declare the donotrenderlist . At a minimum, the LaTeX
commands of input , include , and catcode should be in the list. On
publicly editable wiki's, the commands newcommand and def should be
added as well. newenvironment , newfont , newtheorem , and newsavebox
should be considered as well.
Finally, one should set a limit on the length of time allowed for latex to
finish its processing. This can be done in Apache via
RLimit![]() More DetailsVersion control is not specifically used for the image files. Because the images are generated from the raw text, the topic history includes all the versions of the markup for the expressions, and can be re-rendered when you view a different version. This plugin is an enhanced version of the TWiki:Plugins.MathModePlugin![]() ![]()
Additional Resources (external)
Plugin Info
![]() |