Debian Codegraph @

texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt

raw
1
2 % Save this as tutorial.tex for the lwarp package tutorial.
3
4 \documentclass{book}
5
6 \usepackage{iftex}
7
8 % --- LOAD FONT SELECTION AND ENCODING BEFORE LOADING LWARP ---
9
10 \ifPDFTeX
11 \usepackage{lmodern} % pdflatex or dvi latex
12 \usepackage[T1]{fontenc}
13 \usepackage[utf8]{inputenc}
14 \else
15 \usepackage{fontspec} % XeLaTeX or LuaLaTeX
16 \fi
17
18 % --- LWARP IS LOADED NEXT ---
19 \usepackage[
20 % HomeHTMLFilename=index, % Filename of the homepage.
21 % HTMLFilename={node-}, % Filename prefix of other pages.
22 % IndexLanguage=english, % Language for xindy index, glossary.
23 % latexmk, % Use latexmk to compile.
24 % OSWindows, % Force Windows. (Usually automatic.)
25 % mathjax, % Use MathJax to display math.
26 ]{lwarp}
27 % \boolfalse{FileSectionNames} % If false, numbers the files.
28
29 % --- LOAD PDFLATEX MATH FONTS HERE ---
30
31 % --- OTHER PACKAGES ARE LOADED AFTER LWARP ---
32 \usepackage{makeidx} \makeindex
33 \usepackage{xcolor} % (Demonstration purposes only.)
34 \usepackage{hyperref,cleveref} % LOAD THESE LAST!
35
36 % --- LATEX AND HTML CUSTOMIZATION ---
37 \title{The Lwarp Tutorial}
38 \author{Some Author}
39 \setcounter{tocdepth}{2} % Include subsections in the \TOC.
40 \setcounter{secnumdepth}{2} % Number down to subsections.
41 \setcounter{FileDepth}{1} % Split \HTML\ files at sections
42 \booltrue{CombineHigherDepths} % Combine parts/chapters/sections
43 \setcounter{SideTOCDepth}{1} % Include subsections in the side\TOC
44 \HTMLTitle{Webpage Title} % Overrides \title for the web page.
45 \HTMLAuthor{Some Author} % Sets the HTML meta author tag.
46 \HTMLLanguage{en-US} % Sets the HTML meta language.
47 \HTMLDescription{A description.}% Sets the HTML meta description.
48 \HTMLFirstPageTop{Name and \fbox{HOMEPAGE LOGO}}
49 \HTMLPageTop{\fbox{LOGO}}
50 \HTMLPageBottom{Contact Information and Copyright}
51 \CSSFilename{lwarp_sagebrush.css}
52
53 \begin{document}
54
55 \maketitle % Or titlepage/titlingpage environment.
56
57 % An article abstract would go here.
58
59 \tableofcontents % MUST BE BEFORE THE FIRST SECTION BREAK!
60 \listoffigures
61
62 \chapter{First chapter}
63
64 \section{A section}
65
66 This is some text which is indexed.\index{Some text.}
67
68 \subsection{A subsection}
69
70 See \cref{fig:withtext}.
71
72 \begin{figure}\begin{center}
73 \fbox{\textcolor{blue!50!green}{Text in a figure.}}
74 \caption{A figure with text\label{fig:withtext}}
75 \end{center}\end{figure}
76
77 \section{Some math}
78
79 Inline math: $r = r_0 + vt - \frac{1}{2}at^2$
80 followed by display math:
81 \begin{equation}
82 a^2 + b^2 = c^2
83 \end{equation}
84
85
86 \begin{warpprint} % For print output ...
87 \cleardoublepage % ... a common method to place index entry into TOC.
88 \phantomsection
89 \addcontentsline{toc}{chapter}{\indexname}
90 \end{warpprint}
91 \ForceHTMLPage % HTML index will be on its own page.
92 \ForceHTMLTOC % HTML index will have its own toc entry.
93 \printindex
94
95 \end{document}