diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-16 13:51:52 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-16 13:51:52 +0100 |
commit | 2d4c42e2f033d767fa4d6065e6cc7cff36cfc4b7 (patch) | |
tree | 1ea4b45f051c119634729dbfb2d7cd4739398dcc /doc/luaotfload-latex.tex | |
parent | e16c57f7e33e0d1cf44c3b3f5bf425b24b5277ec (diff) | |
parent | 5eedcacffc80114cd64523d1fca6fb8eb1d189e1 (diff) | |
download | luaotfload-2d4c42e2f033d767fa4d6065e6cc7cff36cfc4b7.tar.gz |
Merge pull request #202 from phi-gamma/texlive2014
improve docs
Diffstat (limited to 'doc/luaotfload-latex.tex')
-rw-r--r-- | doc/luaotfload-latex.tex | 147 |
1 files changed, 146 insertions, 1 deletions
diff --git a/doc/luaotfload-latex.tex b/doc/luaotfload-latex.tex index 615ad42..d00a617 100644 --- a/doc/luaotfload-latex.tex +++ b/doc/luaotfload-latex.tex @@ -1,3 +1,4 @@ +\luatexsuppresslongerror1%% sigh ... %% Copyright (C) 2009-2014 %% %% by Elie Roux <elie.roux@telecom-bretagne.eu> @@ -31,6 +32,8 @@ \documentclass{ltxdoc} +\makeatletter + \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace} \usepackage[x11names]{xcolor} @@ -125,8 +128,150 @@ \VerbatimFootnotes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% structurals +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def \definestructural #1{% + \expandafter \let \csname end#1\endcsname \relax + + \expandafter \def \csname begin#1\endcsname {% + \@ifnextchar[{\csname begin#1indeed\endcsname} + {\csname begin#1indeed\endcsname[]}% + } + + \expandafter \def \csname begin#1indeed\endcsname [##1]##2{% + \edef \first {##1}% + \ifx \first \empty + \csname #1\endcsname [##2]{##2}% + \else + \csname #1\endcsname [\first]{##2}% + \fi + } +} + +\definestructural {section} +\definestructural {subsection} +\definestructural {subsubsection} + +\def \fakesection #1{\section*{#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% codelistings; this sucks hard since we lack access to buffers +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcount \othercatcode \othercatcode 12 +\newcount \activecatcode \othercatcode 13 + +\newluatexcatcodetable \vrbcatcodes +\setluatexcatcodetable \vrbcatcodes {% + \luatexcatcodetable \CatcodeTableIniTeX + \catcode 9 \othercatcode %% \tabasciicode + \catcode 13 \othercatcode %% \endoflineasciicode + \catcode 12 \othercatcode %% \formfeedasciicode + \catcode 26 \othercatcode %% \endoffileasciicode + \catcode 32 \othercatcode %% \spaceasciicode +} + +\newluatexcatcodetable \literalcatcodes +\setluatexcatcodetable \literalcatcodes {% + \luatexcatcodetable \CatcodeTableString + \catcode 32 \activecatcode %% \spaceasciicode +} + +\def \beginlisting {% + \begingroup + \luatexcatcodetable \vrbcatcodes + \beginlistingindeed% +} + +\directlua { + local texprint = tex.print + document = document or { } + document.printlines = function (buffer) + for _, line in next, string.explode (buffer, "\noexpand\n") do + texprint (-1, line) + texprint (-1, "") + end + end +} + +\def \beginlistingindeed#1\endlisting{% + \endgroup + \begingroup + \ttfamily + \small + \begin {quote} + \bgroup + \luatexcatcodetable \literalcatcodes + \obeyspaces + \obeylines + \directlua{document.printlines ([==[\detokenize {#1}]==])} + \egroup + \end {quote} + \endgroup +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% enumerations and lists +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def \definelist [#1]#2{% name, itemcode + \expandafter \def \csname begin#1\endcsname {% + \begin {itemize} + \let \normalitem = \item + \def \altitem ####1{% + \def \first {####1}% + #2 + } + } + + \expandafter \def \csname end#1\endcsname {% + \end {itemize} + } +} + +\definelist [definitions]{\normalitem {\fileent {\first}}} +\definelist [filelist]{\normalitem {\fileent {\first}}\space--\hskip 1em} +\definelist [functionlist]{\normalitem {\luafunction {\first}}\hfill\break} + +\def \beginenumeration {\begin {enumerate}} +\def \endenumeration {\end {enumerate}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% columns +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def \begindoublecolumns {\begin {multicols} {2}} +\def \enddoublecolumns {\end {multicols}} + +\def \begintriplecolumns {\begin {multicols} {3}} +\def \endtriplecolumns {\end {multicols}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% alignment +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def \begincentered {\begin {center}} +\def \endcentered {\end {center}} +\makeatother + +\def \beginnarrower {\begin {quote}} +\def \endnarrower {\end {quote}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% special elements +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def \beginabstractcontent {\begin {abstract}} +\def \endabstractcontent {\end {abstract}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% main +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin {document} - \input {luaotfload-main.tex} + \input {luaotfload-main.tex} \end {document} |