Debian Codegraph @

texmf-dist/doc/lualatex/pdfarticle/pdfArticle.tex

raw
1 % Copyright (c) 2015-2019 Robert Ryszard Paciorek <[email protected]>
2 %
3 % MIT License
4 %
5 % Permission is hereby granted, free of charge, to any person obtaining a copy
6 % of this software and associated documentation files (the "Software"), to deal
7 % in the Software without restriction, including without limitation the rights
8 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 % copies of the Software, and to permit persons to whom the Software is
10 % furnished to do so, subject to the following conditions:
11 %
12 % The above copyright notice and this permission notice shall be included in all
13 % copies or substantial portions of the Software.
14 %
15 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 % SOFTWARE.
22
23 \documentclass[ fontSize=10pt, ]{pdfArticle}
24
25
26 \title {Features of \texttt{pdfArticle} document class}
27 \author{Robert Ryszard Paciorek <[email protected]>}
28 \date {2019-05-05}
29
30 \makeatletter\hypersetup{
31 pdftitle = {\@title},
32 pdfauthor = {\@author}
33 }\makeatother
34
35 \setstretch{1.0} \setlength{\parindent}{0pt} \setlength{\parskip}{2pt}
36
37 \usepackage{titling}
38 \renewcommand{\maketitlehooka}{\vspace{-44pt}}
39 \renewcommand{\maketitlehookb}{\vspace{-14pt}}
40 \renewcommand{\maketitlehookd}{\vspace{-13pt}}
41 \renewcommand{\maketitlehookd}{\vspace{-12pt}}
42
43 \usepackage{hologo}
44 \newcommand{\pkgLink}[1]{\texttt{\href{https://ctan.org/pkg/#1}{#1}}}
45
46 \begin{document}
47
48 \maketitle\thispagestyle{empty}
49
50 Document class \texttt{pdfArticle} is simple document class dedicated for creating pdf documents with \hologo{LuaLaTeX}.
51 This class:
52 \begin{itemize}
53 \item Use \texttt{extarticle} (from \pkgLink{extsizes}) as base document class (for support wide range of base font sizes).
54 \item Require and configure \pkgLink{fontspec} package, that enable support for Unicode Open Type fonts.
55 Configure default document \textrm{sherif}, \textsf{sans} and \texttt{mono} fonts via \texttt{fontspec} according to class options.
56 By default use \textit{Latin Modern} fonts with support for \textsc{small caps} in sherif and mono fonts.
57 \item Require and configure \pkgLink{graphicx} and \pkgLink{graphbox} packages (for including graphics).
58 Set file extensions for search graphics files to \texttt{.mp, .pdf, .png, .jpg, .jpeg} (in this order -- first \hologo{METAPOST}, last JPEG) and default image resolution to \texttt{imgResolution} class atribute (default 150).
59 \item Require \pkgLink{xcolor} (for foreground and background colors) and \pkgLink{fifo-stack} packages and configure colours stack (you can use it with \Verb$\FSPush{colors}$, \Verb$\FSPop{colors}$ and \Verb$\FSTop{colors}$ commands).
60 \item Require \pkgLink{hyperref} package (for internal and external links in pdfs) and configure color external (url) link as blue and internal (\Verb$\ref{}$) links as color from top of colours stack.
61 More setting (eg. set PDF title, author, etc) can be do via \Verb$\hypersetup{}$ command.
62 \item Require \pkgLink{geometry} package and configure page gemetry (paper size, orientation and marings) according to class options. By default use portrait A4 paper.
63 \item Provide \Verb$\forceNewPageGeometry$ commad for enforce new page geometry (like \Verb$\newgeometry$, but allow change paper size too).
64 \item Require \pkgLink{fancyvrb} and \pkgLink{fvextra} (for good verbatim enviromet with line breaking, line numbering, titles, frames, etc).
65 Redefine standard \Verb$verbatim$ enviromet and \Verb$\verb$ commad to using fancyvrb. Allow break long lines on spaces, \Verb$/$ or \Verb$-$, set $\hookrightarrow$ as post break marker.
66 \item Require \pkgLink{ulem}, \pkgLink{contour} and \pkgLink{shadowtext} (for text decorations).
67 \item Is incompatible with \texttt{sout} package,
68 because define own \Verb$\ul[color]{text}$, \Verb$\st[color]{text}$ and \Verb$\hl[color]{text}$ commands (based on \texttt{ulem} package)
69 for \ul[blue]{underline}, \st[red]{strike out} and \hl[yellow]{highlight} text with selected color.
70 \item Require \pkgLink{enumitem} (for better enumerate, itemize and description environments).
71 \item Redefine \Verb$\alph$ and \Verb$\Alph$ with \pkgLink{alphalph} package (for converting big numbers to letters as \Verb[breaklines=true]$a, b, ..., x, y, z, aa, ab, ac, ..., az, ba, ..., zz, aaa, ...$).
72 \item Require \pkgLink{pbox} and \pkgLink{varwidth} (for vertical box with automatic minimal width).
73 \item Require \pkgLink{overpic} (for putting \hologo{LaTeXTeX} stuff on images).
74 \item Require \pkgLink{wrapfig} (for wraping text around images).
75 \item Require \pkgLink{array} and \pkgLink{dcolumn} (for useful extentions for tables).
76 \item Require \pkgLink{tabto} (for tabbing to fixed positions).
77 \item Require \pkgLink{ragged2e} (for \Verb$justify$ environment and configurable \Verb$Center$, \Verb$FlushLeft$, \Verb$FlushRight$).
78 \item Require \pkgLink{changepage} (for changes margins via \Verb$adjustwidth$ environment).
79 \item Require \pkgLink{setspace} (for setting line stretch -- global and via \Verb$spacing$ environment).
80 \item Require \pkgLink{amsmath} and \pkgLink{unicode-math} (for better math with Unicode Open Type fonts).
81 \item Require \pkgLink{adjustbox} (for scaling, rotating, clipping, etc boxes).
82 \item Only when \Verb$extra$ option was given require: \pkgLink{minted} (code highlight), \pkgLink{tcolorbox} (nice framed boxes).
83 \end{itemize}
84
85 \clearpage
86 Class can be simple used by: \Verb$\documentclass{pdfArticle}$. Below is example of class usage with all avalible options, all options in this example are set to default values:
87 \begin{Verbatim}[xleftmargin=5mm]
88 \documentclass[
89 fontSize=12pt,
90
91 mainFont={Latin Modern Roman},
92 mainFontFeat={
93 UprightFeatures = { SmallCapsFont={ lmromancaps10regular } },
94 ItalicFeatures = { SmallCapsFont={ lmromancaps10oblique } },
95 SlantedFont = lmromanslant10regular,
96 BoldSlantedFont = lmromanslant10bold,
97 Ligatures=TeX
98 },
99 sansFont={Latin Modern Sans},
100 sansFontFeat={
101 Ligatures=TeX
102 },
103 monoFont={Latin Modern Mono},
104 monoFontFeat={
105 UprightFeatures = { SmallCapsFont={ lmmonocaps10regular } },
106 ItalicFont = lmmono10italic,
107 ItalicFeatures = { SmallCapsFont={ lmmonocaps10oblique } },
108 SlantedFont = lmmonoslant10regular
109 },
110
111 paperSize=a4paper, paperMode=portrait, twoside=true,
112 tmargin=2.2cm, bmargin=2.5cm, lmargin=2.2cm, rmargin=2.2cm,
113
114 imgResolution=150, extra=false
115 ]{pdfArticle}
116 \end{Verbatim}
117
118 It's also possible load some packages (or do other things) right before load \texttt{hyperref} package (after load all other packages) via \Verb$\pdfArticlePreHyperRef$:
119 \begin{Verbatim}[xleftmargin=5mm]
120 \newcommand\pdfArticlePreHyperRef{
121 % stuff to do before load hyperref
122 }
123 \documentclass{pdfArticle}
124 \end{Verbatim}
125 \end{document}