File:LuaTeX Output DE.svg
Summary
LuaTeX source
\documentclass[a4paper]{scrartcl}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new, babelshorthands=true]{german}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{luacode}
\setromanfont{Cambria}
\setsansfont{Calibri}
\setmonofont{Consolas}
\setmathfont{Cambria Math}
\title{Ein Testdokument}
\author{Otto Normalverbraucher}
\date{15. Januar 2014}
\begin{document}
\maketitle
\tableofcontents
\section{Schriftarten}
Mit Lua\TeX{} lassen sich in Windows die systemeigenen
Schriftarten verwenden, wie zum Beispiel Cambria, die über einen
großen Satz mathematischer Zeichen für die Formeldarstellung
verfügt, oder auch \textsf{Calibri} und \texttt{Consolas}.
\section{Formeln}
Lua\TeX{} ist auch ohne Formeln sehr nützlich und
einfach zu verwenden. Grafiken, Tabellen,
Querverweise aller Art, Literatur- und
Stichwortverzeichnis sind kein Problem.
Formeln sind etwas schwieriger, dennoch hier ein
einfaches Beispiel:
\begin{displaymath}
E = \frac{m_{0} c^{2}}{\sqrt{1-v^{2}/c^{2}}}
\end{displaymath}
\section{Lua-Code}
Lua\TeX{} kann aber auch Lua-Programmcode ausführen.
So erzeugt man zum Beispiel mit \texttt{directlua}
die Zufallszahl \directlua{tex.print(math.random())}.
Auch die Kreiszahl $π$ muss man nicht mehr auswendig
wissen, sie hat den Wert \directlua{tex.print(math.pi)}.
Mithilfe der \texttt{luacode}-Umgebung kann man sogar
zählen, wie hier bis Sechzig:
\begin{luacode}
for x=1,60 do
tex.print(x)
end
\end{luacode}
Hier ist der Schluss des Testdokuments.
\end{document}
Licensing
![]() |
I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |