diff options
author | Karl Berry <karl@freefriends.org> | 2010-09-19 22:55:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-09-19 22:55:13 +0000 |
commit | 0f3246084432cce62eeafbf11e702cb4720db9ec (patch) | |
tree | 2b671648ce303f467a9d470ec389d037a10bdbfa | |
parent | 63653db196b6e47d4fc631c9e850c2b31478fe6f (diff) |
realscripts update (19sep10)
git-svn-id: svn://tug.org/texlive/trunk@19811 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/realscripts/README | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/realscripts/realscripts.pdf | bin | 90799 -> 100902 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/realscripts/realscripts.dtx | 107 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/realscripts/realscripts.sty | 30 |
4 files changed, 104 insertions, 38 deletions
diff --git a/Master/texmf-dist/doc/latex/realscripts/README b/Master/texmf-dist/doc/latex/realscripts/README index c81220e8ddd..74b2743688e 100644 --- a/Master/texmf-dist/doc/latex/realscripts/README +++ b/Master/texmf-dist/doc/latex/realscripts/README @@ -15,6 +15,11 @@ For more information see the documentation realscripts.pdf. Change History -------------- +v0.2 + + * Add feature to specify the font of the patched footnotemark. + This behaves well with KOMA-Script's `\setkomafont`, as well. + v0.1 * First release diff --git a/Master/texmf-dist/doc/latex/realscripts/realscripts.pdf b/Master/texmf-dist/doc/latex/realscripts/realscripts.pdf Binary files differindex 2f6a63cffd7..a1b60e4efba 100644 --- a/Master/texmf-dist/doc/latex/realscripts/realscripts.pdf +++ b/Master/texmf-dist/doc/latex/realscripts/realscripts.pdf diff --git a/Master/texmf-dist/source/latex/realscripts/realscripts.dtx b/Master/texmf-dist/source/latex/realscripts/realscripts.dtx index 22b00f667ea..aea17aa7298 100644 --- a/Master/texmf-dist/source/latex/realscripts/realscripts.dtx +++ b/Master/texmf-dist/source/latex/realscripts/realscripts.dtx @@ -47,7 +47,7 @@ This work consists of the file realscripts.dtx %</driver> %<package>\ProvidesPackage{realscripts} %<*package> - [2010/08/05 v0.1 Access OpenType subscripts and superscripts] + [2010/09/20 v0.2 Access OpenType subscripts and superscripts] %</package> % \end{macrocode} % @@ -77,7 +77,8 @@ This work consists of the file realscripts.dtx % % \maketitle % -% \noindent +% \section{Introduction} +% % OpenType fonts provide the possiblity of using specially-drawn glyphs for % subscript and superscript text. \LaTeX\ by default simply uses a smaller % font size, which is acceptable if the font has optical sizes. Most fonts @@ -89,8 +90,29 @@ This work consists of the file realscripts.dtx % \cmd\textsubscript\ commands that take advantage of the OpenType font % features. % +% \section{Technical details} +% +% Starred versions of the original commands are provided (e.g., \cs{textsubscript*}) for cases where the new commands are not appropriate. +% The functionality of the starred and non-starred commands can +% also be accessed using the macros +% \cmd\realsubscript, +% \cmd\realsuperscript, +% \cmd\fakesubscript, and +% \cmd\fakesuperscript, in case another package (or you wish to) +% redefine the original \cmd\text\dots\ commands. +% % This package will also patch the default \LaTeX\ footnote mechanism to -% use \cs{textsuperscript} automatically. +% use \cs{textsuperscript} automatically. You may change the font used +% to typeset the footnote numbers (by default it is the \cs{normalfont}) +% by redefining \cs{footnotemarkfont}; e.g.: +% {\par\qquad\verb|\renewcommand\footnotemarkfont|\marg{font switch}\par} +% \noindent and users of \pkg{KOMA-Script} may use instead +% {\par\qquad\verb|\setfkomafont{footnotelabel}|\marg{font switch}\par} +% \noindent where \meta{font switch} is a command such as \cs{sffamily} or a \pkg{fontspec} font defined with \cs{newfontfamily}. +% +% Beware of other packages, however, that change the footnote mechanism. (Usually by redefining \cs{@makefnmark}. I can often work around or work with such packages to \pkg{realscripts} cooperates gracefully with them; please report any conflicts to me. +% +% \section{Examples} % % Here is an example using the `{\fontspec{Skia} Skia}' font of Mac\,OS\,X: (surrounded by `A' and `Z' for visual context) % @@ -120,26 +142,46 @@ This work consists of the file realscripts.dtx % |\textsubscript | A {\textsubscript{abcdefghijklmnopqrstuvwxyz1234567890}} Z % \end{quotation} % -% The functionality of the starred and non-starred commands can -% also be accessed using the macros -% \cmd\realsubscript, -% \cmd\realsuperscript, -% \cmd\fakesubscript, and -% \cmd\fakesuperscript, in case another package (or you wish to) -% redefine the original \cmd\text\dots\ commands -% % \newpage -% \part{The \textsf{\jobname} package} +% \part{Implementation of \textsf{\jobname}} %\iffalse %<*package> %\fi % This is the package implementation. +% If you're only interested in the footnote redefinition, +% skip ahead to Section~\ref{sec:fn} on page~\pageref{sec:fn}. % % \begin{macrocode} \RequirePackage{fontspec}[2010/05/14 v2.0] \ExplSyntaxOn % \end{macrocode} % +% \begin{macro}{\fakesubscript} +% \begin{macro}{\fakesuperscript} +% The old (`fake') methods. +% Because \cs{textsubscript} is not defined in \LaTeXe, +% we either define it from scratch along with \cs{textsuperscript} +% (for consistency), +% or if it's already defined just use whatever definition +% is currently active (e.g., if \pkg{fixltx2e} is loaded). +% \begin{macrocode} +\cs_if_exist:NTF \textsubscript +{ + \cs_set_eq:NN \fakesubscript \textsubscript + \cs_set_eq:NN \fakesuperscript \textsuperscript +} +{ + \DeclareDocumentCommand \fakesubscript {m} { + \@textsubscript{\selectfont#1} + } + \DeclareDocumentCommand \fakesuperscript {m} { + \@textsuperscript{\selectfont#1} + } +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}{\textsubscript} % \begin{macro}{\textsubscript*} % \begin{macro}{\textsuperscript} @@ -158,22 +200,8 @@ This work consists of the file realscripts.dtx % \end{macro} % \end{macro} % -% \begin{macro}{\fakesubscript} -% \begin{macro}{\fakesuperscript} -% The old (`fake') methods: -% \begin{macrocode} -\DeclareDocumentCommand \fakesubscript {m} { - \@textsubscript{\selectfont#1} -} -\DeclareDocumentCommand \fakesuperscript {m} { - \@textsuperscript{\selectfont#1} -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}{\realsubscript} -% The new subscript command to use OpenType features if possible. +% The new subscript command to use rich font features if possible. % \begin{macrocode} \DeclareDocumentCommand \realsubscript {m} { \fontspec_if_fontspec_font:TF { @@ -207,7 +235,7 @@ This work consists of the file realscripts.dtx % \end{macro} % % \begin{macro}{\realsuperscript} -% The new superscript command to use OpenType features if possible. +% The new superscript command to use rich font features if possible. % \begin{macrocode} \DeclareDocumentCommand \realsuperscript {m} { \fontspec_if_fontspec_font:TF @@ -235,15 +263,34 @@ This work consists of the file realscripts.dtx } % \end{macrocode} % \end{macro} -% Patching footnotes: +% +% \section{Patching footnotes} +% \label{sec:fn} +% % \begin{macro}{\@makefnmark} % This is the command used to typeset the `footnote mark'. +% Feel free to redefine it as necessary for your own purposes. % \begin{macrocode} \cs_set:Npn \@makefnmark { - \mbox{\normalfont\textsuperscript{\@thefnmark}} + \mbox{\footnotemarkfont\textsuperscript{\@thefnmark}} +} +% \end{macrocode} +% We define a \cs{footnotemarkfont} that is used to style +% the number used for the footnote, which by default is +% simply \cs{normalfont} (following \LaTeXe's default). +% If \pkg{KOMA-Script} is +% being used, we use their hook for the footnotemark font instead. +% \begin{macrocode} +\cs_if_exist:NTF \ftntm@font +{ + \cs_new:Npn \footnotemarkfont {\ftntm@font} +} +{ + \cs_new:Npn \footnotemarkfont {\normalfont} } % \end{macrocode} % \end{macro} +% Fin. % %\iffalse %</package> diff --git a/Master/texmf-dist/tex/latex/realscripts/realscripts.sty b/Master/texmf-dist/tex/latex/realscripts/realscripts.sty index 22658d56dee..be557c70890 100644 --- a/Master/texmf-dist/tex/latex/realscripts/realscripts.sty +++ b/Master/texmf-dist/tex/latex/realscripts/realscripts.sty @@ -11,21 +11,28 @@ %% License information appended %% \ProvidesPackage{realscripts} - [2010/08/05 v0.1 Access OpenType subscripts and superscripts] + [2010/09/20 v0.2 Access OpenType subscripts and superscripts] \RequirePackage{fontspec}[2010/05/14 v2.0] \ExplSyntaxOn +\cs_if_exist:NTF \textsubscript +{ + \cs_set_eq:NN \fakesubscript \textsubscript + \cs_set_eq:NN \fakesuperscript \textsuperscript +} +{ + \DeclareDocumentCommand \fakesubscript {m} { + \@textsubscript{\selectfont#1} + } + \DeclareDocumentCommand \fakesuperscript {m} { + \@textsuperscript{\selectfont#1} + } +} \DeclareDocumentCommand \textsubscript {s} { \IfBooleanTF #1 \fakesubscript \realsubscript } \DeclareDocumentCommand \textsuperscript {s} { \IfBooleanTF #1 \fakesuperscript \realsuperscript } -\DeclareDocumentCommand \fakesubscript {m} { - \@textsubscript{\selectfont#1} -} -\DeclareDocumentCommand \fakesuperscript {m} { - \@textsuperscript{\selectfont#1} -} \DeclareDocumentCommand \realsubscript {m} { \fontspec_if_fontspec_font:TF { \fontspec_if_opentype:TF @@ -59,7 +66,14 @@ { \fakesuperscript{#1} } } \cs_set:Npn \@makefnmark { - \mbox{\normalfont\textsuperscript{\@thefnmark}} + \mbox{\footnotemarkfont\textsuperscript{\@thefnmark}} +} +\cs_if_exist:NTF \ftntm@font +{ + \cs_new:Npn \footnotemarkfont {\ftntm@font} +} +{ + \cs_new:Npn \footnotemarkfont {\normalfont} } %% %% Copyright (C) 2010 by Will Robertson <will.robertson@latex-project.org> |