summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/uspace/uspace.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/uspace/uspace.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/uspace/uspace.sty')
-rw-r--r--macros/latex/contrib/uspace/uspace.sty84
1 files changed, 84 insertions, 0 deletions
diff --git a/macros/latex/contrib/uspace/uspace.sty b/macros/latex/contrib/uspace/uspace.sty
new file mode 100644
index 0000000000..29672d2df4
--- /dev/null
+++ b/macros/latex/contrib/uspace/uspace.sty
@@ -0,0 +1,84 @@
+% LaTeX package that defines meanings to several different Unicode space
+% characters.
+%
+% © 2016 Václav Haisman
+%
+%% This program can be redistributed and/or modified under the terms of the
+%% MIT license. See LICENSE file.
+%
+
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+
+\ProvidesPackage{uspace}
+[2016/11/06 v0.04 LaTeX package that defines meanings to several different
+Unicode space characters.]
+
+\RequirePackage{ifxetex,ifluatex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
+\RequirePackage[utf8]{inputenc}
+\fi
+
+\RequirePackage{newunicodechar}
+
+% zero width space
+\newunicodechar{​}{\hspace{0pt}}
+
+% narrow no-break space
+\newunicodechar{ }{\leavevmode\,}
+
+% non-breaking space
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
+\relax
+\else % if !pdftex
+\newunicodechar{ }{~}
+\fi
+
+% soft hyphen
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
+\relax
+\else % if !pdftex
+\newunicodechar{­}{\-}
+\fi
+
+% en quad and en space
+\newunicodechar{ }{\enskip}
+\newunicodechar{ }{\enskip}
+
+% em quad and em space
+\newunicodechar{ }{\quad}
+\newunicodechar{ }{\quad}
+
+% three-per-em space
+\newunicodechar{ }{\hspace{0.33333em}}
+
+% four-per-em space
+\newunicodechar{ }{\hspace{0.25em}}
+
+% six-per-em space
+\newunicodechar{ }{\hspace{0.16667em}}
+
+% figure space
+\newunicodechar{ }{\leavevmode\hphantom{0}}
+
+% punctuation space
+\newunicodechar{ }{\hspace{\fontcharwd \font `\,}}
+
+% thin space
+\newunicodechar{ }{\leavevmode\allowbreak\,}
+
+% hair space
+\newunicodechar{ }{\hspace{0.08333em}}
+
+% line separator
+\newunicodechar{
}{\newline}
+
+% next line (NEL)
+\newunicodechar{…}{\newline}
+
+% paragraph separator
+\newunicodechar{
}{\csname par\endcsname}
+
+\endinput
+
+%%
+%% End of file `uspace.sty'.