1 % private class for lualatex-doc
2 % see lualatex-doc.tex for copying conditions
3 % Manuel Pégourié-Gonnard
5 \ProvidesClass{lltxdoc}
7 \LoadClass[a4paper]{scrartcl}
8 \RequirePackage{fontspec}
9 \RequirePackage{metalogo, xspace, ifmtarg, xargs, fancyvrb}
10 \RequirePackage[table]{xcolor}
11 \RequirePackage[english]{babel}
12 \RequirePackage[colorlinks=true]{hyperref}
13 \RequirePackage{bookmark}
15 \defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
16 \setmainfont{Linux Libertine O}
18 \setmonofont[Scale=MatchLowercase]{Monaco}
20 \newcommand*\simplelogo [1] {%
21 \ifcsname #1\endcsname \else \badlogocommand \fi
22 \lowercase{\expandafter\simple@logo\expandafter{%
23 \csname #1\expandafter\endcsname\expandafter}}\expandafter{%
24 \csname #1\endcsname}{#1}}
25 \newcommand*\simple@logo [3] {%
26 \newcommand #1 {#2\xspace}%
27 \pdfstringdefDisableCommands{\def#1{#3\space}}}
29 \providecommand \ConTeXt {Con\TeX{}t}
30 \providecommand \pdfTeX {pdf\TeX}
31 \providecommand \TeXLive {\TeX\thinspace Live}
32 \providecommand \MiKTeX {MiK\TeX}
37 \simplelogo {LuaLaTeX}
45 \colorlet{code}{blue!80!black}
46 \fvset{formatcom=\color{code}}
48 \catcode`\ 10 % non-breakable space
50 \newcommand*\email [1] {<\href{mailto:#1}{#1}>}
52 {\href{http://mirror.ctan.org/#1}{\nolinkurl{#1}}}
53 \newcommand \file {\nolinkurl}
54 \newcommand*\note [1] {\noindent\textsf{\bfseries #1.}\quad\ignorespaces}
55 \newcommand \cmd {\texttt}
56 \newcommand \code [1] {\texorpdfstring {\texttt{\color{code}#1}} {#1}}
57 \newcommand*\cs [1] {\code{\textbackslash #1}}
59 \newcommandx*\para [2][2] {%
60 \@ifmtarg{#2}{\para@{#1}{#1}}{\para@{#1}{#2}}}
61 \newcommand \para@ [2] {%
63 \hypertarget{para.#2}{}%
64 \belowpdfbookmark{#1}{para.#2}%
68 \textsf{\bfseries #1\quad}}%
71 \newcommandx*\pararef [3][1, 3] {%
72 \@ifmtarg{#3}{\para@ref{#1}{#2}{#2}}{\para@ref{#1}{#2}{#3}}}
73 \newcommand \para@ref [3] {%
74 \hyperlink{para.#3}{#1{#2}}}
75 \newcommand*\parapageref [1] {%
78 \newcommand \pf {\textsf}
79 \newcommand \pk {\pararef[\pf]}
81 \newcommandx*\pkdesc [6][6] {%
83 \pkditem {Engines} {#3}
84 \pkditem {Formats} {#4}
85 \pkditem {Authors} [\\]{#2}
86 \pkditem {CTAN location} [\\]{#5}[\ctan]
87 \pkditem {Development url} [\\]{#6}[\url]
90 \newcommandx*\pkditem [4][2,4] {\@ifnotmtarg{#3}{%
91 #2\textsf{\bfseries #1:} #4{#3}.%
95 \newenvironment{myquote}{%
96 \list{}{\leftmargin0pt \rightmargin1em}%