diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-13 23:35:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-13 23:35:53 +0000 |
commit | 4776da14c604f45e9c7a51a4efb48e9e97ec3dd1 (patch) | |
tree | 14f7b73e7ca63d86636e038beb0e2680f4693b20 /Master | |
parent | 2bd3a97e68ab7bbf790cb6cfcc49c2d9dae3e51d (diff) |
newunicodechar (13nov12)
git-svn-id: svn://tug.org/texlive/trunk@28253 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/newunicodechar/README | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf | bin | 368751 -> 387122 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx | 73 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty | 27 |
5 files changed, 62 insertions, 51 deletions
diff --git a/Master/texmf-dist/doc/latex/newunicodechar/README b/Master/texmf-dist/doc/latex/newunicodechar/README index e213ea2a8e1..b747dd77348 100644 --- a/Master/texmf-dist/doc/latex/newunicodechar/README +++ b/Master/texmf-dist/doc/latex/newunicodechar/README @@ -8,9 +8,12 @@ or by XeLaTeX/LuaLaTeX: it provides the syntax where <char> is some (directly typed in) Unicode character and <code> is what we need to be substituted to <char>. -This is version 1.0 of the package +This is version 1.1 of the package -Copyright (C) 2011 by Enrico Gregorio +Changes from version 1.0: +o The inputenx package is supported + +Copyright (C) 2012 by Enrico Gregorio <Enrico dot Gregorio at univr dot it> ------------------------------------------------------- @@ -45,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" -2011/02/18 +2012/11/12 Enrico Gregorio diff --git a/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf b/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf Binary files differindex 1e7e3d9c076..41b6ebd2ab4 100644 --- a/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf +++ b/Master/texmf-dist/doc/latex/newunicodechar/newunicodechar.pdf diff --git a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx index 96e996cb844..75e06376619 100644 --- a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx +++ b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2011 by Enrico Gregorio +% Copyright (C) 2011-2012 by Enrico Gregorio % <Enrico dot Gregorio at univr dot it> % ------------------------------------------------------- % @@ -30,7 +30,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2008/04/05] %<package>\ProvidesPackage{newunicodechar} %<*package> - [2011/02/18 v1.0 Defining Unicode characters] + [2012/11/12 v1.1 Defining Unicode characters] %</package> % %<*driver> @@ -48,7 +48,7 @@ %</driver> % \fi % -% \CheckSum{193} +% \CheckSum{200} % % \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 @@ -67,6 +67,7 @@ % Right brace \} Tilde \~} % % +% \changes{v1.1}{2012/11/12}{Added support for \mbox{\textsf{inputenx}}} % \changes{v1.0}{2011/02/15}{Initial version} % % \GetFileInfo{newunicodechar.dtx} @@ -97,8 +98,8 @@ %\end{verbatim} % where |xxx| may be the actual character we input or a combination of % strange characters. This happens because the \texttt{utf8} option -% given to \textsf{inputenc} defines the \LaTeX{} meaning of many -% Unicode characters, but, of course, not all of them. +% given to \textsf{inputenc} or \textsf{inputenx} defines the \LaTeX{} +% meaning of many Unicode characters, but, of course, not all of them. % % For example, one might want to write some Latin words with prosodic % marks, i.e., the diacritics that tell whether a vowel is long or @@ -168,12 +169,13 @@ % \section{Usage} % % The package requires the use of a Unicode engine, i.e., \XeLaTeX{} -% or \LuaLaTeX{}, or, with (pdf)\LaTeX{}, the \textsf{inputenc} -% package along with the \texttt{utf8} option. It won't work with the -% \texttt{utf8x} option that employs a completely different mechanism -% for parsing Unicode characters in (pdf)\LaTeX{}. It should be said -% that \texttt{utf8x} defines many more characters than \texttt{utf8}, -% so that the present package wouldn't be needed. +% or \LuaLaTeX{}, or, with (pdf)\LaTeX{}, the \textsf{inputenc} or +% \textsf{inputenx} package along with the \texttt{utf8} option. It +% won't work with the \texttt{utf8x} option that employs a completely +% different mechanism for parsing Unicode characters in +% (pdf)\LaTeX{}. It should be said that \texttt{utf8x} defines many +% more characters than \texttt{utf8}, so that the present package +% wouldn't be needed. % % Of course the \LaTeX{} document must be written using a Unicode % savvy editor. @@ -363,46 +365,51 @@ % % \subsection{Eight bit engines} % From now on we can assume an eight bit engine is used; we check that -% inputenc has been loaded with the right option, otherwise we define -% |\newunicodechar| to swallow its arguments, after a warning. +% \textsf{inputenc} or \textsf{inputenx} has been loaded with the +% 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.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' with the `utf8' option}% + `inputenc' or `inputenx' with the `utf8' option}% \let\newunicodechar\@gobbletwo\endinput} - -\@ifpackageloaded{inputenc}{}{\nuc@stop} -\@ifpackagewith{inputenc}{utf8}{}{\nuc@stop} -\@ifpackagewith{inputenc}{utf8x}{\nuc@stop}{} +\@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}{} % \end{macrocode} % \begin{macro}{\newunicodechar} % The main macro. We set the temporary switch to false and put in -% |\@tempa| the first argument, but detokenized, since it consists of +% |\nuc@tempa| the first argument, but detokenized, since it consists of % active characters. We check that it's not empty and access to its -% first token that we put into \@tempb. Then we call |\nuc@check| and -% if it sets the temporary switch to true, we execute the definition, -% since the first argument is a valid UTF-8 character, but we issue a -% warning if it already has a meaning. All we need to do is to define -% the macro |\csname u8:\@tempa\endcsname|, because that's how -% inputenc acts. The part between |\ifdefined| and the corresponding -% |\fi| will be executed only with the \texttt{verbose} option. +% first token that we put into |\@tempb|. Then we call |\nuc@check| +% and if it sets the temporary switch to true, we execute the +% definition, since the first argument is a valid UTF-8 character, but +% we issue a warning if it already has a meaning. All we need to do is +% to define the macro |\csname u8:\nuc@tempa\endcsname|, because that's +% how \textsf{inputenc} acts. The part between |\ifdefined| and the +% corresponding |\fi| will be executed only with the \texttt{verbose} +% option. % \begin{macrocode} \def\newunicodechar#1#2{% \@tempswafalse - \edef\@tempa{\detokenize{#1}}% - \if\relax\@tempa\relax + \edef\nuc@tempa{\detokenize{#1}}% + \if\relax\nuc@tempa\relax \nuc@emptyargerr \else - \edef\@tempb{\expandafter\@car\@tempa\@nil}% + \edef\@tempb{\expandafter\@car\nuc@tempa\@nil}% \nuc@check \if@tempswa - \@ifundefined{u8:\@tempa}{} + \@ifundefined{u8:\nuc@tempa}{} {\PackageWarning{newunicodechar} {Redefining Unicode character\ifdefined\nuc@verbose; it meant\MessageBreak ***\space\space\nuc@meaning\space\space***\MessageBreak before your redefinition\fi}}% - \@namedef{u8:\@tempa}{#2}% + \@namedef{u8:\nuc@tempa}{#2}% \fi \fi } @@ -420,7 +427,7 @@ \fi} \ifdefined\nuc@verbose \def\nuc@meaning{\expandafter\expandafter\expandafter - \strip@prefix\expandafter\meaning\csname u8:\@tempa\endcsname} + \strip@prefix\expandafter\meaning\csname u8:\nuc@tempa\endcsname} \fi % \end{macrocode} % We select the action based on the length of the first argument; in @@ -434,7 +441,7 @@ % temporary switch to true. % \begin{macrocode} \def\nuc@check{% - \ifcase\numexpr0\expandafter\nuc@getlength\@tempa\@nil + \ifcase\numexpr0\expandafter\nuc@getlength\nuc@tempa\@nil \or %0 \nuc@onebyteerr\or %1 \nuc@ch@ck{192}\or %2 diff --git a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins index 5806394c2e1..6352c94d153 100644 --- a/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins +++ b/Master/texmf-dist/source/latex/newunicodechar/newunicodechar.ins @@ -1,4 +1,4 @@ -% Copyright (C) 2011 by Enrico Gregorio +% Copyright (C) 2011-2012 by Enrico Gregorio % <Enrico dot Gregorio at univr dot it> % ------------------------------------------------------- % @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2011 by Enrico Gregorio +Copyright (C) 2011-2012 by Enrico Gregorio <Enrico dot Gregorio at univr dot it> ------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty b/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty index c5bd3520055..6a9e4f7cf32 100644 --- a/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty +++ b/Master/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty @@ -31,7 +31,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2008/04/05] \ProvidesPackage{newunicodechar} - [2011/02/18 v1.0 Defining Unicode characters] + [2012/11/12 v1.1 Defining Unicode characters] \@ifundefined{eTeXversion} {\PackageError{newunicodechar}{LaTeX engine too old, aborting} {Please upgrade your TeX system}\@@end}{} @@ -78,28 +78,29 @@ \fi % End of code for Unicode engines \def\nuc@stop{\PackageWarningNoLine{newunicodechar} {This package won't work without loading\MessageBreak - `inputenc' with the `utf8' option}% + `inputenc' or `inputenx' with the `utf8' option}% \let\newunicodechar\@gobbletwo\endinput} - -\@ifpackageloaded{inputenc}{}{\nuc@stop} -\@ifpackagewith{inputenc}{utf8}{}{\nuc@stop} -\@ifpackagewith{inputenc}{utf8x}{\nuc@stop}{} +\@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}{} \def\newunicodechar#1#2{% \@tempswafalse - \edef\@tempa{\detokenize{#1}}% - \if\relax\@tempa\relax + \edef\nuc@tempa{\detokenize{#1}}% + \if\relax\nuc@tempa\relax \nuc@emptyargerr \else - \edef\@tempb{\expandafter\@car\@tempa\@nil}% + \edef\@tempb{\expandafter\@car\nuc@tempa\@nil}% \nuc@check \if@tempswa - \@ifundefined{u8:\@tempa}{} + \@ifundefined{u8:\nuc@tempa}{} {\PackageWarning{newunicodechar} {Redefining Unicode character\ifdefined\nuc@verbose; it meant\MessageBreak ***\space\space\nuc@meaning\space\space***\MessageBreak before your redefinition\fi}}% - \@namedef{u8:\@tempa}{#2}% + \@namedef{u8:\nuc@tempa}{#2}% \fi \fi } @@ -111,10 +112,10 @@ \fi} \ifdefined\nuc@verbose \def\nuc@meaning{\expandafter\expandafter\expandafter - \strip@prefix\expandafter\meaning\csname u8:\@tempa\endcsname} + \strip@prefix\expandafter\meaning\csname u8:\nuc@tempa\endcsname} \fi \def\nuc@check{% - \ifcase\numexpr0\expandafter\nuc@getlength\@tempa\@nil + \ifcase\numexpr0\expandafter\nuc@getlength\nuc@tempa\@nil \or %0 \nuc@onebyteerr\or %1 \nuc@ch@ck{192}\or %2 |