summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/utf8add
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-11-17 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2021-11-17 03:01:09 +0000
commit210a940181d3ba84d3a77ac4c21466fa398d61d5 (patch)
tree45a126a95b86e3ee1dea21c3bbb7637560112554 /macros/latex/contrib/utf8add
parentf57760f92d28c76b8efac9994495070b37777bea (diff)
CTAN sync 202111170301
Diffstat (limited to 'macros/latex/contrib/utf8add')
-rw-r--r--macros/latex/contrib/utf8add/utf8add.pdfbin213512 -> 42419 bytes
-rw-r--r--macros/latex/contrib/utf8add/utf8add.sty121
-rw-r--r--macros/latex/contrib/utf8add/utf8add.tex27
-rw-r--r--macros/latex/contrib/utf8add/utf8hax.pdfbin205767 -> 39436 bytes
4 files changed, 96 insertions, 52 deletions
diff --git a/macros/latex/contrib/utf8add/utf8add.pdf b/macros/latex/contrib/utf8add/utf8add.pdf
index 7b9b8919f5..965028ef97 100644
--- a/macros/latex/contrib/utf8add/utf8add.pdf
+++ b/macros/latex/contrib/utf8add/utf8add.pdf
Binary files differ
diff --git a/macros/latex/contrib/utf8add/utf8add.sty b/macros/latex/contrib/utf8add/utf8add.sty
index 90ce4b5675..4610c63830 100644
--- a/macros/latex/contrib/utf8add/utf8add.sty
+++ b/macros/latex/contrib/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
diff --git a/macros/latex/contrib/utf8add/utf8add.tex b/macros/latex/contrib/utf8add/utf8add.tex
index 2521455308..6896d99090 100644
--- a/macros/latex/contrib/utf8add/utf8add.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/utf8add/utf8hax.pdf b/macros/latex/contrib/utf8add/utf8hax.pdf
index ea37008c54..fb6b2b9dd7 100644
--- a/macros/latex/contrib/utf8add/utf8hax.pdf
+++ b/macros/latex/contrib/utf8add/utf8hax.pdf
Binary files differ