From c22ab9576265f84ca4d5a4a331998e171aa3872d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Sep 2016 21:36:23 +0000 Subject: cstypo (3sep16) git-svn-id: svn://tug.org/texlive/trunk@41986 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/lualatex/cstypo/README.md | 6 +- Master/texmf-dist/doc/lualatex/cstypo/cstypo.pdf | Bin 67456 -> 74001 bytes Master/texmf-dist/doc/lualatex/cstypo/cstypo.tex | 26 ++++++- .../texmf-dist/doc/lualatex/cstypo/cstypotest.pdf | Bin 21174 -> 28731 bytes .../texmf-dist/doc/lualatex/cstypo/cstypotest.tex | 78 +++++++++++++++++++++ 5 files changed, 105 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/doc/lualatex') diff --git a/Master/texmf-dist/doc/lualatex/cstypo/README.md b/Master/texmf-dist/doc/lualatex/cstypo/README.md index db71a70026b..4b0ed9a8ef0 100644 --- a/Master/texmf-dist/doc/lualatex/cstypo/README.md +++ b/Master/texmf-dist/doc/lualatex/cstypo/README.md @@ -1,11 +1,9 @@ # cstypo -This package provides macros for Czech language typography rules using -Lua(La)TeX. +This package provides macros for Czech language typography rules using Lua(La)TeX. - License is MIT license. See `LICENSE` file. - Author is [Václav Haisman](mailto:vhaisman+cstypo@gmail.com?subject=[cstypo]) -- Source code on GitHub in [`wilx/cstypo`](https://github.com/wilx/cstypo) - repository. +- Source code on GitHub in [`wilx/cstypo`](https://github.com/wilx/cstypo) repository. diff --git a/Master/texmf-dist/doc/lualatex/cstypo/cstypo.pdf b/Master/texmf-dist/doc/lualatex/cstypo/cstypo.pdf index 98610d9d79e..a1454c37073 100644 Binary files a/Master/texmf-dist/doc/lualatex/cstypo/cstypo.pdf and b/Master/texmf-dist/doc/lualatex/cstypo/cstypo.pdf differ diff --git a/Master/texmf-dist/doc/lualatex/cstypo/cstypo.tex b/Master/texmf-dist/doc/lualatex/cstypo/cstypo.tex index 9e87d617b90..1246e3d9566 100644 --- a/Master/texmf-dist/doc/lualatex/cstypo/cstypo.tex +++ b/Master/texmf-dist/doc/lualatex/cstypo/cstypo.tex @@ -13,6 +13,12 @@ \usepackage{polyglossia} \setmainlanguage[]{english} +\usepackage{newunicodechar} +\newunicodechar{℃}{{°C}} +\newunicodechar{℉}{{°F}} + +\usepackage[autostyle]{csquotes} + \author{Václav Haisman\texorpdfstring{% \\{\small\href{mailto:vhaisman+cstypo@gmail.com?subject=[cstypo]}{vhaisman@gmail.com}}}{}} \date{\today} @@ -66,6 +72,9 @@ enforcable through this package. \section{User interface} +Czech typography rules, when enabled by the following macros, are only +enforced on text marked as Czech by \texttt{polyglossia} or \texttt{babel}. + The following two macros allow to enable and disable hook that enforces penalization of line breaks after single letter words: %(\refitem{rulesList{itm:singleletter}): @@ -88,13 +97,24 @@ to have this rule enforced for all of the single letter words except for the \end{lstlisting} The following two macros allow to enable and disable hook that enforces -penalization of line breaks between number and \% symbol. +penalization of line breaks between number and \enquote*{\%} symbol and also +few more symbols: per thousand~\enquote*{‰}, degree~\enquote*{°}, degree +Celsius~\enquote*{℃} and degree Fahrenheit~\enquote*{℉}. \begin{lstlisting}[style=myLatexStyle] \cstypoPercentsEnable \cstypoPercentsDisable \end{lstlisting} +The following two macros allow to enable and disable hook that enforces +penalization of line breaks between~\enquote*{§} symbol and following number. + +\begin{lstlisting}[style=myLatexStyle] +\cstypoParagraphEnable +\cstypoParagraphDisable +\end{lstlisting} + + \section{History} This package was inspired by @@ -106,6 +126,10 @@ people of \href{http://tex.stackexchange.com/}{\TeX.SE} site itself. \begin{description}[style=nextline, labelwidth=4.5em, leftmargin=!, labelindent=0em] +\item[\texttt{v0.03}] Limit Czech typography rules enforcement only to text + marked as Czech language. Handle per thousand~\enquote*{‰}, + degree~\enquote*{°}, degree Celsius~\enquote*{℃}, degree + Fahrenheit~\enquote*{℉} and paragraph~\enquote*{§} symbols. \item[\texttt{v0.02}] Fixed some packaging and documentation issues found by CTAN submission review. \item[\texttt{v0.01}] First published version of this package. diff --git a/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.pdf b/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.pdf index 9752e42b352..1d6912a1341 100644 Binary files a/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.pdf and b/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.pdf differ diff --git a/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.tex b/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.tex index bd94218c940..bfdc3cfab4d 100644 --- a/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.tex +++ b/Master/texmf-dist/doc/lualatex/cstypo/cstypotest.tex @@ -32,6 +32,23 @@ Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce. +\expl{Next line is similar as the one above but tests behaviour for the ‰ + character.} + +Zde, v České republice, stále není povoleno ani 1 ‰ alkoholu v krvi při +řízení automobilu. + +\expl{Next line shows bad line break between degree sign `°' and number.} + +Součet všech tří úhlů v trojůhelníku je vždy 180 °. + +Voda taje při teplotě 0 ℃ a vypařuje se při 100 ℃. + +\expl{Next line show use of ``paragraf'' symbol. It should be kept with the + following number.} + +Jak může státní zástupce věc odložit zmiňuje § 159a. + \section{Better line breaks} \expl{And here we add Lua code to penalize single letter words. It results in following line layout:} @@ -39,6 +56,7 @@ following line layout:} \cstypoSingleLetterEnable{} \cstypoPercentsEnable{} \cstypoALetterEnable{} +\cstypoParagraphEnable{} 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.} @@ -53,6 +71,50 @@ Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce. +\expl{Next line is similar as the one above but tests behaviour for the ‰ + character.} + +Zde, v České republice, stále není povoleno ani 1 ‰ alkoholu v krvi při +řízení automobilu. + +\expl{Next line shows line break between degree sign `°' and number. The + degree sign should stay with the number.} + +Součet všech tří úhlů v trojůhelníku je vždy 180 °. + +Voda taje při teplotě 0 ℃ a vypařuje se při 100 ℃. + +\expl{Next line show use of ``paragraf'' symbol. It should be kept with the + following number.} + +Jak může státní zástupce věc odložit zmiňuje § 159a. + + +\section{Bad line breaks because of English} +\expl{This section shows that while the hooks are still active, the actual + Czech language text is marked as English which results in bad line breaks.} + +\begin{english} +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.} + +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).} + +Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce. + +Zde, v České republice, stále není povoleno ani 1 ‰ alkoholu v krvi při +řízení automobilu. + +Součet všech tří úhlů v trojůhelníku je vždy 180 °. + +Voda taje při teplotě 0 ℃ a vypařuje se při 100 ℃. + +Jak může státní zástupce věc odložit zmiňuje § 159a. + +\end{english} + + \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.} @@ -60,6 +122,7 @@ Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řád \cstypoSingleLetterDisable{} \cstypoPercentsDisable{} \cstypoALetterDisable{} +\cstypoParagraphDisable{} 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.} @@ -75,6 +138,21 @@ Mezi oblíbené dětské pohádky patří pohádky \emph{[O Palečkovi], Alenka Se správným nastavením fontů znak \% v `na 100 \%' skončí na další řádce. +\expl{Next line is similar as the one above but tests behaviour for the ‰ + character.} + +Zde, v České republice, stále není povoleno ani 1 ‰ alkoholu v krvi při +řízení automobilu. + +\expl{Next line shows bad line break between degree sign `°' and number.} + +Součet všech tří úhlů v trojůhelníku je vždy 180 °. + +Voda taje při teplotě 0 ℃ a vypařuje se při 100 ℃. + +\expl{Next line show use of ``paragraf'' symbol. It should be kept with the + following number.} +Jak může státní zástupce věc odložit zmiňuje § 159a. \end{document} -- cgit v1.2.3