summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/ydoc/ydoc.dtx70
1 files changed, 56 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/ydoc/ydoc.dtx b/Master/texmf-dist/source/latex/ydoc/ydoc.dtx
index 8f96314275b..c285ee5ca96 100644
--- a/Master/texmf-dist/source/latex/ydoc/ydoc.dtx
+++ b/Master/texmf-dist/source/latex/ydoc/ydoc.dtx
@@ -182,7 +182,7 @@
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesFile{ydoc.dtx}[%
%<=*DATE>
- 2011/11/19
+ 2012/05/03
%<=/DATE>
%<=*VERSION>
v0.6alpha
@@ -821,18 +821,20 @@
% \end{macrocode}
% \end{macro}
%
-%
-% \begin{macro}{\ydoclistingssettings}
% \begin{macrocode}
-\def\ydoclistingssettings{%
- \lstset{%
+\lstdefinestyle{ydoccode}{%
language=[latex]tex,basicstyle=\ttfamily,
numbers=left,numberstyle=\tiny\color{gray},firstnumber=last,
breaklines,prebreak={\mbox{\tiny$\swarrow$}},
commentstyle=\color{black!60},
- }%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\ydoclistingssettings}
+% \begin{macrocode}
+\def\ydoclistingssettings{%
+ \lstset{style=ydoccode}%
}
-\ydoclistingssettings
% \end{macrocode}
% \end{macro}
%
@@ -1391,6 +1393,15 @@
% \subsubsection{Color and style definitions}
% \begin{macrocode}
\RequirePackage{xcolor}
+% \end{macrocode}
+% Define special no-op `none' color which does not change the color.
+% This is not yet tested and may break output files, but seems to work fine with PDF.
+% \begin{macrocode}
+\expandafter\def\csname\string\color@none\endcsname{%
+ \xcolor@ {}{}{}{}
+}
+% \end{macrocode}
+% \begin{macrocode}
\definecolor{macrodesc}{rgb}{0,0.2,0.6}
\definecolor{keydesc}{rgb}{0,0.4,0.9}
\definecolor{macroimpl}{rgb}{0,0.1,0.3}
@@ -1526,11 +1537,11 @@
\newcommand*\envstyle[1]{\texttt{\textcolor{env}{#1}}}
\newcommand*\optstyle[1]{\textsf{\textcolor{opt}{#1}}}
\newcommand*\filestyle[1]{\texttt{\textcolor{file}{#1}}}
-\colorlet{cls}{black}
-\colorlet{lib}{black}
-\colorlet{env}{black}
-\colorlet{file}{black}
-\colorlet{pkg}{black}
+\colorlet{cls}{none}
+\colorlet{lib}{none}
+\colorlet{env}{none}
+\colorlet{file}{none}
+\colorlet{pkg}{none}
\definecolor{opt}{rgb}{0.5,0.16666,0}
% \end{macrocode}
% \end{macro}
@@ -1934,6 +1945,14 @@
% \end{macrocode}
% \end{macro}
%
+% Allows `|=|' to be used directly without switching to verbatim
+% mode. This is especially useful for keys.
+% \begin{macrocode}
+\define@Macro@handler{=}={%
+ =\read@Macro@arg
+}
+% \end{macrocode}
+%
% \begin{macro}{\read@Macro@verb}
% Sets up verbatim mode calls second macro.
% \begin{macrocode}
@@ -2626,7 +2645,29 @@
%
% \begin{style}{examplecode}
% \begin{macrocode}
-\lstdefinestyle{examplecode}{numbers=left,firstnumber=1,numberstyle=\tiny\color{gray}\sffamily,numbersep=5pt}%
+\lstdefinestyle{examplecode}{%
+ language=[latex]tex,
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ numbers=left,
+ firstnumber=1,
+ numberstyle=\tiny\color{gray}\sffamily,
+ numbersep=5pt,
+ breaklines,prebreak={\mbox{\tiny$\swarrow$}},
+ commentstyle=\color{black!60},
+}%
+% \end{macrocode}
+% \end{style}
+%
+% \begin{style}{exampleresult}
+% \begin{macrocode}
+\lstdefinestyle{exampleresult}{%
+ firstnumber=1,
+ gobble=0,
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ commentstyle=\color{black!60},
+}
% \end{macrocode}
% \end{style}
%
@@ -2649,6 +2690,7 @@
{\ydoc@exafile}%
\unskip\color@endgroup}%
\setbox\exampleresultbox\hbox{\color@setgroup
+ \lstset{style=exampleresult}%
\@@input\ydoc@exafile\relax
\unskip\color@endgroup}%
}
@@ -2705,8 +2747,8 @@
% \begin{macrocode}
\lstnewenvironment{examplecode}[1][]{%
\lstdefinestyle{thisexampleprint}{#1}%
- \lstset{style=exampleextract,#1}%
\setbox\@tempboxa\hbox\bgroup
+ \lstset{style=exampleextract,#1}%
\lst@BeginWriteFile{\ydoc@exafile}%
}
{%