You are here: Foswiki>System Web>LatexIntro (02 Nov 2013, UnknownUser)EditAttach
%BEGINLATEXPREAMBLE% \usepackage{amsfonts} \definecolor{Lightmaroon}{rgb}{0.6667,0,0} \definecolor{Cornflowerblue}{rgb}{0,0.4,0.8} %ENDLATEXPREAMBLE%

Introduction to %BEGINLATEX{inline="1" color="Lightmaroon"}%\Large\LaTeX%ENDLATEX%

%BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX% is a complete typesetting language developed by Leslie Lamport on top of Donald Knuth's %BEGINLATEX{inline="1"}%\TeX%ENDLATEX%. Most of it is implemented using LatexModePlugin, but the main use is producing mathematics, since most other formatting is more conveniently accomplished using Wiki constructs. To produce mathematics in-line, the %BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX% text must be surrounded by %$ and $%. Thus,
%$\Gamma \vdash Rx_1\cdots x_n$%
looks like this \Gamma \vdash Rx_1\cdots x_n in the middle of some text. To display mathematics, it must be surrounded by %\[ and \]%. Thus, %\[\mathcal{N}=\langle \mathbb{N},0,1+,\cdot \rangle \subseteq \langle \mathbb{R},0,1+,\cdot \rangle\]% produces this centered display
\mathcal{N}=\langle \mathbb{N},0,1+,\cdot \rangle \subseteq \langle \mathbb{R},0,1+,\cdot \rangle
in the middle of a paragraph, which is preferable for long formulas or ones requiring emphasis.

%BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX% is used by most mathematicians, physicists, and engineers for mathematics, and articles and books are typically submitted for publication in %BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX%. There are therefore many helpful web sites, newsgroups, and books about %BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX%. The standard complete reference is Lamport's LaTeX: A Document Preparation System (2nd Edition). The place to start on the web is the %BEGINLATEX{color="Cornflowerblue" inline="1"}%\TeX%ENDLATEX% Users Group.

Brief Tutorial on %BEGINLATEX{inline="1" color="Lightmaroon"}%\bf\LaTeX%ENDLATEX%

All %BEGINLATEX{inline="1"}%\TeX%ENDLATEX% codes begin with a backslash (\). Curly braces ({ }) are used to delimit groupings, except in a few cases where optional arguments must be enclosed in square brackets ([ ]). Many symbols have mnemonic names, like \Alpha, \alpha, \forall, \exists, \lor, \land.

A list of some common symbols is given in the LatexSymbols topic. Other off-site lists include: Some Symbols and Some Little-Known Symbols, All the Symbols. Not all the symbols work in the Wiki, but most of them do.

A subscript is indicated with an underline (_). If the subscript consists of more than one symbol, it must be enclosed in braces. Similarly, a superscript is indicated with a caret (^). Thus, %$ \alpha _{ \beta _1^2}^{ \gamma ^{ \delta ^ \epsilon }} $% yields \alpha _{ \beta _1^2}^{ \gamma ^{ \delta^ \epsilon }},

Document Structure

In standard %BEGINLATEX{inline="1"}%\LaTeX%ENDLATEX% 2e documents, the main file has the following structure:
\documentclass[options]{class}

preamble

\begin{document}

text

\end{document}

Any text that normally goes in the preamble or text sections of the template above can be rendered in TWiki. The preamble is typically used to define new commands, or use LaTeX style-files to extend LaTeX's functionality. The text area contains the actual text to be rendered. One does not need to use the \documentclass or document environment to use LaTeX in TWiki.

The ability to render a complete LaTeX document within TWiki, say from an existing file, is currently under consideration. See TWiki:Codev.IncludeExistingLatexDocsInTWiki for details and current status.

-- courtesy of TWiki:Main.ShaughanLavine (see also)
Error during latex2img:
ERROR: problems during latex
INPUT:
\documentclass[fleqn,12pt]{article}
\usepackage{amsmath}
\usepackage[normal]{xcolor}
\setlength{\mathindent}{0cm}
\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{maroon}{rgb}{0.5,0,0}
\definecolor{silver}{gray}{0.75}
\usepackage{latexsym}
\begin{document}
\pagestyle{empty}
\pagecolor{white}
{
\color{black}
\begin{math}\displaystyle \mathcal{N}=\langle \mathbb{N},0,1+,\cdot \rangle \subseteq \langle \mathbb{R},0,1+,\cdot \rangle\end{math}
}
\clearpage
{
\color{black}
\begin{math}\displaystyle \Gamma \vdash Rx_1\cdots x_n\end{math}
}
\clearpage
{
\color{black}
\begin{math}\displaystyle \alpha _{ \beta _1^2}^{ \gamma ^{ \delta^ \epsilon }}\end{math}
}
\clearpage
\end{document}
STDERR:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(/tmp/I6vsPjLqvs/Bv_F3WPo67
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-01-16>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/fleqn.clo)
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/usr/share/texlive/texmf-dist/tex/latex/base/latexsym.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file Bv_F3WPo67.aux.
(/usr/share/texlive/texmf-dist/tex/latex/base/ulasy.fd)
! Undefined control sequence.
l.17 ...}\displaystyle \mathcal{N}=\langle \mathbb
                                                  {N},0,1+,\cdot \rangle \su...

! Undefined control sequence.
l.17 ...1+,\cdot \rangle \subseteq \langle \mathbb
                                                  {R},0,1+,\cdot \rangle\end...

[1] [2] [3] (./Bv_F3WPo67.aux) )
(see the transcript file for additional information)
Output written on Bv_F3WPo67.dvi (3 pages, 1276 bytes).
Transcript written on Bv_F3WPo67.log.
Topic revision: r1 - 02 Nov 2013, UnknownUser
 
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback