%META:TOPICINFO{author="GerdNeugebauer" date="1236896542" format="1.1" reprev="1.13" version="1.13"}%
%META:TOPICPARENT{name="WebHome"}%
---+ \LaTeX\ Syntax TWiki Plugin

This is a TWiki Plugin which uses a subset of \LaTeX\ syntax for
input. Thus it is easily possible to use the topics gathered in TWiki
to compose a typeset document.

%TOC%

---++ Coexistence with TWiki Syntax

TWiki has a set of syntax rules for input. They continue to work. This
plugin does not invalidate those rules. This includes embedded HTML.
This is still valid.

Beware that such a practice makes the reuse of the topic as \LaTeX\ 
input harder.

Note that the TWiki variables are still in action. Thus playing around
with the percent sign might lead to unexpected results.

---++ Syntax Rules

In principle the input language of \LaTeX\ is emulated up to a certain
degree. If an control sequence is not defined then it is shown in
blinking red surrounded by question marks, as in \undefined.

---+++ Headings

Note: Star variants of the sectioning commands are currently not
supported.

|!\section{}||from =article.cls=, =report.cls=, =book.cls=, ...|
|!\subsection{}||from =article.cls=, =report.cls=, =book.cls=, ...|
|!\subsubsection{}||from =article.cls=, =report.cls=, =book.cls=, ...|
|!\paragraph{}||from =article.cls=, =report.cls=, =book.cls=, ...|
|!\subparagraph{}||from =article.cls=, =report.cls=, =book.cls=, ...|
|!\subsubparagraph{}|||

\section{Sample section}
\subsection{Sample subsection}
\subsubsection{Sample subsubsection}
\paragraph{Sample paragraph}
\subparagraph{Sample subparagraph}
\subsubparagraph{Sample subsubparagraph}

---+++ Paragraph Formatting

|!\noindent|\noindent|
|!\par|\par|
|!\smallskip|\smallskip|
|!\medskip|\medskip|
|!\bigskip|\bigskip|
|!\begin{center}||
|!\begin{quotation}||
|!\begin{quote}||

\begin{center}
  Sample centered text
\end{center}

\begin{quotation}
  Sample quotation text
\end{quotation}

\begin{quote}
  Sample quoted text
\end{quote}

---+++ Lists

|!\begin{itemize}||
|!\begin{enumerate}||
|!\begin{description}||

\begin{itemize}
\item First item
\item Second item
\end{itemize}

\begin{itemize}
\item[] First item
\item[] Second item
\end{itemize}

\begin{enumerate}
\item First item
\item Second item
\end{enumerate}

\begin{description}
\item[one] First item
\item[two] Second item
\end{description}


---+++ Code

|!\verb|\verb/abc/||
|!\begin{verbatim}...!!\end{verbatim}|||
|!\begin{lstlisting}[...]...!\end{lstlisting}||from =listings.sty=|

\begin{verbatim}
  Sample verbatim text
\end{verbatim}

---+++ Graphics

|!\includegraphics[...]{...}||Include some graphics. Some of the optional arguments are recognized (see below).|from =graphicx.sty=|

Note: The reference to an attachment in TWiki can be accomplished with the TWiki variable =&#37;ATTACHURLPATH&#37;=. It is highly recommended to uses this as path and attach the image in a common graphics format as png, jpg, or gif to the current topic. You should suppress the listing of the attached image in the attachment list when uploading the attachment.

