Debian Codegraph @

texmf-dist/doc/latex/ycbook/ycbook-doc.tex

raw
1 % ======================================================================
2 % ycbook-doc.tex
3 % Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2018
4 %
5 % This file is part of the ycbook LaTeX2e class.
6
7 % This work may be distributed and/or modified under the conditions of
8 % the LaTeX Project Public License, version 1.3c of the license.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3c or later is part of all distributions of LaTeX
12 % version 2005/12/01 and of this work.
13 %
14 % This work has the LPPL maintenance status "author-maintained".
15 % ======================================================================
16
17 \documentclass[withmarginpar,titleauthor,11pt]{mwart}
18 %\renewcommand{\sectsettings}{\sffamily\bfseries}
19 \usepackage[english]{babel}
20 \usepackage[dvipsnames,svgnames]{xcolor}
21 \usepackage{fontspec}
22 \setmainfont{Warnock Pro}[Numbers=OldStyle]
23 \usepackage{FiraSans}
24 \usepackage[scale=0.9,lf]{FiraMono}
25 %\setmathrm{}
26 %\setsansfont{Fira Sans Book}[BoldFont={FiraSans-Bold},BoldItalicFont={FiraSans-BoldItalic},Scale=.9]
27 %\setmonofont[Scale=0.8,Color=Teal]{Fira Mono}
28 \usepackage{tikz}
29 \usetikzlibrary{shapes,shadings,shadows,shapes.geometric,decorations,positioning,arrows,decorations.pathmorphing}
30 \usepackage[framemethod=tikz]{mdframed}
31 \surroundwithmdframed[linecolor=PaleTurquoise,skipabove=10pt,skipbelow=6pt, backgroundcolor=PaleTurquoise!30,roundcorner=6pt
32 ]{verbatim}%roundcorner=10pt,
33 %MediumSeaGreen
34 %OrangeRed
35
36 \newmdenv[linecolor=MediumPurple,skipabove=10pt,skipbelow=6pt, backgroundcolor=SpringGreen,roundcorner=6pt
37 ]{resumo}
38
39 \usepackage{hyperref}
40 \usepackage{multicol}
41 \usepackage{microtype}
42 \frenchspacing
43
44 \hyphenation{Bring-hurst}
45
46 \newcommand{\flor}{\fontspec{Minion Pro}}
47 \newcommand{\folhadireita}{\fontspec{Minion Pro}}
48 \newcommand{\duasondas}{\fontspec{Minion Pro} }
49
50 %%% Warnock Pro Ornaments
51 %
52 \newcommand{\folhawarnock}{\fontspec{Warnock Pro}}
53 \newcommand{\folhawarnockmetade}{\fontspec{Warnock Pro}}
54 \newcommand{\folhawarnocklinhaum}{\fontspec{Warnock Pro}}
55 \newcommand{\folhawarnocklinhadois}{\fontspec{Warnock Pro}}
56
57 \newcommand{\carimboa}{\fontspec{Warnock Pro}}
58 \newcommand{\carimbob}{\fontspec{Warnock Pro}}
59 \newcommand{\carimboc}{\fontspec{Warnock Pro}}
60 \newcommand{\carimbod}{\fontspec{Warnock Pro}}
61 \newcommand{\carimboe}{\fontspec{Warnock Pro}}
62 \newcommand{\carimbof}{\fontspec{Warnock Pro}}
63
64
65 \newcommand{\estampa}{\fontspec{Warnock Pro}}
66 \newcommand{\estampab}{\fontspec{Warnock Pro}}
67 \newcommand{\estampac}{\fontspec{Warnock Pro}}
68
69
70
71
72
73
74
75 \SetSectionFormatting{section}
76 {24pt plus5pt minus2pt} %space before
77 {\normalfont\centering\scshape\large\ifHeadingNumbered
78 \HeadingNumber.\enspace\fi
79 \HeadingText}
80 {10pt plus3pt}%space after
81
82 \SetSectionFormatting{subsection}
83 {16pt plus4pt minus2pt}
84 {\FormatHangHeading{\normalfont\itshape}}
85 {6pt plus2pt}
86
87
88 \usepackage[style=authoryear-icomp]{biblatex}
89 \addbibresource{ycbook-bibliografia.bib}
90 \DeclareFieldFormat{url}{\url{#1}}
91
92 %\usepackage[justification=raggedright,font={sf},labelfont=bf]{caption}
93 %\usepackage{picinpar}
94
95 \setlength{\marginparwidth}{1.3in}
96
97
98 \newcommand{\option}[1]{\marginpar{\footnotesize \texttt{#1}}}
99 %\newcommand{\opt}[1]{<<\textit{#1}>>}
100 \newcommand{\opt}[1]{\texttt{#1}}
101
102
103 \title{\estrela{\textit{ycbook}}\tikz \node[inner sep=0pt,remember picture,overlay] at (-2,4){\includegraphics[height=3cm,width=0.4\textwidth,keepaspectratio]{icone}};\\
104 \tikz \node[left color=PineGreen,rectangle,remember picture, overlay,
105 rounded corners=3pt] at (0,0) {A versatile and simple book class};\\
106 \tikz \draw[teal,remember picture, overlay,thick] (-4.2,0.2) -- (4,0.2);%
107 %\tikz \node[remember picture,overlay] at (7,5) {\florgrande};%
108 %
109 }
110 \author{\addfontfeatures{Style=Swash,Contextuals=Swash}\textit{Youssef Cherem}\\ \href{mailto:[email protected]}{[email protected]}}
111 \date{\carimboa\ MMXVII \carimboa\\ \folhawarnocklinhaum% %
112 }
113
114
115 \usepackage%[headsepline]
116 {scrlayer-scrpage}
117 %\addtokomafont{headsepline}{\color{JungleGreen}} %yes, works on other classes as well
118 \pagestyle{scrheadings}
119 \clearscrheadfoot
120 %\chead{}
121 %\cehead{}
122 \newcommand{\bola}{\tikz \node [top color=SpringGreen, shading angle=45,circle,drop shadow] at (0,0) {\thepage};}
123 \cfoot*{\upshape\bfseries\large\addfontfeatures{Numbers=Lining}\bola}
124
125 \newcommand{\estrela}[1]{\tikz \node [top color=SpringGreen,star,star points=7] at (0,0) {#1};}%,star point ratio=0.8 % shading angle=45,
126
127 \usepackage{tcolorbox}
128 \tcbuselibrary{skins}
129 \newtcolorbox{caixa}{enhanced,
130 interior style={left color=SpringGreen,right color=Dandelion,shading angle=45},frame hidden,width=0.8\textwidth,center,drop shadow}
131
132
133
134 \usepackage{lipsum}
135
136 \usepackage[toc]{multitoc}
137 \renewcommand*{\multicolumntoc}{2}
138 %\setlength{\columnseprule}{1pt}
139
140
141
142 \begin{document}
143
144 \maketitle
145
146
147 \thispagestyle{scrheadings}
148
149
150 \begin{caixa}
151 This class is intended to be an interpretation of the \texttt{mwbk} class from Mar\-cin Wo\-li\'{n}s\-ki's \texttt{mwcls} classes. The \texttt{mwcls} class\-es are simple, yet powerful and customizable classes that allow the end user to customize the layout of headers, headings etc. They also have the benefit of being more economic in space than the most common \LaTeX\ classes, while keeping a clear appearance and a smooth flow.
152 %\lipsum[1-5]
153 \end{caixa}
154
155 \tableofcontents
156
157
158 \section*{The reasons for this class}
159
160
161 Although many usual \LaTeX\ packages and classes offer a wide array of solutions for text block and margin specifications, and although some of them, notably Koma-Script \parencite{koma-script} allow and facilitate the application of “classical” canons of page construction \parencite{tschichold_form_1991,bringhurst_elements_2013}, one may have several reasons to avoid this aesthetic solution. One reason is that these page construction methods were intended, obviously, for handwritten or printed material. Even assuming the material is to be printed, one reason to find an alternative is economic and environmental: the more paper you print, the more it will cost---both in terms of money and environmental impact. But the user also wishes to avoid a sloppy solution, squeezing as much content as possible onto the page just to save space. The compromise solution would be somewhat closer to what most commercial books look like---without jeopardizing legibility. In fact, it is rare to find a book that looks like it has been laid out according to the ``canons". That is one motive why I find the \texttt{mwcls} classes \parencite{mwcls} useful. Besides, \texttt{mwcls} alternatives for basic classes (\texttt{mwart} for articles, \texttt{mwrep} for reports and \texttt{mwbk} for books) allow the user to easily modify headings, being somewhat more flexible and providing a simpler interface than many classes. The goal was to provide a more user-friendly syntax for some common tweaks and more alternatives to the end-user. (As for the \texttt{mwart} class, I did not find anything to be changed---although the user might adapt some of the options presented in the \texttt{ycbook} class.)
162
163
164
165 \section{Options for chapter and section}
166 To add a rule below chapter and section titles, use \opt{chapterrule} and
167 \opt{sectionrule}. Other sectional headings may be changed likewise:
168
169 \option{chapterrule}
170 \option{sectionrule}
171
172
173 \begin{verbatim}
174 \SetSectionFormatting{section}
175 {24pt plus5pt minus2pt} %space before
176 {\large\textbf{\ifHeadingNumbered
177 \HeadingNumber.\enspace\fi
178 \HeadingText}\\\rule[10pt]{\hsize}{0.4pt}}
179 {10pt plus3pt}%space after
180 \end{verbatim}
181
182 Or this, if you want unnumbered headings to be centralized:
183
184 \begin{verbatim}
185 \SetSectionFormatting[breakbefore,wholewidth]{chapter}
186 {12pt}
187 {\ifHeadingNumbered\FormatBlockHeading{\bfseries\LARGE}
188 \else \FormatBlockHeading{\centering\bfseries\LARGE}\fi}
189 {24pt plus9pt}
190 \end{verbatim}
191
192
193 \option{chaptercentered}
194 \option{chapterleft}
195 \option{chapterright}
196
197 Options \opt{chaptercentered}, \opt{chapterleft}, and \opt{chapterright} control chapter alignment.
198
199 Options \opt{nochaptercentered}, \opt{nochapterleft}, and \opt{nochapterright} control chapter alignment and exclude the name “Chapter” from the entry. The default, as in the \texttt{mwcls} classes, is \opt{chapterleft}. \option{nochaptercentered}
200 \option{nochapterleft}
201 \option{nochapterright}
202
203 \option{nodots}
204 If you don't want a dot after section numbers, you can invoke the option \verb|nodots|. This option does not by itself affect the page headings.
205
206
207 \section{Page Styles}
208 Several page styles are provided:
209
210 \begin{verbatim}
211 \pagestyle{headings}
212
213 \pagestyle{myheadings}
214
215 \pagestyle{headingsbeforeplain}
216
217 \pagestyle{myheadingsbeforeplain}
218
219 \pagestyle{uheadings} %for heading rules
220
221 \pagestyle{myuheadings} %for heading rules
222 \end{verbatim}
223
224 The styles \verb+headingsbeforeplain+ and \verb+myheadingsbeforeplain+ have been added, in which an even empty page finishing a chapter takes the \verb|plain| style. The default option is \verb|headings|.
225
226
227 \verb|\pagestyle{uheadings}| and \verb|\pagestyle{myuheadings}| may be used instead, defaulting to more usual parameters, and in which the header is separated by a thin line.
228
229 All page styles have an option not to include the dot after the chapter/section number: just add \verb|nodots| to the name of the usual style:
230
231 \begin{verbatim}
232 \pagestyle{headingsnodot}
233
234 \pagestyle{uheadingsnodot}
235
236 \pagestyle{headingsbeforeplainnodot}
237
238 \end{verbatim}
239
240 And so on.
241
242
243 This class is somewhat compatible with the \verb|scrlayer-scrpage| (formerly \verb|scrpage2|) for headers and footers:
244
245 \begin{verbatim}
246 \usepackage{scrlayer-scrpage}
247 \clearpairofpagestyles
248 \pagestyle{scrheadings}
249 \ofoot{\pagemark}
250 \chead{A centered heading}
251 \end{verbatim}
252
253 For additional information, see chapters 5 and 18 of the Koma-Script manual.
254
255 \section{Table of contents styles}
256
257 The \texttt{titletoc} package can be used to customize the table of contents. As a convenience, the commands \verb|\fancytoc| and \verb|\traditionaltoc| can be used in the preamble to create predefined TOC styles. More styles will be added in the future.
258
259
260 %\section{Captions}
261 %Captions have been redefined with the \verb|caption| package with the following parameters: \verb|justification=raggedright,font={sf},labelfont=bf|.
262 %
263 %\marginpar{\includegraphics[width=\marginparwidth]{apparition-fogg}
264 % \captionof{figure}{\texttt{L'apparition}, by Gustave Moreau, 1876--1877. Fogg Art Museum.}
265 % }
266
267
268
269 \section{Footnotes and margin paragraphs}
270 \option{sansserifnotes} The option \opt{sansserifnotes} changes all footnotes to sans serif.
271
272 \option{nofootnoterule} The option \opt{nofootnoterule} removes the footnote rule that separates footnotes from the main text.
273
274 \option{traditionalfootnote} The option \opt{traditionalfootnote} removes indentation of footnotes and also the wider space between the footnote mark and the footnote text.
275
276 You can choose to turn all footnotes into margin notes with the \texttt{footmisc} package:
277
278 \begin{verbatim}
279 \usepackage[side,ragged,flushmargin]{footmisc}
280 \end{verbatim}
281
282 Margin paragraphs in two-side documents have been somewhat improved, but should not be overindulged. They don't work particularly well in smaller paper formats.
283
284 \section{Other footnote and header options}
285
286 If you have ever imagined how to change the color of the header line or the footnote line, two commands are provided: \verb|\coloredheadline{}|\footnote{Colored header lines will only work with the page style \texttt{uheadings} activated.} and\linebreak \verb|\coloredfootline{}|:
287
288 \begin{verbatim}
289 \coloredheadline{JungleGreen}
290 \coloredfootline{Dandelion}
291 \pagestyle{uheadings}
292 \end{verbatim}
293
294 Be sure to issue the commands in the exact order as above.
295
296
297 \section{Other options}
298 All other options from the \texttt{mwcls} classes are available, e.g.:
299
300 \begin{multicols}{2}
301
302 \begin{itemize}
303 \item \texttt{floatssmall};
304 \item \texttt{floatsnormalsize};
305 \item \texttt{sfheadings};
306 \item \texttt{authortitle} (default);
307 \item \texttt{titleauthor};
308 \item \verb|\renewcommand{\sectsettings}{}|;
309 \item \verb|\SetTOCIndents|,
310 \item \verb|indentfirst| and \verb|noindentfirst|,
311 \item \verb|wide|, for shorter margins, and
312 \item font size and paper specifications (\texttt{12pt}, \texttt{a5paper}, etc.).
313 \end{itemize}
314 \end{multicols}
315
316 \section{Figures spreading over two pages}
317
318 Thanks to Martin Scharrer,\footnote{\url{http://tex.stackexchange.com/a/23865/9424}}
319 we also have \verb|\twopagepicture| (for numbered pictures) and \verb|\twopagepicturen| (for unnumbered pictures) to automatically split a picture on a spread (left and right pages).
320
321 It works thus: \verb|\twopagepicture{image place regarding the caption}|\\ \verb|{text width or page width}{image}{caption}|:
322
323 \begin{itemize}
324 \item \verb|\twopagepicture{b}{l}{image}{Test}|: image below caption (“b”), same width as text (“l”);
325 \item \verb|\twopagepicture{t}{l}{image}{Test}|: image above caption (“t”), same width as text (“l”);
326 \item \verb|\twopagepicture{b}{p}{image}{Test}|: image below caption (“b”), same width as page (“p”), and
327 \item \verb|\twopagepicture{t}{p}{image}{Test}|: image above caption (“t”), same width as page (“p”),
328 \end{itemize}
329
330 %\section{Implementation}
331 %
332 %
333 %\lstinputlisting{ycbook.cls}
334
335 %\marginpar{\texttt{\small This document was typeset with XXX}}
336
337 \printbibliography
338
339 \end{document}
340
341
342 %removed
343 %, so you can do fun things like this to color your header line:
344 %
345 %
346 %\begin{verbatim}
347 %\usepackage[headsepline]{scrlayer-scrpage}
348 %\addtokomafont{headsepline}{\color{JungleGreen}}
349 %\usepackage[dvipsnames,svgnames,x11names]{xcolor}
350 %\pagestyle{scrheadings}
351 %\end{verbatim}
352 %
353 %And of course simpler things such as: