diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltfssbas.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/ltfssbas.dtx | 101 |
1 files changed, 100 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltfssbas.dtx b/Master/texmf-dist/source/latex/base/ltfssbas.dtx index 4733457ae2a..61d487ef5d0 100644 --- a/Master/texmf-dist/source/latex/base/ltfssbas.dtx +++ b/Master/texmf-dist/source/latex/base/ltfssbas.dtx @@ -35,7 +35,7 @@ % % \ProvidesFile{ltfssbas.dtx} - [2015/04/07 v3.1a LaTeX Kernel (NFSS Basic Macros)] + [2017/01/10 v3.2a LaTeX Kernel (NFSS Basic Macros)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -1799,10 +1799,20 @@ % {Use \cs{normalfont} and make colour safe, and autoloadable} % \changes{v3.0u}{1998/03/25} % {Suppress unnecessary error when used in preamble} +% \changes{v3.2a}{2017/01/10} +% {Add version of \cs{showhyphens} that works with Xe\TeX.} % The |\showhyphens| command must be redefined since the version in % \texttt{plain.tex} uses |\tenrm|. We have also made some further % adjustments for its use in \LaTeX. % \begin{macrocode} +%</2ekernel> +%<latexrelease>\IncludeInRelease{2017/01/01}{\showhyphens}% +%<latexrelease> {XeTeX support for \showhyphens}% +%<*2ekernel|latexrelease> +\ifx\XeTeXcharclass\@undefined +% \end{macrocode} +% Version for engines other than Xe\TeX. +% \begin{macrocode} \gdef\showhyphens#1{% \setbox0\vbox{% \color@begingroup @@ -1812,6 +1822,95 @@ \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1% \color@endgroup}} % \end{macrocode} +% \begin{macrocode} +\else +% \end{macrocode} +% Xe\TeX\ version. When using system fonts Xe\TeX\ reports consecutive +% runs of characters as a single item in box logging, which means the +% standard |\showhyphens| does not work. This version typesets the +% text into a narrow box to force hyphenation and then reconstructs a +% horizontal list with explicit hyphens to generate the display. Note +% that the |lmr| OpenType font is forced, this works even if the +% characters are not in the font as hyphenation is attempted due to +% the width of the space and hyphen character. It may generate +% spurious Missing Character warnings in the log, these are however +% suppressed from the terminal output by ensuring that +% |\tracingonline| is locally zero. +% \begin{macrocode} +\long\def\showhyphens#1{% + \setbox0\vbox{% + \usefont{TU}{lmr}{m}{n}% + \hsize 1sp % + \hbadness\@M + \hfuzz\maxdimen + \tracingonline\z@ + \everypar={}% + \leftskip\z@skip + \rightskip\z@skip + \parfillskip\z@skip + \hyphenpenalty=-\@M + \pretolerance\m@ne + \interlinepenalty\z@ + \clubpenalty\z@ + \widowpenalty\z@ + \brokenpenalty1127 % + \setbox\z@\hbox{}% + \noindent + \hskip\z@skip + #1% + \par +% \end{macrocode} +% Note here we stop the loop if made no progress, non-removable items +% may mean that we can not process the whole list (which would be +% testable as |\lastnodetype=-1|). +% \begin{macrocode} + \loop + \@tempswafalse + \ifnum\lastnodetype=11\unskip\@tempswatrue\fi + \ifnum\lastnodetype=12\unkern\@tempswatrue\fi + \ifnum\lastnodetype=13 % + \count@\lastpenalty + \unpenalty\@tempswatrue + \fi + \ifnum\lastnodetype=\@ne + \setbox\tw@\lastbox\@tempswatrue + \setbox0\hbox{\unhbox\tw@\unskip\unskip\unpenalty + \ifnum\count@=1127 \else\ \fi + \unhbox0}% + \count@\z@ + \fi + \if@tempswa + \repeat + \hbadness\z@ + \hsize\maxdimen + \showboxdepth\z@ + \tolerance\m@ne + \hyphenpenalty\z@ + \noindent\unhbox\z@ +}} +% \end{macrocode} +% +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}{\showhyphens}% +%<latexrelease> {XeTeX support for \showhyphens}% +%<latexrelease>\gdef\showhyphens#1{% +%<latexrelease> \setbox0\vbox{% +%<latexrelease> \color@begingroup +%<latexrelease> \everypar{}% +%<latexrelease> \parfillskip\z@skip\hsize\maxdimen +%<latexrelease> \normalfont +%<latexrelease> \pretolerance\m@ne\tolerance\m@ne +%<latexrelease> \hbadness\z@\showboxdepth\z@\ #1% +%<latexrelease> \color@endgroup}} +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} % \end{macro} % % |