<pre>
  \includegraphics{&#37;ATTACHURLPATH&#37;/sample.png}
</pre>
\includegraphics{%ATTACHURLPATH%/sample.png}

<pre>
  \includegraphics[width=8em]{&#37;ATTACHURLPATH&#37;/sample.png}
</pre>
\includegraphics[width=8em]{%ATTACHURLPATH%/sample.png}

<pre>
  \includegraphics[width=.25\textwidth]{&#37;ATTACHURLPATH&#37;/sample.png}
</pre>
\includegraphics[width=.25\textwidth]{%ATTACHURLPATH%/sample.png}

---+++ Floats

Floats do in fact not float when typeset in HTML. Nevertheless they enable the
use of a caption.

The optional positioning argument is ignored.

|!\begin{table}...!\end{table}||
|!\begin{figure}...!\end{figure}||
|!\caption{...}||

\begin{table}
 \caption{Sample Caption}
 Sample contents.
\end{table}

\begin{figure}
 Sample contents.
 \caption{Sample Caption}
\end{figure}

---+++ Tables

|!\begin{tabular}{...}...!\end{tabular}|||
|!\hline|||
|!\toprule||from =booktabs.sty=|
|!\midrule||from =booktabs.sty=|
|!\bottomrule||from =booktabs.sty=|
|!\cr|||
|\symbol{38}|||

<pre>
\begin{tabular}{ll}
 one & 1\cr
 two & 2\cr
 three & 3\cr
\end{tabular}
</pre>

\begin{tabular}{ll}
 one & 1\cr
 two & 2\cr
 three & 3\cr
\end{tabular}

<pre>
\begin{tabular}{ll}\hline
 one & 1\cr
 two & 2\cr
 three & 3\cr\hline
\end{tabular}
</pre>

\begin{tabular}{ll}\hline
 one & 1\cr
 two & 2\cr
 three & 3\cr\hline
\end{tabular}

<pre>
\begin{tabular}{ll}\toprule
 one & 1\cr\midrule
 two & 2\cr
 three & 3\cr\bottomrule
\end{tabular}
</pre>

\begin{tabular}{ll}\toprule
 one & 1\cr\midrule
 two & 2\cr
 three & 3\cr\bottomrule
\end{tabular}

---+++ References

|!\label{abc}|\label{abc}|Define a label to be referenced|
|!\ref{abc}|\ref{abc}|Create a link to a label. Since no numbering is at hand the link is rendered as ???.|
|!\pageref{abc}|\pageref{abc}|Create a link to the page of a label. Since no pages are generated the link is rendered as 1.|
|!\url{http://www.tug.org}|\url{http://www.tug.org}|Create a link to a URL and render it with the URL.|
|!\href{http://www.tug.org}{TUG}|\href{http://www.tug.org}{TUG}|Create a link to a URL and render it with some text.|

---+++ Displaced Material

|!\marginpar{...}|Typeset material in a box in the right margin.|
|!\footnote{...}|Is currently typeset as margin par. This might change.|

Note:\marginpar{This is a margin par.} The margin par is typeset in a box on the right side which has the width of
a quater of the window width.

---+++ Date

|!\today|\today|
|!\day|\day|
|!\month|\month|
|!\year|\year|


---+++ Logos

|!\TeX|\TeX|from =plain.tex=|
|!\LaTeX|\LaTeX||
|!\LaTeXe|\LaTeXe||
|!\BibTeX|\BibTeX||
|!\eTeX|\eTeX||
|!\XeTeX|\XeTeX||
|!\ExTeX|\ExTeX||
|!\ConTeXt|\ConTeXt||

---+++ Text Formatting

|!\emph{}|\emph{Abc}|
|!\textit{}|\textit{Abc}|
|!\textbf{}|\textbf{Abc}|
|!\textsc{}|\textsc{Abc}|
|!\textrm{}|\textrm{Abc}|
|!\textsf{}|\textsf{Abc}|

---+++ Characters

|!\aa|\aa||
|!\AA|\AA||
|!\ae|\ae||
|!\AE|\AE||
|!\oe|\oe||
|!\OE|\OE||
|!\o|\o||
|!\O|\O||
|!\ss|\ss||
|!\"a|\"a|and other umlaut characters: \"e \"i \"o \"u \"A \"E \"I \"O \"U \"y|
|!\`a|\`a|and other accent grave characters: \`e \`i \`o \`u \`A \`E \`I \`O \`U|
|!\'a|\'a|and other accent acute characters: \'e \'i \'o \'u \'A \'E \'I \'O \'U|
|!\^a|\^a|and other accent circumflex characters: \^e \^i \^o \^u \^A \^E \^I \^O \^U|
|!\c c|\c c|and other characters with cedilla: \c C|
|!\~n|\~n|and other characters with tilde: \~N, \~a, \~o, \~A, \~O|

Note: The macros which place an accent above a letter can be invoked with an empty
block as argument. This normally produces the accent alone.

Note: The accented characters i can be entered with i or !\i.

---+++ Symbols

|!\symbol{code}|\symbol{65}|Produce a character with the given code. The code has to be a decimal constant.|

Some of the symbols defined in \TeX\ are provided here as well.

|!\P| \P|
|!\S| \S|
|!\dots| \dots|
|!\ldots| \ldots|

---++++ Symbols from =textcomp=
|!\texteuro		| \texteuro		|from =textcomp.sty=|
|!\textcent		| \textcent		|from =textcomp.sty=|
|!\textdollar		| \textdollar		|from =textcomp.sty=|
|!\textyen		| \textyen		|from =textcomp.sty=|
|!\texttrademark	| \texttrademark	|from =textcomp.sty=|
|!\textcopyright	| \textcopyright	|from =textcomp.sty=|
|!\textregistered	| \textregistered	|from =textcomp.sty=|
|!\textcelsius		| \textcelsius		|from =textcomp.sty=|
|!\textperthousand	| \textperthousand	|from =textcomp.sty=|
|!\textonesuperior	| \textonesuperior	|from =textcomp.sty=|
|!\texttwosuperior	| \texttwosuperior	|from =textcomp.sty=|
|!\textthreesuperior	| \textthreesuperior	|from =textcomp.sty=|
|!\textonequater	| \textonequater	|from =textcomp.sty=|
|!\textonehalf		| \textonehalf		|from =textcomp.sty=|
|!\textthreequaters	| \textthreequaters	|from =textcomp.sty=|
|!\textdiv		| \textdiv		|from =textcomp.sty=|
|!\textmu		| \textmu		|from =textcomp.sty=|

---++++ Greek Letters

  !\alpha		\alpha		
  !\theta		\theta		
  !\tau		\tau		
  !\beta		\beta		
  !\vartheta	\vartheta		
  !\pi			\pi			
  !\upsilon		\upsilon		
  !\gamma	\gamma		
  !\varpi		\varpi		
  !\phi		\phi		
  !\delta		\delta		
  !\kappa		\kappa		
  !\rho		\rho		
  !\varphi		\varphi		
  !\epsilon		\epsilon		
  !\lambda		\lambda		
  !\varrho		\varrho		
  !\chi		\chi		
  !\varepsilon	\varepsilon		
  !\mu		\mu			
  !\sigma		\sigma		
  !\psi		\psi		
  !\zeta		\zeta		
  !\nu		\nu			
  !\varsigma	\varsigma		
  !\omega		\omega		
  !\eta		\eta		
  !\xi			\xi			
  !\Gamma	\Gamma		
  !\Lambda	\Lambda		
  !\Sigma		\Sigma		
  !\Psi		\Psi		
  !\Delta		\Delta		
  !\Xi			\Xi			
  !\Upsilon		\Upsilon		
  !\Omega		\Omega		
  !\Theta		\Theta		
  !\Pi			\Pi			
  !\Phi		\Phi		

---++++ Operators

  !\pm		\pm			
  !\cap		\cap		
  !\diamond	\diamond		
  !\oplus		\oplus		
  !\mp		\mp			
  !\cup		\cup		
  !\bigtriangleup	\bigtriangleup	
  !\ominus		\ominus		
  !\times		\times		
  !\uplus		\uplus		
  !\bigtriangledown	\bigtriangledown	
  !\otimes		\otimes		
  !\div		\div		
  !\sqcap		\sqcap		
  !\triangleleft	\triangleleft	
  !\oslash		\oslash		
  !\ast		\ast		
  !\sqcup		\sqcup		
  !\triangleright	\triangleright	
  !\odot		\odot		
  !\star		\star		
  !\vee		\vee		
  !\lhd		\lhd		
  !\bigcirc		\bigcirc		
  !\circ		\circ		
  !\wedge		\wedge		
  !\rhd		\rhd		
  !\dagger		\dagger		
  !\bullet		\bullet		
  !\setminus	\setminus		
  !\unlhd		\unlhd		
  !\ddagger	\ddagger		
  !\cdot		\cdot		
  !\wr		\wr			
  !\unrhd		\unrhd		
  !\amalg		\amalg		
  !\leq		\leq		
  !\geq		\geq		
  !\equiv		\equiv		
  !\models		\models		
  !\prec		\prec		
  !\succ		\succ		
  !\sim		\sim		
  !\perp		\perp		
  !\preceq		\preceq		
  !\succeq		\succeq		
  !\simeq		\simeq		
  !\mid		\mid		
  !\ll			\ll			
  !\gg		\gg			
  !\asymp		\asymp		
  !\parallel		\parallel		
  !\subset		\subset		
  !\supset		\supset		
  !\approx		\approx		
  !\bowtie		\bowtie		
  !\subseteq	\subseteq		
  !\supseteq	\supseteq		
  !\cong		\cong		
  !\Join		\Join		
  !\sqsubset	\sqsubset		
  !\sqsupset	\sqsupset		
  !\neq		\neq		
  !\smile		\smile		
  !\sqsubseteq	\sqsubseteq		
  !\sqsupseteq	\sqsupseteq		
  !\doteq		\doteq		
  !\frown		\frown		
  !\in			\in			
  !\ni			\ni			
  !\propto		\propto		
  !\vdash		\vdash		
  !\dashv		\dashv		
  !\colon		\colon		
  !\ldotp		\ldotp		
  !\cdotp		\cdotp		

---++++ Arrows

  !\leftarrow		\leftarrow		
  !\longleftarrow	\longleftarrow	
  !\uparrow		\uparrow		
  !\Leftarrow		\Leftarrow		
  !\Longleftarrow	\Longleftarrow	
  !\Uparrow		\Uparrow		
  !\rightarrow		\rightarrow		
  !\longrightarrow	\longrightarrow	
  !\downarrow		\downarrow		
  !\Rightarrow		\Rightarrow		
  !\Longrightarrow	\Longrightarrow	
  !\Downarrow		\Downarrow		
  !\leftrightarrow	\leftrightarrow	
  !\longleftrightarrow	\longleftrightarrow	
  !\updownarrow	\updownarrow	
  !\Leftrightarrow	\Leftrightarrow	
  !\Longleftrightarrow	\Longleftrightarrow	
  !\Updownarrow	\Updownarrow	
  !\mapsto		\mapsto		
  !\longmapsto		\longmapsto		
  !\nearrow		\nearrow		
  !\hookleftarrow	\hookleftarrow	
  !\hookrightarrow	\hookrightarrow	
  !\searrow		\searrow		
  !\leftharpoonup	\leftharpoonup	
  !\rightharpoonup	\rightharpoonup	
  !\swarrow		\swarrow		
  !\leftharpoondown	\leftharpoondown	
  !\rightharpoondown	\rightharpoondown	
  !\nwarrow		\nwarrow		
  !\rightleftharpoons	\rightleftharpoons	
  !\leadsto		\leadsto		

---++++ ...

  !\ldots		\ldots		
  !\cdots		\cdots		
  !\vdots		\vdots		
  !\ddots		\ddots		
  !\aleph		\aleph		
  !\prime		\prime		
  !\forall		\forall		
  !\infty		\infty		
  !\hbar		\hbar		
  !\emptyset	\emptyset		
  !\exists		\exists		
  !\Box		\Box		
  !\imath		\imath		
  !\nabla		\nabla		
  !\neg		\neg		
  !\Diamond	\Diamond		
  !\jmath		\jmath		
  !\surd		\surd		
  !\flat		\flat		
  !\triangle		\triangle		
  !\ell			\ell		
  !\top		\top		
  !\natural		\natural		
  !\clubsuit		\clubsuit		
  !\wp		\wp			
  !\bot		\bot		
  !\sharp		\sharp		
  !\diamondsuit	\diamondsuit	
  !\Re		\Re			
  !\backslash	\backslash		
  !\heartsuit	\heartsuit		
  !\Im		\Im			
  !\angle		\angle		
  !\partial		\partial		
  !\spadesuit	\spadesuit		
  !\mho		\mho		
  !\sum		\sum		
  !\bigcap		\bigcap		
  !\bigodot	\bigodot		
  !\prod		\prod		
  !\bigcup		\bigcup		
  !\bigotimes	\bigotimes		
  !\coprod		\coprod		
  !\bigsqcup	\bigsqcup		
  !\bigoplus	\bigoplus		
  !\int		\int		
  !\bigvee		\bigvee		
  !\biguplus	\biguplus		
  !\oint		\oint		
  !\bigwedge	\bigwedge		

---++++ Functions

  !\arccos		\arccos		
  !\cos		\cos		
  !\csc		\csc		
  !\exp		\exp		
  !\ker		\ker		
  !\limsup		\limsup		
  !\min		\min		
  !\sinh		\sinh		
  !\arcsin		\arcsin		
  !\cosh		\cosh		
  !\deg		\deg		
  !\gcd		\gcd		
  !\lg			\lg			
  !\ln			\ln			
  !\Pr			\Pr			
  !\sup		\sup		
  !\arctan		\arctan		
  !\cot		\cot		
  !\det		\det		
  !\hom		\hom		
  !\lim		\lim		
  !\log		\log		
  !\sec		\sec		
  !\tan		\tan		
  !\arg		\arg		
  !\coth		\coth		
  !\dim		\dim		
  !\inf		\inf		
  !\liminf		\liminf		
  !\max		\max		
  !\sin		\sin		
  !\tanh		\tanh		

---++++ ...

  !\lfloor		\lfloor		
  !\rfloor		\rfloor		
  !\lceil		\lceil		
  !\rceil		\rceil		
  !\langle		\langle		
  !\rangle		\rangle		
  !\backslash	\backslash		

<!--
---++++ Brace Pieces

  !\rmoustache	\rmoustache		
  !\lmoustache	\lmoustache		
  !\rgroup		\rgroup		
  !\lgroup		\lgroup		
  !\arrowvert	\arrowvert		
  !\Arrowvert	\Arrowvert		
  !\bracevert	\bracevert		
-->

---+++ Inclusion of Fragments

|!\include{file}||Insert the contents of the file at this position.|from latex.ltx|
|!\input{file}||Insert the contents of the file at this position.|from \TeX|
|!\Include{file}{text}||Create a link to the file. In the TWiki rendering this is no inclusion at all.|new|

Note that the included contents has no variables expanded.

---+++ Conditional Processing of Material

|!\iftex...!\fi|The material ... is discarded. This is meant to be used in \LaTeX.|
|!\ifhtml...!\fi|The material ... is included unprocessed. This is meant to be ignored in \LaTeX.|

\iftex
Material for \LaTeX.
\fi

\ifhtml
Material not meant for \LaTeX.
\fi

Note: In contrast to \TeX\ the ifs can not be stacked.

---+++ Math

|!\(|Enter inline math mode.|
|!\begin{math}|Enter inline math mode.|
|!\)|Leave inline math mode.|
|!\end{math}|Leave inline math mode.|
|!\[|Enter display math mode.|
|!\begin{displaymath}|Enter display math mode.|
|!\}|Leave display math mode.|
|!\end{displaymath}|Leave display math mode.|

Note: The shorthand notation using dollars to enter and leave math mode is not supported yet.

|&#95;|Typeset the following argument as subscript.|
|&#94;|Typeset the following argument as superscript.|

\(x^2_3\)

\(x^ {2^2}_{3_3}\)


|!\not=|\not=|
|!\not!\in|\not\in|
|!\not!\subset|\not\subset|

---++ Indexing

|!\index{}|\index{term}|is silently ignored|

---++ Plugin Settings

   * Set SHORTDESCRIPTION = Renders !LaTeX syntax in a topic.
   * Set DEBUG = 0
      * Set LATEXSYNTAXPLUGIN_MONTHS = MMM ,D YYYY
      * Set LATEXSYNTAXPLUGIN_DATEFORMAT = MMM ,D YYYY
      * Set LATEXSYNTAXPLUGIN_FIGURENAME = Figure
      * Set LATEXSYNTAXPLUGIN_TABLENAME = Table

---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server. 

   * Download the ZIP file from the Plugin Home (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
     | ==pub/TWiki/%TOPIC%/sample.png== | Sample attached graphics |
   * Configure the Plugin:
      * TWiki 4.0 and up: Run the [[%SCRIPTURL%/configure%SCRIPTSUFFIX%][configure]] script to enable the Plugin
      * Change the Plugin settings as needed
   * Test if the installation was successful:
      * Look at this page; many control sequences should be gone and be replaced by some typeset construction.

---++ Plugin Info

|  Plugin Author: | TWiki:Main.GerdNeugebauer |
|  Copyright: | &copy; 2009, Gerd Neugebauer|
|  License: | LGPL ([[http://www.gnu.org/copyleft/lgpl.html][Library GNU General Public License]]) |
|  Plugin Version: | 01 Mar 2009 |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  1 Mar 2009: | Public version |
|  TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
|  CPAN Dependencies: | none |
|  Other Dependencies: | none |
|  Perl Version: | 5.005 |
|  TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle xx%, %TWIKIWEB%.FormattedSearch xx%, %TOPIC% xx% |
|  Plugin Home: | http://www.gerd-neugebauer.de/TWiki/Plugins/%TOPIC% |
<!--
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |
-->

%META:FILEATTACHMENT{name="sample.png" attachment="sample.png" attr="" comment="!LaTeX logo with perspective shadow" date="1236530459" path="sample.png" size="19266" stream="sample.png" tmpFilename="/tmp/OKK6YUldhK" user="Main.GerdNeugebauer" version="1"}%
