summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/verbdef/verbdef.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-02-24 01:09:15 +0000
committerKarl Berry <karl@freefriends.org>2010-02-24 01:09:15 +0000
commit91fd73a79f94329f1539cf76d0014df8d8e18838 (patch)
tree7914905a66083d7b2a56f01ecf03bda1c73576d9 /Master/texmf-dist/doc/latex/verbdef/verbdef.tex
parent7dd8df13011ecf3efb1f799c52149d2a846296a1 (diff)
verbdef doc update, own package (23feb10)
git-svn-id: svn://tug.org/texlive/trunk@17177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/verbdef/verbdef.tex')
-rw-r--r--Master/texmf-dist/doc/latex/verbdef/verbdef.tex53
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/verbdef/verbdef.tex b/Master/texmf-dist/doc/latex/verbdef/verbdef.tex
new file mode 100644
index 00000000000..e07315059af
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/verbdef/verbdef.tex
@@ -0,0 +1,53 @@
+\documentclass[a4paper]{article}
+\usepackage[dvips,a4paper]{geometry}
+\usepackage{verbdef}
+\verbdef\verbdefcmd|\verbdef|
+\providecommand\cs[1]{\texttt{\char`\\#1}}
+\begin{document}
+\title{The \textsf{verbdef} package\thanks{This documents version 0.2, of
+ 2000-10-06}}
+\author{Robin Fairbairns}
+\maketitle
+
+\section{What is it for?}
+
+Verbatim text is notoriously difficult in \TeX{}; in \LaTeX{} it adds
+confusion by being ``more fragile than fragile''.
+
+This package provides one way out of the impasse: the command
+\verbdefcmd, which defines a robust command that expands to verbatim
+text.
+
+\section{Using \verbdefcmd}
+
+The \verbdefcmd{} command can take an its verbatim string between
+matching characters, as \cs{verb} does:
+\begin{quote}
+\verbdefcmd\cs{demo}\texttt{|demonstration text|}
+\end{quote}
+or you may give it a more normal-looking argument:
+\begin{quote}
+ \verbdefcmd\cs{demo}\texttt{\char`\{demonstration text\char`\}}
+\end{quote}
+
+The command also respects ``\texttt{*}'', as it's used in \cs{verb}
+and the \texttt{verbatim} environment:
+\begin{quote}
+ \verbdefcmd\texttt{*}\cs{stardemo}\texttt{\char`\{with visible spaces\char`\}}
+\end{quote}
+%
+% another self-reference...
+\verbdef*\stardemo{with visible spaces}%
+which will define a verbatim text \stardemo{} (just like that).
+
+\section{Caveat}
+
+If the command you're defining with \verbdefcmd{} is to be used in a
+\cs{section}-type command, or a \cs{caption}, it's going to appear in
+the table of contents (or list of whatever else). In this case you
+\emph{must} define the command before the \cs{tableofcontents} command
+(or whatever). I recommend defining such commands in the preamble of
+the document\footnote{In fact, the source of the present document is
+ so structured, since \verbdefcmd{} is used to define a command for
+ \verbdefcmd\dots}.
+\end{document}