diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/bibleref/bibleref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/bibleref/bibleref.dtx | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx index 204eec7fc80..6f2304ddbc8 100644 --- a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx +++ b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx @@ -973,7 +973,7 @@ % Declare package % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bibleref}[2018/06/05 1.17a (NLCT and MR)] +\ProvidesPackage{bibleref}[2018/07/21 1.18 (NLCT and MR)] % \end{macrocode} % Need to do some conditional stuff % \begin{macrocode} @@ -990,6 +990,10 @@ % \begin{macrocode} \RequirePackage{amsgen} % \end{macrocode} +% We need to know if we use XeTeX. +% \begin{macrocode} +\RequirePackage{ifxetex} +% \end{macrocode} %\begin{macro}{\BRbooknumberstyle} % The style of the book % number. By default, it simply displays its argument @@ -1755,6 +1759,7 @@ defined}{}}} %\end{macro} % %\begin{macro}{\setbooktitle} +%\changes{v1.18}{2018/07/21}{Fix bug in indexing with title containing unicode character using a non-native unicode engine.} %\begin{definition} %\cs{setbooktitle}\marg{fullname}\marg{title} %\end{definition} @@ -2234,7 +2239,7 @@ defined}{}}} {\@end@@bibleverse}% }% } -% \changes{1.15}{2016/09/10}{fix bug with book without chapter} +% \changes{1.15}{2016/09/10}{Fix bug with book without chapter} \def\@@bibleversenosep#1){% \def\@bv@tmp{#1}% \ifx\@bv@tmp\@empty @@ -2310,23 +2315,47 @@ defined}{}}} %\end{macro} % %\begin{macro}{\biblerefmap} +% \begin{macro}{\biblerefmap@} % Map the sort key to something else. Overwrites previous mapping % for the given key. +% In case we use unicode character with non unicode engines (using fontspec), we need a little hack to: +% \begin{itemize} +% \item Transform the input 16 bits (or more) content to series of \cs{char}; +% \item Use the detokinzed version of this representation of characters to define the \cs{@bibleref@map@XXX} commands. +% \end{itemize} +% In this case, we do it using \cs{biblerefmap@}, passing a transformed forme of the first argument of \cs{biblerefmap}. +% %\changes{1.09}{2009/04/26}{new} % \begin{macrocode} +\newcommand{\biblerefmap@}[2]{% + \expandafter\def\csname @bibleref@map@\detokenize{#1}\endcsname{#2}% +}% \newcommand*{\biblerefmap}[2]{% - \expandafter\def\csname @bibleref@map@#1\endcsname{#2}% + \ifxetex% + \expandafter\def\csname @bibleref@map@#1\endcsname{#2}% + \else% + \edef\@tmp{#1}% + \expandafter\biblerefmap@\expandafter{\@tmp}{#2}% + \fi% } % \end{macrocode} +% \end{macro} %\end{macro} % %\begin{macro}{\@do@bibleref@map} % \begin{macrocode} \def\@do@bibleref@map#1\relax{% - \@ifundefined{@bibleref@map@#1}{}{% - \expandafter\let\expandafter\@@bv@idxsort - \csname @bibleref@map@#1\endcsname - }% + \ifxetex% + \@ifundefined{@bibleref@map@#1}{}{% + \expandafter\let\expandafter\@@bv@idxsort% + \csname @bibleref@map@#1\endcsname% + }% + \else% + \@ifundefined{@bibleref@map@\detokenize{#1}}{}{% + \expandafter\let\expandafter\@@bv@idxsort% + \csname @bibleref@map@\detokenize{#1}\endcsname% + }% + \fi% } % \end{macrocode} %\end{macro} |