diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-07 22:26:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-07 22:26:48 +0000 |
commit | 31231686b0b60fdcd0a2ca264ffbbe8a11c4cdb1 (patch) | |
tree | 67b4236364c858dce2c4913d08849c0dd9d144b3 /Master/texmf-dist/doc/latex/uspace/uspace-test.tex | |
parent | cee1cf1fa4bae5836fd774f55d623142edad60e3 (diff) |
uspace (6oct16)
git-svn-id: svn://tug.org/texlive/trunk@42229 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/uspace/uspace-test.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/uspace/uspace-test.tex | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/uspace/uspace-test.tex b/Master/texmf-dist/doc/latex/uspace/uspace-test.tex new file mode 100644 index 00000000000..0c0b8cb573f --- /dev/null +++ b/Master/texmf-dist/doc/latex/uspace/uspace-test.tex @@ -0,0 +1,150 @@ +\documentclass{article} +\usepackage{lmodern} +\usepackage{ifluatex} +\ifnum 0\ifluatex 1\fi=1 % if LuaLaTeX +\usepackage{luatex85} +\fi +\usepackage[a6paper]{geometry} +\usepackage{parskip} +\usepackage[para,online,flushleft]{threeparttable} +\usepackage{array} +\PassOptionsToPackage{unicode}{hyperref} +\usepackage{bookmark} +\hypersetup{ + hidelinks, + breaklinks} +\urlstyle{same} % don't use monospace font for urls +\usepackage{uspace} + + +%\setlength{\emergencystretch}{3em} % prevent overfull lines +\DeclareRobustCommand{\expl}[1]{\textsf{#1}} +\newcommand{\zwsp}{\textsc{zero width space}} +\newcommand{\nnbsp}{\textsc{narrow no-break space}} +\newcommand{\nbsp}{\textsc{non-breaking space}} +\newcommand{\shy}{\textsc{soft hyphen}} +\newcommand{\enquad}{\textsc{en quad}} +\newcommand{\enspaceC}{\textsc{en space}} +\newcommand{\emquad}{\textsc{em quad}} +\newcommand{\emspaceC}{\textsc{em space}} +\newcommand{\threePerEm}{\textsc{three-per-em space}} +\newcommand{\fourPerEm}{\textsc{four-per-em space}} +\newcommand{\sixPerEm}{\textsc{six-per-em space}} +\newcommand{\figuresp}{\textsc{figure space}} +\newcommand{\punctsp}{\textsc{punctuation space}} +\newcommand{\thinsp}{\textsc{thin space}} +\newcommand{\hairsp}{\textsc{hair space}} + +\overfullrule=0.5em + +\begin{document} + +\section{\zwsp{}} + +\expl{\LaTeX{} does not hyphenate word after solidus (forward slash) in + compounds like `input/output'. Inserting \zwsp{} after the solidus in such + compound forces \LaTeX{} to consider the compound to be two words and thus + it will use the usual line breaking algorithm for the second word of the + compound. The following few lines are testing behaviour \emph{without} + \zwsp{} inserted:} + +Here, we are---testing line breaking of `input/output' compound. + +Here, we are--testing line breaking of `input/output' compound. + +\expl{Notice how both lines cause hbox overflow because \LaTeX{} cannot find + good line break.} + +\expl{And now \emph{with} \zwsp{} inserted:} + +Here, we are---testing line breaking of `input/output' compound. + +Here, we are--testing line breaking of `input/output' compound. + +\pagebreak +\section{\nnbsp{}} + +\expl{\nnbsp{} is used, e.g., in German and Czech typography to separate + multi-part abbreviations. Here is an example with `s. r. o.', which is an + equivalent of LLC or GmbH in Czech. It should be typeset with narrow space + between letters and no line break should occur between the letters:} + +\begin{tabular}{l | p{0.75\textwidth}} + s.r.o. & \expl{without any spaces} \tabularnewline + s.~r.~o. & \expl{with usual \nbsp{} (\textasciitilde{})} \tabularnewline + s. r. o. & \expl{with \nnbsp{}} \tabularnewline +\end{tabular} + +\expl{The following sentence is showing line breaking when ordinary space is + used:} + +He invested all of his savings into Pyramid s. r. o. and lost all of it. + +\expl{And here we use \nnbsp{} for much nicer result:} + +He invested all of his savings into Pyramid s. r. o. and lost all of it. + +\pagebreak + +\section{\nbsp{}} + +\expl{Here, we are testing the use of Unicode character \nbsp{}:} + +Telephone number example for Czechia: +420 123 456 789 + +Telephone number example for Czechia: +420 123 456 789 + +\expl{The line above overflows hbox because line break cannot be inserted + between digits groups due to use of \nbsp{}.} + +\pagebreak + +\section{\shy{}} +\expl{Sometimes, text might come with words pre-hyphenated using \shy{} + character. Let's use the name `Kurremkarmerruk', name of Master Namer from + Earthsea novels by Ursula K.\ Le~Guin, as an example here. Without manually + inserted \shy{}, it will be hyphenated but it will overflow hbox slightly:} + +The name of the Master Namer is `Kurremkarmerruk'. + +\expl{Here is the same with with \shy{} inserted as follows: + Kur-rem-kar-mer-ruk.} + +The name of the Master Namer is `Kurremkarmerruk'. + +\expl{Note: I claim no correctness of the above hyphenation of the name. This + is purely just an example.} + +\pagebreak + +\section{en, em and other spaces} + +\expl{Unicode contains several more space characters, some of which are shown in +the following table:} + +\begin{center} +\begin{threeparttable} +\begin{tabular}[c]{l | >{\raggedright}p{0.666\textwidth}} + a b c & \expl{\emspaceC{}}\tabularnewline + a b c & \expl{\emquad{} is canonically equivalent{\tnote{i} } to \emspaceC{}}\tabularnewline + a b c & \expl{\enspaceC{}}\tabularnewline + a b c & \expl{\enquad{} is canonically equivalent{\tnote{i} } to \enspaceC{}}\tabularnewline + a b c & \expl{\threePerEm{}}\tabularnewline + a b c & \expl{\fourPerEm{}}\tabularnewline + a b c & \expl{\sixPerEm{}}\tabularnewline + a b c & \expl{\figuresp{}}\tabularnewline + a b c & \expl{\punctsp{}}\tabularnewline + a b c & \expl{\thinsp{}}\tabularnewline + a b c & \expl{\hairsp{}}\tabularnewline + abc & \expl{no spaces, for comparison}\tabularnewline +\end{tabular} +\begin{tablenotes} +\item[\expl{i}] \expl{\footnotesize See \url{http://unicode.org/notes/tn5/} + for explanation of the term.} +\end{tablenotes} +\end{threeparttable} +\end{center} + +\pagebreak + +\end{document} |