diff options
author | Karl Berry <karl@freefriends.org> | 2021-11-16 21:24:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-11-16 21:24:17 +0000 |
commit | 8596fbb0024154e107b3309d77164b9a1aca5087 (patch) | |
tree | 4659468b975d93bd7e53f6b03beebfe48f50a9c8 /Master | |
parent | 969fe4bb95debc564d4dfc6ee2e7be61ced636ac (diff) |
utf8add (16nov21)
git-svn-id: svn://tug.org/texlive/trunk@61074 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/utf8add/utf8add.pdf | bin | 213512 -> 42419 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/utf8add/utf8add.tex | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/utf8add/utf8hax.pdf | bin | 205767 -> 39436 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/utf8add/utf8add.sty | 121 |
4 files changed, 96 insertions, 52 deletions
diff --git a/Master/texmf-dist/doc/latex/utf8add/utf8add.pdf b/Master/texmf-dist/doc/latex/utf8add/utf8add.pdf Binary files differindex 7b9b8919f50..965028ef971 100644 --- a/Master/texmf-dist/doc/latex/utf8add/utf8add.pdf +++ b/Master/texmf-dist/doc/latex/utf8add/utf8add.pdf diff --git a/Master/texmf-dist/doc/latex/utf8add/utf8add.tex b/Master/texmf-dist/doc/latex/utf8add/utf8add.tex index 2521455308d..6896d990900 100644 --- a/Master/texmf-dist/doc/latex/utf8add/utf8add.tex +++ b/Master/texmf-dist/doc/latex/utf8add/utf8add.tex @@ -1,4 +1,4 @@ -% Copyright 2020 Palle Jorgensen, hamselv@pallej.dk +% Copyright 2020-21 Palle Jorgensen, hamselv@pallej.dk % % This file is part of utf8add. % @@ -19,6 +19,7 @@ \usepackage[utf8]{inputenc} % \usepackage[math,nicefrac]{utf8add} % \usepackage{babel} % +\usepackage[sc]{mathpazo} % \usepackage{tgpagella} % \usepackage{listings} % \usepackage[scaled]{luximono} % @@ -47,6 +48,21 @@ The main purpose of this package is to make the text parts of \LaTeX\ document source more readable for non-\LaTeX\ users and to make more use of the possibilities with UTF-8 encoded input. +One major issue with this package is that it does \emph{not} map input +and output correct with respekt to the Unicode standards. However it +makes some \emph{available} UTF-8 input provide some \emph{desired} +outout. + +As the applied support for say the mathemathical greek letters of +Unicode still is scarse this is more of a workaround than a decent, +native support. + +The package is \emph{hack}-ish by nature. Thus the use of this +package is somewhat (quite) incompatible with documents written in +greek using e.g. the LGR input encoding. + +Thus puritans should not use this package. + \section{Loading the package} \label{sec:loading-package} \begin{lstlisting} @@ -84,6 +100,8 @@ use of the possibilities with UTF-8 encoded input. However; don't use this. \item[lowercasegreek] The same story as for the `\texttt{uppercasegreek}' option. Don't use this either. +\item[nogreek] disable the mapping of greek input. This is for + compatibility with greek texts. \end{description} @@ -108,6 +126,7 @@ support. This is the same case as for fractions. mode. View section~\ref{sec:fractions} for details. \end{description} +\clearpage \section{Using the package} \label{sec:using-package} @@ -120,7 +139,8 @@ your UTF-8 characters into your document. The default behaviour of the math support of the fractions is to typeset fractions in the default \LaTeX\ way, that is small fractions, $\tfrac12$, in text mode and larger fractions, $\dfrac12$, in display -mode. +mode. The fractions are set with the math font in math mode and text +font in text mode. Starring the fractions forces the fractions to be in text mode style. I find it useful in some cases such as @@ -141,6 +161,9 @@ details. The support for the \texttt{verbatim} environment and other source displaying features is not that good. In fact it probably won't work. +The imcompatibility with support for the greek language makes the use +of this package less desirable for users writing in greek. + \section{Copyright and license} \label{sec:copyright-license} diff --git a/Master/texmf-dist/doc/latex/utf8add/utf8hax.pdf b/Master/texmf-dist/doc/latex/utf8add/utf8hax.pdf Binary files differindex ea37008c54a..fb6b2b9dd7a 100644 --- a/Master/texmf-dist/doc/latex/utf8add/utf8hax.pdf +++ b/Master/texmf-dist/doc/latex/utf8add/utf8hax.pdf diff --git a/Master/texmf-dist/tex/latex/utf8add/utf8add.sty b/Master/texmf-dist/tex/latex/utf8add/utf8add.sty index 90ce4b5675e..4610c638305 100644 --- a/Master/texmf-dist/tex/latex/utf8add/utf8add.sty +++ b/Master/texmf-dist/tex/latex/utf8add/utf8add.sty @@ -1,4 +1,4 @@ -% Copyright 2020 Palle Jorgensen, hamselv@pallej.dk +% Copyright 2020-21 Palle Jorgensen, hamselv@pallej.dk % % This file is part of utf8add. % @@ -14,7 +14,7 @@ % % You should have received a copy of the GNU General Public License % along with utf8add. If not, see <https://www.gnu.org/licenses/>. -\ProvidesPackage{utf8add}[2020/05/26 Palle Jorgensen] +\ProvidesPackage{utf8add}[2021/11/16 Palle Jorgensen] %% Package dependencies \RequirePackage[utf8]{inputenc} @@ -24,13 +24,18 @@ \RequirePackage{gensymb} \RequirePackage{nicefrac} +\newif\if@greek@ +\@greek@true + %% Options +%% Disable greek overall? +\DeclareOptionX{nogreek}{\@greek@false} + %% Choosing the uppercase greek style :-/ \newif\if@uppercasegreek@default@ \newif\if@uppercasegreek@upright@ \newif\if@uppercasegreek@italic@ \@uppercasegreek@default@true - \DeclareOptionX{uppercasegreek}[default]{% \csname @uppercasegreek@#1@true\endcsname} @@ -105,70 +110,75 @@ \providecommand*\Upzeta{\mathrm{Z}} } +\def\auto@superior#1{\ifmmode^{#1}\else\textsuperscript{#1}\fi} +\def\auto@inferior#1{\ifmmode^{#1}\else\textsubcript{#1}\fi} \if@math@superior@ \AtBeginDocument{% - \def\textonesuperior{\ensuremath{^{1}}} - \def\texttwosuperior{\ensuremath{^{2}}} - \def\textthreesuperior{\ensuremath{^{3}}} - \def\textfoursuperior{\ensuremath{^{4}}} - \def\textfivesuperior{\ensuremath{^{5}}} - \def\textsixsuperior{\ensuremath{^{6}}} - \def\textsevensuperior{\ensuremath{^{7}}} - \def\texteightsuperior{\ensuremath{^{8}}} - \def\textninesuperior{\ensuremath{^{9}}} - \def\textzerosuperior{\ensuremath{^{0}}} + \def\textonesuperior{\auto@superior{1}} + \def\texttwosuperior{\auto@superior{2}} + \def\textthreesuperior{\auto@superior{3}} + \def\textfoursuperior{\auto@superior{4}} + \def\textfivesuperior{\auto@superior{5}} + \def\textsixsuperior{\auto@superior{6}} + \def\textsevensuperior{\auto@superior{7}} + \def\texteightsuperior{\auto@superior{8}} + \def\textninesuperior{\auto@superior{9}} + \def\textzerosuperior{\auto@superior{0}} } \else \AtBeginDocument{% - \providecommand*\textonesuperior{\ensuremath{^{1}}} - \providecommand*\texttwosuperior{\ensuremath{^{2}}} - \providecommand*\textthreesuperior{\ensuremath{^{3}}} - \providecommand*\textfoursuperior{\ensuremath{^{4}}} - \providecommand*\textfivesuperior{\ensuremath{^{5}}} - \providecommand*\textsixsuperior{\ensuremath{^{6}}} - \providecommand*\textsevensuperior{\ensuremath{^{7}}} - \providecommand*\texteightsuperior{\ensuremath{^{8}}} - \providecommand*\textninesuperior{\ensuremath{^{9}}} - \providecommand*\textzerosuperior{\ensuremath{^{0}}}} + \providecommand*\textonesuperior{\auto@superior{1}} + \providecommand*\texttwosuperior{\auto@superior{2}} + \providecommand*\textthreesuperior{\auto@superior{3}} + \providecommand*\textfoursuperior{\auto@superior{4}} + \providecommand*\textfivesuperior{\auto@superior{5}} + \providecommand*\textsixsuperior{\auto@superior{6}} + \providecommand*\textsevensuperior{\auto@superior{7}} + \providecommand*\texteightsuperior{\auto@superior{8}} + \providecommand*\textninesuperior{\auto@superior{9}} + \providecommand*\textzerosuperior{\auto@superior{0}}} \fi \if@math@inferior@ \AtBeginDocument{% - \def\textoneinferior{\ensuremath{_{1}}} - \def\texttwoinferior{\ensuremath{_{2}}} - \def\textthreeinferior{\ensuremath{_{3}}} - \def\textfourinferior{\ensuremath{_{4}}} - \def\textfiveinferior{\ensuremath{_{5}}} - \def\textsixinferior{\ensuremath{_{6}}} - \def\textseveninferior{\ensuremath{_{7}}} - \def\texteightinferior{\ensuremath{_{8}}} - \def\textnineinferior{\ensuremath{_{9}}} - \def\textzeroinferior{\ensuremath{_{0}}} -} + \def\textoneinferior{\auto@inferior{1}} + \def\texttwoinferior{\auto@inferior{2}} + \def\textthreeinferior{\auto@inferior{3}} + \def\textfourinferior{\auto@inferior{4}} + \def\textfiveinferior{\auto@inferior{5}} + \def\textsixinferior{\auto@inferior{6}} + \def\textseveninferior{\auto@inferior{7}} + \def\texteightinferior{\auto@inferior{8}} + \def\textnineinferior{\auto@inferior{9}} + \def\textzeroinferior{\auto@inferior{0}}} \else \AtBeginDocument{% - \providecommand*\textoneinferior{\ensuremath{_{1}}} - \providecommand*\texttwoinferior{\ensuremath{_{2}}} - \providecommand*\textthreeinferior{\ensuremath{_{3}}} - \providecommand*\textfourinferior{\ensuremath{_{4}}} - \providecommand*\textfiveinferior{\ensuremath{_{5}}} - \providecommand*\textsixinferior{\ensuremath{_{6}}} - \providecommand*\textseveninferior{\ensuremath{_{7}}} - \providecommand*\texteightinferior{\ensuremath{_{8}}} - \providecommand*\textnineinferior{\ensuremath{_{9}}} - \providecommand*\textzeroinferior{\ensuremath{_{0}}} -} + \providecommand*\textoneinferior{\auto@inferior{1}} + \providecommand*\texttwoinferior{\auto@inferior{2}} + \providecommand*\textthreeinferior{\auto@inferior{3}} + \providecommand*\textfourinferior{\auto@inferior{4}} + \providecommand*\textfiveinferior{\auto@inferior{5}} + \providecommand*\textsixinferior{\auto@inferior{6}} + \providecommand*\textseveninferior{\auto@inferior{7}} + \providecommand*\texteightinferior{\auto@inferior{8}} + \providecommand*\textnineinferior{\auto@inferior{9}} + \providecommand*\textzeroinferior{\auto@inferior{0}}} \fi \def\@autofrac#1#2{% - \@ifstar{\ensuremath{\tfrac{#1}{#2}}}{% + \@ifstar{% + \ifmmode + \tfrac{#1}{#2} + \else + $\frac{\text{#1}}{\text{#2}}$ + \fi}{% \ifmmode \frac{#1}{#2} \else \if@nicefrac@ \nicefrac{#1}{#2} \else - \ensuremath{\tfrac{#1}{#2}}\fi\fi}} + $\tfrac{\text{#1}}{\text{#2}}$\fi\fi}} %% Fractions \if@math@fractions@ @@ -259,6 +269,15 @@ \DeclareUnicodeCharacter{2152}{\textonetenth} \DeclareUnicodeCharacter{2189}{\textzerothirds} + +\if@greek@ + +\@ifundefined{ver@lgrenc.def}{} {\PackageWarning{utf8add}{LGR font + encoding loaded. Output will be poor.}} + +\@ifpackageloaded{textalpha}{\PackageWarning{utf8add}{Package + 'textalpha' loaded. Output will be poor.}{}} + %% Lowercase Greek Letters \if@lowercasegreek@upright@ \DeclareUnicodeCharacter{03B1}{\ensuremath{\upalpha}} @@ -399,7 +418,7 @@ \DeclareUnicodeCharacter{03A7}{\ensuremath{\Chi}} \DeclareUnicodeCharacter{03A8}{\ensuremath{\Psi}} \DeclareUnicodeCharacter{03A9}{\ensuremath{\Omega}} -\fi\fi\fi +\fi\fi\fi\fi %% Superior numbers 4-0 \DeclareUnicodeCharacter{2074}{\textfoursuperior} @@ -448,10 +467,12 @@ \DeclareUnicodeCharacter{2016}{\ifmmode\Vert\else\textbardbl\fi} %% Other miscelaneous symbols -\DeclareUnicodeCharacter{207A}{\ensuremath{^{+}}} -\DeclareUnicodeCharacter{207B}{\ensuremath{^{-}}} +\DeclareUnicodeCharacter{207A}{\auto@superior{+}} +\DeclareUnicodeCharacter{207B}{\ifmmode^{-}\else\textsuperscript{\textminus}\fi} \DeclareUnicodeCharacter{2213}{\ensuremath{\mp}} \DeclareUnicodeCharacter{2212}{\ifmmode-\else--\fi} \DeclareUnicodeCharacter{0127}{\ensuremath{\hbar}} +\providecommand*\molar{\textsc{m}} +\DeclareUnicodeCharacter{1D0D}{\molar} \endinput
\ No newline at end of file |