summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/program/program-doc.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/program/program-doc.tex
Initial commit
Diffstat (limited to 'macros/latex/contrib/program/program-doc.tex')
-rw-r--r--macros/latex/contrib/program/program-doc.tex76
1 files changed, 76 insertions, 0 deletions
diff --git a/macros/latex/contrib/program/program-doc.tex b/macros/latex/contrib/program/program-doc.tex
new file mode 100644
index 0000000000..a761b39825
--- /dev/null
+++ b/macros/latex/contrib/program/program-doc.tex
@@ -0,0 +1,76 @@
+\documentclass[pagesize=auto]{scrartcl}
+
+\usepackage{fixltx2e}
+\usepackage{etex}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{upquote}
+\usepackage{hologo}
+\usepackage{microtype}
+\usepackage{hyperref}
+
+\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
+\newcommand*{\pkg}[1]{\textsf{#1}}
+\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
+\makeatletter
+\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
+\makeatother
+\newcommand*{\env}[1]{\texttt{#1}}
+
+\addtokomafont{title}{\rmfamily}
+\deffootnote{1em}{1em}{\textsuperscript{\thefootnotemark}}
+\renewcommand*{\labelenumi}{(\theenumi)}
+
+\title{The \pkg{program} package\thanks{This manual corresponds to \pkg{program.sty}~v3.3.14, dated~May 5, 2017.}}
+\author{Martin Ward\thanks{\mail{martin@gkc.org.uk}, \mail{Martin.Ward@smltd.com}\newline\url{http://www.gkc.org.uk/}}}
+\date{May 5, 2017}
+
+
+\begin{document}
+
+\maketitle
+
+\noindent
+This is the ``\pkg{program}'' style option which sets up the
+\env{program} and \env{programbox} environments,
+keywords for programs and a few goodies.
+\emph{Note:} Within the program environment:
+%
+\begin{enumerate}
+\item Newlines are significant.
+\item Each line is in math mode, so for example spaces in the input
+ file are not significant.
+\item \cmd{\\} within a line causes a linebreak in the output.
+\end{enumerate}
+
+We also define a ``\env{programbox}'' environment which typesets a program in a box.
+Useful for keeping a pice of code on one page or for typesetting small
+programs in running text.
+We also redefine \cmd{\(} and \cmd{\)} as \verb+\begin{programbox}+ and \verb+\end{programbox}+.
+The \cmd{\tab} and \cmd{\untab} commands are defined to have no effect while outside
+a \env{program} environment, hence a single-line program can be typeset in
+maths mode without the overhead associated with \env{programbox}.
+
+The notation \verb+|variable_name|+ can be used within normal text,
+maths expressions or programs to indicate a variable name.
+Use \cmd{\origbar} to get a normal \verb+|+ symbol in a program.
+The commands \cmd{\A}, \cmd{\B}, \cmd{\R}, \cmd{\T} and \cmd{\Z} typeset the corresponding bold
+letter with the next object as a substript (eg \verb+\S1+ typesets {\bf
+S$_1$} etc). They now cope with primes as well, (eg \verb+$\S2'''$+)\@. The
+\env{program.sty} file can be easily edited to reflect your favoured style.
+Typesetting a program is as easy as:
+%
+\begin{verbatim}
+\(\IF x \ne 0 \THEN |long_name|_{123} = x^y \FI\)
+\end{verbatim}
+%
+See the \texttt{program-demo.tex} file for examples.
+
+\bigskip\noindent
+The file should work with or without \hologo{AmSLaTeX}.
+
+\bigskip\noindent
+This work is released under the GPL version 3.
+
+\end{document}