1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
\listfiles
\documentclass[english]{article}
\usepackage{pst-poker}
\usepackage[cleanup={}]{auto-pst-pdf-lua}
\ifpdf
\usepackage{fontspec}
\usepackage{dejavu-otf}
\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{dejavu}
\fi
\usepackage{babel}
\usepackage[a4paper,tmargin=1cm,bmargin=1.5cm,includeheadfoot]{geometry}
\usepackage{listings}
\title{\texttt{auto-pst-pdf-lua}, v. 0.03\\ using Lua\LaTeX\ with PSTricks}
\author{Herbert Voß}
\begin{document}
\maketitle
The package is based on \texttt{auto-pst-pdf} and uses for the \texttt{latex} run the
program \texttt{dvilualatex}. The package can have all optional arguments which are
possible for \texttt{auto-pst-pdf}.
\section{The example code}
\lstset{basicstyle=\ttfamily\small,language={[LaTeX]TeX},frame=lrtb}
\begin{lstlisting}
\documentclass{article}
\usepackage{pst-poker}
\usepackage{auto-pst-pdf-lua}
\ifpdf
\usepackage{fontspec}
\usepackage{dejavu-otf}
\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{dejavu}
\fi
\begin{document}
An example for using Luacode:
$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$
An example for PostScript code:
\bigskip
\begin{postscript}
\As~\Ad~\Ac~\Ah~\crdAs~\crdAd~\crdAc~\crdAh
\end{postscript}
\end{document}
\end{lstlisting}
\section{The output}
And here comes the output when running with \verb|lualatex --shell-escape <file>|:
An example for using Luacode:
$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$
An example for PostScript code:
\bigskip
\begin{postscript}
\As~\Ad~\Ac~\Ah~\crdAs~\crdAd~\crdAc~\crdAh
\end{postscript}
\section{Caveats}
When running \texttt{dvilualatex} the package \texttt{fontspec} cannot be active. If you
need it, then just just the \texttt{\textbackslash ifpdf} switch:
\begin{verbatim}
\ifpdf
\usepackage{fontspec}%% for the lualatex run(s)
\usepackage{dejavu-otf}
\else
\usepackage[T1]{fontenc}% for the dvilualatex run
\usepackage[utf8]{inputenc}
\usepackage{dejavu}
\fi
\end{verbatim}
\end{document}
|