summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/ptex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-19 22:32:39 +0000
committerKarl Berry <karl@freefriends.org>2019-10-19 22:32:39 +0000
commit643931a207ee2c74b254ab0f4110fdcd2b3db1ac (patch)
tree1af0d8a7cd130b1e04d9fa33e64a97e7ba32ea4e /Master/texmf-dist/doc/ptex
parent8a702999f8288aa129506015ac679ed86566d79f (diff)
ptex-manual.sty -> doc
git-svn-id: svn://tug.org/texlive/trunk@52451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/ptex')
-rw-r--r--Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.sty131
1 files changed, 131 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.sty b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.sty
new file mode 100644
index 00000000000..686d10998ea
--- /dev/null
+++ b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.sty
@@ -0,0 +1,131 @@
+%%% common macros for ptex-manual documents
+\def\headfont{\normalfont\mathversion{bold}\sffamily}
+\def\node#1{\textit{#1}}
+\def\.#1{\texorpdfstring{%
+ \leavevmode\hbox{\texttt{\textbackslash#1}}\ifmmode\else\textcompwordmark\fi}{\textbackslash #1}}
+
+\@ifpackageloaded{enumitem}{%
+\let\orig@cs=\.
+\def\ind@cs#1{\orig@cs{#1}\indcs{#1}}
+\def\indcs#1{\index{{\texttt{\textbackslash #1}}}}
+\newlist{cslist}{description}1
+\setlist[cslist]{%
+ itemsep=\medskipamount,listparindent=1zw,
+ font=\normalfont\mdseries, leftmargin=2zw,
+ before=\advance\@listdepth\@ne,
+ after=\advance\@listdepth\m@ne
+}
+\def\csitem[#1]{\item[\llap{$\blacktriangleright$~}\let\.=\ind@cs#1]
+ \leavevmode\par\nopagebreak}
+}{}
+
+\def\emph#1{{\bfseries\sffamily\gtfamily\mathversion{bold}#1}}
+\def\paragraph#1{\par\medskip\par\noindent\emph{■#1}\par\nobreak}
+
+\def\Pkg#1{\textsf{#1}}
+\let\@lessthan <
+\catcode`\<=13
+\xspcode`\\=3
+\xspcode`\*=3
+\xspcode`\-=3
+\xspcode23=3 % \textcompwordmark
+\def<{\ifmmode\@lessthan\else\expandafter\@@meta\fi}
+\def\@@meta#1>{\ensuremath{\langle\hbox{\normalfont\textit{#1}}\rangle}}
+\def\hex#1{\ifmmode\mbox\fi{\texttt{"#1}}}%"
+
+\normalsize
+\bigskipamount=\baselineskip
+\medskipamount=.5\baselineskip
+\smallskipamount=.25\baselineskip
+
+\usepackage{etoolbox}
+\patchcmd\@verbatim\@totalleftmargin{\dimexpr\@totalleftmargin+2zw\relax}{}{}
+\patchcmd\quote{\list{}}{\par\addvspace\medskipamount\list{}}{}{}
+\patchcmd\endquote{\endlist}{\endlist\addvspace\medskipamount}{}{}
+\patchcmd\@verbatim{\trivlist}{\trivlist\addvspace\medskipamount\noautoxspacing}{}{}
+\patchcmd\endverbatim{\endtrivlist}{\endtrivlist\addvspace\medskipamount}{}{}
+\expandafter\let\csname endverbatim*\endcsname =\endverbatim
+\patchcmd\verb{\ifmmode\hbox\else\leavevmode\vadjust{}\fi\bgroup}
+ {\ifmmode\else\leavevmode\vadjust{}\fi\hbox
+ \bgroup\textcompwordmark\noautoxspacing\noautospacing}{}{}
+\patchcmd\verb@egroup{\egroup}{\egroup\textcompwordmark}{}{}
+
+\ifx\jsc@clsname\@undefined\else % jsclasses-specific
+\renewenvironment{theindex}{%
+ \def\presectionname{}\def\postsectionname{}%
+ \section*{\indexname}
+ \@mkboth{\indexname}{\indexname}%
+ \plainifnotempty % \thispagestyle{plain}
+ \parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \let\item\@idxitem
+ \raggedright
+ \begin{multicols}{2}
+ }{
+ \end{multicols}
+ \clearpage
+ }
+\fi
+
+% multilist env.
+\newenvironment{multilist}[2]%
+ {$$\setbox\z@=\hbox\bgroup % catch some funny things -> \mathord
+ \let\a=\empty
+ \let\b=\empty
+ \count@=\z@
+ \toks@={#2}%
+ \def\item##1\cr
+ {\ifnum \count@=\z@
+ \count@=#1%
+ \expandafter\def\expandafter\b\expandafter{\b\y{}}%
+ \fi
+ \advance\count@ by\m@ne
+ \expandafter\def\expandafter\a\expandafter{\a\x{##1}}}%
+ \ignorespaces}%
+ {\loop
+ \ifnum \count@>\z@
+ \expandafter\def\expandafter\a\expandafter{\a\expandafter\z\b\relax}%
+ \advance\count@ by\m@ne
+ \repeat
+ \def\x##1{\expandafter\y\b\relax{##1}}%
+ \def\y\y##1##2\relax##3%
+ {\ifx @##1@%
+ \def\b{##2\y{##3}}%
+ \else
+ \def\b{##2\y{##1&##3}}%
+ \fi}%
+ \def\z\y##1##2\relax{\def\b{##2\y{##1}}}%
+ \a
+ \def\x
+ {\expandafter\egroup\expandafter\halign\expandafter\bgroup
+ \expandafter&\the\toks@\cr}%
+ \def\y##1{\expandafter\def\expandafter\x\expandafter{\x##1\cr}}%
+ \b
+ \x\egroup $$}
+
+% dangerous env.
+\font\man=manfnt at 10pt
+\def\dbend{\raise0pt\hbox{\man\char'177}}
+\newenvironment{dangerous}{%
+ \ifnum\@listdepth>\z@
+ \GenericError{}{Do not use `dangerous' environment inside any list}{}{}
+ \fi
+ \par\addvspace\medskipamount
+ \@tempdima=\dimexpr\textwidth-2zw\relax\small
+ \bigskipamount=\baselineskip
+ \medskipamount=.5\baselineskip
+ \smallskipamount=.25\baselineskip
+ \divide\@tempdima by\dimexpr1zw\relax\@tempcnta=\@tempdima
+ \leftskip=\dimexpr\textwidth-\@tempcnta zw\relax
+ \@totalleftmargin\dimexpr\leftskip+0zw
+ \linewidth=\dimexpr\@tempcnta zw-0zw
+ \parindent1zw\noindent\kern-\leftskip\hbox to\leftskip{\dbend\hss}%
+ \everypar{\everypar{}}\ignorespaces
+}{\par\addvspace\medskipamount}
+
+% macros for index (simplified from doc.sty)
+\newif\ifscan@allowed
+\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus1fill}%
+\def\pfill{\unskip~\dotfill\nobreak}
+
+%%% EOF