From 65a6cc78ea8d1397df8fd68fb8379d54ce8d63b9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 8 Apr 2018 20:06:28 +0000 Subject: newunicodechar (8apr18) git-svn-id: svn://tug.org/texlive/trunk@47382 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/newunicodechar/README | 12 +++---- .../doc/latex/newunicodechar/newunicodechar.pdf | Bin 387122 -> 388367 bytes .../source/latex/newunicodechar/newunicodechar.dtx | 40 ++++++++++++--------- .../source/latex/newunicodechar/newunicodechar.ins | 12 +++---- .../tex/latex/newunicodechar/newunicodechar.sty | 20 +++++------ 5 files changed, 45 insertions(+), 39 deletions(-) diff --git a/Master/texmf-dist/doc/latex/newunicodechar/README b/Master/texmf-dist/doc/latex/newunicodechar/README index b747dd77348..52add6ffb56 100644 --- a/Master/texmf-dist/doc/latex/newunicodechar/README +++ b/Master/texmf-dist/doc/latex/newunicodechar/README @@ -8,12 +8,12 @@ or by XeLaTeX/LuaLaTeX: it provides the syntax where is some (directly typed in) Unicode character and is what we need to be substituted to . -This is version 1.1 of the package +This is version 1.2 of the package -Changes from version 1.0: -o The inputenx package is supported +Changes from version 1.1: +o Now utf8 is default for 8 bit engines -Copyright (C) 2012 by Enrico Gregorio +Copyright (C) 2018 by Enrico Gregorio ------------------------------------------------------- @@ -30,7 +30,7 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Enrico Gregorio. This work consists of the files - newunicodechar.dtx + newunicodechar.dtx newunicodechar.ins and the derived file newunicodechar.sty. @@ -48,5 +48,5 @@ o run "makeindex -s gind.ist newunicodechar" o run "makeindex -s gglo.ist -o newunicodechar.gls newunicodechar.glo" o run "pdflatex newunicodechar.dtx" -2012/11/12 +2018/04/08 Enrico Gregorio diff --git a/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf b/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf index 41b6ebd2ab4..f1267ba57fe 100644 Binary files a/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf and b/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf differ diff --git a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx index 75e06376619..3875a206af0 100644 --- a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx +++ b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx @@ -1,9 +1,9 @@ % \iffalse meta-comment % -% Copyright (C) 2011-2012 by Enrico Gregorio +% Copyright (C) 2011-2018 by Enrico Gregorio % % ------------------------------------------------------- -% +% % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any @@ -13,11 +13,11 @@ % of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. -% +% % The Current Maintainer of this work is Enrico Gregorio. % % This work consists of the files -% newunicodechar.dtx +% newunicodechar.dtx % newunicodechar.ins % and the derived file newunicodechar.sty. % @@ -27,10 +27,10 @@ %<*driver> \ProvidesFile{newunicodechar.dtx} % -%\NeedsTeXFormat{LaTeX2e}[2008/04/05] +%\NeedsTeXFormat{LaTeX2e}[2018/04/01] %\ProvidesPackage{newunicodechar} %<*package> - [2012/11/12 v1.1 Defining Unicode characters] + [2018/04/08 v1.2 Defining Unicode characters] % % %<*driver> @@ -48,7 +48,7 @@ % % \fi % -% \CheckSum{200} +% \CheckSum{201} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -66,7 +66,7 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% +% \changes{v1.2}{2018/04/08}{Now utf8 is default} % \changes{v1.1}{2012/11/12}{Added support for \mbox{\textsf{inputenx}}} % \changes{v1.0}{2011/02/15}{Initial version} % @@ -124,7 +124,7 @@ % for \texttt{\u{o}}, \texttt{\={o}}, and \texttt{\u{u}}. As a matter % of fact, only \texttt{\u{a}} and \texttt{\u{A}} are defined, as they % are used in the Romanian language. -% +% % One might resort to |\DeclareUnicodeCharacter| in the document's % preamble, but this requires looking up at the (long) list of Unicode % characters and jotting down the relevant numbers. For example, @@ -147,6 +147,11 @@ % |\usepackage{wasysym}|\\ % |\newunicodechar{|\eighthnote|}{\eighthnote}| % \end{flushleft} +% Important note: the package will not work if the \textsf{inputenc} package +% is called with an option different from \texttt{utf8}. As of April 2018, +% this encoding is assumed by default in 8~bit \TeX{} engines when running +% \LaTeX. However one can still load \textsf{inputenc} or \textsf{inputenx} +% with the \texttt{utf8} option (not \texttt{utf8x}). % % A similar problem may arise even with \XeLaTeX{}. A frequently asked % question on mailing lists or discussion groups is how to print some @@ -369,17 +374,18 @@ % right option, otherwise we define |\newunicodechar| to swallow its % arguments, after a warning. We need to first check for % \textsf{inputenx} because it loads \textsf{inputenc}. +% \changes{v1.2}{2018/04/08}{Now utf8 is default} % \changes{v1.1}{2012/11/12}{Added support for \mbox{\textsf{inputenx}}} % \begin{macrocode} \def\nuc@stop{\PackageWarningNoLine{newunicodechar} - {This package won't work without loading\MessageBreak - `inputenc' or `inputenx' with the `utf8' option}% + {This package only works if the document\MessageBreak + encoding is `utf8'}% \let\newunicodechar\@gobbletwo\endinput} -\@ifpackageloaded{inputenx} - {\def\nuc@tempa{inputenx}} - {\@ifpackageloaded{inputenc}{\def\nuc@tempa{inputenc}}{\nuc@stop}} -\@ifpackagewith{\nuc@tempa}{utf8}{}{\nuc@stop} -\@ifpackagewith{\nuc@tempa}{utf8x}{\nuc@stop}{} +\edef\@tempa{\detokenize{utf8}} +\edef\@tempb{\detokenize\expandafter{\inputencodingname}} +\ifx\@tempb\@tempa\else + \nuc@stop +\fi % \end{macrocode} % \begin{macro}{\newunicodechar} % The main macro. We set the temporary switch to false and put in @@ -405,7 +411,7 @@ \if@tempswa \@ifundefined{u8:\nuc@tempa}{} {\PackageWarning{newunicodechar} - {Redefining Unicode character\ifdefined\nuc@verbose; + {Redefining Unicode character\ifdefined\nuc@verbose; it meant\MessageBreak ***\space\space\nuc@meaning\space\space***\MessageBreak before your redefinition\fi}}% diff --git a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins index 6352c94d153..94c70ef0a44 100644 --- a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins +++ b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins @@ -1,7 +1,7 @@ -% Copyright (C) 2011-2012 by Enrico Gregorio +% Copyright (C) 2011-2018 by Enrico Gregorio % % ------------------------------------------------------- -% +% % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any @@ -11,11 +11,11 @@ % of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. -% +% % The Current Maintainer of this work is Enrico Gregorio. % % This work consists of the files -% newunicodechar.dtx +% newunicodechar.dtx % newunicodechar.ins % and the derived file newunicodechar.sty. @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2011-2012 by Enrico Gregorio +Copyright (C) 2011-2018 by Enrico Gregorio ------------------------------------------------------- @@ -45,7 +45,7 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Enrico Gregorio. This work consists of the files - newunicodechar.dtx + newunicodechar.dtx newunicodechar.ins and the derived file newunicodechar.sty. diff --git a/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty b/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty index 6a9e4f7cf32..03f6c4be8b4 100644 --- a/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty +++ b/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2011 by Enrico Gregorio +%% Copyright (C) 2011-2018 by Enrico Gregorio %% %% ------------------------------------------------------- %% @@ -29,9 +29,9 @@ %% newunicodechar.ins %% and the derived file newunicodechar.sty. %% -\NeedsTeXFormat{LaTeX2e}[2008/04/05] +\NeedsTeXFormat{LaTeX2e}[2018/04/01] \ProvidesPackage{newunicodechar} - [2012/11/12 v1.1 Defining Unicode characters] + [2018/04/08 v1.2 Defining Unicode characters] \@ifundefined{eTeXversion} {\PackageError{newunicodechar}{LaTeX engine too old, aborting} {Please upgrade your TeX system}\@@end}{} @@ -77,14 +77,14 @@ \expandafter\endinput \fi % End of code for Unicode engines \def\nuc@stop{\PackageWarningNoLine{newunicodechar} - {This package won't work without loading\MessageBreak - `inputenc' or `inputenx' with the `utf8' option}% + {This package only works if the document\MessageBreak + encoding is `utf8'}% \let\newunicodechar\@gobbletwo\endinput} -\@ifpackageloaded{inputenx} - {\def\nuc@tempa{inputenx}} - {\@ifpackageloaded{inputenc}{\def\nuc@tempa{inputenc}}{\nuc@stop}} -\@ifpackagewith{\nuc@tempa}{utf8}{}{\nuc@stop} -\@ifpackagewith{\nuc@tempa}{utf8x}{\nuc@stop}{} +\edef\@tempa{\detokenize{utf8}} +\edef\@tempb{\detokenize\expandafter{\inputencodingname}} +\ifx\@tempb\@tempa\else + \nuc@stop +\fi \def\newunicodechar#1#2{% \@tempswafalse \edef\nuc@tempa{\detokenize{#1}}% -- cgit v1.2.3