summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-21 22:21:37 +0000
committerKarl Berry <karl@freefriends.org>2016-01-21 22:21:37 +0000
commitc826689e35799045873cee4c33d95d7820317ec8 (patch)
treed177709a1ff804a12aab183e9902448b766f4e55 /Master
parenta3530eabad2579db06eb6d331f67435d3150da8b (diff)
xltxtra (21jan16)
git-svn-id: svn://tug.org/texlive/trunk@39453 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/xltxtra/README33
-rw-r--r--Master/texmf-dist/doc/latex/xltxtra/xltxtra.pdfbin136593 -> 133494 bytes
-rw-r--r--Master/texmf-dist/source/latex/xltxtra/xltxtra.dtx127
-rw-r--r--Master/texmf-dist/source/latex/xltxtra/xltxtra.ins8
-rw-r--r--Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty109
5 files changed, 189 insertions, 88 deletions
diff --git a/Master/texmf-dist/doc/latex/xltxtra/README b/Master/texmf-dist/doc/latex/xltxtra/README
index 95c4f5509d0..efbafa9cbfc 100644
--- a/Master/texmf-dist/doc/latex/xltxtra/README
+++ b/Master/texmf-dist/doc/latex/xltxtra/README
@@ -1,27 +1,28 @@
-_________________________
-THE XLTXTRA PACKAGE v0.5e
+________________________
+THE XLTXTRA PACKAGE v0.6
-This package was previous used to provide a number of small
+This package was previously used to provide a number of small
features that are useful for XeLaTeX. As of fontspec v2, many
-of these have now been incorporated into that package.
+of these have now been incorporated into that package. More
+recently, other updates to LaTeX2e itself have eliminated some
+of the workarounds previously included in this package.
This package therefore no longer does as much as it used to,
-but is still provided for backwards compatibility.
+but is still provided for backwards compatibility. A summary:
-- Loads fontspec automatically. fontspec now loads
- Ross Moore's xunicode internally.
+- Loads fontspec.
-- Loads Andrew Moschou's metalogo package for \XeTeX
- and \XeLaTeX logos.
+- Loads Andrew Moschou's metalogo package for customised
+ \XeTeX and \XeLaTeX logos.
-- Loads the realscripts package to obtain "real" subscript
- and superscript glyphs in \textsuperscript etc.,
+- Loads the realscripts package to obtain OpenType-feature
+ subscript and superscript glyphs in \textsuperscript etc.,
including in footnotes.
-- \showhyphens is redefined so it now works to some degree.
+- \showhyphens is redefined so it now works.
- Defines the dubiously useful commands
- \vfrac - for vulgar fractions with fontspec
+ \vfrac - for vulgar fractions using OpenType features
\namedglyph - to access font glyphs by name
For more information see the documentation xltxtra.pdf.
@@ -29,6 +30,10 @@ For more information see the documentation xltxtra.pdf.
______________
Change History
+v0.6:
+ Replace definition of \showhyphens with one that properly
+ replicates the plain TeX definition in behaviour.
+
v0.5e:
Remove the code for subscripts/superscripts and load the
realscripts package instead.
@@ -48,5 +53,5 @@ v0.5b:
______________
Will Robertson
-2006-2010
+2006-2016
Released under the LaTeX Project Public License
diff --git a/Master/texmf-dist/doc/latex/xltxtra/xltxtra.pdf b/Master/texmf-dist/doc/latex/xltxtra/xltxtra.pdf
index 8cdce99c5d6..6d16c22a8b7 100644
--- a/Master/texmf-dist/doc/latex/xltxtra/xltxtra.pdf
+++ b/Master/texmf-dist/doc/latex/xltxtra/xltxtra.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/xltxtra/xltxtra.dtx b/Master/texmf-dist/source/latex/xltxtra/xltxtra.dtx
index 9572098597f..f2ce62f83f2 100644
--- a/Master/texmf-dist/source/latex/xltxtra/xltxtra.dtx
+++ b/Master/texmf-dist/source/latex/xltxtra/xltxtra.dtx
@@ -8,13 +8,13 @@
\preamble
____________________________
The XLTXTRA package
- (C) 2006-2010 Will Robertson
+ (C) 2006-2016 Will Robertson
License information appended
\endpreamble
\postamble
-Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
+Copyright (C) 2006-2016 by Will Robertson <wspr81@gmail.com>
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -72,12 +72,10 @@ This work consists of the file xltxtra.dtx
% \section{Introduction}
%
% This document describes the \pkg{xltxtra} package.
-% It implements some odds-and-ends features and
-% improved functionality for broken or sub-standard \LaTeX\ methods when using the
-% \XeTeX\ format.
+% It implements some odds-and-ends features when using the \XeLaTeX\ format.
%
% \subsection{Usage}
-% Easy: |\usepackage{xltxtra}|. This package automatically loads the following packages: \pkg{fixltx2e}, \pkg{metalogo}, \pkg{xunicode}, \pkg{fontspec}.
+% Easy: |\usepackage{xltxtra}|. This package automatically loads the following packages: \pkg{fontspec}, \pkg{realscripts}, \pkg{metalogo}.
%
% There are some package options to disable various functionality that could clash with other things:
% \begin{description}[font=\ttfamily]
@@ -90,6 +88,9 @@ This work consists of the file xltxtra.dtx
% \subsection{\cmd\textsuperscript\ and \cmd\textsubscript}
% \seclabel{sscript}
%
+% This functionality is achieved through loading the \pkg{realscripts}
+% package.
+%
% These two macros have been redefined to take advantage, if possible, of actual superior or inferior glyphs in the main document font. This is very important for high-quality typesetting — compare this first example to the third; yes, they are the same font.
% \begin{quotation}\color{niceblue}
% \fontspec{Skia}
@@ -125,8 +126,6 @@ This work consists of the file xltxtra.dtx
% \cmd\fakesuperscript\
% may be used to access the `new' and `old' functionalities regardless of the \pkgopt{no-sscript}.
%
-% This functionality is achieved through loading the \pkg{realscripts}
-% package.
%
%
%
@@ -188,8 +187,8 @@ This work consists of the file xltxtra.dtx
%
% \subsection{The \cmd\showhyphens\ command}
% The default definition doesn't work in \XeTeX.
-% A new version, written by Jonathan Kew, is included in this package that \emph{does} work. Minor differences with the original: the showing of hyphens in the console output will be marked with explanatory text. Also, multiple words, separated by commas, will end up in separate instances of `showing hyphens'.
-% \showhyphens{discomedusoid, discommodiousness}
+% A new version, written by Enrico Gregorio, is included in this package that \emph{does} work; note that the syntax now matches plain \TeX's original rather than the comma-list approach taken by an earlier version of this package.
+% \showhyphens{discomedusoid discommodiousness}
%
% \newpage
% \part{The \textsf{xltxtra} package}
@@ -200,7 +199,7 @@ This work consists of the file xltxtra.dtx
%
% \begin{macrocode}
\ProvidesPackage{xltxtra}
- [2010/09/20 v0.5e Improvements for the "XeLaTeX" format]
+ [2016/01/21 v0.6 Improvements for the "XeLaTeX" format]
% \end{macrocode}
%
% \paragraph{Not for Lua\TeX}
@@ -212,7 +211,7 @@ This work consists of the file xltxtra.dtx
LOAD FONTSPEC DIRECTLY, INSTEAD.^^J
ABORTING LOADING%
}
- \RequirePackage{fontspec}[2010/05/14 v2.0]
+ \RequirePackage{fontspec}
\expandafter \endinput
\fi
% \end{macrocode}
@@ -221,7 +220,7 @@ This work consists of the file xltxtra.dtx
% \begin{macrocode}
\RequirePackage{ifxetex}
\RequireXeTeX
-\RequirePackage{fontspec}[2010/05/14 v2.0]
+\RequirePackage{fontspec}
\RequirePackage{realscripts}
% \end{macrocode}
%
@@ -372,34 +371,82 @@ This work consists of the file xltxtra.dtx
%
%
% \begin{macro}{\showhyphens}
-% This macro is entirely due to Jonathan Kew.
-% I wish I knew how to write these sorts of things.
+% Courtesy egreg.
% \begin{macrocode}
-\newbox\xxt@tempbox
-\def\showhyphens#1{%
- \typeout{^^J***********************
- \string\showhyphens:
- ***********************}%
- \@for\@ii:=#1\do{\xxt@showhyphens{\@ii}}%
- \typeout{^^J***********************%
- ***************%
- ***********************^^J}}
-\def\xxt@showhyphens#1{%
- \setbox\@tempboxa=\vbox{%
- \hsize1sp \hbadness10000 \hfuzz\maxdimen
- \everypar={} \leftskip\z@ \rightskip\leftskip
- \pretolerance\m@ne \noindent \hskip\z@ #1\par
- \global\setbox\xxt@tempbox=\hbox{}\xxt@sh@cat}%
- \setbox\@tempboxa=\hbox to \maxdimen{\unhbox\xxt@tempbox}}
-\def\xxt@sh@cat{\unskip\unpenalty
- \setbox\@tempboxa=\lastbox
- \unless\ifvoid\@tempboxa
- \global\setbox\xxt@tempbox=\hbox{%
- \unhbox\@tempboxa
- \unskip\unskip
- \unhbox\xxt@tempbox}%
- \expandafter\xxt@sh@cat
- \fi}
+\ExplSyntaxOn
+\seq_new:N \l__xetex_showhyphens_seq
+\box_new:N \l__xetex_show_hyphens_wrapping_box
+\box_new:N \l__xetex_show_hyphens_temp_box
+\box_new:N \l__xetex_show_hyphens_final_box
+\box_new:N \g__xetex_show_hyphens_word_box
+
+\cs_new_protected:Npn \xetex_show_hyphens:n #1
+ {
+ \box_clear:N \l__xetex_show_hyphens_final_box
+ % split the input into items
+ \seq_set_split:Nnn \l__xetex_showhyphens_seq { ~ } { #1 }
+ % hyphenate all items
+ \seq_map_function:NN \l__xetex_showhyphens_seq \xetex_hyphenate_word:n
+ % set a box to the maximum dimension to force a Underfull \hbox warning
+ \hbox_set_to_wd:Nnn \l__xetex_show_hyphens_final_box { \c_max_dim }
+ {
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_final_box
+ }
+ }
+
+\cs_new_protected:Npn \xetex_hyphenate_word:n #1
+ {
+ \vbox_set:Nn \l__xetex_show_hyphens_wrapping_box
+ {% build a paragraph with the word with a very narrow line width
+ \dim_set:Nn \hsize { 1sp }
+ % disregard spurious messages
+ \hbadness = \c_ten_thousand
+ \dim_set:Nn \hfuzz { \c_max_dim }
+ % clear possible values of \everypar and other parameters
+ \everypar={}
+ \skip_set:Nn \leftskip { 0pt }
+ \skip_set_eq:NN \rightskip \leftskip
+ % skip the first step
+ \pretolerance = \c_minus_one
+ % avoid the indentation and add a skip to allow hyphenation
+ \noindent
+ \skip_horizontal:n { 0pt }
+ #1
+ \par
+ \hbox_gset:Nn \g__xetex_show_hyphens_word_box {}
+ % start a recursion to dismantle the paragraph just built
+ \xetex_show_hyphens_split:
+ % the result is put into \g__xetex_show_hyphens_word_box
+ }
+ % add the box to the final container
+ \hbox_set:Nn \l__xetex_show_hyphens_final_box
+ {
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_final_box
+ \hbox_unpack_clear:N \g__xetex_show_hyphens_word_box
+ }
+ }
+
+\cs_new_protected:Npn \xetex_show_hyphens_split:
+ {
+ \unskip % remove the interline glue
+ \unpenalty % remove possible penalties
+ % get the last line
+ \box_set_to_last:N \l__xetex_show_hyphens_temp_box
+ \box_if_empty:NF \l__xetex_show_hyphens_temp_box
+ {% if there is a last line unpack it into a container
+ \hbox_gset:Nn \g__xetex_show_hyphens_word_box
+ {% the order is last to first
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_temp_box
+ \unskip\unskip % remove spaces
+ \hbox_unpack_clear:N \g__xetex_show_hyphens_word_box
+ }
+ % restart the recursion
+ \xetex_show_hyphens_split:
+ }
+ }
+
+\cs_set_eq:NN \showhyphens \xetex_show_hyphens:n
+\ExplSyntaxOff
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/xltxtra/xltxtra.ins b/Master/texmf-dist/source/latex/xltxtra/xltxtra.ins
index 4b0ce56590c..665ce38a8da 100644
--- a/Master/texmf-dist/source/latex/xltxtra/xltxtra.ins
+++ b/Master/texmf-dist/source/latex/xltxtra/xltxtra.ins
@@ -7,7 +7,7 @@
%% xltxtra.dtx (with options: `batchfile')
%% ____________________________
%% The XLTXTRA package
-%% (C) 2006-2010 Will Robertson
+%% (C) 2006-2016 Will Robertson
%% License information appended
%%
\input docstrip.tex
@@ -15,13 +15,13 @@
\preamble
____________________________
The XLTXTRA package
- (C) 2006-2010 Will Robertson
+ (C) 2006-2016 Will Robertson
License information appended
\endpreamble
\postamble
-Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
+Copyright (C) 2006-2016 by Will Robertson <wspr81@gmail.com>
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -40,7 +40,7 @@ This work consists of the file xltxtra.dtx
\generate{\file{xltxtra.sty}{\from{xltxtra.dtx}{package}}}
\endbatchfile
%%
-%% Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
+%% Copyright (C) 2006-2016 by Will Robertson <wspr81@gmail.com>
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
diff --git a/Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty b/Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty
index 7c4ee541468..377ffbc6701 100644
--- a/Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty
+++ b/Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty
@@ -7,11 +7,11 @@
%% xltxtra.dtx (with options: `package')
%% ____________________________
%% The XLTXTRA package
-%% (C) 2006-2010 Will Robertson
+%% (C) 2006-2016 Will Robertson
%% License information appended
%%
\ProvidesPackage{xltxtra}
- [2010/09/20 v0.5e Improvements for the "XeLaTeX" format]
+ [2016/01/21 v0.6 Improvements for the "XeLaTeX" format]
\RequirePackage{ifluatex}
\ifluatex
\PackageWarningNoLine {xltxtra} {^^J
@@ -19,12 +19,12 @@
LOAD FONTSPEC DIRECTLY, INSTEAD.^^J
ABORTING LOADING%
}
- \RequirePackage{fontspec}[2010/05/14 v2.0]
+ \RequirePackage{fontspec}
\expandafter \endinput
\fi
\RequirePackage{ifxetex}
\RequireXeTeX
-\RequirePackage{fontspec}[2010/05/14 v2.0]
+\RequirePackage{fontspec}
\RequirePackage{realscripts}
\newif\if@xxt@nosscript@
\newif\if@xxt@nologos@
@@ -86,33 +86,82 @@
\xxt@namedglyph@fallback{#1}%
\fi}
\newcommand\xxt@namedglyph@fallback[1]{[#1]}
-\newbox\xxt@tempbox
-\def\showhyphens#1{%
- \typeout{^^J***********************
- \string\showhyphens:
- ***********************}%
- \@for\@ii:=#1\do{\xxt@showhyphens{\@ii}}%
- \typeout{^^J***********************%
- ***************%
- ***********************^^J}}
-\def\xxt@showhyphens#1{%
- \setbox\@tempboxa=\vbox{%
- \hsize1sp \hbadness10000 \hfuzz\maxdimen
- \everypar={} \leftskip\z@ \rightskip\leftskip
- \pretolerance\m@ne \noindent \hskip\z@ #1\par
- \global\setbox\xxt@tempbox=\hbox{}\xxt@sh@cat}%
- \setbox\@tempboxa=\hbox to \maxdimen{\unhbox\xxt@tempbox}}
-\def\xxt@sh@cat{\unskip\unpenalty
- \setbox\@tempboxa=\lastbox
- \unless\ifvoid\@tempboxa
- \global\setbox\xxt@tempbox=\hbox{%
- \unhbox\@tempboxa
- \unskip\unskip
- \unhbox\xxt@tempbox}%
- \expandafter\xxt@sh@cat
- \fi}
+\ExplSyntaxOn
+\seq_new:N \l__xetex_showhyphens_seq
+\box_new:N \l__xetex_show_hyphens_wrapping_box
+\box_new:N \l__xetex_show_hyphens_temp_box
+\box_new:N \l__xetex_show_hyphens_final_box
+\box_new:N \g__xetex_show_hyphens_word_box
+
+\cs_new_protected:Npn \xetex_show_hyphens:n #1
+ {
+ \box_clear:N \l__xetex_show_hyphens_final_box
+ % split the input into items
+ \seq_set_split:Nnn \l__xetex_showhyphens_seq { ~ } { #1 }
+ % hyphenate all items
+ \seq_map_function:NN \l__xetex_showhyphens_seq \xetex_hyphenate_word:n
+ % set a box to the maximum dimension to force a Underfull \hbox warning
+ \hbox_set_to_wd:Nnn \l__xetex_show_hyphens_final_box { \c_max_dim }
+ {
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_final_box
+ }
+ }
+
+\cs_new_protected:Npn \xetex_hyphenate_word:n #1
+ {
+ \vbox_set:Nn \l__xetex_show_hyphens_wrapping_box
+ {% build a paragraph with the word with a very narrow line width
+ \dim_set:Nn \hsize { 1sp }
+ % disregard spurious messages
+ \hbadness = \c_ten_thousand
+ \dim_set:Nn \hfuzz { \c_max_dim }
+ % clear possible values of \everypar and other parameters
+ \everypar={}
+ \skip_set:Nn \leftskip { 0pt }
+ \skip_set_eq:NN \rightskip \leftskip
+ % skip the first step
+ \pretolerance = \c_minus_one
+ % avoid the indentation and add a skip to allow hyphenation
+ \noindent
+ \skip_horizontal:n { 0pt }
+ #1
+ \par
+ \hbox_gset:Nn \g__xetex_show_hyphens_word_box {}
+ % start a recursion to dismantle the paragraph just built
+ \xetex_show_hyphens_split:
+ % the result is put into \g__xetex_show_hyphens_word_box
+ }
+ % add the box to the final container
+ \hbox_set:Nn \l__xetex_show_hyphens_final_box
+ {
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_final_box
+ \hbox_unpack_clear:N \g__xetex_show_hyphens_word_box
+ }
+ }
+
+\cs_new_protected:Npn \xetex_show_hyphens_split:
+ {
+ \unskip % remove the interline glue
+ \unpenalty % remove possible penalties
+ % get the last line
+ \box_set_to_last:N \l__xetex_show_hyphens_temp_box
+ \box_if_empty:NF \l__xetex_show_hyphens_temp_box
+ {% if there is a last line unpack it into a container
+ \hbox_gset:Nn \g__xetex_show_hyphens_word_box
+ {% the order is last to first
+ \hbox_unpack_clear:N \l__xetex_show_hyphens_temp_box
+ \unskip\unskip % remove spaces
+ \hbox_unpack_clear:N \g__xetex_show_hyphens_word_box
+ }
+ % restart the recursion
+ \xetex_show_hyphens_split:
+ }
+ }
+
+\cs_set_eq:NN \showhyphens \xetex_show_hyphens:n
+\ExplSyntaxOff
%%
-%% Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
+%% Copyright (C) 2006-2016 by Will Robertson <wspr81@gmail.com>
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of