summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.tex
blob: bd94218c94084e858854958891bdf1f86000b58c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
\documentclass{article}
\usepackage{lmodern}
\usepackage{ifluatex}
\usepackage[a6paper]{geometry}
\usepackage{parskip}
\usepackage{polyglossia}
\setmainlanguage[]{czech}
\setotherlanguage{english}
\usepackage{microtype}

\setlength{\emergencystretch}{3em}  % prevent overfull lines
\newcommand{\expl}[1]{\begin{english}\sffamily #1\end{english}}

\usepackage{cstypo}

\begin{document}
\section{Bad line breaks}
\expl{The follwing text has prepostions `O' and `k' at end of line which
  is incorrect according to Czech language typography standards:}

Mezi oblíbené dětské pohádky patří pohádky \emph{O Palečkovi, Alenka v říši
  divů} a \emph{Socialismem k lepším zítřkům.}

\expl{The follwing text is the same as above but parentheses are used to test
  that a preposition stay (or not stay, in this case) with following word
  even if the prepostion is preceeded with a parenthesis:}

Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka v říši
  divů} a \emph{Socialismem (k lepším zítřkům).}

\expl{Next line shows bad line break between number and the \% symbol.}

Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce.

\section{Better line breaks}
\expl{And here we add Lua code to penalize single letter words. It results in
following line layout:}

\cstypoSingleLetterEnable{}
\cstypoPercentsEnable{}
\cstypoALetterEnable{}
Mezi oblíbené dětské pohádky patří pohádky \emph{O Palečkovi, Alenka v říši
  divů} a \emph{Socialismem k lepším zítřkům.}

\expl{The follwing text is the same as above but parentheses are used to test
  that a preposition stay with following word even if the prepostion is
  preceeded with a parenthesis:}

Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka v říši
  divů} a \emph{Socialismem (k lepším zítřkům).}

\expl{Here, the \% symbol should be together with the number.}

Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce.

\section{Bad line breaks again}
\expl{This section shows that disabling of the hook works and that the
  prepositions are again left at the end of their line.}

\cstypoSingleLetterDisable{}
\cstypoPercentsDisable{}
\cstypoALetterDisable{}

Mezi oblíbené dětské pohádky patří pohádky \emph{O Palečkovi, Alenka v říši
  divů} a \emph{Socialismem k lepším zítřkům.}

\expl{The follwing text is the same as above but parentheses are used to test
  that a preposition stay (or not stay, in this case) with following word
  even if the prepostion is preceeded with a parenthesis:}

Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka v říši
  divů} a \emph{Socialismem (k lepším zítřkům).}

\expl{And here, line break is inserted before the \% symbol again.}

Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce.



\end{document}