summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/oberdiek/accsupp.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/accsupp.dtx')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/accsupp.dtx261
1 files changed, 207 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/accsupp.dtx b/Master/texmf-dist/source/latex/oberdiek/accsupp.dtx
index 65bad3c8b26..3794bcb98a5 100644
--- a/Master/texmf-dist/source/latex/oberdiek/accsupp.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/accsupp.dtx
@@ -18,7 +18,8 @@
% and the derived files
% accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
% accsupp-pdftex.def, accsupp-dvipdfm.def, accsupp-dvips.def,
-% accsupp-example.tex.
+% accsupp-example1.tex, accsupp-example2.tex,
+% accsupp-test1.tex.
%
% Distribution:
% CTAN:macros/latex/contrib/oberdiek/accsupp.dtx
@@ -56,7 +57,9 @@
% TDS:tex/latex/oberdiek/accsupp-dvipdfm.def
% TDS:tex/latex/oberdiek/accsupp-dvips.def
% TDS:doc/latex/oberdiek/accsupp.pdf
-% TDS:doc/latex/oberdiek/accsupp-example.tex
+% TDS:doc/latex/oberdiek/accsupp-example1.tex
+% TDS:doc/latex/oberdiek/accsupp-example2.tex
+% TDS:doc/latex/oberdiek/test/accsupp-test1.tex
% TDS:source/latex/oberdiek/accsupp.dtx
%
%<*ignore>
@@ -72,12 +75,13 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: accsupp 2007/03/21 v0.1 Accessibility support by marked content (HO)}
+\Msg{* Package: accsupp 2007/11/14 v0.2 Accessibility support by marked content (HO)}
\Msg{************************************************************************}
\keepsilent
\askforoverwritefalse
+\let\MetaPrefix\relax
\preamble
This is a generated file.
@@ -100,9 +104,11 @@ This work consists of the main source file accsupp.dtx
and the derived files
accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
accsupp-pdftex.def, accsupp-dvipdfm.def, accsupp-dvips.def,
- accsupp-example.tex.
+ accsupp-example1.tex, accsupp-example2.tex,
+ accsupp-test1.tex.
\endpreamble
+\let\MetaPrefix\DoubleperCent
\generate{%
\file{accsupp.ins}{\from{accsupp.dtx}{install}}%
@@ -113,7 +119,10 @@ and the derived files
\file{accsupp-dvipdfm.def}{\from{accsupp.dtx}{dvipdfm}}%
\file{accsupp-dvips.def}{\from{accsupp.dtx}{dvips}}%
\usedir{doc/latex/oberdiek}%
- \file{accsupp-example.tex}{\from{accsupp.dtx}{example}}%
+ \file{accsupp-example1.tex}{\from{accsupp.dtx}{example1}}%
+ \file{accsupp-example2.tex}{\from{accsupp.dtx}{example2}}%
+ \usedir{doc/latex/oberdiek/test}%
+ \file{accsupp-test1.tex}{\from{accsupp.dtx}{test1}}%
}
\obeyspaces
@@ -125,6 +134,10 @@ and the derived files
\Msg{* accsupp.sty, accsupp-pdftex.def, accsupp-dvipdfm.def,}
\Msg{* accsupp-dvips.def}
\Msg{*}
+\Msg{* And install the following script file:}
+\Msg{*}
+\Msg{* }
+\Msg{*}
\Msg{* To produce the documentation run the file `accsupp.drv'}
\Msg{* through LaTeX.}
\Msg{*}
@@ -140,16 +153,16 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{accsupp.drv}%
- [2007/03/21 v0.1 Accessibility support by marked content (HO)]%
+ [2007/11/14 v0.2 Accessibility support by marked content (HO)]%
\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2007/10/21]
+\usepackage{holtxdoc}[2007/11/11]
\begin{document}
\DocInput{accsupp.dtx}%
\end{document}
%</driver>
% \fi
%
-% \CheckSum{289}
+% \CheckSum{395}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -170,7 +183,7 @@ and the derived files
% \GetFileInfo{accsupp.drv}
%
% \title{The \xpackage{accsupp} package}
-% \date{2007/03/21 v0.1}
+% \date{2007/11/14 v0.2}
% \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}}
%
% \maketitle
@@ -224,7 +237,8 @@ and the derived files
%
% \begin{description}
% \item[\xoption{ActualText}:]
-% Provides a replacement text, see example in section \ref{sec:example}.
+% Provides a replacement text, see examples in
+% section \ref{sec:example}.
% \item[\xoption{Alt}:]
% Provides an alternate description.
% \item[\xoption{E}:]
@@ -248,7 +262,7 @@ and the derived files
% The result is a valid PDF string.
% \item[\xoption{method=hex}:]
% The string is given in hexadecimal notation.
-% Section \ref{sec:example} shows an example.
+% Section \ref{sec:example:notparallel} shows an example.
% \item[\xoption{method=pdfstringdef}:]
% If package \xpackage{hyperref} is loaded, then its \cs{pdfstringdef}
% is used. This method is slow, but useful if the string contains
@@ -307,17 +321,22 @@ and the derived files
% |ps2pdf -dCompressPages=false input.ps output.pdf|
% \end{description}
%
-% \section{Example}\label{sec:example}
+% \section{Example}
+% \label{sec:example}
+%
+% \subsection{Example \cs{notparallel}}
+% \label{sec:example:notparallel}
%
% \begin{macrocode}
-%<*example>
+%<*example1>
% \end{macrocode}
% \begin{macrocode}
+%<<END
\documentclass{article}
-\usepackage{accsupp}
+\usepackage{accsupp}[2007/11/14]
\usepackage{centernot}
- % U+2226 NOT PARALLEL
- % \mathrel{...} prevents page break in between
+% U+2226 NOT PARALLEL
+% \mathrel{...} prevents page break in between
\newcommand*{\notparallel}{%
\ensuremath{%
\mathrel{%
@@ -332,9 +351,40 @@ and the derived files
A\notparallel B
\end{equation}
\end{document}
+%END
% \end{macrocode}
% \begin{macrocode}
-%</example>
+%</example1>
+% \end{macrocode}
+%
+% \subsection{Example with \xoption{pdfstringdef}}
+%
+% \begin{macrocode}
+%<*example2>
+% \end{macrocode}
+% \begin{macrocode}
+%<<END
+\documentclass{article}
+\usepackage[unicode]{hyperref}
+\usepackage{accsupp}[2007/11/14]
+\begin{document}
+ \begin{equation}
+ \BeginAccSupp{
+ method=pdfstringdef,
+ unicode,
+ ActualText={%
+ a\texttwosuperior +b\texttwosuperior
+ =c\texttwosuperior
+ }
+ }
+ a^2 + b^2 = c^2
+ \EndAccSupp{}
+ \end{equation}
+\end{document}
+%END
+% \end{macrocode}
+% \begin{macrocode}
+%</example2>
% \end{macrocode}
%
% \StopEventually{
@@ -346,34 +396,58 @@ A\notparallel B
%
% \begin{macrocode}
%<*package>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{accsupp}%
- [2007/03/21 v0.1 Accessibility support by marked content (HO)]%
% \end{macrocode}
%
% \begin{macrocode}
-\edef\ACCSUPP@end{%
- \catcode39 \the\catcode39 % '
- \catcode40 \the\catcode40 % (
- \catcode41 \the\catcode41 % )
- \catcode60 \the\catcode60 % <
- \catcode61 \the\catcode61 % =
- \catcode62 \the\catcode62 % >
- \catcode94 \the\catcode94 % ^
- \catcode96 \the\catcode96 % `
- \catcode254 \the\catcode254 % ^^FE
- \catcode255 \the\catcode255 % ^^FF
+\begingroup
+ \catcode123 1 % {
+ \catcode125 2 % }
+ \def\x{\endgroup
+ \expandafter\edef\csname ACCSUPP@AtEnd\endcsname{%
+ \catcode35 \the\catcode35\relax
+ \catcode64 \the\catcode64\relax
+ \catcode123 \the\catcode123\relax
+ \catcode125 \the\catcode125\relax
+ }%
+ }%
+\x
+\catcode35 6 % #
+\catcode64 11 % @
+\catcode123 1 % {
+\catcode125 2 % }
+\def\TMP@EnsureCode#1#2{%
+ \edef\ACCSUPP@AtEnd{%
+ \ACCSUPP@AtEnd
+ \catcode#1 \the\catcode#1\relax
+ }%
+ \catcode#1 #2\relax
}
-\@makeother\(
-\@makeother\)
-\@makeother\'
-\@makeother\<
-\@makeother\=
-\@makeother\>
-\catcode94 = 7 %
-\@makeother\`
-\@makeother\^^fe
-\@makeother\^^ff
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{61}{12}% =
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{254}{12}% ^^fe
+\TMP@EnsureCode{255}{12}% ^^ff
+\g@addto@macro\ACCSUPP@AtEnd{\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{accsupp}%
+ [2007/11/14 v0.2 Accessibility support by marked content (HO)]
% \end{macrocode}
%
% \begin{macrocode}
@@ -398,11 +472,11 @@ A\notparallel B
\@dblarg\ACCSUPP@@DefineDriverKey
}
\def\ACCSUPP@@DefineDriverKey[#1]#2{%
- \define@key{ActTxt}{#2}[]{%
+ \define@key{ACCSUPP}{#2}[]{%
\def\ACCSUPP@driver{#1}%
}%
\g@addto@macro\ACCSUPP@DisableOptions{%
- \DisableKeyvalOption{ActTxt}{#2}%
+ \DisableKeyvalOption{ACCSUPP}{#2}%
}%
}
\let\ACCSUPP@DisableOptions\@empty
@@ -412,6 +486,7 @@ A\notparallel B
\ACCSUPP@DefineDriverKey{dvipdfm}
\ACCSUPP@DefineDriverKey[dvipdfm]{dvipdfmx}
\ACCSUPP@DefineDriverKey[dvipdfm]{xetex}
+\let\ACCSUPP@driver\relax
\InputIfFileExists{accsupp.cfg}{}{}
\providecommand*{\ActualTextDriverDefault}{dvips}
\ifpdf
@@ -420,7 +495,9 @@ A\notparallel B
\ifxetex
\def\ACCSUPP@driver{dvipdfm}%
\else
- \let\ACCSUPP@driver\BookmarkDriverDefault
+ \ifx\ACCSUPP@driver\relax
+ \let\ACCSUPP@driver\ActualTextDriverDefault
+ \fi
\fi
\fi
% \end{macrocode}
@@ -450,7 +527,7 @@ A\notparallel B
Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak
Package loading is aborted%
}\@ehc
- \expandafter\expandafter\expandafter\endinput
+ \expandafter\expandafter\expandafter\ACCSUPP@AtEnd
\fi
\def\ACCSUPP@temp{dvipdfm}%
\ifxetex
@@ -464,12 +541,19 @@ A\notparallel B
\fi
\fi
\fi
+\ifx\ACCSUPP@driver\relax
+ \PackageError{accsupp}{%
+ Missing driver option.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\ACCSUPP@AtEnd
+\fi
\InputIfFileExists{accsupp-\ACCSUPP@driver.def}{}{%
\PackageError{accsupp}{%
Unsupported driver `\ACCSUPP@driver'.\MessageBreak
Package loading is aborted%
}\@ehc
- \endinput
+ \ACCSUPP@AtEnd
}
% \end{macrocode}
%
@@ -585,7 +669,7 @@ A\notparallel B
% \end{macrocode}
% \begin{macrocode}
\def\ACCSUPP@method@pdfstringdef#1{%
- \ifActText@unicode
+ \ifACCSUPP@unicode
\@ifundefined{hypersetup}{}{%
\hypersetup{unicode}%
}%
@@ -596,14 +680,19 @@ A\notparallel B
}\@ehc
\let\ACCSUPP@temp\@empty
}{%
- \pdfstringdef\ACCSUPP@temp#1%
+ \begingroup
+ \setbox0=\hbox{%
+ \pdfstringdef\ACCSUPP@temp#1%
+ \global\let\ACCSUPP@temp\ACCSUPP@temp
+ }%
+ \endgroup
}%
\edef#1{(\ACCSUPP@temp)}%
}
% \end{macrocode}
%
% \begin{macrocode}
-\ACCSUPP@end
+\ACCSUPP@AtEnd
%</package>
% \end{macrocode}
%
@@ -615,7 +704,7 @@ A\notparallel B
%<*pdftex>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{accsupp-pdftex.def}%
- [2007/03/21 v0.1 accsupp driver for pdfTeX (HO)]%
+ [2007/11/14 v0.2 accsupp driver for pdfTeX (HO)]%
% \end{macrocode}
%
% \begin{macrocode}
@@ -636,7 +725,7 @@ A\notparallel B
%<*dvipdfm>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{accsupp-dvipdfm.def}%
- [2007/03/21 v0.1 accsupp driver for dvipdfm (HO)]%
+ [2007/11/14 v0.2 accsupp driver for dvipdfm (HO)]%
% \end{macrocode}
%
% \begin{macrocode}
@@ -657,11 +746,11 @@ A\notparallel B
%<*dvips>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{accsupp-dvips.def}%
- [2007/03/21 v0.1 accsupp driver for dvips (HO)]%
+ [2007/11/14 v0.2 accsupp driver for dvips (HO)]%
% \end{macrocode}
%
% \begin{macrocode}
-\def\ACCSUPP@bdc#1{%
+\def\ACCSUPP@bdc{%
\special{ps:[\ACCSUPP@span/BDC pdfmark}%
}
\def\ACCSUPP@emc{%
@@ -672,6 +761,62 @@ A\notparallel B
%</dvips>
% \end{macrocode}
%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\makeatletter
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{127}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \RequirePackage{accsupp}[2007/11/14]\relax
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
% \section{Installation}
%
% \subsection{Download}
@@ -736,7 +881,9 @@ A\notparallel B
% accsupp-dvipdfm.def & tex/latex/oberdiek/accsupp-dvipdfm.def\\
% accsupp-dvips.def & tex/latex/oberdiek/accsupp-dvips.def\\
% accsupp.pdf & doc/latex/oberdiek/accsupp.pdf\\
-% accsupp-example.tex & doc/latex/oberdiek/accsupp-example.tex\\
+% accsupp-example1.tex & doc/latex/oberdiek/accsupp-example1.tex\\
+% accsupp-example2.tex & doc/latex/oberdiek/accsupp-example2.tex\\
+% test/accsupp-test1.tex & doc/latex/oberdiek/test/accsupp-test1.tex\\
% accsupp.dtx & source/latex/oberdiek/accsupp.dtx\\
% \end{tabular}^^A
% }^^A
@@ -870,6 +1017,12 @@ A\notparallel B
% \item
% First version.
% \end{Version}
+% \begin{Version}{2007/11/14 v0.2}
+% \item
+% Various bug fixes.
+% \item
+% Catcode section rewritten, test added.
+% \end{Version}
% \end{History}
%
% \PrintIndex