Debian Codegraph @

texmf-dist/doc/lualatex/cstypo/cstypo.tex

raw
1 \documentclass[paper=B5,DIV=calc,parskip=half]{scrartcl}
2 \usepackage{ifluatex}
3
4 \usepackage{fontspec}
5 %\defaultfontfeatures{Ligatures={TeX,Common},Scale=MatchLowercase}
6 \setmainfont[]{Charis SIL}
7 \setsansfont[Ligatures={TeX,Common}, Scale=MatchLowercase]{TeX Gyre Heros}
8 \setmonofont[Ligatures=,Scale=MatchLowercase]{DejaVu Sans Mono}
9
10 \usepackage{listings}
11 \usepackage{enumitem}
12 %\usepackage{enumitem-zref}
13 \usepackage{polyglossia}
14 \setmainlanguage[]{english}
15
16 \usepackage{newunicodechar}
17 \newunicodechar{℃}{{°C}}
18 \newunicodechar{℉}{{°F}}
19
20 \usepackage[autostyle]{csquotes}
21
22 \author{Václav Haisman\texorpdfstring{%
23 \\{\small\href{mailto:[email protected]?subject=[cstypo]}{[email protected]}}}{}}
24 \date{\today}
25 \title{\texttt{cstypo} user manual}
26
27 \PassOptionsToPackage{unicode}{hyperref}
28 \usepackage{bookmark}
29 \usepackage{xcolor}
30 \hypersetup{
31 colorlinks,
32 linkcolor={red!50!black},
33 citecolor={blue!50!black},
34 urlcolor={blue!80!black},
35 breaklinks=true}
36 \urlstyle{same} % don't use monospace font for urls
37
38 \usepackage{microtype}
39 \usepackage{metalogo}
40
41 \setlength{\emergencystretch}{3em} % prevent overfull lines
42
43 \lstdefinestyle{myLatexStyle}{
44 language=[LaTeX]{Tex},
45 basicstyle=\ttfamily
46 }
47
48
49 \begin{document}
50 \begin{titlepage}
51 \maketitle
52 \end{titlepage}
53
54 \tableofcontents
55
56 \section{Introduction}
57 The \href{https://www.ctan.org/pkg/cstypo}{\texttt{cstypo}}\footnote{Source
58 code is on GitHub in
59 \href{https://github.com/wilx/cstypo}{\texttt{wilx/cstypo}} repository.}
60 package provides macros that enforce basic Czech typography rules through Lua
61 hooks available in \LuaTeX{}.
62
63 \begin{enumerate}%[name=rulesList]
64 \item\label{itm:singleletter} There should be no line break between single
65 letter preprosition and single letter conjugations and word following them.
66 \item\label{itm:percents} There should be no line break between number and \%
67 symbol.
68 \end{enumerate}
69
70 There are obviously more rules than these two but only the above rules are
71 enforcable through this package.
72
73 \section{User interface}
74
75 Czech typography rules, when enabled by the following macros, are only
76 enforced on text marked as Czech by \texttt{polyglossia} or \texttt{babel}.
77
78 The following two macros allow to enable and disable hook that enforces
79 penalization of line breaks after single letter words:
80 %(\refitem{rulesList{itm:singleletter}):
81
82 \begin{lstlisting}[style=myLatexStyle]
83 \cstypoSingleLetterEnable
84 \cstypoSingleLetterDisable
85 \end{lstlisting}
86
87 The following two macros allow to enable and disable hook that enforces the
88 same rule as above but for ‘a’ conjugation. The reason that this is separete
89 from the rest of the single letter prepositions and conjugations is that line
90 break after ‘a’ is tolerated for narrow column texts. It might be desirable
91 to have this rule enforced for all of the single letter words except for the
92 ‘a’.
93
94 \begin{lstlisting}[style=myLatexStyle]
95 \cstypoALetterEnable
96 \cstypoALetterDisable
97 \end{lstlisting}
98
99 The following two macros allow to enable and disable hook that enforces
100 penalization of line breaks between number and \enquote*{\%} symbol and also
101 few more symbols: per thousand~\enquote*{‰}, degree~\enquote*{°}, degree
102 Celsius~\enquote*{℃} and degree Fahrenheit~\enquote*{℉}.
103
104 \begin{lstlisting}[style=myLatexStyle]
105 \cstypoPercentsEnable
106 \cstypoPercentsDisable
107 \end{lstlisting}
108
109 The following two macros allow to enable and disable hook that enforces
110 penalization of line breaks between~\enquote*{§} symbol and following number.
111
112 \begin{lstlisting}[style=myLatexStyle]
113 \cstypoParagraphEnable
114 \cstypoParagraphDisable
115 \end{lstlisting}
116
117
118 \section{History}
119
120 This package was inspired by
121 \texttt{\href{http://www.ctan.org/pkg/impnattypo}{impnattypo}} French
122 typography package. It would not be possible without help and comments from
123 people of
124 \href{http://chat.stackexchange.com/rooms/41/tex-latex-and-friends}{\TeX{},
125 \LaTeX{} and Friends} StackExchange chat room and the
126 \href{http://tex.stackexchange.com/}{\TeX.SE} site itself.
127
128 \begin{description}[style=nextline, labelwidth=4.5em, leftmargin=!, labelindent=0em]
129 \item[\texttt{v0.03}] Limit Czech typography rules enforcement only to text
130 marked as Czech language. Handle per thousand~\enquote*{‰},
131 degree~\enquote*{°}, degree Celsius~\enquote*{℃}, degree
132 Fahrenheit~\enquote*{℉} and paragraph~\enquote*{§} symbols.
133 \item[\texttt{v0.02}] Fixed some packaging and documentation issues found by
134 CTAN submission review.
135 \item[\texttt{v0.01}] First published version of this package.
136 \end{description}
137
138 \end{document}