summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xltxtra/xltxtra.sty
blob: 7c4ee541468442253a5f251d9173b1f235ab230e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
%%
%% This is file `xltxtra.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xltxtra.dtx  (with options: `package')
%%   ____________________________
%%   The XLTXTRA package
%%   (C) 2006-2010 Will Robertson
%%   License information appended
%% 
\ProvidesPackage{xltxtra}
  [2010/09/20 v0.5e Improvements for the "XeLaTeX" format]
\RequirePackage{ifluatex}
\ifluatex
  \PackageWarningNoLine {xltxtra} {^^J
    XLTXTRA IS TO BE USED ONLY UNDER XETEX.
    LOAD FONTSPEC DIRECTLY, INSTEAD.^^J
    ABORTING LOADING%
  }
  \RequirePackage{fontspec}[2010/05/14 v2.0]
  \expandafter \endinput
\fi
\RequirePackage{ifxetex}
\RequireXeTeX
\RequirePackage{fontspec}[2010/05/14 v2.0]
\RequirePackage{realscripts}
\newif\if@xxt@nosscript@
\newif\if@xxt@nologos@
\DeclareOption{no-sscript}{\@xxt@nosscript@true}
\DeclareOption{no-logos}{\@xxt@nologos@true}
\ProcessOptions*
\RequirePackage{metalogo}
\if@xxt@nologos@
  \let\TeX\original@TeX
  \let\LaTeX\original@LaTeX
  \let\LaTeXe\original@LaTeXe
\fi
\newcommand*\TeX@logo@spacing[6]{%
  \PackageWarning{xltxtra}{%
    Use of \protect\TeX@logo@spacing\space is deprecated,\MessageBreak
    recommend to use commands from package `metalogo' instead}
  \setlogokern{Te}{#1}%
  \setlogokern{eT}{#1}%
  \setlogokern{eX}{#2}%
  \setlogokern{Xe}{#2}%
  \setlogodrop{#3}%
  \setlogokern{La}{#4}%
  \setlogokern{aT}{#5}%
  \setlogokern{eL}{#6}}
\if@xxt@nosscript@
  \DeclareRobustCommand*\textsubscript{%
    \@ifstar{\realsubscript}{\fakesubscript}}
  \DeclareRobustCommand*\textsuperscript{%
    \@ifstar{\realsuperscript}{\fakesuperscript}}
\fi
\ExplSyntaxOn
\newcommand*\vfrac[2]{
  \fontspec_if_fontspec_font:TF
  {
    \fontspec_if_opentype:TF
    {
      {\addfontfeature{VerticalPosition=Numerator}#1}
       \textfractionsolidus
      {\addfontfeature{VerticalPosition=Denominator}#2}
    }
    {
      {\addfontfeature{VerticalPosition=Superior}#1}
       \textfractionsolidus
      {\addfontfeature{VerticalPosition=Inferior}#2}
    }
  }
  {
    \PackageError {xltxtra}
      { \string\vfrac\space~can~only~be~used~with~fontspec~fonts }
      { Nothing~more~to~tell. }
  }
}
\ExplSyntaxOff
\newcommand\namedglyph[1]{%
  \@tempcnta=\XeTeXglyphindex "#1"\relax
  \ifnum\@tempcnta>0
    \XeTeXglyph\@tempcnta
  \else
    \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}
%% 
%% Copyright (C) 2006-2010 by Will Robertson <wspr81@gmail.com>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Will Robertson.
%% 
%% This work consists of the file  xltxtra.dtx
%%           and the derived files xltxtra.sty,
%%                                 xltxtra.ins, and
%%                                 xltxtra.pdf.
%% 
%%
%% End of file `xltxtra.sty'.