diff options
author | Karl Berry <karl@freefriends.org> | 2014-02-09 23:14:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-02-09 23:14:32 +0000 |
commit | fcf7284341a573f0d6a46f47811ae66a5a66d1a7 (patch) | |
tree | 771b2778f27fbd1157cd7df6b62f0dcb19c03b8e /Master/texmf-dist/doc/latex/dickimaw/src/novices | |
parent | 3c5263791a2db0a013beab5b5a3bcfed77acf2db (diff) |
dickimaw (9feb14)
git-svn-id: svn://tug.org/texlive/trunk@32925 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/dickimaw/src/novices')
96 files changed, 21074 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/dickimaw-novices.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/dickimaw-novices.tex new file mode 100644 index 00000000000..0b1ce901b1c --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/dickimaw-novices.tex @@ -0,0 +1,11105 @@ +% This is part of the source code for "LaTeX for Complete Novices" +% It includes some code that was used to generate other formats of +% this tutorial that aren't included in this distribution. That code +% will be skipped by the current class settings. + +% arara: pdflatex +% arara: bibtex +% arara: makeglossaries +% arara: pdflatex +% arara: makeglossaries +% arara: pdflatex +% arara: makeindex: { style: novices-index.ist } +% arara: pdflatex +% arara: pdflatex +% arara: pdflatex +% arara: pdflatex +% arara: makeindex: { style: novices-index.ist } +% arara: pdflatex + +% Multiple pdflatex runs are required to ensure the flow frame switches occur +% correctly before and after the summary and index +\documentclass[report]{novices} + +\usepackage{fancybox} +\usepackage{tikz} +\usetikzlibrary{shapes} +\usetikzlibrary{decorations.pathmorphing} +\usepackage{caption,subcaption} +\usepackage{makeidx} +\usepackage{alltt} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{graphicx} +\usepackage{rotating} +\usepackage{booktabs} +\usepackage{pifont} + +\usepackage{cmap} + +\usepackage[utf8]{inputenc} +\usepackage[math]{anttor} +\usepackage{libris} +\renewcommand*{\ttdefault}{txtt} + +\newcommand*{\docdate}{\formatdate{25}{9}{2012}} + +\authordetails{1970}{Talbot}{Nicola L.~C.} +\title[LaTeX for Complete Novices]{\LaTeX\ for Complete Novices} +\version{1.4} +\edition{1} +\volume{1} +\series{The Dickimaw \LaTeX\ Series} +\seriesurl{http://www.dickimaw-books.com/latex/} +\affiliation + {Dickimaw Books} + {http://www.dickimaw-books.com/} + {Saxlingham Nethergate} +\keywords{LaTeX,beginners,introduction,typesetting} +\subject{LaTeX} +\date{\docdate} + +\html{\input{htmlonly}} + +\makeindex +\makeglossaries + +\input{keywords} +\input{glsentries} + +\newacr{ctan}{CTAN} + {the Comprehensive \TeX\ Archive Network} + {http://mirror.ctan.org/} + +\newacr{tug}{TUG}% + {\TeX\ User Group}% + {http://tug.org/} + +\newacr{uktug}{UK TUG}% + {UK \TeX\ User Group}% + {http://uk.tug.org/} + +\newacr{ukfaq}{UK FAQ}% + {UK List of \TeX\ Frequently Asked Questions}% + {http://www.tex.ac.uk/faq} + +\newacrx{tds}{TDS}{\TeX\ Directory Structure} + +\newacrnocite{gui}{GUI}{graphical user interface} + +\definecolor{midgray}{gray}{0.4} + +\indexpreamble{\latexhtml{Page numbers}{Locations} in \textit{italic} indicate the primary +reference. \latexhtml{Page numbers}{Locations} in \textbf{bold} indicate the entry +definition in the summary.} + +\newcommand{\xtableref}[1]{\objectref{Table}{#1}} + +% \figconts[graphics opts]{image}{caption}{label} +\newcommand{\figconts}[4][]{% + \begin{makeimage}\end{makeimage}\figuretop{#4} + \centering + \incPgfOrGraphics[#1]{#2}% + #3% caption + \label{#4}% +} + +\newcommand{\latexbook}{\emph{\LaTeX: A Document Preparation System}~\cite{lamport94}} +\newcommand{\latexcomp}{\emph{The \LaTeX\ Companion}~\cite{goossens94}} +\newcommand{\latexguide}{\emph{A Guide to \LaTeX}~\cite{kopka95}} +\newcommand{\latexgraphic}{\emph{The \LaTeX\ Graphics Companion}~\cite{goossens97}} +\newcommand{\latexweb}{\emph{The \LaTeX\ Web Companion}~\cite{goossens99}} + +\newcommand{\baseurl}{http://www.dickimaw-books.com} +\newcommand{\packageurl}{\baseurl/latex/packages} +\newcommand{\exerciseurl}{\baseurl/latex/novices/html/exercises} + +\newcommand{\pderiv}[2]{\frac{\partial #1}{\partial #2}} +\newcommand{\e}{\mathrm{e}} + +\newcommand{\koma}{KOMA-Script} + +\newcommand*{\backcovertext}{If you choose to buy a copy of this book, +Dickimaw Books asks for your support through buying the Dickimaw +Books edition to help cover costs.} + +\copyrighttext{% + Copyright \textcopyright\ 2004 Nicola L.~C. Talbot + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + one Back-Cover Text: \dq{\backcovertext} A copy of the license is included in + the section entitled \htmlref{\dq{GNU Free Documentation + License}}{sec:fdl}. + + \doifnotbook + {% + The base URL for this document is: \url{\baseurl/latex/novices/} + }% +} + +\renewcommand{\glossaryname}{Summary} + +\begin{document} +\maketitle + +\frontmatter +\setcounter{tocdepth}{2} +\setnode{contents} +\tableofcontents +\setnode{listoffigures} +\listoffigures +\setnode{listoftables} +\listoftables + +\setnode{listofexercises} +\listofexercises + +\mainmatter + +%%%%%%%%%%%%%%%% INTRODUCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{introduction} +\chapter{Introduction} +\label{ch:intro} + +The aim of this book is to introduce \LaTeX\ to a non-technical +person. \LaTeX\ is excellent for producing professional looking +documents, however it is a \emph{language} not a word +processor\faq{Why is TeX not a WYSIWYG system?}{notWYSIWYG}, so +it can take a bit of getting used to, particularly if you have never +had any experience using programming languages. + +\LaTeX\ does take a while to learn, so why should you use it? Here are +a few reasons but it is not an exhaustive list: + +\LaTeX\ is far better at typesetting mathematical equations +than word processors. I~wrote my Ph.D. thesis back in the days of +\LaTeX2.09 (the old version of \LaTeX) and given the high quantity of +mathematics that I~had to typeset, it would have taken me considerably +longer to write it in a word processor, and the resulting document +wouldn't have looked nearly as good. Even Microsoft have +acknowledged \glsterm{tex}'s high-quality mathematical +typography~\cite{sargentiii}. + +\xminisec{Example:} +Here's an equation taken from some kernel survival analysis: +\begin{result}[latexintromaths.html] +\newcommand{\me}{\mathrm{e}} +\newcommand{\pfrac}[2]{\frac{\partial #1}{\partial #2}} +\[ +\pfrac{^2\mathcal{L}}{{z_i^\rho}^2} = +-\pfrac{\rho_i}{z_i^\rho}\left(\pfrac{v_i}{\rho_i}\frac{\me^{v_i}}{1-\me^{v_i}} ++v_i\frac{\me^{v_i}\pfrac{v_i}{\rho_i}(1-\me^{v_i})+\me^{2v_i}\pfrac{v_i}{\rho_i}}{(1-\me^{v_i})^2}\right) +\] +\end{result} +(You can find out how to create this equation \latexhtml{on +page~\pageref{introeq} in \sectionref{sec:delimiters}}{\htmlref{later}{introeq}}.) + +That's all very well and good if you want to typeset some equations, +but if your work doesn't involve maths, does that mean that \LaTeX\ +is not for you? Although I~am a mathematician, I~have written plenty +of documents with no maths in at all, including prose, poetry, +newsletters, posters and brochures, but I~still opt for \LaTeX\ +because using \LaTeX\ ensures consistent formatting, and the style +of the document can be completely changed by simply using a +different \glsterm{cls}, or loading additional \htmlref{packages}{sec:packages}. This +means that I~can concentrate on writing the document, rather than +worrying about how it will look. It also means that if, after having +written a 200 page document, I~then find that I~need to change all +the figure captions so that they are labelled \dq{Fig} instead of +\dq{Figure}, all I~need to do is edit a single line, rather than +going through 200 pages to individually edit every single figure +caption.\footnote{Sure, you could use a search and replace function, +but a sweeping replace-all can have unexpected side effects. For +example, your document may include the sentence, \dq{Figures from +the last quarter showed improvement}, which would get changed to, +\dq{Figs from the last quarter showed improvement}.} + +Serious fiction writers are taught never to remind the reader that +they're reading a book. Poor formatting is just as much a reminder +of this as authorial intrusion. + +\LaTeX\ makes it very easy to cross-reference chapters, sections, +equations, figures, tables etc, and it also makes it very easy to +generate a table of contents, list of figures, list of tables, +index, glossary\footnote{Glossaries are covered in \latexthesis.}\ and +bibliography. You don't need to worry about numbering anything, +as this is done automatically, which means that you can insert new +sections or swap sections around without having to worry about +updating all the section numbering etc. Furthermore, if you use +\BiBTeX\footnote{Automating bibliographies is covered in +\latexthesis.}\ in combination with \LaTeX, and you have, say, 100 +or more citations, it doesn't matter if you are then told that the +citations have to be re-ordered (say, in order of citation rather +than alphabetically). All that is required is a minor edit to change +the appropriate style file rather than ploughing through the entire +document changing all the citations by hand. + +When you are editing a document using a word processor, the +word processor has to work out how to reformat the document every time +you type something. If you have a large document with a great many +inserted objects (such as figures and equations), the response to +keyboard input can become very slow. You may find that after typing +a few words you will have to wait until the computer catches up +before you can see what you have typed. With \LaTeX\ you type in your +code using an ordinary text editor. The document +doesn't get formatted until you pass it to \LaTeX, which means that +you are not slowed down by constant reformatting. + +Lastly, there's the fact that \LaTeX\ follows certain typographical +rules, so you can leave most of the typesetting to \LaTeX. You +rarely need to worry about minor things such as +\glstext{intersentencespacing}. The default is English spacing, but +if you have a publisher who disapproves of this, you can switch if +off with a single command. (See \sectionref{sec:intersentencespacing}.) + +\LaTeX\ will also automatically deal with +f-ligatures.\footnote{Ligatures can be suppressed using the +\isty{microtype} package if necessary} That is, if any of the +following combination of letters are found: \texttt{fl}, +\texttt{ffl}, \texttt{ff}, \texttt{fi}, \texttt{ffi}, they will +automatically be converted into the corresponding ligatures: +% Using CMR as the ligatures are more noticeable than with anttor. +% make latex2html convert this text into an image +\makeimg{fl ligature}{\cmr{fl}}, +\makeimg{ffl ligature}{\cmr{ffl}}, +\makeimg{ff ligature}{\cmr{ff}}, +\makeimg{fi ligature}{\cmr{fi}}, +\makeimg{ffi ligature}{\cmr{ffi}}. + Note the difference between +\makeimg{fl-ligature u ffi-ligature e r}{\cmr{fluffier}} (2 +ligatures) and \makeimg{fluffier}{\cmr{f{}l{}uf{}f{}i{}er}} (no ligatures). These +points may seem minor but they all contribute towards the impact of +the entire document. When writing technical documents, the +presentation as well as the content is important. All too often +examiners or referees are put off reading a document because it is +badly formatted. This provokes an immediate negative reaction and +provides little desire to look favourably upon your work. + +To give you an idea of what you can do with \LaTeX, this book was +written in \LaTeX.\footnote{The source code is available at +\url{\baseurl/latex/novices/}, but it really is +\emph{not} the place to start if you are a beginner, as it contains +\LaTeX\ and \glsterm{perl} code beyond the scope of this tutorial.} The PDF +versions (including \ifbookorother{this}{the} paperback version) were generated using PDF\LaTeX\ and \appname{makeindex} and +the HTML version was generated using the +\latexhtml + {\LaTeX2HTML\footnote{\url{http://www.latex2html.org/}}}% + {\htmladdnormallink{\LaTeX2HTML}{http://www.latex2html.org/}}% +\faq{Conversion from (La)TeX to HTML}{LaTeX2HTML} converter. + +For more reasons as to why you might want to use \LaTeX\ instead +of a word processor, have a look at +\ifbookorother + {\url{http://www.ctan.org/what_is_tex.html\#whytex}.}% + {\htmladdnormallink{Why TeX?}{http://www.ctan.org/what_is_tex.html\#whytex}} + +\setnode{texdoc} +\section{Class and Package Documentation} +\label{sec:texdoc} + +There are hundreds of \htmlref{classes}{sec:cls} and +\htmlref{packages}{sec:packages} available on \gls{ctan}. These are +made available by many volunteers. Some provide detailed +documentation to accompany their contribution, while others only +provide a few notes in a README file or comments in the source +files. This book only provides an introductory +look at a small selection of these contributions. If you want +further details on how to use a particular class or package you +should check the documentation that accompanies it. You can use the +\iappname{texdoc} application to search for the documentation. This +is a command line application, which means you need a terminal or +command prompt (see \sectionref{sec:terminal}). + +To use \appname{texdoc}, you need to +type (at the command prompt) \appname{texdoc} followed by a space followed by the name of +the class or package you want information about. +For example, to read the \icls{memoir} +documentation, type the following at the \htmlref{command prompt}{sec:terminal} (press the +return/enter key \enter\ at the end of the line): +\begin{verbatim} +texdoc memoir +\end{verbatim} +Some packages come with more than one set of documentation. For +example, the \isty{glossaries} package comes with the main user +manual, a short guide for beginners and the documented code for +advanced users. Just doing +\begin{verbatim} +texdoc glossaries +\end{verbatim} +will display the advanced documented code. To list all available +documentation for a package, use the \texttt{-l} option: +\begin{verbatim} +texdoc -l glossaries +\end{verbatim} +Then type the number corresponding to the file you want to view. If +you can remember the file name (for example \texttt{glossaries-user}) +you can type that next time you want to view it: +\begin{verbatim} +texdoc glossaries-user +\end{verbatim} +There is also a \glsterm{perl}/Tk-based \gls{gui} called \iappname{texdoctk}, +which is distributed with \texdistro{TeX~Live}, +that you can use instead of \appname{texdoc} if you can't work out +how to use a \glsterm{terminal} or prefer a \gls*{gui} approach. + +Failing that, you can also check on \gls{ctan} using the URL +\texttt{ctan.org\slash pkg\slash}\meta{name}, where \meta{name} is the name of +the package or class. For example, if you want to look up the +documentation for the \icls{memoir} package, you can find it at +\url{http://ctan.org/pkg/memoir} or go to +\url{http://mirror.ctan.org/} and search for the package or class. + +Another alternative recently made available is to use the URL +\texttt{texdoc.net\slash pkg\slash}\meta{name}. For example, +\url{http://texdoc.net/pkg/memoir} will +fetch the documentation for the \icls{memoir} class. + +However, it's better to use \appname{texdoc} or \appname{texdoctk} to +read the documentation installed with the +class or package on your computer to ensure it +matches the installed class or package version. + +Note that it is important to remember that the \glsterm{tex} world is mostly +supported by volunteers. \gls{ctan} itself is maintained by a very small +group (currently two people). It's not like a commercial company +with 24/7 support and hundreds of paid employees constantly updating +the software. At its core, \TeX\ is a community effort. While some +volunteers actively maintain and update their classes or packages, +some people move on to other things and stop maintaining their work. +Occasionally, if the class or package is popular, someone else +might take over maintenance. There is no dedicated helpdesk to go +to, but there are many ways of getting help, see +\appendixref{ch:help} + +\setnode{overview} +\section{Overview} + +This document is structured as follows: + +\begin{description} + +\item[\chapterref{ch:def}] +defines terms that will be used throughout this document. I +strongly suggest that you look through this +\latexhtml{chapter}{section} before you start so that you understand +the terminology used in this document. At the very least, you should +read the first part that details how corresponding input and output +is displayed in this document\dash you need to understand the +difference between \dq{input} (source code) and \dq{output} (how the +source code will appear in the typeset document).\html{ Note that it +is not always possible to reproduce an exact replica of the output +in the HTML version, so if in doubt, look at one of the PDF versions +instead, which can be downloaded from this +book's \htmladdnormallink{home page}{../index.html}.} + +\item[\chapterref{ch:tex2pdf}] details the software that you will +need to use \LaTeX\ and describes how to use the software. + +\item[\chapterref{ch:simpledoc}] shows you how to create a very +basic document. + +\item[\chapterref{ch:sections}] +shows you how to create chapters and other sectional units so that +you end up with a fully structured document. + +\item[\chapterref{ch:graphicx}] +shows you how to include external image files and how to scale and +rotate text. + +\item[\chapterref{ch:floats}] +describes how to create figures and tables. + +\item[\chapterref{ch:newcom}] +describes how to define your own commands, and redefine existing +commands. + +\item[\chapterref{ch:maths}] describes how +to typeset mathematics. + +\item[\chapterref{ch:newenv}] describes how to define new +environments. + +\item[\chapterref{ch:counters}] +discusses how numbers are stored in counters, how to change their +values, and how to define your own counter. + +\item[\appendixref{ch:installsty}] shows you how +to download and install additional +packages that weren't installed with your \TeX\ distribution. + +\item[\appendixref{ch:errors}] +documents possible errors you may encounter, and gives advice on how +to fix them. + +\item[\appendixref{ch:help}] gives pointers on where to go for help. + +\end{description} + +Throughout this document there are pointers to related topics +in the \gls{ukfaq}. +\latexhtml{These are displayed in the margin in +square brackets, as illustrated on the +\ifbookorother{\ifthispageodd{right}{left}}{right}.}{% +These are displayed in the text like this:}% +\faq{What is LaTeX?}{latex} You may find these resources useful in +answering related questions that are not covered in this +book. +\begin{latexonly} +\doifbook{% + To find the resources, go to \url{http://www.tex.ac.uk/faq} and + either look for the question title in the list, or enter a keyword + in the search field.% +} + +This book and associated files, including +solutions to the exercises, are available on-line at: +\url{\baseurl/latex/novices/}. +\doifnotbook +{% + The links in this document are colour-coded: internal links are + blue, external links are magenta. +}% +\end{latexonly} + +\setnode{reading} +\section{Recommended Reading} + +This document is designed as an introductory text, not a +comprehensive guide. For further reading try some of the +following\faq{Books on LaTeX}{latex-books}: + +\latexbook\ is the user guide and reference manual for \LaTeX, and +is a good basic text for anyone starting out, however it doesn't +cover AMS\TeX\faq{What are the AMS packages?}{AMSpkg}, so anyone who +needs to typeset more than basic mathematics may prefer either +\latexguide\ or \latexcomp. Both these books cover AMS\TeX, +\iBiBTeX\ and \appname{makeindex}. + +In the same series as \emph{The \LaTeX\ Companion}, there is also +\latexgraphic\ which details how to illustrate +documents with \LaTeX\ and PostScript, including a chapter on colour +(coloured text, background, tables and slides). This is recommended +to anyone who is contemplating heavy use of graphics, but you do need +a basic knowledge of \LaTeX\ before delving into it. + +The final book in the \dq{Companion} series which you may find useful +is \latexweb. This is recommended for those interested in creating +documents for the web, either as HTML or PDF. It details how +to convert \LaTeX\ documents into HTML using various applications +such as \appname{LaTeX2HTML} and \appname{TeX4ht}, and how to create +PDF documents using \iPDFLaTeX\faq{What is PDFTeX?}{whatpdftex}, +including how to create active links within your document using the +\isty{hyperref} package. + +There are two new \LaTeX\ books that I haven't read but have +been recommended to me: \emph{\LaTeX\ Beginner's +Guide}~\cite{kottwitz} and \emph{\LaTeX\ and +Friends}~\cite{vandongen}. + +Note that the \gls{uktug} has a 25\% book discount scheme +for members. See \url{http://uk.tug.org/membership} for more details +of that and other associated benefits. If you're not in the +UK, have a look at \url{http://www.tug.org/usergroups.html} to see +if there is a local user group in your area. + +There is also a wealth of \LaTeX-related information on the +Internet\faq{How to get help}{gethelp}. \reportlinebreak\Gls{ctan} is a good place +to start. You can check the on-line catalogue~\cite{texcat} for +information about available software and, as mentioned earlier, there is also the list of +\htmladdnormallink{frequently asked +questions}{http://www.tex.ac.uk/faq} which I~recommend you try if +you have any queries. See also \appendixref{ch:help} + +%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{definitions} +\printkeywords +\html{\input{novices.hkls}} + + +\glsaddall[types=keywords] + +%%%%%%%%%%%%%%%%%%%%%% SOURCE TO PDF %%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{fromsource2output} +\chapter{From Source Code to Typeset Output} +\label{ch:tex2pdf} + +Every time you want to create or edit a \LaTeX\ document, there are three +basic steps you will always need to follow: + +\begin{enumerate} +\item\label{itm:step1} Write or edit the \gls{source}. + +\item\label{itm:step2} Pass the source code to the \iappname{latex} or \iappname{pdflatex} application (\dq{\LaTeX\ the document}). + +\begin{itemize} +\item If there are any error messages, return to \objectref{Step}{itm:step1}. +\item If there are no error messages, a +\glslink{output}{PDF file}\indexPDF\ is created. +\end{itemize} + +\item\label{itm:step3} View the \glslink{output}{PDF file} to check +the result. If you need to modify your document, go back to +\objectref{Step}{itm:step1}. +\end{enumerate} + +You will therefore need: + +\begin{enumerate} +\item A text editor (to perform \objectref{Step}{itm:step1}). For +example \iappnamelink[,]{Vim}{http://www.vim.org/} +\iappnamelink{Emacs}{http://www.gnu.org/software/emacs/} or +\iappnamelink[.]{Gedit}{http://projects.gnome.org/gedit/} + +\refstepcounter{object}\label{obj:MiKTeX}% +\item The \gls{tex} software\faq{(La)TeX for different +machines}{TeXsystems} (to perform \objectref{Step}{itm:step2}). If +you don't already have \TeX\ on your machine, you will need to +install it. The most convenient way to do this is +to install from the \TeX\ Collection DVD ROM, which is distributed +to all \gls{tug} members, but you can also download and install free +\TeX\ distributions, such as \itexdistro{TeX~Live}, +\itexdistro{MiKTeX} or \itexdistro{MacTeX}, from the Internet (see +\xpageref{below}{obj:install}). There is also \itexdistro{proTeXt}, +an enhancement of \texdistro{MiKTeX} that aims to be an +easy-to-install \TeX\ Distribution. For more information including +up-to-date links, go to \url{http://www.ctan.org/starter.html}. + +\item A PDF viewer (to perform +\objectref{Step}{itm:step3}). For example +\iappnamelink[,]{Adobe Reader}{http://www.adobe.com/} +\iappnamelink[,]{Sumatra}{http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html} +\iappnamelink{Evince}{http://projects.gnome.org/evince/} or +\iappnamelink[.]{Okular}{http://okular.kde.org/} + +\end{enumerate} + +This can be rather complicated for a beginner, especially for those +with no experience writing computer code. Fortunately, there are +some all-in-one applications (often called a \keyword{front-end}) +that provide a text editor (for \objectref{Step}{itm:step1}), +buttons or menu items to run the \appname{latex} or +\appname{pdflatex} \glslink{terminal}{command-line application} (for +\objectref{Step}{itm:step2}) and, in some cases, a viewer to perform +\objectref{Step}{itm:step3}. + +\sectionref[The next section]{sec:texworks} describes one such front-end called +\iappnamelink[.]{TeXWorks}{http://www.tug.org/texworks/} I~have chosen +to describe TeXWorks because it is a free, cross-platform +application. Binaries are available for Microsoft Windows, Mac~OS~X +and GNU/Linux. The screen shots of TeXWorks in this +book were taken from the Linux version running +under Fedora. If you run TeXWorks on other operating systems, it may +have a slightly different look, but it has the same functionality. + +New versions of \texdistro{TeX~Live} and \texdistro{MiKTeX} include TeXWorks for MS~Windows, +and new versions of \texdistro{MacTeX} include TeXWorks for Mac~OS~X users. +GNU/Linux users can use their Add\slash Remove Software utility to +install TeXWorks. Alternatively, you can download TeXWorks by +following the links provided at \url{http://www.tug.org/texworks/}. + +\refstepcounter{object}\label{obj:install}% +If you're confused by all the options, let's keep +things as simple as possible: + +\begin{itemize} + +\item MS~Windows: + + You have a choice between \texdistro{MiKTeX} (or \texdistro{proTeXt}) and + \texdistro{TeX~Live}. \texdistro{MiKTeX} provides a + smaller and quicker installation, but the downside is that you may + not have the classes or packages you want to use. \texdistro{MiKTeX} can + install these whenever you try to \LaTeX\ a document that uses them, + but you need an Internet connection while it does this. + \texdistro{TeX~Live} installs everything, so it takes longer and needs + more space, but you should have the majority of packages and classes that you need. + + \begin{description} + + \item[TeX~Live:]\mbox{} + + \begin{enumerate} + \item Fetch and unpack + \url{http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip} + + \item Run \iappname{install-tl} and follow the instructions. + This can take an hour or more. + \end{enumerate} + + \item[proTeXt:]\mbox{} + + \begin{enumerate} + \item Go to \url{http://tug.org/protext/} + + \item Click on the \dq{download the self-extract protext.exe} link + to download and run the executable. + \end{enumerate} + + \item[MiKTeX:]\mbox{} + + \begin{enumerate} + \item Go to \url{http://www.miktex.org/} + + \item In the left-hand panel, there is a link to the download page + for the latest version. At time of writing, it is \texdistro{MiKTeX}~2.9. + Click on that link. + + \item Scroll down to the section \dq{Installing a basic + \texdistro{MiKTeX} system}. + + \item If you're happy with the selected mirror location, click on the + \dq{Download} button. + + \item Run the executable. + \end{enumerate} + \end{description} + +\item Mac~OS~X: + + \begin{enumerate} + \item Go to \url{http://tug.org/mactex/} + + \item Follow the instructions on that page. + \end{enumerate} + +\item GNU/Linux: + + \begin{enumerate} + \item Fetch and unpack + \url{http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz} + + \item Follow the instructions at + \url{http://tug.org/texlive/quickinstall.html} + + \item Once \texdistro{TeX~Live} has finished installing, run your + system's \dq{Add\slash Remove Software} tool. + + \item Find \dq{texworks}, select the newest version and install. + \end{enumerate} + +\end{itemize} + +If you run into problems, there are mailing lists at +\url{http://tug.org/mailman/listinfo/tex-live} and +\url{http://docs.miktex.org/manual/lists.html} for +\itexdistro{TeX~Live} and \itexdistro{MiKTeX}, and +\itexdistro{MacTeX} help at \url{http://www.tug.org/mactex/help/}. +There is also a list of places where you can ask for help in +\appendixref{ch:help}. + +%%%%%%%%%%%%%%%%%%% TeXWorks %%%%%%%%%%%%%%%%%%%%% + +\setnode{texworks} +\section{TeXWorks} +\label{sec:texworks} + +Hopefully you've managed to successfully install \gls{tex} and TeXWorks as +described \latexhtml{above}{in the \htmlref{previous +section}{ch:tex2pdf}}, so let's test it out. + +First run TeXWorks. On Windows, you can access it via the +\menu{Start} menu. On GNU/Linux, it's probably located in +\menu{Applications}\menuto\menu{Office}, or you can type +\iappname{texworks} in a \gls{terminal}. You should now see the TeXWorks +window. The button marked +with a grey triangle in a green circle is the build or typeset function. It +runs the application in the drop-down list next to it. This is set to +pdfLaTeX, which is what we want for now. + +It's a good idea to switch on the syntax highlighting, if it isn't +already on. This is done via the \menu{Format}\menuto\menu{Syntax +Coloring} sub-menu. Make sure the \menu{LaTeX} item is selected. + +Next, type in the following sample source code, as shown in \figureref{fig:texworks2} +(the commands used here will be described in more detail in +\chapterref{ch:simpledoc}): +\begin{code} +\begin{verbatim} +\documentclass{scrartcl} + +\begin{document} + +This is an example document. + +\end{document} +\end{verbatim} +\end{code} +\textbf{Pay close attention to the backslashes at the start of each +command name.} If you find the font is a bit too small for you, +you can make it larger using the \menu{Format}\menuto\menu{Font} menu item. +\emph{This doesn't affect the font size in your PDF file, just the +font size of your code.} This displays the \dq{Select Font} dialog +box. Set the font size as appropriate. + +Then save the document, using the +\menu{File}\menuto\menu{Save As} menu item. I~called my document +\texttt{example1.tex} (remember the \texttt{.tex} extension and +stick to file names that only consist of alphabetical characters, +digits and hyphens\dash don't uses spaces or underscores). + +\begin{figure}[htbp] +\figconts + {pictures/texworks2} + {% + \caption[Source Code for an Example Document]{Source Code for an + Example Document. (Syntax highlighting switched on.)}% + }% + {fig:texworks2} +\end{figure} + +Now that you have saved the file, you can run pdfLaTeX. Make sure +the drop-down list next to the build button has \dq{pdfLaTeX} +selected and click on the build button. If all goes well, a new +window should open displaying the typeset document +(\figureref{fig:texworks3}). + +\begin{figure}[htbp] +\figconts + {pictures/texworks3} + {% + \caption{The Typeset Document} + }% + {fig:texworks3} +\end{figure} + +\begin{figure}[htbp] +\figconts + {pictures/texworks4} + {% + \caption{The Source Code Has a Misspelt Command} + }% + {fig:texworks4} +\end{figure} + +Now let's see what happens if there is an error in the source code. +In \figureref{fig:texworks4} I~have misspelt the +\glsni{documentclass} command. This time, when I~click on the +build button, I~get the error message: +\begin{verbatim} +! Undefined control sequence. +l.1 \documentclas + {scrartcl} +? +\end{verbatim} +(Shown in \figureref{fig:texworks5}.) + +\begin{figure}[htbp] +\figconts + {pictures/texworks5-annote} + {% + \caption{An Error Message is Displayed}% + }% + {fig:texworks5} +\end{figure} + + +Here \dq{Undefined control sequence} means an unrecognised command, +and below that message, \dq{\texttt{l.1}} means the error was encountered on +line~1. An input line at the bottom of the window has appeared with a +cursor. \LaTeX\ is in interactive mode +and is awaiting a response. There are several responses, but I'm +only going to mention two of them: +\begin{enumerate} +\item Type \texttt{h} and press the Return/Enter key \enter. This displays +a short help message and awaits a new response (see +\figureref{fig:texworks6}). + +\item Type \texttt{x} and press Return/Enter. This aborts the +\LaTeX\ run. +\end{enumerate} + +Notice that the green circle button with the grey triangle has turned +into a red stop button. This button can be used to abort the +process instead of typing \texttt{x}. + +\begin{figure}[htbp] +\figconts + {pictures/texworks6} + {% + \caption{A Short Help Message}% + }% + {fig:texworks6} +\end{figure} + +Now, there is a second tab at the bottom of the TeXWork's window +(\figureref{fig:texworks7}). This lists the error message and +provides a link to the line where the error occurred. Clicking on +this link highlights line~1. Next I~need to fix the error by +correcting the spelling of the command. Once it's fixed, I~can click +on the build button. + +\begin{figure}[htbp] +\figconts + {pictures/texworks7} + {% + \caption{Error Tab}% + }% + {fig:texworks7} +\end{figure} + +Here's another error you might encounter: I'm now going to misspell +the class name. It should be \texttt{scrartcl}, but in +\figureref{fig:texworks8} it has been misspelt. This time, when I +click on the build button, I~get the error: +\begin{verbatim} +! LaTeX Error: File `scrartc.cls' not found. +\end{verbatim} +I~have two choices: type in the correct name on the line below +\dq{Enter file name:} or I~can abort the process using the red abort +button. In either case I~need to go back and fix the error in my +code. + +\begin{figure}[htbp] +\figconts + {pictures/texworks8} + {% + \caption{Misspelt Class File}% + }% + {fig:texworks8} +\end{figure} + + +%%%%%%%%%%%%% CREATING A SIMPLE DOCUMENT %%%%%%%%%%%%%%%%%% + +\setnode{simpledoc} +\chapter{Creating a Simple Document} +\label{ch:simpledoc} + +Having installed and tested the software, let's now look at how to +actually write the \gls{source}. The very first line of any document that you create must have +the \gls{command}: +\begin{definition} +\gls{documentclass}\oarg{\meta{option-list}}\marg{\meta{class-name}} +\end{definition}% +This tells \LaTeX\ what type of document you want to create +(for example an article, a technical report or correspondence). The +\glsni{documentclass} command takes one \gls{mandatory}, \meta{class-name}, +that specifies the \gls{cls}. + +There are many class files available, and some publishers, +institutions or journals provide their own custom classes (for +example, the \icls{jmlr} class for the Journal of Machine Learning +Research). Popular classes include \icls{memoir} (for books and +reports) and those supplied in the \koma\ bundle (for books, +reports, articles and correspondence). There's also \icls{beamer} +(for presentations) as well as classes for typesetting exams, +flashcards, concert programmes etc. For simplicity, this +book will concentrate on three of the +\koma\ classes \icls{scrartcl} (for articles), \icls{scrreprt} +(for technical reports, theses etc) and \icls{scrbook} (for books). + +We'll start with a very simple document, so let's use the +\icls{scrartcl} class file. In this case the very first line of the +\gls{source} should be: +\begin{codeS} +\glsni{documentclass}\marg{scrartcl} +\end{codeS} +The \glsni{documentclass} command also takes an +\gls{optional}, \meta{option-list}, +which should be a comma separated list of options to be passed to the +class file. This allows you to override the class file defaults. +For example, the \icls{scrartcl} class file by default uses A4 +paper, but if you are in the USA you will probably want to use +letter paper. This can be achieved +using the option \clsopt{letterpaper}. So you would need to edit the +above line to: +\begin{codeS} +\glsni{documentclass}\oarg{letterpaper}\marg{scrartcl} +\end{codeS} +\refstepcounter{object}\label{obj:sizeopt}% +Let's change another option. The normal font size is \clsopt{11pt} +by default, but we have the option to change it, so let's use +\clsopt{12pt}: +\begin{codeS} +\glsni{documentclass}\oarg{letterpaper,12pt}\marg{scrartcl} +\end{codeS} +You can also change your document so that it is in a two-column +format using the \clsopt{twocolumn} option: +\begin{codeS} +\glsni{documentclass}\oarg{letterpaper,12pt,twocolumn}\marg{scrartcl} +\end{codeS} + +After deciding what type of document you want, you now need to specify +the contents of the document. This is done inside the \gls{env-document} +\gls{environment}. The document is started with the +command: +\begin{codeS} +\glsni{begin}\marg{document} +\end{codeS} +and ended with +\begin{codeS} +\glsni{end}\marg{document} +\end{codeS} +(\LaTeX\ stops reading the file when it reaches the above line, so +anything occurring after it is ignored.) + +My \gls{source} now looks like: +\begin{code} +\glsni{documentclass}[12pt]\marg{scrartcl}\newline +\mbox{}\newline +\glsni{begin}\marg{document}\newline +\mbox{}\newline +\glsni{end}\marg{document} +\end{code} +Every document you create must have this form. You can't simply +start typing the document text. You must first specify +your class file\indexCLS, and then place the contents of the document +inside the \glsni{env-document} environment.\screenpagebreak + +So far so good, but at the moment we have an empty document, so we +won't get any output. Let's now put some text into our document: +\begin{code} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrartcl} + +\glsni{begin}\marg{document} + +This is a simple document. +Here is the first paragraph. + +Here is the second paragraph. As you +can see it's +a rather +short paragraph, but not as short as the previous one. + +\glsni{end}\marg{document} +\end{alltt} +\end{code} + +\xminisec{Top Five Mistakes Made by New Users} +I first started teaching \LaTeX\ in 1998, and these are the most +common errors I've seen when people start learning \LaTeX: +\begin{enumerate} +\item Missing out the backslash \glsni{backslashchar} at the start +of one or more of the \glspl{command}. + +\item Using a forward slash \glsni{slashchar} instead of a backslash +\glsni{backslashchar}. + +\item Forgetting \texttt{\glsni{end}\marg{document}}. + +\item Misspelling \dq{document} (in +\texttt{\glsni{begin}\marg{document}} and +\texttt{\glsni{end}\marg{document}}). + +\item Missing a closing brace \glsni{rightbracechar}. + +\end{enumerate} +If you encounter any problems when you start out, go through that check list first. +Then check \appendixref{ch:errors}. + +Whenever you start a new document, always type in the +\glsni{documentclass}, \texttt{\glsni{begin}\marg{document}} and +\texttt{\glsni{end}\marg{document}} commands first +(\figureref{fig:newdoc-1}). Then move your cursor between the +\glsni{begin} and \glsni{end} lines and type the document text +(\figureref{fig:newdoc-2}). + +\begin{figure}[htbp] +\figconts + {pictures/newdoc-1} + {% + \caption[Starting a New Document (1)]{Starting a New Document: + always type these three lines first.}% + }% + {fig:newdoc-1} + +\ifscreenorother +{% + \end{figure} + \begin{figure}[htbp] +}% +{% + \strut +} + +\figconts + {pictures/newdoc-2} + {% + \caption[Starting a New Document (2)]{Starting a New Document: + move the cursor inside the \glsni{env-document} environment and + start typing the document text.}% + }% + {fig:newdoc-2} +\end{figure} + +\begin{exercise}{Simple Document}{ex:simpledoc} + +Try typing the code in the above example into TeXWorks or the editor +of your choice (see \chapterref[the previous section]{ch:tex2pdf} if +you can't remember what to do.) You can also \download{simpledoc} a +copy of this file, but I~recommend that you try typing it in to give +yourself some practice. + +Things to note while you are typing: firstly, when you press the +return character at the end of a line this end-of-line character is +converted into a space in the \gls{output}. So the +fact that I~have some very ragged lines in my \gls{source} has +no effect on the final result. (Note that some front-ends will +reformat your lines as you type.) Whereas a completely blank line +will be converted into a paragraph break (\gls{par} has the same +effect). + +Secondly, multiple \Index{spaces} are converted into a single space, +so the large gap between the words \dq{\texttt{can}} and \dq{\texttt{see}} is +no different from having a single space. + +Once you have typed up your \gls{source}, save your file +(called, for example, \texttt{exercise1.tex}), and run PDF\LaTeX\ as described in +\sectionref{sec:texworks}. If all goes well, TeXWorks should display +the resulting PDF file in a new window, usually alongside the window +containing the source code. + +\xminisec{Notes:} +\begin{enumerate} + +\item Each paragraph automatically starts with an indentation in the +PDF. + +\item There is no blank line between the paragraphs in the PDF +document. (See what happens if you add the \koma\ class option +\scrclsopt[full]{parskip}: +\begin{codeS} +\glsni{documentclass}\oarg{12pt,parskip=full}\marg{scrartcl} +\end{codeS} +and rebuild the PDF.) + +\item Move the mouse over one of paragraphs in the PDF viewer and +pop-up the context menu (usually a right mouse click). Select +\menu{Jump to Source}. The window containing the source code should +now gain the focus and the line of code matching the typeset line you clicked on +in the PDF should now be highlighted. + +\end{enumerate} + +\end{exercise} + +%%%%%%%%%%%%%%%%%% Simple Commands %%%%%%%%%%%%%%%%%% + +\setnode{simplecommands} +\section{Using Simple Commands} +\label{sec:simple} + +\faq{Typesetting all those TeX-related logos}{logos}Now let's try +adding a few simple \glspl{command} to our +document. The command \gls{LaTeX} produces the +\makeimg{ALT=LaTeX}{\LaTeX} logo and the command \gls{today} prints +the current date. \LaTeX\ always ignores any spaces that follow a +command name that consists of letters, as it uses the space to +indicate the end of the command name. This means that if we want a +space to occur immediately after the command, we need to explicitly +say so using the command \gls{spacesym} (recall from +\ifscreenorother{\htmlref{earlier}{obj:visiblespace}}{page~\pageref{obj:visiblespace}} +\gls{visiblespace} indicates a space character). So, for example: +\begin{codeS} +\glsni{LaTeX}\glsni{spacesym}logo +\end{codeS}% +produces the output: +\begin{resultS}[LaTeX logo] +\LaTeX\ logo +\end{resultS}% +Some people when starting out can get a bit confused by this and +read it as the entity \dq{\cmdname{LaTeX}\cmdname{}} whereas it is +in fact two commands: \dq{\cmdname{LaTeX}} (print the \LaTeX\ logo) +followed \dq{\cmdname{\ }} (print a space.) + +Let's also try using a command that takes an +\gls{argument}. The command +\begin{definition} +\gls{footnote}\refstepcounter{object}\label{cmd:footnote}\marg{\meta{text}} +\end{definition}% +takes one argument that specifies the text that should +appear in the footnote. This command must be placed where you want +the footnote marker to appear. + +\begin{exercise}{Using Simple Commands}{ex:simple} + +Edit the document you created in \exerciseref{ex:simpledoc}, +so that it looks like the following: (You can \download{simple} it if +you like, but again it is better if you try typing it in yourself.) +\begin{bcode} +\glsni{documentclass}\oarg{12pt}\marg{scrartcl}\newline +\mbox{}\newline +\glsni{begin}\marg{document}\newline +\mbox{}\newline +This is a simple \glsni{LaTeX}\glsni{spacesym}document. +Here is the first paragraph.\newline +\mbox{}\newline +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}.\newline +\glsni{end}\marg{document} +\end{bcode} + +Now \htmlref{\LaTeX\ your document}{ch:tex2pdf} and view the result. +(Remember to check \appendixref{ch:errors} +if you have a problem.) You should see the \LaTeX\ logo, the footnote +marker and the current date. If you scroll down to the bottom of the +page, you should see the footnote. +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%%%% PACKAGES %%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{packages} +\section{Packages} +\label{sec:packages} + +Packages\indexSTY\ are files with the extension \texttt{.sty} that +either define new \glspl{command} or redefine +existing commands\faq{What are LaTeX classes and packages?}{clsvpkg}. +They're like a type of add-on or plug-in. Most of the commonly used +packages should have been installed when you installed your \gls{tex} +distribution (see \chapterref{ch:tex2pdf}). +\appendixref{ch:installsty} covers how to install new packages. +Most packages come with documentation that can be accessed using the +\iappname{texdoc} application described in \sectionref{sec:texdoc}. + +Packages are loaded in the \gls{preamble} (after +\gls{documentclass} and before \glsni{begin}\marg{document}) using +\begin{definition} +\gls{usepackage}\oarg{\meta{option list}}\marg{\meta{package}} +\end{definition} +where \meta{package} is the name of the package and \meta{option +list} is a list of comma-separated options. For example, to load the +package \isty{graphicx} with the \istyopt{graphicx}{draft} option: +\begin{codeS} +\glsni{usepackage}\oarg{draft}\marg{graphicx} +\end{codeS} +Any applicable class options are also passed to packages, so in +\begin{code} +\gls{documentclass}\oarg{draft}\marg{scrartcl}\newline +\glsni{usepackage}\marg{graphicx} +\end{code} +the \clsopt{draft} option is set for both the \icls{scrartcl} class +and the \isty{graphicx} package. + +You can specify more than one package in the argument of +\glsni{usepackage}, where each package name is separated by a +comma. For example: +\begin{codeS} +\glsni{usepackage}\marg{amsmath,amsfonts} +\end{codeS} +The \isty{graphicx} package is covered in \chapterref{ch:graphicx} +and the \isty{amsmath} package is covered in \chapterref{ch:maths}, +so let's start out with a~relatively simple example. + +\setnode{datetime} +\subsection{Changing the Format of +\latexhtml{\texorpdfstring{\protect\cmdname{today}}{\protect\textbackslash +today}}{\protect\cmdname{today}}} +\label{sec:today} + +In the \htmlref{previous exercise}{ex:simple}, we used the +\gls{today} command to produce the current date. By default, this +command displays the date in US format. To illustrate how to use +packages, this section will look at how to use the \isty{datetime} +package to change the way that \gls{today} displays the date. + +The \isty{datetime} package has various options that can be used to +change the format of \gls{today}. For example, by default the +\isty{datetime} package redefines \gls{today} to display the +date in the form: {\showdowtrue\longdate +\renewcommand{\fmtord}[1]{\textsuperscript{#1}}\docdate}. The option +\istyopt{datetime}{short} will produce an abbreviated form, (for +example {\shortdate\docdate}) and the option \istyopt{datetime}{nodayofweek} +won't display the day of the week (for example +{\showdowfalse\docdate}). +For those who don't like the raised ordinal, there is the +\istyopt{datetime}{level} option. +These can be passed as a comma separated list in the +\gls{optional} to the +\gls{usepackage} command. It is also possible to use a +declaration instead. For example, to redefine \gls{today} to +display the date in the form {\ddmmyyyydate\docdate}, you can either do +\begin{codeS} +\glsni{usepackage}\oarg{ddmmyyyy}\marg{datetime} +\end{codeS}% +or +\begin{code} +\begin{alltt} +\glsni{usepackage}\marg{datetime} +\gls{ddmmyyyydate} +\end{alltt} +\end{code} + +The \isty{datetime} package also defines the command +\begin{definition} +\gls{currenttime} +\end{definition} +which displays the current time, where again +the format can be changed by the package options. So the option +\istyopt{datetime}{12hr} will cause \glsni{currenttime} to display +the date in 12 hour format (for example, \ampmtime) and the option +\istyopt{datetime}{24hr} will cause \glsni{currenttime} to display +the date in 24 hour format (for example, \xxivtime). + +\begin{exercise}{Using the datetime Package}{ex:datetime} + +Edit your document from \exerciseref{ex:simple} so that it uses the \isty{datetime} +package. Experiment with the different package options, for example +\begin{codeS} +\glsni{usepackage}\oarg{short,nodayofweek,level,12hr}\marg{datetime} +\end{codeS} +and add the current time +\begin{codeS} +This document was created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. +\end{codeS} +You can \downloadorview{datetime} an example. +For a full list \isty{datetime} of package options, see the +\sty{datetime} \htmlref{documentation}{sec:texdoc}. +\latex{(Refer to \sectionref{sec:texdoc} on how to find package +documentation.)} + +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%% Special Characters %%%%%%%%%%%%%%%%%%%% + +\setnode{symbols} +\section{Special Characters and Symbols} +\label{sec:chars} + +You can use most of the standard characters that you find on your keyboard, but the +10 symbols shown in \tableref{tab:specialchars} have a special +meaning. + +\begin{table}[htbp] +\caption{Special Characters} +\label{tab:specialchars} +\centering +\begin{makeimage}\end{makeimage} +\glsi{leftbracechar} \glsi{rightbracechar} +\glsi{percentchar} +\glsi{ampchar} +\glsi{dollarchar} +\glsi{hashchar} +\glsi{underscorechar} +\glsi{circumchar} +\glsi{tildechar} +\glsi{backslashchar} +\end{table} + +We have already used the curly braces \gls{leftbracechar} and +\gls{rightbracechar}. The percent symbol \gls{percentchar} is a +comment character. Everything from the percent symbol up to the end +of line is ignored by \LaTeX. This means you can have comments in +your \gls{source} to remind you what a particular part of your code +is doing. We have also used the backslash symbol +\glsni{backslashchar} which indicates that we are using a \LaTeX\ +command, as in \glstext{LaTeX} or \glstext{today}. The meaning of +the other special characters will be covered later. + +So what do you do if you want one of these symbols to actually appear +in your document? \faq{Where can I find the symbol for +\ldots?}{symbols} \tableref{tab:symbols} lists commands that produce +these and other symbols\faq{How to get copyright, trademark, +etc}{tradesyms}. Note that some of the commands have short cuts, such +as \glsni{emdash} instead of \glsni{textemdash} and +\glsni{questiondown} instead of \glsni{textquestiondown}. + +The symbol \texttt{`} is the backtick (or grave) symbol, as +opposed to the apostrophe symbol~\texttt{'}. \latexhtml{The backtick +symbol usually looks like~\texttt{\`{}} on a keyboard, and on}{On} +most UK keyboards it is situated to the left of the \texttt{1}~key. +The opening double quote is created using two adjacent backtick +symbols and the closing double quote with two adjacent +apostrophe symbols. This gives 66 and 99 style quotes, which you +wouldn't get using the double quote symbol on your keyboard. + +Note that the symbols \gls{barchar} \gls{ltchar} and \gls{gtchar} have to +be created using \glsni{textbar}, \glsni{textless} and +\glsni{textgreater} when in normal text mode. If you try to enter +them using the corresponding keyboard characters you may get +\makeimg{em dash}{\textemdash} \makeimg{upside down exclamation +mark}{\textexclamdown} and \makeimg{upside down question +mark}{\textquestiondown}. (They do however work if you are in +\htmlref{maths mode}{ch:maths}.\footnote{There are also some text +fonts that will display them correctly, but don't rely on it.}) The +slash character \gls{text.slash} may be used directly, as in +\dq{\texttt{and\glsni{text.slash}or}}, but no line break will be permitted at the slash, +whereas \glsni{slash} (as in \dq{\texttt{and\glsni{slash}\glsni{visiblespace}or}}) will allow a +line break at that point. + +\begin{table}[htbp] +\caption{Symbols} +\label{tab:symbols} +\centering +\begin{latexonly} +\begin{tabular}{@{}ll@{\hspace{4\tabcolsep}}ll@{\hspace{4\tabcolsep}}ll@{}} +\begin{inlinedef}\gls{textbackslash}\end{inlinedef} & \textbackslash& +\begin{inlinedef}\gls{slash}\end{inlinedef} & \slash & +\begin{inlinedef}\gls{textgreater}\end{inlinedef} & \textgreater \\ +\begin{inlinedef}\gls{textasciicircum}\end{inlinedef} & \textasciicircum & +\begin{inlinedef}\gls{dollar}\end{inlinedef} & \$ & +\begin{inlinedef}\gls{textbar}\end{inlinedef} & \textbar \\ +\begin{inlinedef}\gls{textasciitilde}\end{inlinedef} & \textasciitilde& +\begin{inlinedef}\gls{leftbrace}\end{inlinedef} & \{ & +\begin{inlinedef}\gls{textless}\end{inlinedef} & \textless \\ +\begin{inlinedef}\gls{pounds}\end{inlinedef} & \pounds & +\begin{inlinedef}\gls{rightbrace}\end{inlinedef} & \} & +\begin{inlinedef}\gls{dag}\end{inlinedef} & \dag \\ +\begin{inlinedef}\gls{textregistered}\end{inlinedef}& +\textregistered& +\begin{inlinedef}\gls{hash}\end{inlinedef} & \# & +\begin{inlinedef}\gls{ddag}\end{inlinedef} & \ddag \\ +\begin{inlinedef}\gls{texttrademark}\end{inlinedef} & \texttrademark & +\begin{inlinedef}\gls{percent}\end{inlinedef} & \% & +\begin{inlinedef}\gls{quoteright}\end{inlinedef} +or \begin{inlinedef}\gls{textquoteright}\end{inlinedef} & \textquoteright\\ +\begin{inlinedef}\gls{copyright}\end{inlinedef} & \copyright & +\begin{inlinedef}\gls{amp}\end{inlinedef} & \& & +\begin{inlinedef}\gls{quoteleft}\end{inlinedef} +or \begin{inlinedef}\gls{textquoteleft}\end{inlinedef} & \textquoteleft \\ +\begin{inlinedef}\gls{textbullet}\end{inlinedef} & \textbullet & +\begin{inlinedef}\gls{i}\end{inlinedef} & \i & +\begin{inlinedef}\gls{quotedblright}\end{inlinedef} +or \begin{inlinedef}\gls{textquotedblright}\end{inlinedef} & \textquotedblright\\ +\begin{inlinedef}\gls{questiondown}\end{inlinedef} +or \begin{inlinedef}\gls{textquestiondown}\end{inlinedef} & ?` & +\begin{inlinedef}\gls{j}\end{inlinedef} & \dotlessj & +\begin{inlinedef}\gls{quotedblleft}\end{inlinedef} +or \begin{inlinedef}\gls{textquotedblleft}\end{inlinedef} & \textquotedblleft\\ +\begin{inlinedef}\gls{exclamdown}\end{inlinedef} +or \begin{inlinedef}\gls{textexclamdown}\end{inlinedef} & !` & +\begin{inlinedef}\gls{dash}\end{inlinedef} & - & +\begin{inlinedef}\gls{endash}\end{inlinedef} +or \begin{inlinedef}\gls{textendash}\end{inlinedef} & \textendash \\ +\begin{inlinedef}\gls{emdash}\end{inlinedef} +or \begin{inlinedef}\gls{textemdash}\end{inlinedef} & \textemdash & +\begin{inlinedef}\gls{S}\end{inlinedef} & \S & +\begin{inlinedef}\gls{textperiodcentered}\end{inlinedef} & +\textperiodcentered\\ +\begin{inlinedef}\gls{ldots}\end{inlinedef} & \ldots & +\begin{inlinedef}\gls{P}\end{inlinedef} & \P & +\begin{inlinedef}\gls{underscore}\end{inlinedef} +or \begin{inlinedef}\gls{textunderscore}\end{inlinedef}& \_ +\end{tabular} +\end{latexonly} +\begin{htmlonly} +\begin{tabular}{ll|ll} +\begin{inlinedef}\gls{textbackslash}\end{inlinedef} & +\textbackslash& +\begin{inlinedef}\gls{underscore}\end{inlinedef}\space +or \begin{inlinedef}\gls{textunderscore}\end{inlinedef}& \_ \\ +\begin{inlinedef}\gls{dash}\end{inlinedef} & - & +\begin{inlinedef}\gls{endash}\end{inlinedef}\space +or \begin{inlinedef}\gls{textendash}\end{inlinedef} & \makeimg{en dash character}{\textendash} \\ +\begin{inlinedef}\gls{emdash}\end{inlinedef}\space +or \begin{inlinedef}\gls{textemdash}\end{inlinedef} & \makeimg{em dash character}{\textemdash} & +\begin{inlinedef}\gls{P}\end{inlinedef} & \P \\ +\begin{inlinedef}\gls{textasciicircum}\end{inlinedef} & \textasciicircum & +\begin{inlinedef}\gls{dollar}\end{inlinedef} & \$ \\ +\begin{inlinedef}\gls{S}\end{inlinedef} & \S & +\begin{inlinedef}\gls{textasciitilde}\end{inlinedef} & \textasciitilde\\ +\begin{inlinedef}\gls{leftbrace}\end{inlinedef} & \{ & +\begin{inlinedef}\gls{ldots}\end{inlinedef} & \ldots \\ +\begin{inlinedef}\gls{pounds}\end{inlinedef} & \pounds & +\begin{inlinedef}\gls{rightbrace}\end{inlinedef} & \} \\ +\begin{inlinedef}\gls{dag}\end{inlinedef} & +\makeimg{dagger symbol}{\dag} & +\begin{inlinedef}\gls{questiondown}\end{inlinedef}\space +or \begin{inlinedef}\gls{textquestiondown}\end{inlinedef} & +\makeimg{upside-down question mark}{?`} \\ +\begin{inlinedef}\gls{textregistered}\end{inlinedef}& +\makeimg{registered symbol}{\textregistered}& +\begin{inlinedef}\gls{hash}\end{inlinedef} & \# \\ +\begin{inlinedef}\gls{ddag}\end{inlinedef} & +\makeimg{double dagger symbol}{\ddag} & +\begin{inlinedef}\gls{exclamdown}\end{inlinedef}\space +or \begin{inlinedef}\gls{textexclamdown}\end{inlinedef} & +\makeimg{upside-down exclamation mark}{!`} \\ +\begin{inlinedef}\gls{texttrademark}\end{inlinedef} & \texttrademark & +\begin{inlinedef}\gls{percent}\end{inlinedef} & \% \\ +\begin{inlinedef}\gls{quoteright}\end{inlinedef}\space +or \begin{inlinedef}\gls{textquoteright}\end{inlinedef} & +\makeimg{closing single quote}{\textquoteright}& +\begin{inlinedef}\gls{quotedblright}\end{inlinedef}\space +or \begin{inlinedef}\gls{textquotedblright}\end{inlinedef} & +\makeimg{closing double quote}{\textquotedblright}\\ +\begin{inlinedef}\gls{copyright}\end{inlinedef} & \copyright & +\begin{inlinedef}\gls{amp}\end{inlinedef} & \& \\ +\begin{inlinedef}\gls{quoteleft}\end{inlinedef}\space +or \begin{inlinedef}\gls{textquoteleft}\end{inlinedef} & +\makeimg{opening single quote}{\textquoteleft} & +\begin{inlinedef}\gls{quotedblleft}\end{inlinedef}\space +or \begin{inlinedef}\gls{textquotedblleft}\end{inlinedef} & +\makeimg{opening double quote}{\textquotedblleft}\\ +\begin{inlinedef}\gls{textbullet}\end{inlinedef} & \makeimg{bullet point}{\textbullet} & +\begin{inlinedef}\gls{i}\end{inlinedef} & \makeimg{dotless i}{\i} \\ +\begin{inlinedef}\gls{j}\end{inlinedef} & \makeimg{dotless j}{\dotlessj} & +\begin{inlinedef}\gls{textbar}\end{inlinedef} & \textbar\\ +\begin{inlinedef}\gls{textperiodcentered}\end{inlinedef} & +\middot & +\begin{inlinedef}\gls{textless}\end{inlinedef} & \textless\\ +\begin{inlinedef}\gls{textgreater}\end{inlinedef} & \textgreater& +\begin{inlinedef}\gls{slash}\end{inlinedef} & / \\ +\end{tabular} +\end{htmlonly} + +\end{table} + +Ligatures and special symbols are shown in \tableref{tab:ligatures}. +(Note that, as mentioned in the \htmlref{introduction}{ch:intro}, the +f-ligatures are automatically converted.) When using a command in +the middle of a word, take care that the command doesn't run into the +rest of the word. For example, the British spelling of the word +man\oe{}uvre has an +\latexhtml{\oe}{oe}-ligature in the middle of it. +You will get an error if you try: +\begin{alltt}\wrong +man\cmdname{oe}uvre +\end{alltt} +as \LaTeX\ will interpret it as the command +\verb|\oeuvre| which doesn't exist. + +There are several ways to code this in \LaTeX: +\begin{enumerate} + +\item Place a space after the command: +\begin{codeS} +man\glsni{oe}\glsni{visiblespace}uvre +\end{codeS} + +\item Place an empty brace after the command: +\begin{codeS} +man\glsni{oe}\marg{}uvre +\end{codeS} + +\item Group the command: +\begin{codeS} +man\marg{\glsni{oe}}uvre +\end{codeS} +(This can adversely affect the kerning so is best avoided.) + +\end{enumerate} + +\begin{table}[htbp] +\caption[Ligatures and Special Symbols]{Ligatures and Special Symbols (Computer Modern Font)} +\label{tab:ligatures} +\centering +\begin{tabular}{ll@{\hspace{3\tabcolsep}}ll@{\hspace{3\tabcolsep}}ll@{\hspace{3\tabcolsep}}ll} +\gls{AE} & + \makeimg{upper case AE ligature}{\fontfamily{cmr}\selectfont\AE} & +\gls{ae} & + \makeimg{lower case ae ligature}{\fontfamily{cmr}\selectfont\ae} & +\gls{OE} & + \makeimg{upper case OE ligature}{\fontfamily{cmr}\selectfont\OE} & +\gls{oe} & + \makeimg{lower case oe ligature}{\fontfamily{cmr}\selectfont\oe}\\ +\Indextt{fi} & + \makeimg{fi ligature}{\fontfamily{cmr}\selectfont fi} & +\Indextt{ffi} & + \makeimg{ffi ligature}{\fontfamily{cmr}\selectfont ffi} & +\Indextt{fl} & + \makeimg{fl ligature}{\fontfamily{cmr}\selectfont fl} & +\Indextt{ffl} & + \makeimg{ffl ligature}{\fontfamily{cmr}\selectfont ffl}\\ +\gls{AA} & \makeimg{upper case A ring}{\fontfamily{cmr}\selectfont\AA} & +\gls{aa} & \makeimg{lower case a ring}{\fontfamily{cmr}\selectfont\aa} & +\gls{L} & \makeimg{upper case L with a stroke}{\fontfamily{cmr}\selectfont\L} & +\gls{l} & \makeimg{lower case l with a stroke}{\fontfamily{cmr}\selectfont\l}\\ +\gls{O} & \makeimg{upper case slashed O}{\fontfamily{cmr}\selectfont\O}& +\gls{o} & \makeimg{lower case slashed o}{\fontfamily{cmr}\selectfont\o} & +\gls{SS} & \makeimg{upper case Eszett}{\fontfamily{cmr}\selectfont\SS} & +\gls{ss} & \makeimg{lower case eszett}{\fontfamily{cmr}\selectfont\ss} +\end{tabular} +\end{table} + +\refstepcounter{object}\label{obj:accents}% +English speakers are by and large very lackadaisical when it comes +to accents, but accents affect pronunciation, and so are just as +important as the correct spelling. There is a big difference +between putting your knife into someone's p\^at\'e (meat paste), and +putting your knife into someone's pate (head)! + +Accented letters are created by specifying which accent you want, and +the letter on which to put the accent. The accent commands are +listed in \xtableref{tab:accents}, and each command takes one +\gls{mandatory}. The command indicates +what accent to use, and the argument indicates the letter on which to put +the accent. + +You may have noticed in \tableref{tab:symbols} the commands \gls{i} +and \gls{j} which produce a dotless i and j (\i\ and \dotlessj). +With old versions of \LaTeX\ (or \TeX) an accent over a normal +\dq{i} or \dq{j} left the original dot in, which is incorrect, so a +dotless \dq{\i} or \dq{\dotlessj} were required. With modern +distributions, an accented \dq{i} or \dq{j} is correctly rendered. + +\bookpagebreak +\xminisec{Example:} +\begin{code} +It's na\glsni{doublequote}ive to think that eating mouldy +p\glsni{circum}at\glsni{acute}e won't result in food poisoning. +\end{code}% +Result: +\begin{resultS}[naive.html] +It's na\"{\i}ve to think that eating mouldy p\^at\'e won't result in food poisoning. +\end{resultS}% + +\begin{table}[htbp] +\caption{Accent Commands} +\label{tab:accents} +\centering +\begin{tabular}{llc@{\hspace{3\tabcolsep}}llc} +\toprule + & \multicolumn{2}{c@{\hspace{3\tabcolsep}}}{Example} & + & \multicolumn{2}{c}{Example} \\ + Definition & Input & Output & Definition & Input & Output\\\midrule +\begin{inlinedef}\gls{acute}\marg{\meta{object}}\end{inlinedef} & +\verb|\'{c}| & \makeimg{c with an acute accent}{\'{c}} & +\begin{inlinedef}\gls{macron}\marg{\meta{object}}\end{inlinedef} & +\verb|\={c}| & \makeimg{c with a macron accent}{\={c}} \\ +\begin{inlinedef}\gls{grave}\marg{\meta{object}}\end{inlinedef} & +\verb|\`{c}| & \makeimg{c with a grave accent}{\`{c}} & +\begin{inlinedef}\gls{period}\marg{\meta{object}}\end{inlinedef} & +\verb|\.{c}| & \makeimg{c with a dot over it}{\.{c}} \\ +\begin{inlinedef}\gls{circum}\marg{\meta{object}}\end{inlinedef} & +\verb|\^{c}| & \makeimg{c with a circumflex}{\^{c}} & +\begin{inlinedef}\gls{tilde}\marg{\meta{object}}\end{inlinedef} & +\verb|\~{c}| & \makeimg{c with a tilde above}{\~{c}} \\ +\begin{inlinedef}\gls{doublequote}\marg{\meta{object}}\end{inlinedef} & +\verb|\"{c}| & \makeimg{c with an umlaut}{\"{c}} & +\begin{inlinedef}\gls{v}\marg{\meta{object}}\end{inlinedef} & +\verb|\v{c}| & \makeimg{c with a caron accent}{\v{c}} \\ +\begin{inlinedef}\gls{u}\marg{\meta{object}}\end{inlinedef} & +\verb|\u{c}| & \makeimg{c with a breve accent over it}{\u{c}} & +\begin{inlinedef}\gls{H}\marg{\meta{object}}\end{inlinedef} & +\verb|\H{c}| & \makeimg{c with double acute accent}{\H{c}} \\ +\begin{inlinedef}\gls{t}\marg{\meta{object}}\end{inlinedef} & +\verb|\t{xy}| & \makeimg{x and y with a tie over them}{\t{xy}} & +\begin{inlinedef}\gls{c}\marg{\meta{object}}\end{inlinedef} & +\verb|\c{c}| & \makeimg{c with a cedilla}{\c{c}}\\ +\begin{inlinedef}\gls{d}\marg{\meta{object}}\end{inlinedef} & +\verb|\d{c}| & \makeimg{c with a dot under it}{\d{c}} & +\begin{inlinedef}\gls{b}\marg{\meta{object}}\end{inlinedef} & +\verb|\b{c}| & \makeimg{c with a bar under it}{\b{c}}\\ +\begin{inlinedef}\gls{r}\marg{\meta{object}}\end{inlinedef} & +\verb|\r{c}| & \makeimg{c with a ring above}{\r{c}} & & &\\ +\bottomrule +\end{tabular} +\end{table} + +This book only covers a very small subset of available symbol +commands. If the command you want isn't here, try Scott~Pakin's +comprehensive symbol list~\cite{pakin09}. Another useful resource is +\iappnamelink[.]{detexify}{http://detexify.kirelabs.org/classify.html} + +\setnode{inputenc} +\subsection{The \sty{inputenc} Package} +\label{sec:inputenc} + +Instead of using the accent and ligature commands described +\htmlref{above}{sec:chars}, you can use the \isty{inputenc} package +and enter the character directly, but you must ensure you match the +encoding with that used by your text editor. For example, this book +uses UTF8 encoding so I~have loaded the \sty{inputenc} package in +the \glsterm{preamble} with the \istyopt{inputenc}{utf8} option: +\begin{codeS} +\glsni{usepackage}\oarg{utf8}\marg{inputenc} +\end{codeS} +Note that it's a good idea to also use the \isty{fontenc} package as +well. For example, if you want to use Type~1 fonts: +\begin{code} +\begin{alltt} +\glsni{usepackage}\oarg{T1}\marg{fontenc} +\glsni{usepackage}\oarg{utf8}\marg{inputenc} +\end{alltt} +\end{code} + +Returning to an earlier example, +I~can directly enter the Unicode character (U+0153) for the +lower case \oe\ ligature: +\bookpagebreak +% actually I can't do it because latex2html won't like it, but lets +% pretend I have +\begin{codeS} +man\oe uvre +\end{codeS} +Note that if you are collaborating on a document and you want to +use this approach, you must ensure that all your co-authors use the +same input encoding. For example, suppose you decide to use +ISO~Latin~1 encoding (\istyopt{inputenc}{latin1} option): +\begin{codeS} +\glsni{usepackage}\oarg{latin1}\marg{inputenc} +\end{codeS} +but your co-author is using a UTF-8 editor and types: +\begin{codeS} +na\"ive +\end{codeS} +where \texttt{\"i} is the Unicode character U+00EF\@. UTF-8 characters +use one to four 8-bit bytes whereas ISO Latin~1 uses an 8-bit +single-byte character set. So the U+00EF binary sequence is +interpreted by ISO Latin~1 encoding as two characters: \~A\ (0xC3) +and \={ } (0xAF)\@. Therefore the resulting PDF file will end up +containing the rather odd looking: +\begin{flushleft}\wrong +na\~A\={ }ve +\end{flushleft}\html{\par}% +(If you are using TeXWorks, you can set your preferred encoding +using \menu{Edit}\menuto\menu{Preferences} and select the \dq{Editor} tab +where there is an \dq{Encoding} setting. Make sure this setting +matches the \isty{inputenc} option you use in your document.) + +\begin{exercise}{Using Special Characters}{ex:spchar} +Start a new file in TeXworks, and +see if you can write the source code to create the output below. +\doifnotbook{(Ignore any \gls{hyphenation} that may appear below, \LaTeX\ does +that automatically where necessary, see \sectionref{sec:hyphenation}. Likewise, +ignore where the line breaks occur, except for the paragraph break.) }Choose +whether you want to use the \isty{inputenc} package or if you +want to use commands such as \gls{c}, but in either case you need to +be careful of the \htmlref{special characters}{tab:specialchars}\doifbook{\ +listed in \tableref{tab:specialchars}}. + +\begin{result}[spcharex.html]\setlength{\parindent}{1.5em}% +Item \#1: Our travel expenditure came to \$2000.00 +\& our equipment expenditure came +to \pounds 100.00 plus VAT @ 17.5\%. + +Chlo\"e collected Zo\"e from the cr\`eche. They stopped to +admire the fa\c{c}ade of a new caf\'e and then went to a matin\'ee. +\end{result} + +You can \downloadorview{spchar} the source code if you can't work out +how to do it, and remember to check \appendixref{ch:errors} if you have a problem. + +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%%% Lists %%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{lists} +\section{Lists} +\label{sec:lists} + +Now you've had a go at using some \glspl{command}, +let's use some \glspl{environment}\latex{ (recall +\sectionref{sec:environment})}. A good example of environments are the list +making environments. There are three basic list making environments: +\glsni{env-itemize} (for unordered lists), +\glsni{env-enumerate} (for ordered lists) and +\glsni{env-description} (for lists where you want to specify +your own label.) + +In each of these environments, each item in the list must be started +with the command: +\begin{definition} +\gls{item}\oarg{\meta{marker}} +\end{definition} +The optional argument \meta{marker} can be used to override +the default marker for that particular item. (For example, to replace +the bullet point for an individual item in an \htmlref{unordered +list}{sec:itemize} to make that item stand out from all the other +items.) We will be looking at how to change the default marker +in \sectionref{sec:renewcom}. + +\xminisec{Related \gls{ukfaq} topics:} +\begin{itemize} +\item \faqlink{Perhaps a missing \cmdname{item}?}{errmissitem} +\item \faqlink{Fancy enumeration lists}{enumerate} +\item \faqlink{How to adjust list spacing}{complist} +\item \faqlink{Interrupting enumerated lists}{interruptlist} +\item \faqlink{\dq{Too deeply nested}}{toodeep} +\end{itemize} + +%---------------------- Itemize -------------------------- + +\setnode{itemize} +\subsection{Unordered Lists} +\label{sec:itemize} + +Unordered lists are created using the \gls{env-itemize} environment. + +\xminisec{Example:} +\begin{code} +\glsni{begin}\marg{itemize}\newline +\glsni{item} Animal\newline +\glsni{item} Vegetable\newline +\glsni{item} Mineral\newline +\glsni{end}\marg{itemize} +\end{code} +\begin{result}[itemize.html] +\begin{itemize} +\item Animal +\item Vegetable +\item Mineral +\end{itemize} +\end{result} + +\xminisec{Another Example:} + +Changing the default markers is covered in \sectionref{sec:renewcom}, +but it's also possible to override the default marker for a +particular item, as in this example (recall the double-dagger +symbol command \gls{ddag} from \tableref{tab:symbols}): +\begin{code} +\glsni{begin}\marg{itemize}\newline +\glsni{item} Animal\newline +\glsni{item}\oarg{\glsni{ddag}} Vegetable\newline +\glsni{item} Mineral\newline +\glsni{end}\marg{itemize} +\end{code}% +\begin{result}[itemizedag.html] +\begin{itemize} +\item Animal +\item[\ddag] Vegetable +\item Mineral +\end{itemize} +\end{result} + +Be careful about using square brackets +\gls{text.opensq}\gls{text.closesq} inside an optional +argument. Grouping is required, as in: +\begin{code} +\glsni{begin}\marg{itemize}\newline +\glsni{item} Animal\newline +\glsni{item}\oarg{\marg{\gls{text.opensq}X\gls{text.closesq}}} Vegetable\newline +\glsni{item} Mineral\newline +\glsni{end}\marg{itemize} +\end{code}% +\begin{result}[itemizesqbr.html] +\begin{itemize} +\item Animal +\item[{[X]}] Vegetable +\item Mineral +\end{itemize} +\end{result} +Similarly if the item starts with an open square bracket +\glsni{opensq}, as in: +\begin{code} +\glsni{begin}\marg{itemize}\newline +\glsni{item} Animal\newline +\glsni{item} \marg{\gls{text.opensq}sic\gls{text.closesq}} Wegetable\newline +\glsni{item} Mineral\newline +\glsni{end}\marg{itemize} +\end{code} +\begin{result}[itemizetextsqbr.html] +\begin{itemize} +\item Animal +\item {[sic]} Wegetable +\item Mineral +\end{itemize} +\end{result} + +\setnode{nesteditemize} +\subsubsection{Nested Lists} +\label{sec:nesteditemise} + +It is also possible to nest \glsni{env-itemize} environments. +The following example has three levels, each using its own default marker. + +\begin{code} +\glsni{begin}\marg{itemize}\newline +\glsni{item} Animal\newline +\glsni{begin}\marg{itemize}\newline +\glsni{item} Mammals\newline +\glsni{item} Birds\newline +\glsni{item} Reptiles. For example:\newline +\glsni{begin}\marg{itemize}\newline +\glsni{item} dinosaurs\newline +\glsni{item} crocodiles\newline +\glsni{end}\marg{itemize}\newline +\glsni{end}\marg{itemize}\newline +\glsni{item} Vegetable\newline +\glsni{begin}\marg{itemize}\newline +\glsni{item} Cultivated\newline +\glsni{item} Wild\newline +\glsni{end}\marg{itemize}\newline +\glsni{item} Mineral\newline +\glsni{end}\marg{itemize} +\end{code} +\begin{result}[nesteditemize.html] +\begin{itemize} +\item Animal +\begin{itemize} +\item Mammals +\item Birds +\item Reptiles. For example: +\begin{itemize} +\item dinosaurs +\item crocodiles +\end{itemize} +\end{itemize} +\item Vegetable +\begin{itemize} +\item Cultivated +\item Wild +\end{itemize} +\item Mineral +\end{itemize} +\end{result} + +You might have noticed the code in the above example is a little +difficult to read. Each new list item starts a new paragraph, so it +doesn't matter if we have blank lines before each item. Also, recall +from \chapterref{ch:def} that spaces at the start of each line of +code are ignored, so it's possible to make the code more readable +without affecting the final result: + +\begin{code} +\begin{alltt} +\glsni{begin}\marg{itemize} + + \glsni{item} Animal + + \glsni{begin}\marg{itemize} + + \glsni{item} Mammals + + \glsni{item} Birds + + \glsni{item} Reptiles. For example: + + \glsni{begin}\marg{itemize} + + \glsni{item} dinosaurs + + \glsni{item} crocodiles + + \glsni{end}\marg{itemize} + + \glsni{end}\marg{itemize} + + \glsni{item} Vegetable + + \glsni{begin}\marg{itemize} + + \glsni{item} Cultivated + + \glsni{item} Wild + + \glsni{end}\marg{itemize} + + \glsni{item} Mineral + +\glsni{end}\marg{itemize} +\end{alltt} +\end{code} + +It's now a little easier to see which \verb|\begin{itemize}| matches +up with the corresponding \verb|\end{itemize}|. + +\xminisec{Example (Four Levels)} + +This example has four levels, which is the maximum allowed by most +classes. + +\begin{code} +\begin{alltt} +\glsni{begin}\marg{itemize} + \glsni{item} Animal + + \glsni{begin}\marg{itemize} + \glsni{item} Mammal + + \glsni{begin}\marg{itemize} + \glsni{item} Placental + + \glsni{item} Monotreme + + \glsni{begin}\marg{itemize} + \glsni{item} Platypus + \glsni{end}\marg{itemize} + + \glsni{item} Marsupial + + \glsni{begin}\marg{itemize} + \glsni{item} Kangaroo + + \glsni{item} Koala + \glsni{end}\marg{itemize} + \glsni{end}\marg{itemize} + + \glsni{item} Reptile + \glsni{end}\marg{itemize} + + \glsni{item} Vegetable + + \glsni{item} Mineral +\glsni{end}\marg{itemize} +\end{alltt} +\end{code} +\begin{result}[fourlevelitemize.html] +\begin{itemize} + \item Animal + \begin{itemize} + \item Mammal + + \begin{itemize} + \item Placental + + \item Monotreme + \begin{itemize} + \item Platypus + \end{itemize} + + + \item Marsupial + + \begin{itemize} + \item Kangaroo + + \item Koala + \end{itemize} + \end{itemize} + + \item Reptile + \end{itemize} + + \item Vegetable + + \item Mineral +\end{itemize} +\end{result} + +If you try adding a further level, \LaTeX\ will give a \dq{Too +deeply nested} error. + +%---------------- Enumerate ------------------------- + +\setnode{enumerate} +\subsection{Ordered Lists} +\label{sec:enumerate} + +Ordered lists are created using the \gls{env-enumerate} +environment. +It has exactly the same format as the \gls{env-itemize} environment +described \htmlref{above}{sec:itemize}. + +We can use the same example as before, only this time use +\glsni{env-enumerate} instead of \gls{env-itemize}. + +\begin{code} +\begin{alltt} +\glsni{begin}\marg{enumerate} + \glsni{item} Animal + \glsni{item} Vegetable + \glsni{item} Mineral +\glsni{end}\marg{enumerate} +\end{alltt} +\end{code}% +The above input will produce the following output: +\begin{result}[enumerate.html] +\begin{enumerate} +\item Animal +\item Vegetable +\item Mineral +\end{enumerate} +\end{result} + +As before, the marker for a particular item can be overridden: +\begin{code} +\glsni{begin}\marg{enumerate}\newline +\strut~~\glsni{item} Animal\newline +\strut~~\glsni{item}\oarg{\marg{\gls{text.opensq}X\gls{text.closesq}}} Vegetable\newline +\strut~~\glsni{item} Mineral\newline +\glsni{end}\marg{enumerate} +\end{code}% +\begin{result}[enumeratesqbr.html] +\begin{enumerate} +\item Animal +\item[{[X]}] Vegetable +\item Mineral +\end{enumerate} +\end{result} + +\xminisec{Example (Nested):} + +As with the \gls{env-itemize} environment, most classes allow a +maximum of four nested \gls{env-enumerate} environments. + +\begin{code} +\begin{alltt} +\glsni{begin}\marg{enumerate} + \glsni{item} Animal + + \glsni{begin}\marg{enumerate} + \glsni{item} Mammal + + \glsni{begin}\marg{enumerate} + \glsni{item} Placental + + \glsni{item} Monotreme + + \glsni{begin}\marg{enumerate} + \glsni{item} Platypus + \glsni{end}\marg{enumerate} + + \glsni{item} Marsupial + + \glsni{begin}\marg{enumerate} + \glsni{item} Kangaroo + + \glsni{item} Koala + \glsni{end}\marg{enumerate} + \glsni{end}\marg{enumerate} + + \glsni{item} Reptile + \glsni{end}\marg{enumerate} + + \glsni{item} Vegetable + + \glsni{item} Mineral +\glsni{end}\marg{enumerate} +\end{alltt} +\end{code} +\begin{result}[nestedenumerate.html] +\begin{enumerate} + \item Animal + \begin{enumerate} + \item Mammal + + \begin{enumerate} + \item Placental + + \item Monotreme + \begin{enumerate} + \item Platypus + \end{enumerate} + + + \item Marsupial + + \begin{enumerate} + \item Kangaroo + + \item Koala + \end{enumerate} + \end{enumerate} + + \item Reptile + \end{enumerate} + + \item Vegetable + + \item Mineral +\end{enumerate} +\end{result} + +%--------------------- Description ------------------------- + +\setnode{description} +\subsection{Description Environment} +\label{sec:description} + +The \gls{env-description} environment has the same format as +the \gls{env-itemize} environment described in +\sectionref{sec:itemize}, only this time you need to +specify a marker as an \gls{optional} to +the \gls{item} command, since there is no default marker +for this environment. The marker may be a textual label, and most +classes will typeset it in bold. The \koma\ classes, such as +\icls{scrartcl}, default to a bold sans-serif font, as illustrated +in this next example: + +\begin{code} +\begin{alltt} +\glsni{begin}\marg{description} + \glsni{item}\oarg{Animal} Living being + + \glsni{item}\oarg{Vegetable} Plant + + \glsni{item}\oarg{Mineral} Natural inorganic substance +\glsni{end}\marg{description} +\end{alltt} +\end{code} +\begin{result}[description.html] +\dodescriptionexample +\end{result} + +The \koma\ classes provide a way of changing the font style in +the \glsni{env-description} label markers. (The font changing commands +\glsni{normalfont} and \glsni{scshape} will be covered in +\sectionref{sec:fonts}, and the \koma\ command +\glsni{addtokomafont} in \sectionref{sec:section}.) + +\begin{code} +\begin{alltt} +\glsni{addtokomafont}\marg{descriptionlabel}\marg{\glsni{normalfont}\glsni{scshape}} +\glsni{begin}\marg{description} + \glsni{item}\oarg{Animal} Living being + + \glsni{item}\oarg{Vegetable} Plant + + \glsni{item}\oarg{Mineral} Natural inorganic substance +\glsni{end}\marg{description} +\end{alltt} +\end{code} +\begin{result}[descriptionkoma.html] +% Make sure LaTeX2HTML doesn't think this should be the same +% image as the previous example +\dodescriptionkomaexample +\end{result} + +It is possible to nest all the listing environments, as long as you +don't exceed four \gls{env-itemize} and four \gls{env-enumerate} +environments. The \gls{env-description} environment has no +restriction on the number of times it can be nested. However, just +because you can do something, doesn't mean you should. In general +it's best to avoid an excessively complicated block of text in your +document. + +\xminisec{Example (Assorted Nesting):} + +This example uses each of the listing environments described above. + +\bookpagebreak +\begin{code} +\begin{alltt} +\glsni{begin}\marg{description} + + \glsni{item}\oarg{Animal} Living being + + \glsni{begin}\marg{itemize} + + \glsni{item} Mammals + + \glsni{item} Birds + + \glsni{item} Reptiles. For example: + + \glsni{begin}\marg{enumerate} + + \glsni{item} dinosaurs + + \glsni{item} crocodiles + + \glsni{end}\marg{enumerate} + + \glsni{end}\marg{itemize} + + \glsni{item}\oarg{Vegetable} Plant + + \glsni{begin}\marg{itemize} + + \glsni{item} Cultivated. For example: + + \glsni{begin}\marg{enumerate} + + \glsni{item} Carrots + + \glsni{item} Broccoli + + \glsni{item} Potatoes + + \glsni{end}\marg{enumerate} + + \glsni{item} Wild + + \glsni{end}\marg{itemize} + + \glsni{item}\oarg{Mineral} Natural inorganic substance + +\glsni{end}\marg{description} +\end{alltt} +\end{code} + +\begin{result}[nestedlists.html] +\begin{description} + + \item[Animal] Living being + + \begin{itemize} + + \item Mammals + + \item Birds + + \item Reptiles. For example: + \begin{enumerate} + + \item dinosaurs + + \item crocodiles + + \end{enumerate} + + \end{itemize} + + \item[Vegetable] Plant + + \begin{itemize} + + \item Cultivated. For example: + + \begin{enumerate} + + \item Carrots + + \item Broccoli + + \item Potatoes + + \end{enumerate} + + + \item Wild + + \end{itemize} + + \item[Mineral] Natural inorganic substance + +\end{description} +\end{result} + +\begin{exercise}{Lists}{ex:lists} + +Try writing the \gls{source} that will create +the output shown below. + +\begin{result}[listex.html] +\begin{description} +\item[Village] A small collection of dwelling places. +Examples: +\begin{enumerate} +\item Marlingford +\item Saxlingham Nethergate +\end{enumerate} + +\item[Town] A large collection of dwelling places. +Examples: +\begin{enumerate} +\item Great Yarmouth +\item Beccles +\end{enumerate} + +\item[City] A large town, usually containing a cathedral. +Examples: +\begin{enumerate} +\item Norwich +\item Birmingham +\item London +\end{enumerate} +\end{description} +\end{result}\bookpagebreak +You can \downloadorview{lists} the answer if you can't work out how to do it. + +\end{exercise} + +%%%%%%%%%%%%%%%%%% Font Changing Commands %%%%%%%%%%%%%%%%%%%%%% + +\setnode{fontcommands} +\section{Fonts} +\label{sec:fonts} + +\LaTeX\ uses Donald~Knuth's Computer Modern fonts by +default\faq{Using PostScript fonts with TeX}{usepsfont}. This +supplies three font families: serif, sans-serif and a typewriter (or +monospaced) font (as well as the maths +fonts which are discussed in +\sectionref{sec:mathsfonts}). With each font family, you can +change the shape and weight, as well as the size. + +\reportpagebreak +\setnode{fontstyle} +\subsection{Changing the Font Style} +\label{sec:fontstyle} + +There are two basic ways of changing fonts: you can either change +the font for a small selection of text, for example, if you want to +\emph{emphasize} a word, or you may wish to change the font \dq{from +this point onwards}. The \glspl{command} shown in +\tableref{tab:fontsI} are of the first type (text-block +commands\index{command!text-block|hyperpage}), whereas those shown +in \tableref{tab:fontsII} are of the second type\dash a +\gls{declaration} (or modal command\index{command!modal|hyperpage}). + +\xminisec{Note:} + +\warning Don't be tempted to use \cmdname{bf}, \cmdname{md}, \cmdname{it}, +\cmdname{sl}, \cmdname{sc}, \cmdname{sf}, \cmdname{tt} or \cmdname{rm}. +These commands are \textbf{obsolete}~\cite{l2tabu}.\faq{What's wrong with \cmdname{bf}, \cmdname{it} +etc.?}{2letterfontcmd} + +If you use an italic or slanted font declaration, such as +\glsni{itshape}, you will need to add an \keyword{italic correction} +\gls{itcorr} at the end of the block of text, when the last letter +of the sloping text leans too far over. This isn't necessary for +text-block commands, such as \glsni{textit}, just for the modal +commands. The effect is more noticeable when part of a word is +stressed, particularly with certain fonts. + +\xminisec{Example:} + +In the code below, the first instance of \dq{repeated} doesn't have an italic +correction but the second does: +\begin{codeS} +\marg{\glsni{itshape} repeated}ly \marg{\glsni{itshape} +repeated\glsni{itcorr}}ly +\end{codeS}% +Using Computer Modern: +\begin{resultS}[repeatedly repeatedly]\fontfamily{cmr}\selectfont +{\itshape repeated}ly {\itshape repeated\/}ly +\end{resultS} +Using Helvetica: +\begin{resultS}[repeatedly repeatedly]\fontfamily{phv}\selectfont +{\itshape repeated}ly {\itshape repeated\/}ly +\end{resultS} +Using Antykwa Toru\'nska typeface: +\begin{resultS}[repeatedly repeatedly] +{\itshape repeated}ly {\itshape repeated\/}ly +\end{resultS} + +\begin{table}[tp] +\caption{Font Changing Text-Block Commands} +\label{tab:fontsI} +\centering +\begin{tabular}{@{}lll@{}} +\toprule +\bfseries Command & \bfseries Example Input & \bfseries Corresponding output\\ +& & (Computer Modern)\\ +\midrule +\begin{inlinedef}\gls{textrm}\marg{\meta{text}}\end{inlinedef} & +\verb|\textrm{roman} text| & \makeimg{Roman text}{\fontfamily{cmr}\selectfont{\fontfamily{cmr}\selectfont roman} text}\\ +\begin{inlinedef}\gls{textsf}\marg{\meta{text}}\end{inlinedef} & +\verb|\textsf{sans serif} text| & \makeimg{sans serif text}{\fontfamily{cmr}\selectfont{\fontfamily{cmss}\selectfont sans serif} text}\\ +\begin{inlinedef}\gls{texttt}\marg{\meta{text}}\end{inlinedef} & +\verb|\texttt{typewriter} text| & \makeimg{typewriter text}{\fontfamily{cmr}\selectfont{\fontfamily{cmtt}\selectfont typewriter} text}\\[5pt] +\begin{inlinedef}\gls{textmd}\marg{\meta{text}}\end{inlinedef} & +\verb|\textmd{medium} text| & \makeimg{medium text}{\fontfamily{cmr}\selectfont\textmd{medium} text}\\ +\begin{inlinedef}\gls{textbf}\marg{\meta{text}}\end{inlinedef} & +\verb|\textbf{bold} text| & \makeimg{bold text}{\fontfamily{cmr}\selectfont\textbf{bold} text}\\[5pt] +\begin{inlinedef}\gls{textup}\marg{\meta{text}}\end{inlinedef} & +\verb|\textup{upright} text| & \makeimg{upright text}{\fontfamily{cmr}\selectfont\textup{upright} text}\\ +\begin{inlinedef}\gls{textit}\marg{\meta{text}}\end{inlinedef} & +\verb|\textit{italic} text| & \makeimg{italic text}{\fontfamily{cmr}\selectfont\textit{italic} text}\\ +\begin{inlinedef}\gls{textsl}\marg{\meta{text}}\end{inlinedef} & +\verb|\textsl{slanted} text| & \makeimg{slanted text}{\fontfamily{cmr}\selectfont\textsl{slanted} text}\\[5pt] +\begin{inlinedef}\gls{textsc}\marg{\meta{text}}\end{inlinedef} & +\verb|\textsc{Small Caps} text| & +\makeimg{Small Caps text}{\fontfamily{cmr}\selectfont\textsc{Small Caps} text}\\ +\begin{inlinedef}\gls{emph}\marg{\meta{text}}\end{inlinedef} & +\verb|\emph{emphasized} text| & +\makeimg{emphasized text}{\fontfamily{cmr}\selectfont\emph{emphasized} text}\\[5pt] +\begin{inlinedef}\gls{textnormal}\marg{\meta{text}}\end{inlinedef} & +\verb|\textnormal{default} text| & +\makeimg{default text}{\fontfamily{cmr}\selectfont default text} +\\\bottomrule +\end{tabular} +\end{table} + +Note that if you want to typeset an URL, rather than using +\glsni{texttt} it is better to use\bookpagebreak +\begin{definition} +\gls{url}\marg{\meta{address}} +\end{definition} +which is defined in the \isty{url} package. For example: +\begin{codeS}% +\begin{alltt} +\glsni{url}\marg{http://theoval.cmp.uea.ac.uk/\glsnl{tildechar}nlct/} +\end{alltt} +\end{codeS} +produces: +\begin{resultS}[http://theoval.cmp.uea.ac.uk/\tildesym nlct/] +% simulate to prevent link, which might confuse the reader into +% thinking links automatically occur. +\texttt{http://theoval.cmp.uea.ac.uk/\tildesym nlct/} +\end{resultS} +(Note there is no need to do anything with the \gls{tildechar} +(tilde) \htmlref{special character}{sec:chars} if you use it in the argument of \glsni{url}.) + +\begin{table}[hbtp] +\caption{Font Changing Declarations} +\label{tab:fontsII} +\centering +\begin{tabular}{@{}lll@{}} +\toprule +\bfseries Declaration & \bfseries Example Input & \bfseries Corresponding output\\ +& & (Computer Modern)\\ +\midrule +\begin{inlinedef}\gls{rmfamily}\end{inlinedef} & +\verb|\rmfamily roman text| & +\makeimg{Roman text}{\fontfamily{cmr}\selectfont roman text}\\ +\begin{inlinedef}\gls{sffamily}\end{inlinedef} & +\verb|\sffamily sans serif text| & +\makeimg{sans serif text}{\fontfamily{cmss}\selectfont sans serif text}\\ +\begin{inlinedef}\gls{ttfamily}\end{inlinedef} & +\verb|\ttfamily typewriter text| & +\makeimg{typewriter text}{\fontfamily{cmtt}\selectfont typewriter text}\\[5pt] +\begin{inlinedef}\gls{mdseries}\end{inlinedef} & +\verb|\mdseries medium text| & +\makeimg{medium text}{\fontfamily{cmr}\selectfont\mdseries medium text}\\ +\begin{inlinedef}\gls{bfseries}\end{inlinedef} & +\verb|\bfseries bold text| & +\makeimg{bold text}{\fontfamily{cmr}\selectfont\bfseries bold text}\\[5pt] +\begin{inlinedef}\gls{upshape}\end{inlinedef} & +\verb|\upshape upright text| & +\makeimg{upright text}{\fontfamily{cmr}\selectfont\upshape upright text}\\ +\begin{inlinedef}\gls{itshape}\end{inlinedef} & +\verb|\itshape italic text| & +\makeimg{italic text}{\fontfamily{cmr}\selectfont\itshape italic text}\\ +\begin{inlinedef}\gls{slshape}\end{inlinedef} & +\verb|\slshape slanted text| & +\makeimg{slanted text}{\fontfamily{cmr}\selectfont\slshape slanted text}\\ +\begin{inlinedef}\gls{scshape}\end{inlinedef} & +\verb|\scshape Small Caps text| & +\makeimg{Small Caps text}{\fontfamily{cmr}\selectfont\scshape Small Caps text}\\[5pt] +\begin{inlinedef}\gls{em}\end{inlinedef} & +\verb|\em emphasized text| & +\makeimg{emphasized text}{\fontfamily{cmr}\selectfont\em emphasized text}\\[5pt] +\begin{inlinedef}\gls{normalfont}\end{inlinedef} & +\verb|\normalfont default text| & +\makeimg{default text}{\fontfamily{cmr}\selectfont default text} +\\\bottomrule +\end{tabular} + +\end{table} + +\refstepcounter{object}\label{obj:fontenv}\Glspl{environment} can be used instead. +Each \gls{environment} has the same name as its corresponding +declaration, but \emph{without} the preceding backslash. For example: +\begin{codeS} +\begin{alltt} +\glsni{begin}\marg{sffamily}Some sans-serif text.\glsni{end}\marg{sffamily} +\end{alltt} +\end{codeS}% +yields: +\begin{resultS}[Some sans-serif text.] +\begin{sffamily}Some sans-serif text.\end{sffamily} +\end{resultS} + +You can combine a font family with a given shape and weight using +a variety of methods. + +\xminisec{Examples:} + +\begin{enumerate} +\item Localised declarations: + +\begin{codeS} +\marg{\glsni{sffamily}\glsni{slshape} Some slanted sans-serif text.} +\end{codeS} + +\item Declarations that later get explicitly reset: + +\begin{codeS} +\glsni{sffamily}\glsni{slshape} Some slanted sans-serif +text.\glsni{normalfont} +\end{codeS} + +\bookpagebreak +\item Mixing text-block and modal commands: + +\begin{codeS} +\glsni{textsf}\marg{\glsni{slshape} Some slanted sans-serif text.} +\end{codeS} + +\item Nested commands: + +\begin{codeS} +\glsni{textsf}\marg{\glsni{textsl}\marg{Some slanted sans-serif text.}} +\end{codeS} + +\item Mixing environments and declarations: + +\begin{code} +\glsni{begin}\marg{sffamily}\glsni{slshape} Some slanted sans-serif +text.\glsni{end}\marg{sffamily} +\end{code} +\end{enumerate} + +All of the above produce the same output: +\begin{resultS}[Some slanted sans-serif text.] +\textsf{\slshape Some slanted sans-serif text.} +\end{resultS} + +\faq{Warning: \dq{Font shape \ldots\ not +available}}{fontunavail}Note that some combinations are not +available, in which case \LaTeX\ will give a warning message, and +will substitute the font for what it considers to be the closest +available match. + +\xminisec{Example:} +\begin{codeS} +\glsni{textsc}\marg{\glsni{bfseries} Text} +\end{codeS} +With the Antykwa Toru\'nska typeface, this appears as: +\begin{resultS}[Text (in bold small caps)] +\textsc{\bfseries Text} +\end{resultS}\bookpagebreak\noindent +whereas with Computer Modern, the result is: +\begin{resultS}[Text (in bold)]\fontfamily{cmr}\selectfont +\textsc{\bfseries Text} +\end{resultS} +This is because Computer Modern doesn't have a bold small-caps +font, so it just uses bold. \LaTeX\ gives the following warning: +\begin{verbatim} +LaTeX Font Warning: Font shape `T1/cmr/b/sc' undefined +(Font) using `T1/cmr/b/n' instead on input line 2792. +\end{verbatim} +Most sans-serif fonts don't provide a small-caps variant, so +\begin{codeS} +\glsni{textsf}\marg{\glsni{scshape} Text} +\end{codeS} +will either appear in regular sans-serif or small-caps serif, +depending on the font in use. Using Libris sans-serif the result is: +\begin{resultS}[Text (in sans-serif)] +\textsf{\scshape Text} +\end{resultS} +whereas using Computer Modern Sans, the result is: +\begin{resultS}[Text (in small caps)] +\fontfamily{cmss} +\scshape Text +\end{resultS} + +\setnode{emph} +\subsubsection{Emphasizing Words or Phrases} +\label{sec:emph} + +The \gls{command} \gls{emph}, +the \gls{declaration} \gls{em} and the +\gls{environment} \gls{env-em} behave slightly +differently to the corresponding \gls{textit} command, +\gls{itshape} declaration and \gls{env-itshape} environment. +The latter group simply use an italic font, whereas the former will toggle +between sloping and upright. So if the surrounding font is upright +then \gls{emph}, \gls{em} and \glsni{env-em} will use the +sloping font, but if the surrounding font is italic or slanted, +\gls{emph}, \gls{em} and \glsni{env-em} will use an upright +font. This is particularly useful in abstracts where the +\Index{abstract} font varies between \glspl{cls}. It is recommended that if your intention +is to emphasize something, you should use \gls{emph} etc.\ rather +than \gls{textit} etc.\screenpagebreak + +\xminisec{Examples:} +\begin{enumerate} +\item Emphasized text in upright surrounding: +\begin{codeS} +Some \glsni{emph}\marg{emphasized} text. +\end{codeS}% +yields +\begin{resultS}[Some emphasized text.] +Some \emph{emphasized} text. +\end{resultS} + +\item Emphasized text in italic surrounding: +\begin{codeS} +\marg{\glsni{itshape} Some \glsni{emph}\marg{emphasized} text.} +\end{codeS}% +yields +\begin{resultS}[Some emphasized text] +{\itshape Some \emph{emphasized} text.} +\end{resultS} + +\bookpagebreak +\item Emphasized text in upright sans-serif surrounding: +\begin{codeS} +\marg{\glsni{sffamily} Some \glsni{emph}\marg{emphasized} text.} +\end{codeS}% +yields +\begin{resultS}[Some emphasized text] +{\sffamily Some \emph{emphasized} text.} +\end{resultS} +\end{enumerate} + +\setnode{fontsize} +\subsection{Changing the Font Size} +\label{sec:fontsize} + +When you start writing a document, you need to decide what the base +font size should be. The \koma\ classes default to 11pt, but this can +be changed using the class options \scrclsopt{8pt}, \scrclsopt{9pt}, +\clsopt{10pt}, \clsopt{12pt}, \scrclsopt{14pt}, \scrclsopt{17pt} or +\scrclsopt{20pt}. + +You can then change the font size \emph{relative to} the base size, +using one of the declarations shown in \tableref{tab:fontsize}. That +way, if you later decide to change the normal font size from, say, +11pt to 12pt, all you need do is change the class option (see +\latexhtml{page~\pageref{obj:sizeopt}}{\htmlref{earlier}{obj:sizeopt}}) +and re-run \LaTeX. Note that there are no equivalent text-block +commands. + +\begin{table}[tbhp] +\caption{Font Size Changing Declarations} +\label{tab:fontsize} +\centering +\begin{tabular}{@{}lll@{}} +\toprule +\bfseries Declaration & \bfseries Example Input & +\bfseries Corresponding Output\\ +\midrule +\begin{inlinedef}\gls{tiny}\end{inlinedef} & +\verb|\tiny tiny text| & \makeimg{tiny text}{\tiny tiny text}\\ +\begin{inlinedef}\gls{scriptsize}\end{inlinedef} & +\verb|\scriptsize script size| & +\makeimg{script size}{\scriptsize script size}\\ +\begin{inlinedef}\gls{footnotesize}\end{inlinedef} & +\verb|\footnotesize footnote size| & +\makeimg{footnote size}{\footnotesize footnote size}\\ +\begin{inlinedef}\gls{small}\end{inlinedef} & +\verb|\small small text| & +\makeimg{small text}{\small small text}\\ +\begin{inlinedef}\gls{normalsize}\end{inlinedef} & +\verb|\normalsize normal size| & +\makeimg{normal size}{\normalsize normal size}\\ +\begin{inlinedef}\gls{large}\end{inlinedef} & +\verb|\large large text| & +\makeimg{large text}{\large large text}\\ +\begin{inlinedef}\gls{Large}\end{inlinedef} & +\verb|\Large even larger| & +\makeimg{even larger}{\Large even larger}\\ +\begin{inlinedef}\gls{LARGE}\end{inlinedef} & +\verb|\LARGE larger still| & +\makeimg{larger still}{\LARGE larger still}\\ +\begin{inlinedef}\gls{huge}\end{inlinedef} & +\verb|\huge huge| & \makeimg{huge}{\huge huge}\\ +\begin{inlinedef}\gls{Huge}\end{inlinedef} & +\verb|\Huge extra huge| & +\makeimg{extra huge}{\Huge extra huge} +\\\bottomrule +\end{tabular} + +\end{table} + +Again, \glspl{environment} can be used instead, where +each \gls{environment} has the same name as its corresponding +declaration, but \emph{without} the preceding backslash. +Font environments may be nested, for example:% +\indexEnv{itshape}\indexEnv{Large} +\begin{code} +\glsni{begin}\marg{itshape} Some italic text. +\glsni{begin}\marg{Large}This text is large.\glsni{end}\marg{Large} +\glsni{end}\marg{itshape} Back to normal. +\end{code}% +Output: +\begin{resultS}[Some italic text. This text is large. Back to +normal.] +\begin{itshape} Some italic text. +\begin{Large}This text is large.\end{Large} +\end{itshape} +Back to normal. +\end{resultS} + +\setnode{documentfonts} +\subsection{Changing Document Fonts} +\label{sec:changingfonts} + +\faq{Choice of scalable outline fonts}{psfchoice}What if you don't +want to use the default Computer Modern fonts? Some publishers and +institutions insist on a combination of Times Roman (serif), +Helvetica (sans-serif) and Courier (typewriter). To do this, you can +load the following packages: +\begin{description} +\item[\isty{mathptmx}] (Times) Only affects \gls{rmfamily} and +\gls{textrm}. + +\item[\isty{helvet}] (Helvetica) Only affects \gls{sffamily} and +\gls{textsf}. + +\item[\isty{courier}] (Courier) Only affects \gls{ttfamily} +and \gls{texttt}. +\end{description} + +\xminisec{Notes:} + +\begin{enumerate} + +\item \warning Don't be tempted to use the \sty{times} package. It's +obsolete~\cite{l2tabu}. Use \isty{mathptmx} instead. + +\item Although Times and Helvetica are commonly used together, they +don't match, as illustrated below (temporarily switching from this +book's fonts to Times and Helvetica): +\begin{codeS} +\glsni{rmfamily} xx \glsni{sffamily} xx +\end{codeS} +Results in: +\begin{resultS}[xx xx] +\fontfamily{ptm}\selectfont xx \fontfamily{phv}\selectfont xx +\end{resultS} +The first two x's are in Times Roman and the second two are in +Helvetica, which are somewhat larger. To compensate for this you +need to scale the Helvetica font using the \istyopt{helvet}{scaled} +option: +\begin{alltt} +\glsni{usepackage}\oarg{scaled=0.9}\marg{helvet} +\end{alltt} + +\item Loading \isty{helvet} or \isty{courier} doesn't change the +default font family. Consider the following: +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{usepackage}\marg{helvet} + +\glsni{begin}\marg{document} +This is a sample document. +\glsni{end}\marg{document} +\end{alltt} +Here, the text \dq{This is a sample document} will be typeset in +Computer Modern Roman. This is because \gls{rmfamily} is the default +font and \isty{helvet} only affects \gls{sffamily}, which hasn't +been used. (See \sectionref{sec:renewcom} to find out how to change +the default font family.) +\end{enumerate} +\latexhtml{This book}{The PDF version of this document} has used the following packages: +\begin{alltt} +\glsni{usepackage}\oarg{T1}\marg{fontenc} +\glsni{usepackage}\oarg{math}\marg{anttor} +\glsni{usepackage}\marg{libris} +\end{alltt} +The \isty{fontenc} package is used to switch to Type~1 font +encoding\faq{Why bother with \sty{inputenc} and \sty{fontenc}?}{why-inp-font}, +the \isty{anttor} package is used to set the serif family to Antykwa +Toru\'nska typeface, and the \isty{libris} package is used to set +the sans-serif family to the Libris ADF typeface. + +\begin{exercise}{Fonts}{ex:fonts} + +Go back to the document you created in \exerciseref{ex:simpledoc} and +change the first paragraph to a large bold font and the second +paragraph to normal size italic. Emphasize the words \dq{simple} and +\dq{short}. (Again, you can \downloadorview{fonts} the solution.) + +If you like, you can try experimenting with loading +different font packages, such as \isty{mathptmx}, to change the +default typeface. The \LaTeX\ Font Catalogue~\cite{fontcat} provides +a useful list of fonts, although you may not have all of them +installed. +\end{exercise} + +%%%%%%%%%%%%%% Aligning Material in Rows and Columns %%%%%%%%%%%%%%%% + +\setnode{tabular} +\section{Aligning Material in Rows and Columns} +\label{sec:tabular} + +Text can be aligned in rows and columns using the \gls{env-tabular} +environment. +\begin{definition} +\glsni{begin}\marg{tabular}\oarg{\meta{pos}}\marg{\meta{column specifiers}} +\end{definition}% +This \glsterm{environment} has a +\glsterm{mandatory} \meta{column specifiers} +that specifies how to align each column. Within \meta{column +specifiers}, there must be a specifier for each column. The three +basic are: \texttt{r} (right aligned), \texttt{l} (left aligned) and +\texttt{c} (centred). +(Make sure you don't confuse \texttt{l} (the letter \dq{ell}) with \texttt{1} +(the digit one).) +The optional argument \meta{pos} is covered +\latexhtml{in \sectionref{sec:boxes}}{\htmlref{later}{sec:boxes}}. + +\xminisec{Example:} +Three columns (\underline{l}eft, \underline{c}entred, \underline{c}entred): +\begin{codeS} +\glsni{begin}\marg{tabular}\marg{lcc} +\end{codeS} + +\xminisec{Another Example:} +Four columns (\underline{l}eft, \underline{c}entred, \underline{c}entred, \underline{r}ight): +\begin{codeS} +\glsni{begin}\marg{tabular}\marg{lccr} +\end{codeS} + +The \texttt{r}, \texttt{l} and \texttt{c} specifiers don't allow +line breaks or paragraphs within a cell. It's not a good idea to +have too much text in a cell, but if it's required you can use +\begin{definition} +p\marg{\meta{width}} +\end{definition} +which indicates a paragraph cell of the given width. + +\xminisec{Example:} +Three columns (\underline{p}aragraph of width 1in, +\underline{c}entred, \underline{r}ight): +\begin{codeS} +\glsni{begin}\marg{tabular}\marg{p\marg{1in}cr} +\end{codeS} +The paragraph cell will be formatted fully justified, which is often +inappropriate for a narrow block of text. The \isty{array} package +provides +\begin{definition} +\gls{gtcol}\marg{\meta{declaration}} +\end{definition} +which can be used directly in front of the \texttt{l}, \texttt{c}, +\texttt{r} or \texttt{p} column specifiers. This inserts +\meta{declaration} in front of the entries for that column, so it +can be used to insert, say, \gls{raggedright}. + +\xminisec{Example:} +Three columns, the first \underline{l}eft justified where each entry +is in bold, the second a \underline{p}aragraph column of width 1in set to +ragged right and the third \underline{c}entered: +\begin{codeS} +\glsni{begin}\marg{tabular}\marg{\glsni{gtcol}\marg{\glsni{bfseries}}l\glsni{gtcol}\marg{\glsni{raggedright}}p\marg{1in}c} +\end{codeS} + +The \isty{array} package also provides +\begin{definition} +\gls{ltcol}\marg{\meta{declaration}} +\end{definition} +which can be used directly after the \texttt{l}, \texttt{c}, +\texttt{r} or \texttt{p} column specifiers. This inserts +\meta{declaration} after the entries for that column. + +\xminisec{Inter-Column Gap:} + +The gap between columns is given by twice the value of the +\gls{length} register: +\begin{definition} +\gls{tabcolsep} +\end{definition} +A gap of \glsni{tabcolsep} is +also inserted before the first column and after the last column. +This length can be changed using one of the commands described in +\sectionref{sec:length}. For example: +\begin{codeS} +\gls{setlength}\marg{\glsni{tabcolsep}}\marg{4pt} +\end{codeS} +This will put an 8pt gap between columns and a 4pt gap before the +first column and after the last column. + +The column specifiers can also include: +\begin{definition} +\gls{atchar}\marg{\meta{inter-column text}} +\end{definition} +This inserts \meta{inter-column text} at that place on each row of +the table, replacing the default inter-column gap. + +\xminisec{Example:} + +Suppose we want a centred first column, a right justified second +column and a left justified third column with a dot between the +second and third columns: +\begin{codeS} +\begin{alltt} +\glsni{begin}\marg{tabular}\marg{cr\glsni{atchar}\marg{.}l} +\end{alltt} +\end{codeS} +Alternatively, you may want a larger gap between groups of columns, +for example, two groups of three left justified columns: +\begin{codeS} +\begin{alltt} +\glsni{begin}\marg{tabular}\marg{lll\glsni{atchar}\marg{\glsni{hspace}\marg{4\glsni{tabcolsep}}}lll} +\end{alltt} +\end{codeS} +This uses the command: +\begin{definition} +\gls{hspace}\marg{\meta{length}} +\end{definition} +which inserts a horizontal space of a given \gls{length}. In this +case, four times the value of \glsni{tabcolsep}. This makes the gap +between the third and fourth columns twice as wide as the gap +between the other columns. + +\setnode{rowscols} +\subsection{Column and Row Separation} +\label{sec:rowscols} + +Remember the \latexhtml{special characters mentioned in +\sectionref{sec:chars}}{\htmlref{special characters}{sec:chars}}? +The ampersand character \gls{ampchar} is used to separate column +entries. Rows are separated using: +\begin{definition} +\gls{tab.dbbackslashchar}\oarg{\meta{vertical space}} +\end{definition} +where \meta{vertical space} is extra vertical spacing between rows, +if required. There is also a longer equivalent: +\begin{definition} +\gls{tabularnewline} +\end{definition} +\faq{Alignment tab changed to \cmdname{cr}}{altabcr}% +If you have used something like +\texttt{\gls{gtcol}\marg{\gls{raggedright}}p\marg{\meta{length}}} +as the specifier for your last column, you must use +\glsni{tabularnewline} instead of \glsni{tab.dbbackslashchar} +to indicate the row break otherwise you will get the following +error: +\begin{verbatim} +! Extra alignment tab has been changed to \cr. +<recently read> \endtemplate +\end{verbatim} +\screenpagebreak + +\xminisec{Example:} + +Let's have two columns, the first left justified and the second right justified: +\begin{code} +\glsni{begin}\marg{tabular}\marg{lr}\newline +Video \glsni{ampchar} +8.99\glsni{tab.dbbackslashchar}\newline +CD \glsni{ampchar} 9.11\glsni{tab.dbbackslashchar}\newline +DVD \glsni{ampchar} +15.00\glsni{tab.dbbackslashchar}\newline +Total \glsni{ampchar} 33.10\newline +\glsni{end}\marg{tabular} +\end{code} + +\begin{result}[tabular1.html] +\begin{tabular}{lr} +Video & 8.99\\ +CD & 9.11\\ +DVD & 15.00\\ +Total & 33.10 +\end{tabular} +\end{result}% +Recall from \chapterref{ch:def} that \LaTeX\ ignores spaces at the start of a line and +treats multiple spaces as a single space, so I~could just have +easily done: +\begin{code} +\glsni{begin}\marg{tabular}\marg{lr}\newline +\strut~~Video \glsni{ampchar} 8.99\glsni{tab.dbbackslashchar}\newline +\strut~~CD~~~~\glsni{ampchar} 9.11\glsni{tab.dbbackslashchar}\newline +\strut~~DVD~~~\glsni{ampchar} 15.00\glsni{tab.dbbackslashchar}\newline +\strut~~Total \glsni{ampchar} 33.10\newline +\glsni{end}\marg{tabular} +\end{code}% +and still have got the same result, but now the code is easier to +read. + +Entries form implicit \glsing{group}, so +\glspl{declaration} made +within a \gls{env-tabular} environment only have an effect up to the +next \gls{ampchar} or \gls{tab.dbbackslashchar}. + +\xminisec{Example:} +\begin{code} +\glsni{begin}\marg{tabular}\marg{lr}\newline +\strut~~Video~\glsni{ampchar} 8.99\glsni{tab.dbbackslashchar}\newline +\strut~~CD~~~~\glsni{ampchar} 9.11\glsni{tab.dbbackslashchar}\newline +\strut~~DVD~~~\glsni{ampchar} +15.00\glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{bfseries} Total \glsni{ampchar} 33.10\newline +\glsni{end}\marg{tabular} +\end{code}% +Output:\screenpagebreak +\begin{result}[Image: as the previous example except that the word +Total has appeared in bold] +\begin{tabular}{lr} +Video & 8.99\\ +CD & 9.11\\ +DVD & 15.00\\ +\bfseries Total & 33.10 +\end{tabular} +\end{result}% +Let's add an extra column and a header row: +\begin{code}\obeyspaces +\glsni{begin}\marg{tabular}\marg{lrr}\newline +\strut~~Item~~\glsni{ampchar} ex VAT \glsni{ampchar} inc +VAT\glsni{tab.dbbackslashchar}\newline +\strut~~Video~\glsni{ampchar}~~~8.99 \glsni{ampchar}~~10.56 \glsni{tab.dbbackslashchar}\newline +\strut~~CD~~~~\glsni{ampchar}~~~9.11 \glsni{ampchar}~~10.70 \glsni{tab.dbbackslashchar}\newline +\strut~~DVD~~~\glsni{ampchar}~~15.00 \glsni{ampchar}~~17.63 \glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{bfseries} Total \glsni{ampchar}~~33.10 \glsni{ampchar}~~39.89\newline +\glsni{end}\marg{tabular} +\end{code}% +Output: +\begin{result}[tabular2.html] +\begin{tabular}{lrr} +Item & ex VAT & inc VAT\\ +Video & 8.99 & 10.56\\ +CD & 9.11 & 10.70\\ +DVD & 15.00 & 17.63\\ +\bfseries Total & 33.10 & 39.89 +\end{tabular} +\end{result}% + +\xminisec{Example (Aligning on a Decimal Point):} + +\label{xmp:decpt}If you want to align on the decimal point, it's best to use the +\isty{siunitx} package. That's beyond the scope of this +book, but for simple data this can be achieved +using the \gls{atchar} inter-column specifier. For example: +\begin{code}\obeyspaces +\glsni{begin}\marg{tabular}\marg{lr\glsni{atchar}\marg{.}l}\newline +\strut~~Video \glsni{ampchar} 8 \glsni{ampchar} 99\glsni{tab.dbbackslashchar}\newline +\strut~~CD~~~~\glsni{ampchar} 9 \glsni{ampchar} 11\glsni{tab.dbbackslashchar}\newline +\strut~~DVD~~~\glsni{ampchar} 15 \glsni{ampchar} 00\glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{bfseries} Total \glsni{ampchar} 33 \glsni{ampchar} 10\newline +\glsni{end}\marg{tabular} +\end{code}% +Output:\reportpagebreak +\begin{result}[Image: as the second example but the decimal points +are aligned] +\begin{tabular}{lr@{.}l} +Video & 8 & 99\\ +CD & 9 & 11\\ +DVD & 15 & 00\\ +\bfseries Total & 33 & 10 +\end{tabular} +\end{result}% + +\setnode{multicolumn} +\subsection{Spanning Columns} +\label{sec:multicolumn} + +You may have noticed I~omitted the column headers in the \htmlref{above +example}{xmp:decpt}. \faq{Merging cells in +a column of a table}{multirow} +The problem with rewriting the table using +\texttt{r\glsni{atchar}\marg{.}l} to align the decimal point is that the header +now needs to span the last two columns. +This can be done using the command: +\begin{definition} +\gls{multicolumn}\marg{\meta{cols spanned}}\marg{\meta{col specifier}}\marg{\meta{text}} +\end{definition}% +The first \gls{mandatory} \meta{cols spanned} is the number of +columns you want to span, the second argument \meta{col specifier} +indicates how to align this column-spanning entry, the third +argument \meta{text} indicates what should go in this entry. Note +that \meta{col specifier} should only have a single column +specifier, such as \texttt{\marg{c}} or \texttt{\marg{r}}. We can +use \glsni{multicolumn} to modify an earlier example as +follows:\screenpagebreak +\begin{code} +\glsni{begin}\marg{tabular}\marg{lrr}\newline +\strut~~~~~~~~\glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{Price (\glsni{pounds})}\glsni{tab.dbbackslashchar}\newline +\strut~~Item~~\glsni{ampchar} ex VAT \glsni{ampchar} inc +VAT\glsni{tab.dbbackslashchar}\newline +\strut~~Video~\glsni{ampchar}~~~8.99 \glsni{ampchar}~~10.56 \glsni{tab.dbbackslashchar}\newline +\strut~~CD~~~~\glsni{ampchar}~~~9.11 \glsni{ampchar}~~10.70 \glsni{tab.dbbackslashchar}\newline +\strut~~DVD~~~\glsni{ampchar}~~15.00 \glsni{ampchar}~~17.63 \glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{bfseries} Total \glsni{ampchar}~~33.10 \glsni{ampchar}~~39.89\newline +\glsni{end}\marg{tabular} +\end{code}% +Output: +\begin{result}[tabular2multicol.html] +\begin{tabular}{lrr} + & \multicolumn{2}{c}{Price (\pounds)}\\ +Item & ex VAT & inc VAT\\ +Video & 8.99 & 10.56\\ +CD & 9.99 & 11.74\\ +DVD & 15.00 & 17.63\\ +\bfseries Total & 33.98 & 39.93 +\end{tabular} +\end{result}% +Here we are spanning two columns, so the first argument to \glsni{multicolumn} is \verb|{2}|, +we want the entry centred, so the second argument is \verb|{c}| and the text to go in this entry +is simply \texttt{\marg{Price (\gls{pounds})}}. + +\faq{How to alter the alignment +of tabular cells}{tabcellalign}The \glsni{multicolumn} command can also be used to override +the alignment of individual entries. Consider +the following example: +\begin{code} +\glsni{begin}\marg{tabular}\marg{lrr}\newline +\strut~~~~~~~~~~\glsni{ampchar} Year1 \glsni{ampchar} Year2 +\glsni{tab.dbbackslashchar}\newline +Travel~~~~\glsni{ampchar} 100,000 \glsni{ampchar} +110,000\glsni{tab.dbbackslashchar}\newline +Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000\newline +\glsni{end}\marg{tabular} +\end{code} +Output: +\begin{result}[tabular3.html] +\begin{tabular}{lrr} + & Year1 & Year2 \\ +Travel & 100,000 & 110,000\\ +Equipment & 50,000 & 60,000 +\end{tabular} +\end{result}% +In this example, the headers \dq{Year1} and \dq{Year2} would look +better centred, but the rest of the entries in the second +and third columns look best right aligned. We can +use \glsni{multicolumn} to span just one column, and +use the second argument of \glsni{multicolumn} to override +the column specification: +\begin{code} +\glsni{begin}\marg{tabular}\marg{lrr}\newline +\strut~~~~~~~~~~\glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1}\newline +\strut~~~~~~~~~~\glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar}\newline +Travel~~~~\glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar}\newline +Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000\newline +\glsni{end}\marg{tabular} +\end{code} +Output: +\begin{result}[Image: as the previous example except that the words +'Year1' and 'Year2' have been centred in their columns] +\begin{tabular}{lrr} + & \multicolumn{1}{c}{Year1} & \multicolumn{1}{c}{Year2} \\ +Travel & 100,000 & 110,000\\ +Equipment & 50,000 & 60,000 +\end{tabular} +\end{result} + +\setnode{tabrules} +\subsection{Rules} +\label{sec:rules} + +In general, vertical rules are considered superfluous~\cite{oxford}. +Although Turabian~\cite{turabian96} allows for the possibility of +vertical rules for tabulated material containing more than two +columns but still advises against having too many and deprecates +the use of them at either end. + +Horizontal rules may be used at the top and bottom of the +tabulated material, but other horizontal rules should be kept to a +minimum. In general, the top and bottom rule should be thicker than +the mid rules. + +The \isty{booktabs} package provides: +\begin{definition} +\gls{toprule}\oarg{\meta{wd}} +\end{definition} +for the top horizontal rule, +\begin{definition} +\gls{bottomrule}\oarg{\meta{wd}} +\end{definition} +for the bottom horizontal rule, and +\begin{definition} +\gls{midrule}\oarg{\meta{wd}} +\end{definition} +for horizontal rules in between rows, such as after the header row. + +These commands should all go at the start of the appropriate row. +This means that if you want a bottom rule, you need to add +\gls{tab.dbbackslashchar} followed by \glsni{bottomrule} at the end of +the tabulated material. + +\xminisec{Example:} +\begin{code} +\glsni{begin}\marg{tabular}\marg{lrr}\newline +\glsni{toprule}\newline +\strut~~~~~~~~~~\glsni{ampchar} +\glsni{multicolumn}\marg{1}\marg{c}\marg{Year1}\newline +\strut~~~~~~~~~~\glsni{ampchar} +\glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}% +\glsni{tab.dbbackslashchar}\newline +\glsni{midrule}\newline +Travel~~~~\glsni{ampchar} 100,000 \glsni{ampchar} +110,000\glsni{tab.dbbackslashchar}\newline +Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000% +\glsni{tab.dbbackslashchar}\newline +\glsni{bottomrule}\newline +\glsni{end}\marg{tabular} +\end{code} +results in: +\begin{result}[Image: as previous example but with horizontal rules +at the start and end and between the first and second rows.] +\begin{tabular}{lrr} +\toprule + & \multicolumn{1}{c}{Year1} + & \multicolumn{1}{c}{Year2} \\ +\midrule +Travel & 100,000 & 110,000\\ +Equipment & 50,000 & 60,000 +\\\bottomrule +\end{tabular} +\end{result} + +The thickness of the top and bottom rule is given by +the \gls{length} register \booklinebreak\gls{heavyrulewidth}, and the thickness of +the mid rule is given by the \gls{length} register +\gls{lightrulewidth}. These rule thicknesses can be overridden using the +optional argument \meta{wd} for \glsni{toprule}, \glsni{midrule} +and \glsni{bottomrule}. + +\begin{exercise}{Aligning Material}{ex:tabular} +Go back to the document you created in \exerciseref{ex:simple} (and later modified in \exerciseref{ex:datetime}), +and add the following: +\begin{result}[tabex.html] +\begin{tabular}{lrr} + & \multicolumn{2}{c}{\bfseries Expenditure (\pounds)}\\ + & \multicolumn{1}{c}{Year1} & \multicolumn{1}{c}{Year2} \\ +\bfseries Travel & 100,000 & 110,000\\ +\bfseries Equipment & 50,000 & 60,000 +\end{tabular} +\end{result} + +Note that the \gls{env-tabular} environment +doesn't create a caption, all it does is arrange its contents in +rows and columns. You can find out how to turn your +\gls{env-tabular} environment into a table +in \sectionref{sec:tables}. + +You can \downloadorview{tabular} the solution to this exercise. (Remember to check +\appendixref{ch:errors} if you encounter an error message.) +\end{exercise} + +For more information about using the \gls{env-tabular} environment see \latexbook, +\latexguide\ or \latexcomp. \emph{The \LaTeX\ Companion} also describes how +to span rows using the \isty{multirow} +\htmlref{package}{sec:packages}. For information on how to create +coloured tables using the \isty{colortbl} +\htmlref{package}{sec:packages}, see \latexgraphic. + +\xminisec{Related \gls{ukfaq} topics:} +\begin{itemize} +\item \faqlink{How to change a whole row of a table}{wholerow} +\item \faqlink{Merging cells in a column of a table}{multirow} +\item \faqlink{Fixed width tables}{fixwidtab} +\item \faqlink{Variable-width columns in tables}{varwidcol} +\item \faqlink{Spacing lines in tables}{struttab} +\end{itemize} + +%%%%%%%%%%%%%%%% Boxes and Mini-Pages %%%%%%%%%%%%%%%%%%% + +\setnode{boxes} +\section{Boxes and Mini-Pages} +\label{sec:boxes} + +\gls{tex} views everything on a page as a form of box. Each box has an +associated width, height and depth, and the boxes are placed together +on the page with \keyword{glue}. This is reminiscent of the days +of manual typesetting, where each letter or symbol was on a wooden +block, and the wooden blocks were glued in place. The simplest form +of box is a single letter. Some letters, such as \dq{a} only have a +height and width, whereas other letters, such as \dq{y} have a +height, width and depth (see \figureref{fig:letterbox}). + +\begin{figure}[htbp] +\figconts[alt=Image of the letters y and a illustrating their +height depth and width. The letter a has zero depth as it does not +extend below the baseline.] + {pictures/letterbox}% + {% + \caption{\texorpdfstring{\protect\TeX}{TeX}\protect\space Views Each Letter as a Box}% + }% + {fig:letterbox}% +\end{figure} + +For example, the phrase \dq{cabbages and peas} is made up of 15 boxes: +\begin{center} +\makeimg{c a b b a g e s a n d p e a s}{\setlength{\fboxsep}{0.5pt}% +\setlength{\fboxrule}{0.1pt}\LARGE +\fbox{c}\fbox{a}\fbox{b}\fbox{b}\fbox{a}% +\fbox{g}\fbox{e}\fbox{s}~\fbox{a}\fbox{n}\fbox{d}~\fbox{p}\fbox{e}% +\fbox{a}\fbox{s}} +\end{center} +whereas the word \dq{cauliflower} consists of 10 boxes:\footnote{The +fl-ligature is a single character, and so is one box not +two.} +\begin{center} +\makeimg{c a u l i fl-ligature o u r}{\setlength{\fboxsep}{0.5pt}% +\setlength{\fboxrule}{0.1pt}\LARGE +\fbox{c}\fbox{a}\fbox{u}\fbox{l}\fbox{i}% +\fbox{fl}\fbox{o}\fbox{w}\fbox{e}\fbox{r}} +\end{center} + +More complicated boxes are made up of smaller boxes. We have already +encountered one of these more complicated boxes: the +\gls{env-tabular} environment, discussed in the +\htmlref{previous section}{sec:tabular}. This type of box is called +a \keyword{horizontal box}, which means that it can go in a line +of text. For example: +\begin{code}\obeyspaces +Here is some text.\newline +\glsni{begin}\marg{tabular}\marg{cc}\newline +A \glsni{ampchar} B\glsni{tab.dbbackslashchar}\newline +C \glsni{ampchar} D\newline +\glsni{end}\marg{tabular}\newline +The rest of the line. +\end{code} +produces: +\begin{result}[Image illustrating the typeset output: the tabulated +material is centred vertically within the line of text.] +Here is some text. +\begin{tabular}{cc} +A & B\\ +C & D +\end{tabular} +The rest of the line. +\end{result} +Recall from \htmlref{the previous section}{sec:tabular} that the +\gls{env-tabular} environment had an optional argument +\meta{pos}. This governs the vertical alignment when the +\gls{env-tabular} environment occurs within a line of text. +This can be one of \texttt{c} (centred\dash the default, as illustrated +above), \texttt{t} (top) and \texttt{b} (bottom). For example, +\begin{code}\obeyspaces +Here is some text.\newline +\glsni{begin}\marg{tabular}\oarg{b}\marg{cc}\newline +A \glsni{ampchar} B\glsni{tab.dbbackslashchar}\newline +C \glsni{ampchar} D\newline +\glsni{end}\marg{tabular}\newline +The rest of the line. +\end{code}% +produces: +\begin{result}[Image illustrating the typeset output: the last row +of the tabulated material rests on the baseline of the text outside it.] +Here is some text. +\begin{tabular}[b]{cc} +A & B\\ +C & D +\end{tabular} +The rest of the line. +\end{result} + +Since a box can't be broken across a line of text, you can use +the box making command: +\begin{definition} +\gls{mbox}\marg{\meta{text}} +\end{definition} +to prevent \meta{text} from spanning a line break. + +\xminisec{Example:} +Compare: +\begin{code} +\gls{raggedright} +Some text at the beginning of a paragraph. Some +text in the middle of the paragraph. Some more text. +\glsni{par} +\end{code} +\begin{result}[Image of typeset output: paragraph is left-justified] +\raggedright +Some text at the beginning of a paragraph. Some text in the +middle of the paragraph. Some more text. +\par +\end{result} +with: +\begin{code} +\gls{raggedright} +Some text at the beginning of a paragraph. \glsni{mbox}\marg{Some +text in the middle of the paragraph.} Some more text. +\glsni{par} +\end{code} +\begin{result}[Image of typeset output: line break occurs at the +start of the second sentence leaving a large white space at the end +of the first line.] +\raggedright +Some text at the beginning of a paragraph. \mbox{Some text in the +middle of the paragraph.} Some more text. +\par +\end{result} +(If \gls{raggedright} had not been used, the text in the \glsni{mbox} +would've spilt out over the edge of the page.) + +Another type of box which can again be placed in a line of text, +is the \gls{env-minipage} environment. +\begin{definition} +\glsni{begin}\marg{minipage}\oarg{\meta{pos}}\oarg{\meta{height}}% +\marg{\meta{width}} +\end{definition} +As the name suggests, this environment creates a \dq{mini-page} +of the given width. + +\xminisec{Example:} +\begin{code} +Some text.\newline +\glsni{begin}\marg{minipage}\marg{2in}\newline +This is a mini-page. The text inside +it is formatted as usual.\newline +\mbox{}\newline +Paragraph breaks can also be used, but +there is no indentation by default\gls{footnote}\marg{and +this is how a footnote appears}.\newline +\glsni{end}\marg{minipage}\newline +The rest of the line. +\end{code}% +which produces:\reportpagebreak +\begin{result}[Image: the contents of the minipage including +footnote have been typeset in a rectangular block within the outer +line of text.] +Some text. +\begin{minipage}{2in} +This is a mini-page. The text inside +it is formatted as usual. + +Paragraph breaks can also be used, but +there is no indentation by default\mpexfootnote{and +this is how a footnote appears}. +\end{minipage} +The rest of the line. +\end{result} + +You can optionally specify a height, and how +the mini-page is aligned with the rest of the text. As with +the \gls{env-tabular} environment, the alignment +option \meta{pos} can be one of \texttt{t} (top), \texttt{c} (centred) +or \texttt{b} (bottom). The default is \texttt{c}, which is why +the above example has the mini-page centred vertically. This +can be changed, for example: +\begin{code} +Some text.\newline +\glsni{begin}\marg{minipage}\oarg{t}\marg{2in}\newline +This is a mini-page. The text inside +it is formatted as usual.\newline +\mbox{}\newline +Paragraph breaks can also be used, but +there is no indentation by default\gls{footnote}\marg{and +this is how a footnote appears}.\newline +\glsni{end}\marg{minipage}\newline +The rest of the line. +\end{code} +which produces +\begin{result}[Image: as previous example but the first line of the +minipage is aligned with the outer text.] +\begin{makeimage} +Some text. +\begin{minipage}[t]{2in} +This is a mini-page. The text inside +it is formatted as usual. + +Paragraph breaks can also be used, but +there is no indentation by default\mpexfootnote{and this +is how a footnote appears}. +\end{minipage} +The rest of the line. +\end{makeimage} +\end{result} + +Note that the width can be specified relative to the current +line width, using the \gls{length} register \gls{linewidth}. For example, +\begin{alltt} +\glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} +\end{alltt} +will start a mini-page that is half the width of the current +line. + +There is also a corresponding command +\begin{definition} +\gls{parbox}\oarg{\meta{pos}}\oarg{\meta{height}}% +\marg{\meta{width}}\marg{\meta{text}} +\end{definition}% +which behaves in a similar way. So the above example can be +rewritten using a \glsni{parbox}: +\begin{code} +Some text.\newline +\glsni{parbox}[t]\marg{2in}\marg{This is a parbox. +The text inside +it is formatted as usual.\newline +\mbox{}\newline +Paragraph breaks can also be used, but +there is no indentation by default.}\newline +The rest of the line. +\end{code} +which produces +\begin{result}[Image: as previous example but without a footnote] +Some text. +\parbox[t]{2in}{This is a parbox. +The text inside +it is formatted as usual. + +Paragraph breaks can also be used, but +there is no indentation by default.} +The rest of the line. +\end{result} +You may have noticed that the \gls{footnote} command has +not been used in the above example. The \glsni{parbox} command +is more restricted than the +\gls{env-minipage} environment, so you can't use the +\gls{footnote} command in it. There are also certain +environments, such as the +\htmlref{list-making +environments}{sec:lists}\latex{\ifscreenorother{}{\ +described in \sectionref{sec:lists}}}, that can be +used in a \gls{env-minipage} but not in a \glsni{parbox}. + +\setnode{fbox} +\subsection{Framed Boxes} +\label{sec:fbox} + +Recall the \gls{framebox} command described in \sectionref{sec:optional}: +\begin{definition} +\glsni{framebox}\oarg{\meta{width}}\oarg{\meta{align}}\marg{\meta{text}} +\end{definition} +This treats \meta{text} as a box of width \meta{width} and puts a frame around it. +The second optional argument may be one of: \texttt{c} (centred +contents), \texttt{l} (left-aligned contents), \texttt{r} +(right-aligned contents). + +\xminisec{Example:} + +\begin{codeS} +Some \glsni{framebox}\oarg{2in}\marg{framed} text. +\end{codeS} +\begin{resultS}[Some framed text (the word 'framed' is inside a 2 +inch wide box)] +Some \framebox[2in]{framed} text. +\end{resultS} + +There is a shorter related command with no optional arguments: +\begin{definition} +\gls{fbox}\marg{\meta{text}} +\end{definition} + +The \isty{fancybox} package provides some additional framing +commands: +\begin{definition} +\gls{shadowbox}\marg{\meta{text}} +\end{definition} +Puts a shadow-style frame around its contents:\bookpagebreak +\begin{codeS} +Some \glsni{shadowbox}\marg{framed} text. +\end{codeS} +\begin{resultS}[Some framed text (the word 'framed' is in a +box with a shadow)] +Some \shadowbox{framed} text. +\end{resultS} + +\begin{definition} +\gls{doublebox}\marg{\meta{text}} +\end{definition} +Puts a double-lined frame around its contents: +\begin{codeS} +Some \glsni{doublebox}\marg{framed} text. +\end{codeS} +\begin{resultS}[Some framed text (the word 'framed' is in a +box with a double lined frame)] +Some \doublebox{framed} text. +\end{resultS} + +\begin{definition} +\gls{ovalbox}\marg{\meta{text}} +\end{definition} +Puts a thin-lined oval frame around its contents: +\begin{codeS} +Some \glsni{ovalbox}\marg{framed} text. +\end{codeS} +\begin{resultS}[Some framed text (the word 'framed' is in a +a box with rounded corners)] +Some \ovalbox{framed} text. +\end{resultS} + +\begin{definition} +\gls{Ovalbox}\marg{\meta{text}} +\end{definition} +Puts a thick-lined oval frame around its contents: + +\begin{codeS} +Some \glsni{Ovalbox}\marg{framed} text. +\end{codeS} +\begin{resultS}[Some framed text (the word 'framed' is in a +a thick bordered box with rounded corners)] +Some \Ovalbox{framed} text. +\end{resultS} + +If you want a different frame effect, you will need to use a +graphical package, such as \isty{pgf}/\isty{tikz}. + +\xminisec{Example:} + +This example uses commands beyond the scope of this book, +but gives you an idea of what's possible. + +\begin{code} +\begin{verbatim} +\documentclass{scrartcl} + +\usepackage{tikz} +\usetikzlibrary{shapes} +\usetikzlibrary{decorations.pathmorphing} + +\begin{document} + +Some +\begin{tikzpicture}[baseline=(n.base),decoration=bumps] +\node[draw,ellipse,decorate] (n) {framed}; +\end{tikzpicture} +text. + +\end{document} +\end{verbatim} +\end{code} +\begin{resultS}[Some framed text (the word 'framed' is in a +decorated with a wiggly border)] +Some +\begin{tikzpicture}[baseline=(n.base),decoration=bumps] +\node[draw,ellipse,decorate] (n) {framed}; +\end{tikzpicture} +text. +\end{resultS} + +For further details, see the \isty{pgf} \htmlref{documentation}{sec:texdoc}. + +\xminisec{Related \gls{ukfaq} topics:} +\begin{itemize} +\item \faqlink{Automatic sizing of minipage}{varwidth} +\item \faqlink{Float(s) lost}{fllost} +\item \faqlink{Perhaps a missing \cmdname{item}?}{errmissitem} +\end{itemize} + +%%%%%%%%%%%%%%%%% CHAPTERS, SECTIONS ETC %%%%%%%%%%%%%%%%%%%%%%% + +\setnode{structure} +\chapter{Structuring Your Document} +\label{ch:sections} + +Let's go back to the document we modified in \exerciseref{ex:tabular}. +In this \latexhtml{chapter}{section} we shall edit that document +step by step until we have a fully-fledged document with title, +abstract, table of contents, sections etc. + +%%%%%%%%%%%%%%%%%% Maketitle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{title} +\section{Author and Title Information} +\label{sec:title} + +The term \keyword{title page} is used to indicate the author, title and +date information that can appear either on the front cover by itself +or along the top of the first page of text. In order to do this, you +must first specify the information. Once this information has been +specified it can then be displayed. + +The author, title and date are entered using the +\glspl{command}: +\begin{definition} +\gls{author}\marg{\meta{author names}} +\\%\end{definition} +%\begin{definition} +\gls{title}\marg{\meta{title text}} +\\%\end{definition} +%\begin{definition} +\gls{date}\marg{\meta{document date}} +\end{definition}% +The \koma\ classes also define: +\begin{definition} +\gls{titlehead}\marg{\meta{Title heading}}\\ +\gls{subject}\marg{\meta{Subject}}\\ +\gls{subtitle}\marg{\meta{Subtitle}}\\ +\gls{publishers}\marg{\meta{Publisher}} +\end{definition} + +\faq{The style of document titles}{titlsty}All these title-related +commands only \emph{store} information, they don't actually display +anything. These commands can be put in the \gls{preamble}. With most +classes, you will typically need to use at least \glsni{author} and +\glsni{title}. + +Once you have used these commands, you can then +display the information using the command:\refstepcounter{object}\label{obj:maketitle} +\begin{definition} +\gls{maketitle} +\end{definition} +This command should be placed where you want the title page to +appear, which is normally at the start of the \gls{env-document} +environment. + +Note that if you don't use the \glsni{date} command, the current +date will be inserted. If you want no date to appear, you need to +specify an empty argument: +\begin{codeS} +\glsni{date}\marg{} +\end{codeS} +\bookpagebreak +Multiple authors should be separated by the command \gls{and}. +For example: +\begin{code} +\begin{alltt} +\glsni{author}\marg{A. Jones\glsni{tab.dbbackslashchar}University of Somewhere \glsni{and} +B. Smith\glsni{tab.dbbackslashchar}University of Somewhere Else} +\end{alltt} +\end{code}% +Within these titling fields, you can also use the command: +\begin{definition} +\gls{thanks}\marg{text} +\end{definition}% +which produces a special type of footnote. For example: +\begin{codeS} +\glsni{title}\marg{A Great Project\glsni{thanks}\marg{funded by XYZ}} +\end{codeS}% +Note that the footnote marker produced using \glsni{thanks} +is considered to have zero width, so if it occurs in the middle +of a line, rather than the end, you will need to insert some +extra space using \gls{spacesym} (backslash space). +The argument of \glsni{thanks} is a \glslink{fragile}{moving +argument}\index{argument!moving|hyperpage}. + +\begin{exercise}{Creating Title Pages}{ex:title} + +Try editing the document you modified in \exerciseref{ex:tabular} to +include title information. Modifications are illustrated in bold +\modification{like this}: + +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrartcl} + +\glsni{usepackage}\marg{datetime} + +\modification{\glsni{title}\marg{A Simple Document}} +\modification{\glsni{author}\marg{Me}} + +\glsni{begin}\marg{document} + +\modification{\glsni{maketitle}} + +This is a simple \glsni{LaTeX}\glsni{spacesym}document. +Here is the first paragraph. + +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. + +\glsni{begin}\marg{tabular}\marg{lrr} + \glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{\glsni{bfseries} Expenditure}\glsni{tab.dbbackslashchar} + \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1} \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar} +\glsni{bfseries} Travel \glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar} +\glsni{bfseries} Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000 +\glsni{end}\marg{tabular} + +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} + +You can \download{title} this document. +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%%% Abstract %%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{abstr} +\section{Abstract} +\label{sec:abstract} + +The \gls{env-abstract} \glsterm{environment} is used to +create an \Index{abstract} for the document\faq{1-column abstract in +2-column document}{onecolabs}. The way in which the +abstract is formatted depends on the class file\indexCLS. The +\icls{scrreprt} class file will put the abstract on a page by itself, +some class files will indent the abstract and some will typeset the +abstract in italic. Note also that some class files (such as +\icls{scrbook}) don't have an \glsni{env-abstract} +environment. Abstracts traditionally go at the start of the document +after the title, so the \glsni{env-abstract} environment should go +after the \gls{maketitle} command. + +\begin{exercise}{Creating an Abstract}{ex:abstr} + +Try editing your document so that it has an abstract: +Modifications are illustrated \modification{like this}: + +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrartcl} + +\glsni{usepackage}\marg{datetime} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} + +\glsni{maketitle} + +\modification{\glsni{begin}\marg{abstract}} +\modification{A brief document to illustrate how to use \glsni{LaTeX}.} +\modification{\glsni{end}\marg{abstract}} + +This is a simple \glsni{LaTeX}\glsni{spacesym}document. +Here is the first paragraph. + +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. + +\glsni{begin}\marg{tabular}\marg{lrr} + \glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{\glsni{bfseries} Expenditure}\glsni{tab.dbbackslashchar} + \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1} \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar} +\glsni{bfseries} Travel \glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar} +\glsni{bfseries} Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000 +\glsni{end}\marg{tabular} + + +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} + +You can \download{abstr} this document. +\end{exercise} + +%%%%%%%%%%%%%%%%% Sections, Subsections etc %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{sectionunits} +\section{Chapters, Sections, Subsections \ldots} +\label{sec:section} + +Chapters, sections, subsections etc can be inserted using the +commands: +\begin{definition} +\gls{part}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{chapter}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{section}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{subsection}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{subsubsection}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{paragraph}\oarg{\meta{short title}}\marg{\meta{title}}\\ +\gls{subparagraph}\oarg{\meta{short title}}\marg{\meta{title}} +\end{definition}% +All these commands have a \latexhtml{moving argument (see +\sectionref{sec:fragile})}{\glslink{fragile}{moving +argument}\index{argument!moving|hyperpage}}, so fragile commands will need to +be protected using \gls{protect}. \faq{How to create a +\cmdname{subsubsub\-section}}{subsubsub}The final two commands in the +above list, \glsni{paragraph} and \glsni{subparagraph}, represent +subsubsubsections and subsubsubsubsections, although most +\glspl{cls} typeset their arguments as unnumbered running titles. + +Note that the availability of these commands depends on the +\gls{cls} you are using. For example, the \icls{scrartcl} class +file that we have been using is designed for articles, so the +\glsni{chapter} command is not defined in that class, whereas it is +defined in the \icls{scrreprt} and \icls{scrbook} class files. + +Each of the commands above has a \gls{mandatory} \meta{title} and an +\gls{optional} \meta{short title}. The mandatory argument +\meta{title} is simply the title of the chapter\slash section\slash subsection +etc. For +example: +\begin{codeS} +\glsni{section}\marg{Introduction} +\end{codeS}% +If you are using the \icls{scrartcl} class file, the output will look +like: +\begin{resultS}[Image: The text '1 Introduction' is typeset in a +large bold font] +\textbf{\sffamily\Large 1\quad Introduction} +\end{resultS}% +Note that you don't specify the section number as \LaTeX\ does this +automatically. This means that you can insert a new section or +chapter or swap sections around or even change a section to a +subsection etc, without having to worry about updating all the +section numbers\faq{The style of section headings}{secthead}. + +\renewcommand{\fmtord}[1]{\textsuperscript{#1}}% +If you are using a class file\indexCLS\ that contains chapters as +well as sections, the section number will depend on the chapter. So, +for example, the current section is the \ordinal{section}\ section +of chapter~\arabic{chapter}, so the section number is \thesection. +\faq{Why are my sections numbered 0.1 ...?}{zerochap}(Note that if +you are using a class file where the section number depends on the +chapter number, you must have a \gls{chapter} command before your +first \gls{section} command, otherwise your section numbers will +come out as 0.1, 0.2 etc.) + +Unnumbered chapters/sections etc are produced by placing an +asterisk \texttt{*} after the command name. For example: +\begin{codeS} +\glsni{chapter}*\marg{Acknowledgements} +\end{codeS} + +You can switch to appendices using the +command +\begin{definition} +\gls{appendix} +\end{definition}% +then continue using \gls{chapter}, \gls{section} +etc\faq{Appendixes}{appendix}. For example (using the \icls{scrreprt} class file): +\begin{code} +\begin{alltt} +\glsni{appendix} +\glsni{chapter}\marg{Derivations} +Some derivations. + +\glsni{chapter}\marg{Tables} +Some tables. +\end{alltt} +\end{code} + +\xminisec{Note:} +The \koma\ classes have another type of sectioning command: +\begin{definition} +\gls{minisec}\marg{\meta{heading}} +\end{definition}\screenpagebreak +This provides an unnumbered heading not associated with any of the +structuring levels. For example, the above was produce using: +\begin{code} +\begin{alltt} +\glsni{minisec}\marg{Note:} +The \koma\ classes have another type of sectioning command: +\end{alltt} +\end{code} +The next note below was produced using: +\begin{code} +\begin{alltt} +\glsni{minisec}\marg{Important Note:} +If you want to change the font style used by headings, +\glsni{emph}\marg{\glsni{bfseries} do not} use font declarations in the sectioning +command arguments. +\end{alltt} +\end{code} + +\xminisec{Important Note:} +If you want to change the font style used by headings, +\emph{\bfseries do not} use font declarations in the sectioning command +arguments. Don't do, for example: +\begin{alltt}\wrong +\glsni{chapter}\marg{\glsni{itshape} Introduction} +\end{alltt} +The \koma\ classes provide the command: +\begin{definition} +\gls{addtokomafont}\marg{\meta{element}}\marg{\meta{commands}} +\end{definition} +where \meta{element} is the name of a structuring element (no +backslash) and \meta{commands} is the list of font changing +declarations (see \tableref{tab:fontsII}) to apply to that element style. +For example, \latexhtml{this book}{the PDF version of this document} +uses the commands: +\begin{code} +\begin{alltt} +\glsni{addtokomafont}\marg{section}\marg{\glsni{rmfamily}\glsni{bfseries}} +\glsni{addtokomafont}\marg{minisec}\marg{\glsni{rmfamily}\glsni{bfseries}\glsni{scshape}} +\end{alltt} +\end{code} + +\begin{exercise}{Creating Chapters, Sections etc}{ex:section} + +Let's try editing our document so that it now has chapters, sections +and an appendix. Since the \icls{scrartcl} class file doesn't have +chapters, let's change to the \icls{scrreprt} class. Changes from our +previous document are shown \modification{like this}. + +\begin{bcode}% +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{\modification{scrreprt}} + +\glsni{usepackage}\marg{datetime} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} +\glsni{maketitle} + +\glsni{begin}\marg{abstract} +A brief document to illustrate how to use \glsni{LaTeX}. +\glsni{end}\marg{abstract} + +\modification{\glsni{chapter}\marg{Introduction}} + +\modification{\glsni{section}\marg{The First Section}} +This is a simple \glsni{LaTeX}\glsni{spacesym}document. +Here is the first paragraph. + +\modification{\glsni{section}\marg{The Next Section}} +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. + +\modification{\glsni{chapter}\marg{Another Chapter}} + +\modification{Here\textquoteright{}s another very interesting chapter.} +\modification{We\textquoteright{}re going to put a picture here later.} + +\modification{\glsni{chapter}*\marg{Acknowledgements}} + +\modification{I would like to acknowledge all those} +\modification{very helpful people who have assisted me in my work.} + +\modification{\glsni{appendix}} + +\modification{\glsni{chapter}\marg{Tables}} +\modification{We will turn this tabular environment into a table later.} + +\glsni{begin}\marg{tabular}\marg{lrr} + \glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{\glsni{bfseries} Expenditure}\glsni{tab.dbbackslashchar} + \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1} \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar} +\glsni{bfseries} Travel \glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar} +\glsni{bfseries} Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000 +\glsni{end}\marg{tabular} + +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} + +(You can \download{section} a copy of this file if you like, but +I~recommend that you try editing the file yourself to give you +practice.) +\end{exercise} + +%%%%%%%%%%%%%%%%%%% Table of Contents %%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{toc} +\section{Creating a Table of Contents} +\label{sec:toc} + +Once you have all your \htmlref{sectioning commands}{sec:section}, +such as \gls{chapter} and \gls{section}, +you can create a table of contents with the command +\begin{definition} +\gls{tableofcontents} +\end{definition}% +This command should go where you want your table of +contents to appear (usually after \gls{maketitle}).\faq{The format of the +Table of Contents, etc}{tocloft} The \koma\ classes provide two +options that govern the format of the table of contents: +\scrclsopt[graduated]{toc} and \scrclsopt[flat]{toc}. The first is the +default and indents the different sectioning levels. The second +doesn't use any indentation. + +\xminisec{Example:} + +\begin{codeS} +\glsni{documentclass}\oarg{12pt,toc=flat}\marg{scrreprt} +\end{codeS} + +You may recall from \htmlref{the previous section}{sec:section} that +the sectioning commands all had an optional argument \meta{short +title}. If your chapter or section title is particularly long\faq{My +section title is too wide for the page header}{runheadtoobig}, you +can use \meta{short title} to specify a shorter title that should go +in the table of contents.\footnote{\label{ftn:header}and in the page header, depending +on the page style.} The longer title (given by the other +argument \meta{title}) will still appear in the section heading in +the main part of the document. + +\LaTeX\ processes all source code sequentially, so when it first +encounters the \glsni{tableofcontents} command, it doesn't yet +know anything about the chapters, sections etc. So the first time +the \htmlref{document is \LaTeX{}ed}{ch:tex2pdf} the necessary +information is written to the table of contents +(\texttt{.toc})\indexTOC\ file (see \sectionref{sec:auxiliary}). The subsequent pass reads the +information in from the \texttt{.toc}\indexTOC\ file, and generates +the table of contents. You will therefore need to \LaTeX\ your +document twice to make sure that the table of contents is +up-to-date\faq{Numbers too large in table of contents, +etc}{tocloftwrong}. + +\xminisec{Adding Extra Information} + +The \htmlref{starred versions}{itm:starredcommand} of the sectional +commands (such as \glsnl{chapter}\texttt{*}) +don't get added to the table of contents. It may be that you want to +add it, in which case you need to use +\begin{definition} +\gls{addcontentsline}\marg{\meta{toc}}\marg{\meta{section +unit}}\marg{\meta{text}} +\end{definition} +after the heading. The first argument \meta{toc} is the file +extension without the dot. As mentioned above, the table of contents +file has the extension \texttt{.toc}, so the first argument should +be \texttt{toc} (\htmlref{later}{ch:floats}\latex{ in \chapterref{ch:floats}}, +we'll be adding a list of figures and a list of tables, and those +have file extensions \texttt{.lof}\indexLOF\ and \texttt{.lot}\indexLOT, respectively). +The second argument \meta{section unit} is the name of the section +unit. This is just the name of the relevant sectioning command +\emph{without} the backslash. The final argument \meta{text} is the +entry text. For example (using \icls{scrreprt} class): +\begin{code} +\gls{chapter}*\marg{Acknowledgments}\newline +\glsni{addcontentsline}\marg{toc}\marg{chapter}\marg{Acknowledgements} +\end{code} + +\begin{exercise}{Creating a Table of Contents}{ex:toc} + +Try modifying your document so that it has a table of contents. +Modifications from the previous exercise are illustrated +\modification{like this}: +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrreprt} + +\glsni{usepackage}\marg{datetime} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} + +\glsni{maketitle} + +\modification{\glsni{tableofcontents}} + +\glsni{begin}\marg{abstract} +A brief document to illustrate how to use \glsni{LaTeX}. +\glsni{end}\marg{abstract} + +\glsni{chapter}\marg{Introduction} + +\glsni{section}\marg{The First Section} + +This is a simple \glsni{LaTeX}\glsni{spacesym}document. Here is the first paragraph. + +\glsni{section}\marg{The Next Section} + +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. + +\glsni{chapter}\marg{Another Chapter} + +Here's another very interesting chapter. +We're going to put a picture here later. + +\glsni{chapter}*\marg{Acknowledgements} + +I would like to acknowledge all those +very helpful people who have assisted +me in my work. + +\glsni{appendix} +\glsni{chapter}\marg{Tables} + +We will turn this tabular environment into a table later. + +\glsni{begin}\marg{tabular}\marg{lrr} + \glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{\glsni{bfseries} Expenditure}\glsni{tab.dbbackslashchar} + \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1} \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar} +\glsni{bfseries} Travel \glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar} +\glsni{bfseries} Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000 +\glsni{end}\marg{tabular} + + +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} + +If your table of contents doesn't come out right, try \LaTeX{}ing it +again. (Again, you can \download{toc} this file.) + +You might want to try experimenting with the +\scrclsopt[flat]{toc} class options to +see what difference it makes: +\begin{codeS} +\glsni{documentclass}\oarg{12pt,toc=flat}\marg{scrreprt} +\end{codeS} + +\end{exercise} + +%%%%%%%%%%%%%%%%% Cross-Referencing %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{crossref} +\section{Cross-Referencing} +\label{sec:crossref} + +We have already seen that \LaTeX\ takes care of all the numbering for +the chapters etc, but what happens if you want to refer to a chapter +or section? There's no point leaving \LaTeX\ to automatically +generate the section numbers if you have to keep track of them all, +and change all your cross-references every time you add a new +section. Fortunately \LaTeX\ provides a way to generate the correct +number. All you have to do is label the part of the document you want +to reference, and then refer to this label when you want to +cross-reference it\faq{Referring to labels in other +documents}{extref}. \LaTeX\ will then determine the correct number +that needs to be inserted at that point. + +The first part, labelling the place you want to reference, is done +using the command: +\begin{definition} +\gls{label}\marg{\meta{string}} +\end{definition}\refstepcounter{object}\label{obj:label}% +The \gls{argument} \meta{string} should be a +unique textual label. This label can be anything you like as long as +it is unique, but it's a good idea to make it something obvious +so that, firstly, you can remember the label when you want to +use it, and secondly, when you read through your code at some later +date, it's immediately apparent to you to which part of the +document you are referring. People tend to have their own conventions +for labelling. I usually start the label with two or three letters +that signify what type of thing I'm labelling. For example, if I'm +labelling a chapter I'll start with \texttt{ch}, if I'm labelling a +section I'll start with \texttt{sec}. + +\xminisec{Examples:} + +\begin{enumerate} +\item Labelling a chapter: + +\begin{code} +\begin{alltt} +\glsni{chapter}\marg{Introduction} +\glsni{label}\marg{ch:intro} +\end{alltt} +\end{code} + +\item Labelling a section: + +\begin{code} +\begin{alltt} +\glsni{section}\marg{Technical Details} +\glsni{label}\marg{sec:details} +\end{alltt} +\end{code} +\end{enumerate} + +Note that the \glsni{label} command doesn't produce any text, it +simply assigns a label. You can now refer to that object +using the command: +\begin{definition} +\gls{ref}\marg{\meta{string}} +\end{definition} +which will produce the relevant number. + +\xminisec{Example:} +\begin{codeS} +See Section \glsni{ref}\marg{sec:results} for an analysis +of the results. +\end{codeS} +\refstepcounter{object}\label{cmd:tilde}% +It is a typographical convention that you should never +start a new line with a number. For example, +if you have the text \dq{Chapter~1} the \dq{1} must +be on the same line as the \dq{Chapter}. We can +do this by using an \keyword{unbreakable space}, which will +put a space but won't allow \LaTeX\ to break the line at +that point. This is done using the tilde (\gls{tildechar}) +\htmlref{special character}{sec:chars}, +so the example above should actually be:\bookpagebreak +\begin{codeS} +See Section\glsni{tildechar}\glsni{ref}\marg{sec:results} for an analysis +of the results. +\end{codeS} +There is a similar command to reference the page number: +\begin{definition} +\gls{pageref}\marg{\meta{string}} +\end{definition} + +\xminisec{Example:} +\begin{code} +See Chapter\glsni{tildechar}\glsni{ref}\marg{ch:def} on +page\glsni{tildechar}\glsni{pageref}\marg{ch:def} for a list of definitions. +\end{code} +The label \texttt{ch:def} obviously needs to +be defined somewhere: +\begin{code} +\begin{alltt} +\glsni{chapter}\marg{Definitions} +\glsni{label}\marg{ch:def} +\end{alltt} +\end{code} +In fact, I~have done this in my source code for \chapterref[the +definitions section]{ch:def} of this document, so the above example +would look like: +\begin{resultS}[See Chapter 2 on page 8 for a list of definitions] +See Chapter~\ref*{ch:def} on +page~\pageref*{ch:def} for a list of definitions. +\end{resultS} + +\faq{Referring to things by their name}{nameref}% +It's not just chapters and sections that you can reference, most of +the numbers that \LaTeX\ automatically generates can be +cross-referenced. + +\xminisec{Example:} +The source code for footnote~\ref{ftn:header} \latexhtml{on +page~\pageref{ftn:header}}{in \sectionref{sec:toc}} is: +\begin{code} +\glsni{footnote}\marg{\glsni{label}\marg{ftn:header}and in the page header, depending +on the page style} +\end{code} +\latexhtml{and it was referenced above using:}{and can be referenced +using:} +\begin{code} +The source code for footnote\glsni{tildechar}\glsni{ref}\marg{ftn:header} on +page\glsni{tildechar}\glsni{pageref}\marg{ftn:header} is: +\end{code} + +The \isty{varioref} package provides a more convenient way of doing this using the +command: +\begin{definition} +\gls{vref}\marg{\meta{label}} +\end{definition} +This is like \gls{ref} but also adds information about the location, +such as \dq{on page~\meta{n}} or \dq{on the following page}, if the +corresponding \gls{label} occurs on a different page, so the above +example can be changed to: +\begin{codeS} +The source code for footnote\glsni{tildechar}\glsni{vref}\marg{ftn:header} is: +\end{codeS} +\begin{latexonly} +\ifscreenorother +{% +which produces +\begin{resultS} +The source code for footnote~\vref{ftn:header} is: +\end{resultS} +}% +{% +\bookpagebreak\noindent which still produces +\begin{resultS} +The source code for footnote~\vref{ftn:header} is: +\end{resultS} +Compare with a reference to one of the labels in the next example: +\begin{codeS} +See step\glsni{tildechar}\cmdname{vref}\marg{itm:edit}. +\end{codeS} +which produces: +\begin{resultS} +See step~\vref{itm:edit}. +\end{resultS} +}% +\end{latexonly} +\begin{htmlonly} +which produces +\begin{resultS}[The source code for footnote 5.1 on page 110 is:] +The source code for footnote~\vref{ftn:header} is: +\end{resultS} +\end{htmlonly} + +\xminisec{Caveat:} +You can run into trouble if the \glsni{vref} command occurs on a +page break. When it tries to insert the location information, such +as \dq{on the next page}, the information is no longer correct. This +can cause an \dq{Infinite loop} error. When this happens, either +edit your paragraph so the reference no longer falls on the page +break or use \gls{ref} instead of \glsni{vref} for that instance. + +\xminisec{Another Example:} + +The \gls{env-enumerate} environment \latex{\ifscreenorother{}{described +in \sectionref{sec:enumerate} }}% +automatically numbers the items within an ordered list, so it's +possible to label list items. Recall the numbered list of +instructions at the start of +\chapterref{ch:tex2pdf}. Here's the code: + +\begin{code}[0.9\linewidth] +\begin{alltt} +\glsni{begin}\marg{enumerate} + + \glsni{item}\glsni{label}\marg{itm:edit} Write or edit the source code. + + \glsni{item} Pass the source code to the \glsni{texttt}\marg{latex} or \glsni{texttt}\marg{pdflatex} + application (``\glsni{LaTeX}\glsni{spacesym}the document''). + + \glsni{begin}\marg{itemize} + + \glsni{item} If there are any error messages, + return to Step\glsni{tildechar}\glsni{ref}\marg{itm:edit}. + + \glsni{item} If there are no error messages, a PDF file + is created, go to Step\glsni{tildechar}\glsni{ref}\marg{itm:view}. + \glsni{end}\marg{itemize} + + \glsni{item}\glsni{label}\marg{itm:view} View the PDF file to check the result. + +\glsni{end}\marg{enumerate} +\end{alltt} +\end{code} +Output: +\begin{result}[enumerateref.html] +\begin{enumerate} + + \item\label{itm:edit} Write or edit the source code. + + \item Pass the source code to the \texttt{latex} or \texttt{pdflatex} application + (\dq{\LaTeX\ the document}). + + \begin{itemize} + + \item If there are any error messages, + return to Step~\ref*{itm:edit}. + + \item If there are no error messages, a PDF file + is created, go to Step~\ref*{itm:view}. + \end{itemize} + + \item\label{itm:view} View the PDF file to check the result. + +\end{enumerate} +\end{result} + +The \gls{ref} and \gls{pageref} commands may come before or +after the corresponding \gls{label} command. As with the table +of contents, \LaTeX\ first writes out all the cross-referencing +information to another file (the \iauxfile, see \sectionref{sec:auxiliary}) and then reads it in the +next time, so you will need to \LaTeX\ your document twice to get +everything up-to-date. + +If the references aren't up-to-date, you will see the following +message at the end of the \LaTeX\ run: +\begin{verbatim} +LaTeX Warning: Label(s) may have changed. +Rerun to get cross-references right. +\end{verbatim} +The following warning +\begin{verbatim} +LaTeX Warning: There were undefined references. +\end{verbatim} +means that \LaTeX\ found a reference to a label that +does not appear in the auxiliary file\indexAUX. This could +mean that it's a new label, and the warning +will go away the next time you \LaTeX\ your document, +or it could mean that either you've forgotten to +define your label with the \gls{label} command, +or you've simply misspelt the label. The undefined references +will show up as two question marks \doublequestionmark\ in the \gls{output}. + +\faq{\dq{Rerun} messages won't go away}{rerun}Very occasionally, if you have cross-references +and a table of contents, you might have to \LaTeX\ +your document three times to get everything up to +date. Just check to see if the \texttt{Label(s) may have changed} +warning appears. + +If you find it inconvenient having to remember to click the typeset +button twice, you can use \iappname{latexmk}. This will run \LaTeX\ +the required number of times to ensure the document is up-to-date. +To do this in TeXWorks, change the drop-down menu to \dq{LaTeXmk}, as +illustrated in \figureref{fig:latexmk}. Note that \appname{latexmk} +is a \gls{perl} script, so you need to make sure you have +\iappname{perl} installed (see \sectionref{sec:perl}). + +\begin{figure}[htbp] +\figconts + {pictures/texworks-latexmk} + {% + \caption{Selecting LaTeXmk in TeXWorks} + }% + {fig:latexmk} +\end{figure} + +If \appname{latexmk} isn't listed in the drop-down menu, you can add +it via \menu{Edit}\menuto\menu{Preferences}. This opens the dialog +box shown in \figureref{fig:texworks-pref}. You can add a new tool +as follows: + +\begin{enumerate} +\item To the right of the box +labelled \dq{Processing Tools} there is a button marked with a plus +(+) sign. Click on it to open the tool configuration dialog, shown +in \figureref{fig:texworks-toolconfig}. + +\item Fill in the name \dq{LaTeXmk} in the box labelled \dq{Name} and either type +in the location of \appname{latexmk} in the box labelled \dq{Program} +or use the \dq{Browse} button to locate it on your filing system. +(See \figureref{fig:texworks-toolconfig2}.) This will vary depending +on your operating system and \gls{tex}-distribution, but it will +probably be in a subdirectory (folder) called \texttt{bin} somewhere +in the \gls*{tex}-distribution tree. + +\item There are lots of options that can be passed to +\appname{latexmk}, but if you want to produce PDF output you need to +add \texttt{-pdf} as an argument. This is done by clicking on the +button marked with a plus to the right of the \dq{Arguments} box and +type \texttt{-pdf}, as shown in \figureref{fig:texworks-toolconfig3}. + +\item Another argument needs to be added that specifies the +basename of the \LaTeX\ file. This is done by again clicking on the +plus button and typing \verb|$basename|, as shown in +\figureref{fig:texworks-toolconfig4} . + +\item Click on \dq{OK} to close the Tool Configuration dialog. + +\item If you want to set \appname{latexmk} to be your default +processing tool, you can select it from the drop-down list labelled +\dq{Default}. + +\item Click \dq{OK} when you're done. +\end{enumerate} + +\begin{figure}[htbp] +\figconts + {pictures/texworks-preferences} + {% + \caption{TeXWorks Preferences} + } + {fig:texworks-pref} +\end{figure} + +\begin{figure}[htbp] +\figconts + {pictures/texworks-toolconfig1} + {% + \caption{Tool Configuration Dialog} + } + {fig:texworks-toolconfig} +\end{figure} + +\begin{figure}[htbp] +\figconts + {pictures/texworks-toolconfig2} + {% + \caption{Tool Configuration Dialog: set the name and program +location} + } + {fig:texworks-toolconfig2} +\end{figure} + +\begin{figure}[htbp] +\figconts + {pictures/texworks-toolconfig3} + {% + \caption{Tool Configuration Dialog: adding \protect\texttt{-pdf} argument} + } + {fig:texworks-toolconfig3} +\end{figure} + +\begin{figure}[htbp] +\figconts + {pictures/texworks-toolconfig4} + {% + \caption{Tool Configuration Dialog: adding \protect\texttt{\$basename} argument} + } + {fig:texworks-toolconfig4} +\end{figure} + +\begin{exercise}{Cross-Referencing}{ex:crossref} + +Try modifying your code so that it has cross-references. +Again, changes made from the previous exercise are +illustrated \modification{like this}: +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrreprt} + +\glsni{usepackage}\marg{datetime} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} + +\glsni{maketitle} + +\glsni{tableofcontents} + +\glsni{begin}\marg{abstract} +A brief document to illustrate how to use \glsni{LaTeX}. +\glsni{end}\marg{abstract} + +\glsni{chapter}\marg{Introduction} +\modification{\glsni{label}\marg{ch:intro}} + +\glsni{section}\marg{The First Section} + +This is a simple \glsni{LaTeX}\glsni{spacesym}document. Here is the first paragraph. +\modification{The next chapter is Chapter\glsni{tildechar}\glsni{ref}\marg{ch:another}} +\modification{and is on page\glsni{tildechar}\glsni{pageref}\marg{ch:another}.} +\modification{The next section is Section\glsni{tildechar}\glsni{ref}\marg{sec:next}.} + +\glsni{section}\marg{The Next Section} +\modification{\glsni{label}\marg{sec:next}} + +Here is the second paragraph\glsni{footnote}\marg{with a footnote}. +As you can see it's a rather short paragraph, but not +as short as the previous one. This document was +created on: \glsni{today}\glsni{spacesym}at \glsni{currenttime}. + +\glsni{chapter}\marg{Another Chapter} +\modification{\glsni{label}\marg{ch:another}} + +Here's another very interesting chapter. +We're going to put a picture here later. +\modification{See Chapter\glsni{tildechar}\glsni{ref}\marg{ch:intro} for an } +\modification{introduction.} + +\glsni{chapter}*\marg{Acknowledgements} + +I would like to acknowledge all those +very helpful people who have assisted +me in my work. + +\glsni{appendix} +\glsni{chapter}\marg{Tables} + +We will turn this tabular environment into a table later. + +\glsni{begin}\marg{tabular}\marg{lrr} + \glsni{ampchar} \glsni{multicolumn}\marg{2}\marg{c}\marg{\glsni{bfseries} Expenditure}\glsni{tab.dbbackslashchar} + \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year1} \glsni{ampchar} \glsni{multicolumn}\marg{1}\marg{c}\marg{Year2}\glsni{tab.dbbackslashchar} +\glsni{bfseries} Travel \glsni{ampchar} 100,000 \glsni{ampchar} 110,000\glsni{tab.dbbackslashchar} +\glsni{bfseries} Equipment \glsni{ampchar} 50,000 \glsni{ampchar} 60,000 +\glsni{end}\marg{tabular} + +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} +(You can \download{crossref} a copy of this file.) + +\end{exercise} + +%%%%%%%%%%%%%%%%%%%% Bibliography %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{biblio} +\section{Creating a Bibliography} +\label{sec:bib} + +If you have a large number of citations in your document, it's best +to use an external bibliographic application\faq{Creating a BibTeX +bibliography file}{buildbib}, such as \iappname{bibtex} or +\iappname{biber}. However, that is beyond the scope of this +book (see, instead, \latexguide, \latexcomp\ +or \latexthesis). Therefore this section just gives a brief +explanation of the \gls{env-thebibliography} environment, which is +usually automatically generated using \appname{bibtex} or +\appname{biber}. + +\begin{definition} +\glsni{begin}\marg{thebibliography}\marg{\meta{widest tag}} +\end{definition} +This environment is very similar to the list making environments described +in \sectionref{sec:lists}, but instead of \gls{item} use +\begin{definition} +\gls{bibitem}\oarg{\meta{tag}}\marg{\meta{key}} +\end{definition}% +where \meta{key} is a unique keyword that identifies this +item. Your keyword can be anything you like, but as with +\glsni{label} I~recommend that you use +a short memorable keyword. I~tend to use the first author's surname +followed by the year of publication. + +The bibliography heading depends on the class file you are using. +Most of the article-style classes, such as \icls{scrreprt}, use +\glsi{refname} (which produces \dq{\refname}) in an unnumbered +section, whereas the report and book-styles, such as \icls{scrreprt} +and \icls{scrbook}, use \glsi{bibname} (which produces +\dq{\bibname}) in an unnumbered chapter. See +\tableref{tab:textlab} for the list of the common textual label +commands. + +Most class files don't automatically add the bibliography to the +table of contents. The \koma\ classes provide the +\scrclsopt{bibliography} option. This can be +\scrclsopt[totoc]{bibliography} (an unnumbered unit added to the +table of contents), for example, +\begin{codeS} +\glsni{documentclass}\oarg{bibliography=totoc}\marg{scrreprt} +\end{codeS} +or \scrclsopt[totocnumbered]{bibliography} (a +numbered unit added to the table of contents), for example, +\begin{codeS} +\glsni{documentclass}\oarg{bibliography=totocnumbered}\marg{scrreprt} +\end{codeS} +If you're not using +one of the \koma\ classes, consult the +\htmlref{documentation}{sec:texdoc} for your class to see if +there is an equivalent option. Failing that, you can use +\gls{addcontentsline} (described in \sectionref{sec:toc}). +For example (using a class that defines chapters): +\begin{code} +\glsni{addcontentsline}\marg{toc}\marg{chapter}\marg{\glsni{bibname}}\\ +\glsni{begin}\marg{bibliography}\marg{1} +\end{code} + +\xminisec{Example:} +(This example uses the command \gls{LaTeXe} which produces the +\LaTeXe\ logo. This indicates the current version of \LaTeX\ rather +than the old 2.09 version.)\footnote{If a friend or colleague gives +you a file containing \cmdname{documentstyle} instead of \cmdname{documentclass} +they are nearly 20~years out of date.} +The class style in use is \cls{scrbook}, so the title is +given by \glsni{bibname} (\dq{Bibliography}). +\begin{code} +\glsni{begin}\marg{thebibliography}\marg{3}\newline +\glsni{bibitem}\marg{lamport94} \glsni{quotedblleft}\glsni{LaTeX}: a document preparation +system\glsni{quotedblright}, Leslie Lamport, 2nd edition (updated for +\glsni{LaTeXe}), Addison-Wesley (1994).\newline +\mbox{}\newline +\glsni{bibitem}\marg{kopka95} \glsni{quotedblleft}A Guide to \glsni{LaTeX}: document +preparation for beginners and advanced users\glsni{quotedblright}, +Helmut Kopka and Patrick W. Daly, Addison-Wesley (1995).\newline +\mbox{}\newline +\glsni{bibitem}\marg{goossens94} \glsni{quotedblleft}The +\glsni{LaTeX}\glsni{spacesym}Companion\glsni{quotedblright}, +Michel Goossens, Frank Mittelbach and +Alexander Samarin, Addison-Wesley, (1994).\newline +\mbox{}\newline +\glsni{end}\marg{thebibliography} +\end{code} +\begin{result}[references.html] +\dobibexamplenumbered +\end{result} + +You can cite an item in your bibliography with the command +\begin{definition} +\gls{cite}\oarg{\meta{text}}\marg{\meta{key list}} +\end{definition}% + +\bookpagebreak +\xminisec{Example:} +\begin{code} +\begin{alltt} +For more information about writing bibliographies see +Goossens \glsni{emph}\marg{et al.}\glsni{tildechar}\glsni{cite}\marg{goossens94}. +\end{alltt} +\end{code}% +Output: +\begin{resultS}[cite.html] +For more information about writing +bibliographies see +Goossens \emph{et al.}~[3]. +\end{resultS} +If you want to cite multiple works, use +a comma-separated list: +\begin{code} +\begin{alltt} +For more information about writing bibliographies +see\glsni{tildechar}\glsni{cite}\marg{kopka95,goossens94}. +\end{alltt} +\end{code}% +Output: +\begin{resultS}[mcite.html] +For more information about writing bibliographies +see~[2,3]. +\end{resultS} +The \gls{optional} \meta{text} to +the \glsni{cite} command can be used to add text to the +citation. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +For more information about writing bibliographies see +Goossens \glsni{emph}\marg{et al.}\glsni{tildechar}\glsni{cite}\oarg{Chapter~13}\marg{goossens94}. +\end{alltt} +\end{code}% +Output: +\begin{result}[chcite.html] +For more information about writing bibliographies see +Goossens \emph{et al.}~[3, Chapter~13]. +\end{result} + +The \gls{env-thebibliography} environment has +a \gls{mandatory}: +\begin{definition} +\glsni{begin}\marg{thebibliography}\marg{\meta{widest tag}} +\end{definition}% +The argument \meta{widest tag} is the widest tag in the list of +entries. This helps \LaTeX\ to align the references correctly. In +the example above, the tags appeared as: [1], [2] and [3], and [3] +is the widest so that was used as the argument. These tags can be +changed from the default numbers to something else using +the optional argument to the \gls{bibitem} command. + +\xminisec{Example (Textual Tags):} + +This example uses the \gls{optional} of \gls{bibitem} to use textual +rather than numerical tags. The widest tag is [Goossens 1994] +so that is chosen to be the argument of the \gls{env-thebibliography} +environment: +\begin{code} +\glsni{begin}\marg{thebibliography}\marg{Goossens 1994}\newline +\mbox{}\newline +\glsni{bibitem}[Lamport 1994]\marg{lamport94} +\glsni{quotedblleft}\glsni{LaTeX}\cmdname{ } : a document +preparation system\glsni{quotedblright}, Leslie Lamport, 2nd edition +(updated for \glsni{LaTeXe}), Addison-Wesley (1994).\newline +\mbox{}\newline +\glsni{bibitem}[Kopka 1995]\marg{kopka95} +\glsni{quotedblleft}A Guide to \glsni{LaTeX}: document +preparation for beginners and advanced users\glsni{quotedblright}, Helmut Kopka +and Patrick W. Daly, Addison-Wesley (1995).\newline +\mbox{}\newline +\glsni{bibitem}[Goossens 1994]\marg{goossens94} +\glsni{quotedblleft}The \glsni{LaTeX}\glsni{spacesym}Companion\glsni{quotedblright}, +Michel Goossens, Frank Mittelbach and +Alexander Samarin, Addison-Wesley, (1994).\newline +\mbox{}\newline +\glsni{end}\marg{thebibliography} +\end{code} +\begin{result}[references2.html] +\dobibexamplelabelled +\end{result} + +\begin{exercise}{Creating a Bibliography}{ex:biblio} + +Try adding the following chapter to your document: +\begin{code} +\glsni{chapter}\marg{Recommended Reading} + +For a basic introduction to \glsni{LaTeX}\glsni{spacesym}see +Lamport\glsni{tildechar}\glsni{cite}\marg{lamport94}. For +more detailed information about \glsni{LaTeX}\glsni{spacesym}and +associated applications, consult Kopka and +Daly\glsni{tildechar}\glsni{cite}\marg{kopka95} or Goossens +\glsni{emph}\marg{et +al}\glsni{tildechar}\glsni{cite}\marg{goossens94}. +\end{code}% +and also add the bibliography shown above to the end of your +document. You can \downloadorview{biblio} the solution, but have a +go by yourself first. Remember that, as before, you will need to +\LaTeX\ the document twice to get the references up-to-date, unless +you're using \iappname{latexmk} (as described in +\sectionref{sec:crossref}) in which case it will be done +automatically. + +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%%% Page Styles %%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{pagestyle} +\section{Page Styles and Page Numbering} +\label{sec:pagestyle} + +You may have noticed that the documents you have created +have all had their page numbers automatically inserted +at the foot of most of the pages\faq{Page numbering +\dq{\meta{n} of \meta{m}}}{nofm}. If you have created the document +that has gradually been modified over the previous few +sections, you may have noticed that the title page has +no header or footer, the table of contents starts on page~1, +the abstract page has no page number, and the pages after +the abstract start on page~1 and continue incrementally +onwards from that point. All the page numbers are Arabic +numerals. This can be changed using the command: +\begin{definition} +\gls{pagenumbering}\marg{\meta{style}} +\end{definition}% +where \meta{style} can be one of: +\begin{fwlist}{\pagenumberingfmt{arabic}} +\fwitem{\ipagenumbering{arabic}} Arabic numerals (1, 2, 3, \ldots) +\fwitem{\ipagenumbering{roman}} Lower case Roman numerals (i, ii, iii, \ldots) +\fwitem{\ipagenumbering{Roman}} Upper case Roman numerals (I, II, III, \ldots) +\fwitem{\ipagenumbering{alph}} Lower case alphabetical characters (a, b, c, \ldots) +\fwitem{\ipagenumbering{Alph}} Upper case alphabetical characters (A, B, C, \ldots) +\end{fwlist} + +Traditionally, the front matter (table of contents, list of figures +etc) should have lower case Roman numeral page numbering, while the +main matter should be in Arabic numerals\faq{Page numbering by +chapter}{pagebychap}. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +\glsni{author}\marg{Me} +\glsni{title}\marg{A Simple Document} +\glsni{maketitle} + +\glsni{pagenumbering}\marg{roman} +\glsni{tableofcontents} + +\glsni{begin}\marg{abstract} +This is the abstract. +\glsni{end}\marg{abstract} + +\glsni{pagenumbering}\marg{arabic} +\glsni{chapter}\marg{Introduction} +\end{alltt} +\end{code} + +The \icls{scrbook} class provides: +\begin{definition} +\gls{frontmatter} +\end{definition} +which switches to lower case Roman numeral page numbering, and +\begin{definition} +\gls{mainmatter} +\end{definition} +which switches to Arabic numeral page numbering. +These two declarations also +change the way the sectioning units, such as \gls{chapter} and +\gls{section}, appear. The former, \glsni{frontmatter}, +suppresses the numbering (regardless of whether or not you've used +the \htmlref{starred version}{itm:starredcommand} of the sectioning commands). The latter, +\glsni{mainmatter}, switches the numbering back on (unless +otherwise suppressed by using the starred sectioning commands). +In addition, \icls{scrbook} provides +\begin{definition} +\gls{backmatter} +\end{definition} +which doesn't affect the page numbering but, like \glsni{frontmatter}, suppresses the +sectional unit numbering. + +\xminisec{Note:} + +The \gls{env-abstract} environment isn't defined by the \icls{scrbook} class, as +a book summary is usually incorporated into an introductory section. + +\xminisec{Example:} + +\begin{code} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{scrbook} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} +\glsni{maketitle} + +\glsni{frontmatter} +\glsni{tableofcontents} + +\glsni{chapter}\marg{Summary} +A brief document to +illustrate how to use \glsni{LaTeX}. + +\glsni{mainmatter} + +\glsni{chapter}\marg{Introduction} +\glsni{label}\marg{ch:intro} + +\glsni{end}\marg{document} +\end{alltt} +\end{code} + +The headers and footers can be changed using the command +\begin{definition} +\gls{pagestyle}\marg{\meta{style}} +\end{definition}% +Individual pages can be changed using +\begin{definition} +\gls{thispagestyle}\marg{\meta{style}} +\end{definition}% +Standard styles are: +\begin{fwlist}{myheadings} +\fwitem{\ipagestyle{empty}} No header or footer. +\fwitem{\ipagestyle{plain}} Header empty, page number in footer. +\fwitem{\ipagestyle{headings}} Header contains page number and various information, + footer empty. +\fwitem{\ipagestyle{myheadings}} Header specified by user, footer empty. +\end{fwlist} + +If the \ipagestyle{myheadings} style is used, the header information +can be specified using: +\begin{definition} +\gls{markboth}\marg{\meta{left head}}\marg{\meta{right head}} +\end{definition}% +if the \clsopt{twoside} option has been passed to the +\gls{cls} (default for \icls{scrbook}), or +\begin{definition} +\gls{markright}\marg{\meta{right head}} +\end{definition}% +if the \clsopt{oneside} option has been passed to the \gls{cls} +(default for \icls{scrartcl} and \icls{scrreprt}). + +The \icls{scrreprt} class file uses the \pagestylefmt{empty} style +for the \Index{title} and \Index{abstract} pages and +\pagestylefmt{plain} for the first page of each new chapter. By +default the remaining pages are also \pagestylefmt{plain}, but +these can be changed using the \glsni{pagestyle} command. +The \icls{scrbook} class defaults to the \pagestylefmt{headings} +style instead of \pagestylefmt{plain}. + +\faq{Alternative head- and footlines in LaTeX}{fancyhdr}% +The \koma\ bundle provides a way to define new page +styles, but that's beyond the scope of this introductory tutorial. +See the \koma\ documentation for further details if you are +interested. + +\casemedia + {% A4 + This book mostly uses the \pagestylefmt{headings} page style and the + \icls{scrbook} class with the + \clsopt{oneside} option, so there is no difference between odd and + even page headers, whereas the paperback version uses the + \clsopt{twoside} option, so the odd pages display the chapter + number and title and the even pages display the current section + header and title. The on-screen PDF version of this book uses a page style + I~defined myself that incorporates a navigation bar in the footer. + }% + {% screen + This screen version of the book uses a page style I~defined myself + that incorporates a navigation bar in the footer. + The \htmladdnormallink{A4 version}{\baseurl/latex/novices/novices-a4.pdf} mostly uses + the \pagestylefmt{headings} page style. If you look at it, you + will see that the chapter number and title appear on the top left and + the page number appears in the top right of most pages. The + \clsopt{oneside} option was used, so there is no difference between + the formatting of odd and even numbered pages. Whereas the paperback + version uses the \clsopt{twoside} option so the odd and even page + headers are different. + } + {% book + This book mostly\footnote{I made some modifications to the page style + for the footers in the summary and index.}\ uses the \pagestylefmt{headings} + page style and the \icls{scrbook} class with the + \clsopt{twoside} option, so the odd and even page headers are + different, whereas the A4 PDF version (available from + \url{\baseurl/}) uses the \clsopt{oneside} option, so the odd and + even page headers are the same. + The on-screen PDF version of this book uses a page style + I~defined myself that incorporates a navigation bar in the footer. + } + {% html + The \htmladdnormallink{A4 + version}{\baseurl/latex/novices/novices-a4.pdf} of this book + mostly uses the \pagestylefmt{headings} page style. If you look at it, you + will see that the chapter number and title appear on the top left and + the page number appears in the top right of most pages. The + \clsopt{oneside} option was used, so there is no difference between + the formatting of odd and even numbered pages. Whereas the paperback + version uses the \clsopt{twoside} option, so the odd pages display the chapter + number and title and the even pages display the current section + header and title. + The \htmladdnormallink{on-screen PDF + version}{\baseurl/latex/novices/novices-screen.pdf} of this book + uses a page style I~defined myself that incorporates a navigation bar + in the footer. + } + +\begin{exercise}{Page Styles and Page Numbering}{ex:pagestyle} + +Try modifying your code so that it uses the \icls{scrbook} class, +\gls{frontmatter} and \gls{mainmatter}. Replace the +\gls{env-abstract} environment with an unnumbered chapter, as shown +below. Again, changes made from the previous document are illustrated +\modification{like this}:\screenpagebreak +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\oarg{12pt}\marg{\modification{scrbook}} + +\glsni{usepackage}\marg{datetime} + +\modification{\glsni{pagestyle}\marg{headings}} + +\glsni{title}\marg{A Simple Document} +\glsni{author}\marg{Me} + +\glsni{begin}\marg{document} + +\glsni{maketitle} + +\modification{\glsni{frontmatter}} +\glsni{tableofcontents} + +\modification{\glsni{chapter}\marg{Summary}} +A brief document to +illustrate how to use \glsni{LaTeX}. + +\modification{\glsni{mainmatter}} + +\glsni{chapter}\marg{Introduction} +\glsni{label}\marg{ch:intro} + +\glsni{section}\marg{The First Section} + +This is a simple \glsni{LaTeX}\glsni{spacesym}document. +Here is the first paragraph. +The next chapter is Chapter\glsni{tildechar}\glsni{ref}\marg{ch:another} +and is on page\glsni{tildechar}\glsni{pageref}\marg{ch:another}. +The next section is Section\glsni{tildechar}\glsni{ref}\marg{sec:next}. + +\glsni{percentchar} Rest of document unchanged but +\glsni{percentchar} omitted for brevity. +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} +(You can \downloadorview{pagestyle} the edited +document.) + +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%% babel %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{babel} +\section{Multi-Lingual Support: using the +\texorpdfstring{\sty{babel}}{babel} package} +\label{sec:babel} + +You may have noticed that the \gls{tableofcontents} and +\gls{chapter} commands have produced English words like +\dq{Contents} and \dq{Chapter}\faq{How to change LaTeX's \dq{fixed +names}}{fixnam}. If you are writing in another language, this is not +appropriate. In this case, you can use the \isty{babel} package, +and specify which language you will be using, either as an option to +the \isty{babel} package, or as an option to the class file\faq{Using +a new language with Babel}{newlang}. If you are writing in more than +one language, list all the languages that you will be using where +the last named language is the default language\faq{Parallel +setting of text}{parallel}. For example: +\begin{alltt} +\glsni{usepackage}\oarg{english,french}\marg{babel} +\end{alltt} +or +\begin{alltt} +\glsni{documentclass}\oarg{english,french}\marg{scrreprt} +\glsni{usepackage}\marg{babel} +\end{alltt} +You can then switch between the named languages either using the +\gls{declaration}: +\begin{definition} +\gls{selectlanguage}\marg{\meta{language}} +\end{definition}% +or the \gls{env-otherlanguage} \glsterm{environment}: +\begin{definition} +\glsni{begin}\marg{otherlanguage}\marg{\meta{language}} +\end{definition}% +These will affect all translations, including the date format +and predefined names like \dq{Chapter}. This also changes the +\gls{hyphenation} patterns.\latex{ (See \sectionref{sec:hyphenation}.)} + +If you only want to set a short section of text in a different +language, without affecting the date format or predefined names, +then you can either use the command: +\begin{definition} +\gls{foreignlanguage}\marg{\meta{language}}\marg{\meta{text}} +\end{definition}% +or the starred version of the \glsni{env-otherlanguage} environment: +\begin{definition} +\glsni{begin}\marg{otherlanguage*}\marg{\meta{language}} +\end{definition}% +You can test to see if a given language is currently selected +using: +\begin{definition} +\gls{iflanguage}\marg{\meta{language}}\marg{\meta{true text}}% +\marg{\meta{false text}} +\end{definition}% + +\xminisec{Example:} +\begin{code} +\begin{alltt} +\glsni{documentclass}\oarg{UKenglish,USenglish,french}\marg{scrartcl} +\glsni{percentchar} french is the last named option, so that's the current language + +\glsni{usepackage}\oarg{T1}\marg{fontenc} +\glsni{usepackage}\oarg{utf8}\marg{inputenc} +\glsni{usepackage}\marg{babel} + +\glsni{begin}\marg{document} +Ce texte est en fran\glsni{c}\marg{c}ais. La date aujourd'hui est: \glsni{today}. + +\glsni{selectlanguage}\marg{USenglish} +This text is in US English. Today's date is: \glsni{today}. + +\glsni{selectlanguage}\marg{UKenglish} +This text is in UK English. Today's date is: \glsni{today}. +\glsni{end}\marg{document} +\end{alltt} +\end{code} +Result: +\begin{result}[babel.html] +Ce texte est en fran\c{c}ais. La date aujourd'hui est~: +{\datefrench\docdate}. + +This text is in US English. Today's date is: {\usdate\docdate}. + +This text is in UK English. Today's date is: {\ukenglishdate\docdate}. +\end{result} + +\xminisec{Note:} +\warning If you are using the \istyopt{babel}{french} option, the +colon character (\Indextt{:}) is made active (that is, it's turned +into a special character) so if you are writing in French it's best +not to use a colon in labels (so where I've used, say, +\texttt{ch:def} you may need to change the colon to something else). + +%%%%%%%%%%%%%%%%%%%%%%%% graphicx %%%%%%%%%%%%%%%%%%% + +\setnode{graphicx} +\chapter{The \texorpdfstring{\sty{graphicx}}{graphicx} Package} +\label{ch:graphicx} + +It is possible to generate images using \LaTeX\ commands\faq{Drawing +with TeX}{drawing} (See the \isty{pgf}\slash\isty{tikz} package or +\latexgraphic) however most people find it easier to create a +picture in some other application, and include that file into their +\LaTeX\ document. + +PDF\LaTeX\ can insert PDF, PNG and JPG image files into your +document. If your image file is in a different format, you may be +able to find an application to convert it. \faq{Spawning programs +from (La)TeX: \cmdname{write}18}{spawnprog}Modern +\gls{tex}-distributions can automatically convert EPS\indexEPS\ +files to PDF during the \LaTeX\ run using the \gls{perl} script +\iappname{epstopdf}. If your \gls{tex}-distribution doesn't support +this, you can convert your EPS file using \appname{epstopdf} +explicitly. For example, if you have an EPS image called, say, +\texttt{sample-image.eps}, you can convert it to a PDF image called +\texttt{sample-image.pdf}, by using the following command in a +\glslink{terminal}{terminal or command prompt}: +\begin{verbatim} +epstopdf sample-image.eps +\end{verbatim} +or (full path name may be required) +\begin{verbatim} +perl epstopdf sample-image.eps +\end{verbatim} + +To insert an image file into your document, you first need to specify that +you want to use the \isty{graphicx} package. So the following must +go in the \gls{preamble}: +\begin{codeS} +\glsni{usepackage}\marg{graphicx} +\end{codeS} +The image can then be included in your document using the command +\begin{definition} +\gls{includegraphics}\oarg{\meta{key-val options}}\marg{\meta{filename}} +\end{definition} +where \meta{filename} is the name of your image file \emph{without the file +extension}\faq{\dq{Modern} graphics file names}{grffilenames}, and +\meta{key-val options} is a comma-separated list of options that can be +used to change the way the image is displayed. Note that if you have an +image where the file name contain spaces or multiple dots, you need to +use the \isty{grffile} package: +\begin{codeS} +\glsni{usepackage}\marg{graphicx,grffile} +\end{codeS} + +\xminisec{Example:} + +Suppose you had a file called \texttt{shapes.pdf}, then to +include it in your document you would do: +\begin{codeS} +\glsni{includegraphics}\marg{shapes} +\end{codeS}% +which would produce: +\begin{resultS*} +\incGraphics[alt=Image of some shapes]{pictures/shapes} +\end{resultS*} + +You can specify a full or relative pathname, but you must use a +forward slash \gls{dir.slash} as the directory divider, even if you are using +Windows. For example: +\begin{codeS} +\glsni{includegraphics}\marg{pictures\glsni{dir.slash}shapes} +\end{codeS} +means the file \texttt{pictures/shapes.pdf} on Unix-type systems, +and it means the file \texttt{pictures\backslashsym shapes.pdf} on +Windows.\footnote{Or \texttt{shapes.png} or \texttt{shapes.jpg} or +\texttt{shapes.eps}. The example assumes a PDF image file.} This is +mainly because the backslash character is a \LaTeX\ special +character indicating a command, but it also helps portability +between platforms. + +You can specify the order of the file types to look for with the command +\begin{definition} +\gls{DeclareGraphicsExtensions}\marg{\meta{ext-list}} +\end{definition}% +where \meta{ext-list} is a comma-separated list of extensions. +For example, +you might want to search first for PDF files, then for PNG files, +then for JPG files and finally for EPS files: +\begin{codeS} +\glsni{DeclareGraphicsExtensions}\marg{.pdf,.png,.jpg,.eps} +\end{codeS}% +The default for \iPDFLaTeX\ is: +\begin{flushleft}\ttfamily +.png\comma .pdf\comma .jpg\comma .mps\comma .jpeg\comma .jbig2\comma .jb2\comma .PNG\comma .PDF\comma .JPG\comma .JPEG\comma .JBIG2\comma .JB2\comma .eps +\end{flushleft} + +The \gls{optional} \meta{key-val options} +should be a comma-separated list of +\meta{key}\texttt{=}\meta{value} pairs. Common options are: + +\begin{fwlist}{\ikeyvalopt{includegraphics}{trim}=\meta{l} \meta{b} \meta{r} \meta{t}} +\fwitem{\ikeyvalopt{includegraphics}{angle}=\meta{\mathorit{x}}} rotate the image +by \degrees{x} anticlockwise. + +\fwitem{\ikeyvalopt{includegraphics}{width}=\meta{length}} scale the image so that the +width is \meta{length}. (Remember to specify the +\htmlref{units}{tab:units}.) + +\fwitem{\ikeyvalopt{includegraphics}{height}=\meta{length}} scale the image so that the +height is \meta{length}. (Remember to specify the +\htmlref{units}{tab:units}.) + +\fwitem{\ikeyvalopt{includegraphics}{scale}=\meta{value}} Scale the image by \meta{value} + +\fwitem{\ikeyvalopt{includegraphics}{trim}=\meta{l} \meta{b} \meta{r} \meta{t}} Specifies +the amount to remove from each side. For example +\begin{codeS} + \glsni{includegraphics}\oarg{trim=1 2 3 4}\marg{shapes} +\end{codeS} +crops the image by 1bp from the left, 2bp from the bottom, 3bp from +the right and 4bp from the top. (Recall the \iunit{bp}{big point} unit +from \tableref{tab:units}.)\reportpagebreak + +\fwitem{\ikeyvalopt{includegraphics}{draft}} Don't actually print the image, just draw a +box of the same size and print the filename inside it. + +\end{fwlist} + +\xminisec{Example:} + +This example first rotates the image by \degrees{45} anticlockwise, +then scales it so that the width is 1~inch. + +\begin{codeS} +\glsni{includegraphics}\oarg{angle=45,width=1in}\marg{shapes} +\end{codeS} + +\begin{resultS}[Image of shapes rotated then scaled] +\includegraphics[angle=45,width=1in]{pictures/shapes} +\end{resultS} + +Note that this isn't the same as scaling and then rotating: +\begin{codeS} +\glsni{includegraphics}\oarg{width=1in,angle=45}\marg{shapes} +\end{codeS} + +\begin{resultS}[Image of shapes scaled then rotated] +\includegraphics[width=1in,angle=45]{pictures/shapes} +\end{resultS} + +You can also scale an image relative to the text area using the +\gls{length} registers \gls{textwidth} and \gls{textheight}. For +example, to scale a portrait image so that its height is +three-quarters of the text area height, you can do: +\begin{codeS} +\glsni{includegraphics}\oarg{height=0.75\glsni{textheight}}\marg{shapes} +\end{codeS} +or to scale a landscape image so that its width is half the text +area width, you can do: +\begin{codeS} +\glsni{includegraphics}\oarg{height=0.5\glsni{textwidth}}\marg{shapes} +\end{codeS} + +\xminisec{Note:} + +The \gls{includegraphics} command is another form of box (see +\sectionref{sec:boxes}), and can be used in the middle of a line of +text, just like the \gls{env-tabular} environment. See +\sectionref{sec:figures} to find out how to put the image in a +figure with a caption. + +\xminisec{Example:} + +\refstepcounter{object}\label{example:inlinegraphic}% +Recall the \iunit{ex}{relative unit} unit of measure from +\tableref{tab:units}. This can be used to scale +an image relative to the font size: +\begin{code} +An image can be inserted into a line +of text like this: +\glsni{includegraphics}\oarg{height=2ex}\marg{shapes} +\end{code} +\begin{resultS}[Image of typeset output: the included image has been +scaled so that it fits into the line of text] +An image can be inserted into a line +of text like this: +\includegraphics[height=2ex]{pictures/shapes} +\end{resultS} + +\setnode{graphictrans} +\section{Graphical Transformations} +\label{sec:graphtrans} + +The \isty{graphicx} package also provides commands to rotate, resize, +reflect and scale text. They are as follows: +\begin{definition} +\gls{rotatebox}\oarg{\meta{option list}}\marg{\meta{angle}}\marg{\meta{text}} +\end{definition} +Rotates \meta{text} by \meta{angle} (degrees anti-clockwise by +default). The optional argument \meta{option list} is a +comma-separated list of any of the following options: + +\begin{itemize} + \item \ikeyvalopt{rotatebox}{units}=\meta{number} + + The number of units in one full anti-clockwise rotation. So + \texttt{units=-360} means that \meta{angle} specifies degrees + clockwise whereas \texttt{units=6.283185} means that + \meta{angle} is in radians. + + \item \ikeyvalopt{rotatebox}{origin}=\meta{label} + + The point of rotation. + The value \meta{label} may contain one from either or both of + the two lists: \texttt{lrc} (left, right, centre) and \texttt{tbB} + (top, bottom, baseline). Alternatively the origin may be + specified using the following two keys: + + \item \ikeyvalopt{rotatebox}{x}=\meta{dimen} + + \item \ikeyvalopt{rotatebox}{y}=\meta{dimen} +\end{itemize} + +\xminisec{Example:} +\begin{code} +\begin{alltt} +base line +\glsni{rotatebox}\marg{45}\marg{Some text} +\glsni{rotatebox}\oarg{units=-360}\marg{45}\marg{Some text} +\glsni{rotatebox}\oarg{units=-360,origin=rB}\marg{45}\marg{Some text} +\glsni{rotatebox}\oarg{x=3em,y=3em}\marg{45}\marg{Some text} +base line +\end{alltt} +\end{code}\screenpagebreak +\begin{result}[Image of typeset output: each occurrence of 'Some text' has been rotated] +base line +\rotatebox{45}{Some text} +\rotatebox[units=-360]{45}{Some text} +\rotatebox[units=-360,origin=rB]{45}{Some text} +\rotatebox[x=3em,y=3em]{45}{Some text} +base line +\end{result} + +\begin{definition} +\gls{scalebox}\marg{\meta{h scale}}\oarg{\meta{v scale}}\marg{\meta{text}} +\end{definition} +Scales \meta{text} by \meta{h scale} in both directions if \meta{v +scale} omitted, otherwise scales \meta{text} by \meta{h scale} +horizontally and \meta{y scale} vertically. + +\xminisec{Example:} +\begin{codeS} +\glsni{scalebox}\marg{0.8}\marg{Some text} +\end{codeS} +\begin{resultS}[Some text (scaled by a factor of 0.8)] +\scalebox{0.8}{Some text} +\end{resultS} +Compare with: +\begin{codeS} +\glsni{scalebox}\marg{0.8}\oarg{1.2}\marg{Some text} +\end{codeS} +\begin{resultS}[Some text (aspect ratio changed)] +\scalebox{0.8}[1.2]{Some text} +\end{resultS} + +\begin{definition} +\gls{reflectbox}\marg{\meta{text}} +\end{definition} +Reflects \meta{text} (equivalent to \glsni{scalebox}\marg{-1}\oarg{1}\marg{\meta{text}}). + +\xminisec{Example:} +\begin{codeS} +\glsni{reflectbox}\marg{Some text} +\end{codeS} +\begin{resultS}[Some text (mirror image)] +\reflectbox{Some text} +\end{resultS} + +\begin{definition} +\gls{resizebox}\marg{\meta{h length}}\marg{\meta{v length}}\marg{\meta{text}} +\end{definition} +Scales \meta{text} so that it is \meta{h length} wide and \meta{v +length} high. To preserve the aspect ratio, use \gls{resizebox.exclamchar} +instead of one of the dimensions. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +\glsni{resizebox}\marg{12mm}\marg{1cm}\marg{Some text} +\glsni{resizebox}\marg{\glsni{resizebox.exclamchar}}\marg{1cm}\marg{Some text} +\end{alltt} +\end{code}% +\begin{resultS}[Image of typeset output: two instances of 'Some text' scaled with and without changing the aspect ratio.] +\dohtmlcolorbox{% +\resizebox{12mm}{1cm}{Some text} +\resizebox{!}{1cm}{Some text} +} +\end{resultS} + +\setnode{graphicxoptions} +\section{Package Options} + +The \isty{graphicx} package can have the following options passed to +it: +\begin{fwlist}{\optfmt{hiderotate}} +\fwitem{\mdseries \istyopt{graphicx}{draft}} Don't actually display the +images, just print the filename in a box of the correct size. This +is useful if you want to print out a draft copy of a document to +check the text rather than the images. + +\fwitem{\mdseries \istyopt{graphicx}{final}} Opposite of +\istyopt{graphicx}{draft} (default). + +\fwitem{\mdseries \istyopt{graphicx}{hiderotate}} Don't show rotated +text. + +\fwitem{\mdseries \istyopt{graphicx}{hidescale}} Don't show scaled text. + +\end{fwlist} + +Remember that relevant options passed to the class file\indexCLS\ also +affect packages. + +\xminisec{Example (Draft Mode):} + +Draft mode helps to speed up compilation of a large document when +you are editing the text. In the preamble: +\begin{codeS} +\glsni{usepackage}\oarg{draft}\marg{graphicx} +\end{codeS} +or +\begin{code} +\begin{alltt} +\glsni{documentclass}\oarg{draft}\marg{scrbook} + +\glsni{usepackage}\marg{graphicx} +\end{alltt} +\end{code} +Later in the document: +\begin{codeS} +\glsni{includegraphics}\oarg{width=1in,angle=45}\marg{pictures/shapes} +\end{codeS} +\begin{resultS}[Only bounding box and file name drawn] + \incGraphics{pictures/draftimage} +\end{resultS} + +\begin{exercise}{Using the \sty{graphicx} Package}{ex:graphicx} + +Download the image file +\htmladdnormallink{\texttt{shapes.pdf}}{\exerciseurl/shapes.pdf}% +\latex{ from \url{\exerciseurl/}} (or create your own image), +and include it into your document. (You +can \downloadorview{graphicx} an example solution.) +\end{exercise} + +\bookpagebreak\screenpagebreak +For more information on the \isty{graphicx} package see +\latexgraphic\ or the \isty{graphicx} documentation. + +\xminisec{Related \gls{ukfaq} topics:} +\begin{itemize} +\item \faqlink{How to import graphics into (La)TeX documents}{impgraph} +\item \faqlink{Imported graphics in PDFLaTeX}{pdftexgraphics} +\item \faqlink{Imported graphics in dvips}{dvipsgraphics} +\item \faqlink{Imported graphics in dvipdfm}{dvipdfmgraphics} +\item \faqlink{Importing graphics from \dq{somewhere else}}{graphicspath} +\item \faqlink{Portable imported graphics}{graph-pspdf} +\item \faqlink{Repeated graphics in a document}{repeatgrf} +\item \faqlink{Limit the width of imported graphics}{grmaxwidth} +\item \faqlink{Top-aligning imported graphics}{topgraph} +\item \faqlink{Labelling graphics}{labelfig} +\item \faqlink{Graphics division by zero}{divzero} +\end{itemize} + +%%%%%%%%%%%%%%%%%%%%%%%%%%% FLOATS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{floats} +\chapter{Floats} +\label{ch:floats} + +Figures and tables are referred to as \dq{floats} because they are +\emph{floated} to the nearest location. This prevents ugly large +spaces appearing on the page if there isn't enough room for the +figure or table before the page break. Floats have a caption and +associated number\faq{The style of captions}{captsty}. It is +customary for captions to appear at the bottom of figures but at the +top of tables~\cite{turabian96,oxford}. + +For both figures and tables, the caption is generated using the +command: +\begin{definition} +\gls{caption}\oarg{\meta{short caption}}\marg{\meta{text}} +\end{definition}% +Note that the \cmdname{caption} command has a +moving argument\index{argument!moving|hyperpage}, so +\glspl{fragile}\faq{Footnotes in captions}{ftncapt} will need to be +protected using \gls{protect}. The \glsterm{optional} +\meta{short caption} is used to provide an alternative shorter +caption for the list of figures or list of tables, akin to the +optional argument to the \htmlref{sectioning +commands}{sec:section}\latex{\ifscreenorother{}{\ described in +\sectionref{sec:section}}}. + +\xminisec{Note:} + +Although the \glsni{caption} command can have an optional +short title, in general, captions should be brief. They should not +contain lots of description or background detail~\cite{turabian96}. +That type of information should be placed in the main text not the +caption. + +\xminisec{Positioning:} + +\refstepcounter{object}\label{obj:positioning}% +\faq{Wide figures in two-column documents}{widefigs}Both the +\glsni{env-figure} and \glsni{env-table} environments have +an optional argument \meta{placement specifiers}, which indicates +permissible locations for the float. This may be a combination of +\texttt{h} (\dq{here}), \texttt{t} (top), \texttt{b} (bottom) and +\texttt{p} (page of floats.) Note that this only gives a general +guideline as to where the float will end up. The final location is +governed by other factors, such as space left on the page and the +proportion of text to floats on the page. If you omit one or more of the +placement specifiers, then you are prohibiting the float from being +placed in that location. A common mistake is to do +\begin{alltt} +\wrong\glsni{begin}\marg{figure}\oarg{h} +\end{alltt} +which says \dq{I~want the figure here and it can't go anywhere +else!} If the figure \emph{can't} be placed exactly here (for +example, there may not be enough room on the page), then you have +given it no alternative location, which can result in this and all +subsequent figures being dumped at the end of the chapter or +document, or can result in a fatal error when running +\LaTeX\faq{\dq{Too many unprocessed floats}}{tmupfl}. You may be +able to manage with only one of the other options, for example, +\begin{alltt} +\glsni{begin}\marg{figure}\oarg{t} +\end{alltt} +(In fact, modern \TeX\ distributions now replace \oarg{h} with +\oarg{t} if the float can't be placed.) +However, if you have a large number of floats it is advisable to +provide as many options as possible: +\begin{alltt} +\glsni{begin}\marg{figure}\oarg{htbp} +\end{alltt} +Similarly for tables. + +If you are absolutely adamant that an image must go \dq{right here}, +then it's not a float, and you shouldn't be using the +\glsni{env-figure} environment. It's just a horizontal box, like the +example \xpageref{earlier}{example:inlinegraphic}. Similarly for +tabulated material. + +It's worth bearing in mind what the Oxford Style Manual~\cite{oxford} has to say: +\begin{quote} +\dq{Text must not be read into it so as to give [the figure] an +explicit and fixed introduction, for example \sq{in the following +figure}: the final placement is determined by page breaks, which +cannot be anticipated before setting, and this makes rewording the +text necessary if the illustration does not fit the make-up of the +page.} +\end{quote} +Turabian~\cite{turabian96} gives the same advice (and reiterates it for +figures): +\begin{quote} +\dq{All text references to a table should be by a number, not by an +introductory phrase such as \sq{in the following table}.} +\end{quote} + +\setnode{figures} +\section{Figures} +\label{sec:figures} + +Figures are created using the \gls{env-figure} environment. +\begin{definition} +\glsni{begin}\marg{figure}\oarg{\meta{placement specifiers}} +\end{definition}% +This environment may contain one or more captions (specified, as +described \htmlref{above}{ch:floats}, with +the \glsni{caption} command) but page breaks are not allowed in the +contents of a \glsni{env-figure} environment. The optional argument +\meta{placement specifiers} is as described +\htmlref{above}{obj:positioning}. + +Recall from \chapterref{ch:graphicx} that we +can include an image in our document with +the command \gls{includegraphics} defined in the \isty{graphicx} +package. We can put our +\htmladdnormallink{\texttt{shapes.pdf}}{\exerciseurl/shapes.pdf} image +into a figure as follows: +\begin{code} +\glsni{begin}\marg{figure}\oarg{htbp}\newline +\strut~~\glsni{includegraphics}\marg{shapes}\newline +\strut~~\glsni{caption}\marg{Some Shapes}\newline +\glsni{end}\marg{figure} +\end{code}% +So far so good, but our picture needs to be centred. This can +be done using the \gls{centering} declaration mentioned in +\sectionref{sec:declaration}: +\begin{code} +\glsni{begin}\marg{figure}\oarg{htbp}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{shapes}\newline +\strut~~\glsni{caption}\marg{Some Shapes}\newline +\glsni{end}\marg{figure} +\end{code} +The \gls{caption} command generates a number, just like +\gls{section}, so we can +\htmlref{cross-reference}{sec:crossref} it with \gls{ref} and +\gls{label}. First, let's label the figure: +\begin{code} +\glsni{begin}\marg{figure}\oarg{htbp}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{shapes}\newline +\strut~~\glsni{caption}\marg{Some Shapes}\newline +\strut~~\glsni{label}\marg{fig:shapes}\newline +\glsni{end}\marg{figure} +\end{code}% +Now we can reference it: +\begin{codeS} +Figure\glsni{tildechar}\glsni{ref}\marg{fig:shapes} shows some shapes. +\end{codeS}% +(As \htmlref{before}{cmd:tilde} we use \gls{tildechar} +to make an unbreakable space.) This produces the following output +in the text: +\begin{resultS}[Figure 7.1 shows some shapes.] +Figure~\ref*{fig:shapes} shows some shapes. +\end{resultS}% +and produces \figureref{fig:shapes}. + +\begin{figure}[hbtp] +\figconts + {pictures/shapes} + {% + \caption{Some Shapes}% + }% + {fig:shapes} +\end{figure} + +\xminisec{Important Note:} + +If you want to change the caption font, \textbf{\em don't} do, e.g.: +\begin{alltt} +\wrong\glsni{caption}\marg{\gls{bfseries} Some Shapes} +\end{alltt} +Recall \gls{addtokomafont} from \sectionref{sec:section}. This can +also be used to change the fonts used by the caption.\bookpagebreak +\begin{alltt} +\correct\glsni{addtokomafont}\marg{caption}\marg{\glsni{bfseries}} +\end{alltt} +Similarly for the caption label. For example: +\begin{codeS} +\glsni{addtokomafont}\marg{captionlabel}\marg{\glsni{scshape}} +\end{codeS} + +\xminisec{List of Figures} + +Just as we were able to generate a \htmlref{table of +contents}{sec:toc} using \gls{tableofcontents}, we can also +generate a list of figures using the command +\begin{definition} +\gls{listoffigures} +\end{definition} +This creates a file with the extension \texttt{.lof}\indexLOF\ (see +\sectionref{sec:auxiliary}). +As with \reportlinebreak\glsni{tableofcontents} you will need to \LaTeX\ your document twice to +get the list of figures up-to-date, unless +you're using \iappname{latexmk} (as described in +\sectionref{sec:crossref}) in which case it will be done +automatically. + +\begin{exercise}{Creating Figures}{ex:figures} + +If you did \exerciseref{ex:graphicx}, you should have a document +with an image in it. You now need to put this image into a +\gls{env-figure} environment. Remember to centre the image, and give +the figure a caption. Next, try labelling the figure and referencing +it in the text. You could also put in a list of figures after the +table of contents. +You can \downloadorview{figures} an example. + +\end{exercise} + +\setnode{sidebysidefigs} +\subsection{Side-By-Side Figures} +\label{sec:sidebysidefigs} + +Recall at the start of \sectionref{sec:figures}, I mentioned that +the \gls{env-figure} environment may contain one or more captions. +In most cases, you'll just have a single caption per +\glsni{env-figure} environment, but sometimes you may want to have +two figures side-by-side, in which case you'll need two captions +within the same \gls{env-figure} environment in order to keep the +figures together. + +To do this, we can use the +\gls{env-minipage} environment, which was covered +in \sectionref{sec:boxes}. Recall that +the \gls*{env-minipage} environment creates a +\Index{horizontal box}, which means that two mini-pages can +be placed side-by-side on the same line. All you need to do +now, is place one image and caption in one mini-page, and the +other image and caption in the neighbouring mini-page. (Do you remember what effect is obtained +by placing a \htmlref{percent symbol}{obj:suppresseol} at the end of a +line?)\doifbook{\footnote{See page~\pageref{obj:suppresseol}.}}\bookpagebreak +\begin{code} +\glsni{begin}\marg{figure}\oarg{htbp}\newline +\strut~\glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{circle}\newline +\strut~~\glsni{caption}\marg{A Circle}\newline +\strut~~\glsni{label}\marg{fig:circle}\newline +\strut~\glsni{end}\marg{minipage}\glsni{percentchar}\newline +\strut~\glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{rectangle}\newline +\strut~~\glsni{caption}\marg{A Rectangle}\newline +\strut~~\glsni{label}\marg{fig:rectangle}\newline +\strut~\glsni{end}\marg{minipage}\newline +\glsni{end}\marg{figure} +\end{code}% +\latex{The above code produces +Figures~\ref{fig:circle-sbs} and~\vref{fig:rectangle-sbs}. }Note that each +mini-page uses \gls{centering} to centre its contents, and the +label is also placed in the same mini-page, after the +\gls{caption} command. If the \gls{label} was not in the same +\htmlref{scope}{sec:group} as the \gls{caption}, the +cross-reference would be incorrect. + +A common mistake when trying to create side-by-side figures is +to do: +\begin{alltt} +\glsni{begin}\marg{figure}[htbp] + \glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} + \glsni{centering} + \glsni{includegraphics}\marg{circle} + \glsni{caption}\marg{A Circle} + \glsni{label}\marg{fig:circle} + \glsni{end}\marg{minipage} +\wrong + \glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} + \glsni{centering} + \glsni{includegraphics}\marg{rectangle} + \glsni{caption}\marg{A Rectangle} + \glsni{label}\marg{fig:rectangle} + \glsni{end}\marg{minipage} +\glsni{end}\marg{figure} +\end{alltt} +This produces one figure on top of the other, instead of +side-by-side\html{, as illustrated in \figureref{fig:circle-sbs} and +\figureref{fig:rectangle-sbs}}. This is because the blank +line indicates a paragraph break, so each minipage is in a separate +paragraph, so it's not possible for them to be on the same line. + +If you want a bit of spacing in your code to make it more readable, +use \gls{percentchar} to comment out the paragraph break. For +example: +\begin{alltt} +\glsni{end}\marg{minipage}% +\correct\glsni{percentchar} +\glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} +\end{alltt} + + +\begin{figure}[htbp] + \begin{makeimage}\end{makeimage} + \begin{minipage}{0.5\linewidth} + \figuretop{fig:circle-sbs} + \centering + \incGraphics[alt=Image of a circle]{pictures/circle} + \caption{A Circle} + \label{fig:circle-sbs} + \end{minipage}% + \begin{minipage}{0.5\linewidth} + \figuretop{fig:rectangle-sbs} + \centering + \incGraphics[alt=Image of a rectangle]{pictures/rectangle} + \caption{A Rectangle} + \label{fig:rectangle-sbs} + \end{minipage} +\end{figure} + +%%%%%%%%%%%%%%%%%%%%%% Tables %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{tables} +\section{Tables} +\label{sec:tables} + +Tables are produced in much the same way as figures, except that the +\gls{env-table} environment is used instead. +\begin{definition} +\glsni{begin}\marg{table}\oarg{\meta{placement specifiers}} +\end{definition} +Where the optional argument \meta{placement specifiers} is as described +\xpageref{earlier}{obj:positioning}. + +As mentioned at the \htmlref{start of this chapter}{ch:floats}, +tables typically have the caption at the top of the +table~\cite{turabian96}. With the \koma\ classes, such as +\icls{scrartcl}, \icls{scrreprt} and \icls{scrbook}, use the class +option \scrclsopt[tableabove]{captions} to ensure that the vertical +spacing appears correctly between the caption and the table content +and put \gls{caption} at the start of the \envname{table} +environment. \faq{Tables longer than a single page}{longtab}Page +breaks are not permitted in the \glsni{env-table} +environment. (The \isty{longtable} package can be used for that +instead. See the \sty{longtable} \htmlref{documentation}{sec:texdoc} for +further details.) + +\xminisec{Example:} + +In the \glsterm{preamble}: +\begin{codeS} +\glsni{documentclass}\oarg{captions=tableabove}\marg{scrbook} +\end{codeS} +Later in the document: +\begin{code} +\begin{alltt} +\glsni{begin}\marg{table}\oarg{htbp} + \glsni{caption}\marg{A Sample Table} + \glsni{label}\marg{tab:sample} + \glsni{centering} + \glsni{begin}\marg{tabular}\marg{lr} + Item \glsni{ampchar} Cost\glsni{tab.dbbackslashchar} + Video \glsni{ampchar} 8.99\glsni{tab.dbbackslashchar} + CD \glsni{ampchar} 9.99\glsni{tab.dbbackslashchar} + DVD \glsni{ampchar} 15.00 + \glsni{end}\marg{tabular} +\glsni{end}\marg{table} +\end{alltt} +\end{code}% +This produces \tableref{tab:sample}. + +\begin{table}[htbp] +\caption{A Sample Table} +\label{tab:sample} +\centering +\begin{makeimage} +\begin{tabular}{lr} +Item & Cost\\ +Video & 8.99\\ +CD & 9.99\\ +DVD & 15.00 +\end{tabular} +\end{makeimage} +\end{table} + +Again, the \gls{centering} declaration is used to centre the +\gls{env-tabular} environment. +As with figures, you can create a list of tables using the command +\begin{definition} +\gls{listoftables} +\end{definition} +This creates a file with the extension \texttt{.lot}\indexLOT\ (see +\sectionref{sec:auxiliary}). +As with the table of contents and list of figures, you will need to +\LaTeX\ your document twice to get the list of tables up-to-date, unless +you're using \iappname{latexmk} (as described in +\sectionref{sec:crossref}) in which case it will be done +automatically. + +\begin{exercise}{Creating Tables}{ex:tables} +If you did \exerciseref{ex:tabular}, you should have +a \gls{env-tabular} environment in your document. Try +turning this into a table, and add \tableref{tab:sample}. +You could also try adding a list of tables. +As before, you can \downloadorview{tables} the solution. +\end{exercise} + +\setnode{sidebysidetab} +\subsection{Side-by-Side Tables} +\label{sec:sidebysidetab} + +You can create side-by-side tables using an analogous method to +the side-by-side figures approach described +\htmlref{above}{sec:sidebysidefigs}. + +\xminisec{Example:} + +This example is similar to the one in \sectionref{sec:sidebysidefigs}. +Again, take care to ensure that there is no paragraph break between the +two \gls{env-minipage} environments. +\begin{code} +\begin{alltt} +\glsni{begin}\marg{table} + \glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} + \glsni{caption}\marg{Prices for 2011} + \glsni{label}\marg{tab:prices2011} + \glsni{centering} + \glsni{begin}\marg{tabular}\marg{lr} + Item \glsni{ampchar} Price (\pounds)\glsni{tab.dbbackslashchar} + Widgets \glsni{ampchar} 10.99\glsni{tab.dbbackslashchar} + Whatsits \glsni{ampchar} 5.99 + \glsni{end}\marg{tabular} + \glsni{end}\marg{minipage}\glsni{percentchar} +\glsni{percentchar} + \glsni{begin}\marg{minipage}\marg{0.5\glsni{linewidth}} + \glsni{caption}\marg{Prices for 2012} + \glsni{label}\marg{tab:prices2012} + \glsni{centering} + \glsni{begin}\marg{tabular}\marg{lr} + Item \glsni{ampchar} Price (\glsni{pounds})\glsni{tab.dbbackslashchar} + Widgets \glsni{ampchar} 11.99\glsni{tab.dbbackslashchar} + Whatsits \glsni{ampchar} 6.99 + \glsni{end}\marg{tabular} + \glsni{end}\marg{minipage}\glsni{percentchar} +\glsni{end}\marg{table} +\end{alltt} +\end{code} +This produces Tables~\ref{tab:prices2011} and~\vref{tab:prices2012}. + +\begin{table}[htbp] + \begin{minipage}{0.5\linewidth} + \caption{Prices for 2011} + \label{tab:prices2011} + \centering + \begin{makeimage} + \begin{tabular}{lr} + Item & Price (\pounds)\\ + Widgets & 10.99\\ + Whatsits & 5.99 + \end{tabular} + \end{makeimage} + \end{minipage}% +% + \begin{minipage}{0.5\linewidth} + \caption{Prices for 2012} + \label{tab:prices2012} + \centering + \begin{makeimage} + \begin{tabular}{lr} + Item & Price (\pounds)\\ + Widgets & 11.99\\ + Whatsits & 6.99 + \end{tabular} + \end{makeimage} + \end{minipage}% +\end{table} + +\setnode{sidewaysfloats} +\section{Sideways Floats} +\label{sec:sidewaysfloats} + +The \isty{rotating} package provides the \gls{env-sidewaysfigure} +environment: +\begin{definition} +\glsni{begin}\marg{sidewaysfigure} +\end{definition} +and the \gls{env-sidewaystable} environment: +\begin{definition} +\glsni{begin}\marg{sidewaystable} +\end{definition} +which are like \gls{env-figure} and \gls{env-table}, respectively, but rotate the +entire float (including caption) sideways. This sideways float is +always placed on a page of its own. + +If you have used the \clsopt{twoside} class option (or you are +using a class like \icls{scrbook}, which defaults to that option) +then the sideways floats will be rotated clockwise or +anti-clockwise, depending on whether they fall on an even (verso) or +odd (recto) numbered page. (Requires a second \LaTeX\ run to get it +correct.) + +\xminisec{Example:} +\begin{code} +\begin{alltt} +\glsni{begin}\marg{sidewaysfigure} + \glsni{centering} + \glsni{includegraphics}\oarg{width=0.75\glsni{textheight}}\marg{shapes} + \glsni{caption}\marg{A Sideways Figure} + \glsni{label}\marg{fig:sideways} +\glsni{end}\marg{sidewaysfigure} +\end{alltt} +\end{code} +The above code produces \figureref{fig:sideways}. + +\dosidewaysfigure + {fig:sideways} + {\includegraphics[width=0.75\textheight]{pictures/shapes}} + {A Sideways Figure} + +\begin{htmlonly} + \begin{figure} + \figuretop{fig:sideways} + \centering +\makeimg{A sideways figure}{% +\colorbox{white}{% + \rotatebox[br]{90}{% + \begin{tabular}{c} + \includegraphics{pictures/shapes}\\ + {\usekomafont{captionlabel}Figure~\ref*{fig:sideways}}\captionformat A Sideways Figure + \end{tabular} + }% +}% +} + \caption{A Sideways Figure} + \label{fig:sideways} + \end{figure} +\end{htmlonly} + +\setnode{subfloats} +\section{Sub-Floats} +\label{sec:subfloats} + +Some floats have sub-floats within them. For example, a figure may +contain several sub-figures, each of which requires a caption. +The simplest way to do this is to use the \isty{subcaption} package +that provides the \gls{env-subfigure} and \gls{env-subtable} environments: +\begin{definition} +\glsni{begin}\marg{subfigure}\oarg{\meta{pos}}\marg{\meta{width}} +\end{definition} +\begin{definition} +\glsni{begin}\marg{subtable}\oarg{\meta{pos}}\marg{\meta{width}} +\end{definition} +Within these environments, you can use \gls{caption} to create a +sub-caption. (In addition to the main \gls{caption} for the +containing \gls{env-figure} or \gls{env-table} +environment.) + +\xminisec{Note:} +The \isty{subcaption} package requires the \isty{caption} package, +but doesn't automatically load it, so you'll need to load +both:\reportpagebreak +\begin{codeS} +\glsni{usepackage}\marg{caption,subcaption} +\end{codeS} + +\xminisec{Example:} + +This is very similar to the side-by-side figures example from +\sectionref{sec:sidebysidefigs}. + +\begin{code}[0.9\linewidth] +\glsni{begin}\marg{figure}\oarg{htbp}\newline +\strut~\glsni{begin}\marg{subfigure}\oarg{b}\marg{0.5\glsni{linewidth}}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{rectangle}\newline +\strut~~\glsni{caption}\marg{Rectangle}\glsni{label}\marg{fig:rectangle}\newline +\strut~\glsni{end}\marg{subfigure}\glsni{percentchar}\newline +\glsni{percentchar}\newline +\strut~\glsni{begin}\marg{subfigure}\oarg{b}\marg{0.5\glsni{linewidth}}\newline +\strut~~\glsni{centering}\newline +\strut~~\glsni{includegraphics}\marg{circle}\newline +\strut~~\glsni{caption}\marg{Circle}\glsni{label}\marg{fig:circle}\newline +\strut~\glsni{end}\marg{subfigure}\glsni{percentchar}\newline +\glsni{caption}\marg{Two Shapes}\newline +\glsni{label}\marg{fig:shape}\newline +\glsni{end}\marg{figure} +\end{code} + +This produces \figureref{fig:shapes2}. +Elsewhere in the document, the figure and its components can be +referenced: +\begin{code} +Figure\gls{tildechar}\gls{ref}\marg{fig:shapes2} shows some shapes. +Figure\gls{tildechar}\gls{ref}\marg{fig:rectangle} shows a rectangle and +Figure\gls{tildechar}\gls{ref}\marg{fig:circle} shows a circle. +\end{code} +which produces the following text: +\begin{result}[Figure 7.5 shows some shapes. Figure 7.5a shows a +rectangle and Figure 7.5b shows a circle.] +Figure~\ref*{fig:shapes2} shows some shapes. +Figure~\ref*{fig:rectangle} shows a rectangle and +Figure~\ref*{fig:circle} shows a circle.\relax +\end{result} + +You can also reference just the sub-float using +\begin{definition} +\gls{subref}\marg{\meta{label}} +\end{definition} +which is analogous to \gls{ref}, but only displays the sub-float +number without the number associated with its containing float. + +\xminisec{Example:} +\begin{code} +Figure\glsni{tildechar}\cmdname{ref}\marg{fig:shapes2} +shows: (\glsni{subref}\marg{fig:rectangle}) a rectangle and +(\glsni{subref}\marg{fig:circle}) a circle. +\end{code} +produces +\begin{resultS}[Figure 7.5 shows: (a) a rectangle and (b) a circle.] +Figure~\ref*{fig:shapes2} shows: (\subref*{fig:rectangle}) a rectangle and (\subref*{fig:circle}) a circle. +\end{resultS} + +\begin{figure}[htbp] +\begin{makeimage}\end{makeimage} +\figuretop{fig:shapes2} +\centering +\begin{latexonly} + \begin{subfigure}[b]{0.5\linewidth} + \centering + \includegraphics{pictures/rectangle} + \caption{Rectangle}\label{fig:rectangle} + \end{subfigure}% + \begin{subfigure}[b]{0.5\linewidth} + \centering + \includegraphics{pictures/circle} + \caption{Circle}\label{fig:circle} + \end{subfigure}% +\end{latexonly} +\begin{htmlonly} +\begin{tabular}{cc} +\htmladdimg{exercises/rectangle.png} \hspace{0.8in}& +\htmladdimg{exercises/circle.png}\\ +(a) Rectangle & (b) Circle +\end{tabular} +\end{htmlonly} +\caption{Two Shapes} +\label{fig:shapes2} +\end{figure} + +\xminisec{Note:} + +The subfigure labels (a, b, etc) should typically be in +italic~\cite{turabian96}. This can be achieved with the +\isty{caption} package using: +\begin{definition} +\gls{DeclareCaptionLabelFormat}\marg{\meta{format-name}}\marg{\meta{code}} +\end{definition} +where \meta{format-name} is the name for this new format and +\meta{code} is the code used to format the label +where \texttt{\glsni{hashchar}2} gets replaced by the reference number. + +Once you have defined a new format, you can then use +\begin{definition} +\gls{captionsetup}\oarg{\meta{type}}\marg{\meta{options}} +\end{definition} +to switch to that new format. For subfloats, \meta{type} needs to be +set to \texttt{sub}. The second argument \meta{options} is a +\meta{key}=\meta{value} comma-separated list. The key that sets the format is +\ikeyvalopt{captionsetup}{labelformat}. (For further details about +both \glsni{DeclareCaptionLabelFormat} and \glsni{captionsetup}, see +the \isty{caption} package \htmlref{documentation}{sec:texdoc}.) + +For example, to create a format called \texttt{em-noparens} that +displays the number in an emphasized font without parentheses: +\begin{codeS} +\glsni{DeclareCaptionLabelFormat}\marg{em-noparens}\marg{\glsni{emph}\marg{\glsni{hashchar}2}} +\end{codeS} +Now switch to that new format: +\begin{codeS} +\glsni{captionsetup}\oarg{sub}\marg{labelformat=em-noparens} +\end{codeS} + +Note that this only changes the caption label format. It doesn't affect the font +used by \gls{ref} or \glsni{subref}. For \gls{ref}, you can use the +\isty{fncylab} package, which provides the command: +\begin{definition} +\gls{labelformat}\marg{\meta{ctr}}\marg{\meta{defn}} +\end{definition} +Within \meta{defn}, use \glsni{hashchar}1 to represent the subfigure value +and use \glsi{thefigure} for the encapsulating figure number. For +example: +\begin{codeS} +\glsni{labelformat}\marg{subfigure}\marg{\glsni{thefigure}\glsni{emph}\marg{\glsni{hashchar}1}} +\end{codeS} +Now +\begin{codeS} +\glsni{ref}\marg{fig:circle} +\end{codeS} +will produce +\begin{resultS}[7.5a (the letter a is emphasized)] +\ref*{fig:shapes2}\emph{a} +\end{resultS} +Unfortunately, this doesn't work for \glsni{subref}. Instead you will have +to do, for example, the following in the text: +\begin{codeS} +\glsni{emph}\marg{\glsni{subref}\marg{fig:circle}} +\end{codeS} + +If you want to add parentheses, the above can be modified +to: +\begin{code} +\glsni{DeclareCaptionLabelFormat}\marg{em-parens}\marg{(\glsni{emph}\marg{\glsni{hashchar}2})}\newline +\glsni{captionsetup}\oarg{sub}\marg{labelformat=em-parens}\newline +\glsni{labelformat}\marg{subfigure}\marg{\glsni{thefigure}(\glsni{emph}\marg{\glsni{hashchar}1})} +\end{code} +For \glsni{subref}, you will have to do, for example, the following +in the text: +\begin{codeS} +(\glsni{emph}\marg{\glsni{subref}\marg{fig:circle}}) +\end{codeS} + +\begin{exercise}{Creating Sub-Figures}{ex:subfloats} + +Download the image files +\htmladdnormallink{\texttt{rectangle.pdf}}{\exerciseurl/rectangle.pdf} +and \htmladdnormallink{\texttt{circle.pdf}}{\exerciseurl/circle.pdf} +\latex{from \url{\exerciseurl/}} (or create your own images) and +add \figureref{fig:shapes2} to your document. You can +\downloadorview{subfloats} the solution. +\end{exercise} + +%%%%%%%%%%%%%%%%%%% DEFINING COMMANDS %%%%%%%%%%%%%%%%%%% + +\setnode{newcom} +\chapter{Defining Commands} +\label{ch:newcom} + +It's possible to define your own \glspl{command} or +redefine existing ones. Be very careful about redefining existing +commands; don't redefine a command simply because you want to use the +name, only redefine it if you are making a modification. For +example, if you want to change the format of the current date, you +would redefine \gls{today}, but if you want to define a command +to display a specific date, you should define a new command with a +different name. + +There are several reasons why you might want to define +a new command: +\begin{enumerate} + +\item Reduce typing: + +Suppose you have a series of commands or text that +you find yourself frequently using, then you could define +a command to do all these other commands for you. + +\xminisec{Example:} + +Suppose you want a lot of large bold slanted sans-serif +portions of text within your document. Every time you type those +portions of text, you will have to do something like: +\begin{codeS} +\glsni{textsf}\marg{\glsni{large}\glsni{bfseries}\glsni{slshape} Some text} +\end{codeS}% +It would be much easier if you could use just one command +to do all that, called, say, \cmdname{largeboldsfsl}: +\begin{codeS} +\begin{verbatim} +\largeboldsfsl{Some text} +\end{verbatim} +\end{codeS}% +or you could call it, say, \cmdname{lbsfsl} which is shorter, +but slightly less memorable: +\begin{codeS} +\begin{verbatim} +\lbsfsl{Some text} +\end{verbatim} +\end{codeS} + +\item Ensure consistency: + +You may find that you want to format an object a certain +way. + +\xminisec{Example:} + +Recall near the end of \sectionref{sec:subfloats}, I~suggested the +following to reference a subfigure (when using \gls{subref} instead +of \gls{ref}): +\begin{codeS} +(\glsni{emph}\marg{\glsni{subref}\marg{fig:circle}}) +\end{codeS} +For consistency, you might want to define a command, say, +\begin{alltt} +\cmdname{formattedsubref}\marg{\meta{label}} +\end{alltt} +that was the same as +(\glsni{emph}\marg{\glsni{subref}\marg{\meta{label}}}). + +\xminisec{Another Example} + +\refstepcounter{object}\label{example:keywords}% +Suppose your document has a lot of keywords +in it, and you want to format these keywords in a different font, +say sans-serif, so that they stand out. You could just +do: +\begin{codeS} +A \glsni{textsf}\marg{command} usually begins with a backslash. +\end{codeS}% +however, it is better to define a new command called, say, +\cmdname{keyword} that will typeset its argument in a +sans-serif font. That way it becomes a lot easier +to change the format at some later date. For example, +you may decide to splash out and have your keywords +typed in a particular colour. In which case, all you +need to do is simply change the definition of the +command \cmdname{keyword}, otherwise you'll have to +go through your entire document looking for keywords +and changing each one which could be very time consuming if +you have a large document. You might also decide at some +later date to make an index for your document. Indexing +all the keywords then becomes much simpler, as again all you'll +need to do is modify the \cmdname{keyword} command. + +\end{enumerate} + +New commands are defined using the command: +\begin{definition} +\gls{newcommand}\marg{\meta{cmd}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{text}} +\end{definition}% +The first \gls{mandatory} \meta{cmd} is +the name of your new command, which must start with a backslash. +The \gls{optional} \meta{n-args} specifies +how many arguments your new command must take. The next +optional argument \meta{default} will be discussed later. +The final mandatory argument \meta{text} specifies what \LaTeX\ +should do every time it encounters this command. + +\xminisec{Example (No Parameters):} + +Let's begin with a trivial example. Suppose I~wanted to write a +document about a particular course, say \dq{Programming \textemdash\ Languages +and Software Construction}, and I~had to keep writing the course +title, then I~might decide to define a command that prints the course +title rather than having to laboriously type it out every time. +Let's call our new command \cmdname{coursetitle}. We want the +following code: +\begin{codeS} +The course \glsni{emph}\marg{\cmdname{coursetitle}} is an undergraduate course. +\end{codeS}% +to produce the following output: +\begin{result}[coursetitle.html] +The course \emph{Programming \textemdash\ Languages and Software Construction} +is an undergraduate course. +\end{result}% +Clearly this command doesn't need any arguments, so we don't need to +worry about the optional argument \meta{n-args} to +\gls{newcommand}, and the only thing our new command needs to do +is print: +\begin{alltt} +Programming \glsni{emdash} Languages and Software Construction +\end{alltt} +so we would define our new command as follows: +\begin{code} +\glsni{newcommand}\marg{\cmdname{coursetitle}}\marg{Programming \glsni{emdash} Languages and Software Construction} +\end{code}% +Commands must always be defined before they are used. The +best place to define commands is in the +\gls{preamble}: +\begin{code} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{newcommand}\marg{\cmdname{coursetitle}}\marg{Programming \glsni{emdash} Languages +and Software Construction} + +\glsni{begin}\marg{document} + +\glsni{section}\marg{\cmdname{coursetitle}} + +The course \glsni{emph}\marg{\cmdname{coursetitle}} is an undergraduate course. + +\glsni{end}\marg{document} +\end{alltt} +\end{code} + +\xminisec{Example (One Mandatory Argument):} + +\refstepcounter{object}\label{sec:newcomarg}% +Now let's try defining a command that takes an \gls{argument} (or +parameter). Let's go back to our \htmlref{\cmdname{keyword} +example}{example:keywords}\latex{ \vpageref{example:keywords}}. This +command needs to take one argument that is the keyword. Let's +suppose we want keywords to come out in +\htmlref{sans-serif}{sec:fontstyle}, then we could do: +\begin{codeS} +\glsni{newcommand}\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{hashchar}1}} +\end{codeS}% +In this case we have used the optional argument \meta{n-args} to +\gls{newcommand}. We want our command \cmdname{keyword} to have +one argument, so we have \texttt{[1]}. In \texttt{\glsni{textsf}\marg{\glsni{hashchar}1}} the +\gls{hashchar}\texttt{1} represents the first argument. (If we had +more than one argument, \glsni{hashchar}\texttt{2} would represent the second +argument, \glsni{hashchar}\texttt{3} would represent the third argument etc.\ up to a +maximum of~9\faq{How to break the 9-argument limit}{moren9}.) So +\begin{verbatim} +\keyword{commands} +\end{verbatim} +will be equivalent to +\begin{alltt} +\glsni{textsf}\marg{commands} +\end{alltt} +and +\begin{verbatim} +\keyword{environment} +\end{verbatim} +will be equivalent to +\begin{alltt} +\glsni{textsf}\marg{environment} +\end{alltt} +and so on. +Again, it's best to put the command definition in the preamble to +ensure the command won't be used before it's defined. + +\begin{code} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{newcommand}\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{hashchar}1}} + +\glsni{begin}\marg{document} + +A \cmdname{keyword}\marg{command} usually begins with a backslash. + +\glsni{end}\marg{document} +\end{alltt} +\end{code} + +Now if we want to change the way the keywords are formatted, +we can simply change the definition of \cmdname{keyword}. +Let's modify our code so that the keyword is now in a +slanted sans-serif font: +\begin{code} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{newcommand}\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{slshape} \glsni{hashchar}1}} + +\glsni{begin}\marg{document} + +A \cmdname{keyword}\marg{command} usually begins with a backslash. + +\glsni{end}\marg{document} +\end{alltt} +\end{code}% +Let's go one stage further. The \isty{color} +\htmlref{package}{sec:packages} provides the \gls{declaration}: +\begin{definition} +\gls{color}\marg{\meta{col-name}} +\end{definition} +which switches the foreground colour to \meta{col-name}. It also +provides the text-block command: +\begin{definition} +\gls{textcolor}\marg{\meta{col-name}}\marg{\meta{text}} +\end{definition} +which sets \meta{text} in the colour given by \meta{col-name}. + +So let's use the \isty{color} package to make our keywords +blue:\screenpagebreak +\begin{code} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{usepackage}\marg{color} + +\glsni{newcommand}\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{slshape}\glsni{color}\marg{blue}\glsni{hashchar}1}} + +\glsni{begin}\marg{document} + +A \cmdname{keyword}\marg{command} usually begins with a backslash. + +\glsni{end}\marg{document} +\end{alltt} +\end{code} +Or we could index the keywords. To do this we need the +\isty{makeidx} \htmlref{package}{sec:packages} and the commands +\gls{makeindex}, +\begin{inlinedef}\gls{index}\marg{\meta{text}}\end{inlinedef} +and \gls{printindex}: +\begin{code} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{usepackage}\marg{makeidx} + +\glsni{makeindex} + +\glsni{newcommand}\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{slshape} \glsni{hashchar}1}\glsni{index}\marg{\glsni{hashchar}1}} + +\glsni{begin}\marg{document} + +A \cmdname{keyword}\marg{command} usually begins with a backslash. + +\glsni{printindex} + +\glsni{end}\marg{document} +\end{alltt} +\end{code} +For further information about how to create an index, +see \latexguide\ or \latexcomp. +Alternatively, if you want a brief overview, try \latexthesis. + +Since it is unlikely that the keyword will contain a paragraph break, +we should indicate that this is a +\gls{short} using the \htmlref{starred form}{itm:starredcommand}: +\begin{codeS} +\glsni{newcommand}*\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{slshape} \glsni{hashchar}1}\glsni{index}\marg{\glsni{hashchar}1}} +\end{codeS} +Now if you forget to add the closing brace, for example, +\verb|\keyword{command|, then \gls{tex}['s] error checking mechanism will +pick up the error sooner. This will give an error message that +looks like: +\begin{verbatim} +! Paragraph ended before \keyword was complete. +<to be read again> + \par +l.604 +\end{verbatim} +This at least gives you the line number (604 in this example) of the +end of the paragraph where the error has occurred. + +If you don't used the starred form of \gls{newcommand}, then +you will get the somewhat less than helpful error: +\begin{verbatim} +! File ended while scanning use of \keyword. +\end{verbatim} +If you have a very large document, it may take a while to track +down where exactly you have missed a brace. + +\begin{exercise}{Defining a New Command}{ex:newcom} +Try typing up the following code: +\begin{bcode} +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{newcommand}*\marg{\cmdname{keyword}}\oarg{1}\marg{\glsni{textsf}\marg{\glsni{hashchar}1}} + +\glsni{begin}\marg{document} + +A \cmdname{keyword}\marg{command} usually begins with a backslash. + +Segments of code may be \cmdname{keyword}\marg{grouped}. + +Some \cmdname{keyword}\marg{commands} take one or more \cmdname{keyword}\marg{arguments}. +\glsni{end}\marg{document} +\end{alltt} +\end{bcode} + +Then modify your code so that the keywords are in a slanted +sans-serif font or modify your code so that the keywords come out in +blue (using the \isty{color} package as in the example earlier). +Again you can \downloadorview{newcom} the result. + +\xminisec{For the more adventurous:} + +If you want to create an index as in the previous example, you will +need to use the application \iappname{makeindex}. If you used +\iappname{latexmk} back in \sectionref{sec:crossref}, you can just +carry on using that as before. If not you need to do the following +in TeXworks: +\begin{enumerate} + \item Create the PDF as described in \sectionref{sec:texworks}. + + \item Select \menu{MakeIndex} from the drop-down list next to the + build (typeset) button (see \figureref{fig:texworks9}). + + \item Click on the build button. If all goes well, you won't see + anything different. If you see something like the following: +\begin{alltt} +Couldn't find input index file exercise\theexercise\space nor exercise\theexercise.idx. +\end{alltt} + then you probably forgot to add the command \gls{makeindex} to + the preamble. Add it in and go back to Step~1. + + \item Select \menu{pdfLaTeX} from the drop-down list and build the + PDF file again. Move to the last page of the PDF, and you should + see the index. +\end{enumerate} + +\begin{figure}[htbp] +\figconts + {pictures/texworks9} + {% + \caption{Selecting MakeIndex in TeXWorks} + }% + {fig:texworks9} +\end{figure} + +\end{exercise} + +%%%%%%%%%%%%% Defining Commands with an Optional Argument %%%%%%%%%%%%% + +\setnode{newcomopt} +\section{Defining Commands with an Optional Argument} +\label{sec:newcomopt} + +As mentioned earlier, the \gls{newcommand} command has a second +optional argument \meta{default}. This allows you to define a +command with an optional argument\faq{More than one optional +argument}{twooptarg}. For example, suppose we want a command called, +say, \cmdname{price}. Suppose we want the following code: +\begin{codeS} +\begin{verbatim} +\price{100} +\end{verbatim} +\end{codeS}% +to produce the following output: +\begin{resultS}[price.html] +\pounds100 excl VAT @ 17.5\%\relax +\end{resultS}% +and let's suppose we want an optional argument +so that we can change the VAT. That is, we +would want the following code: +\begin{codeS} +\begin{verbatim} +\price[20]{30} +\end{verbatim} +\end{codeS}% +to produce the following output: +\begin{resultS}[price2.html] +\pounds30 excl VAT @ 20\% +\end{resultS}% +Therefore we want to define a command +such that if the optional argument is absent +we will have \texttt{17.5}, and if it is present +the optional argument will be substituted instead. +This command can be defined as follows: +\begin{codeS} +\gls{newcommand}\marg{\cmdname{price}}\oarg{2}\oarg{17.5}\marg{\glsni{pounds} \gls{hashchar}2 excl VAT @ \glsni{hashchar}1\glsni{percent}} +\end{codeS}% +Here, \texttt{\glsni{hashchar}1} represents the optional argument (by default +\texttt{17.5}) and \texttt{\glsni{hashchar}2} represents the mandatory argument (the +second argument if the optional argument is present, or the only +argument if the optional argument is absent.) + +As before, since the argument is unlikely to contain a paragraph +break, we should indicate that it is a \gls{short} using the \htmlref{starred form}{itm:starredcommand}: +\begin{codeS} +\gls{newcommand}*\marg{\cmdname{price}}\oarg{2}\oarg{17.5}\marg{\glsni{pounds} \glsni{hashchar}2 excl VAT @ \glsni{hashchar}1\gls{percent}} +\end{codeS}% + +\begin{exercise}{Defining Commands with an Optional Argument}{ex:newcomopt} +In this exercise, you will need to define a slightly modified +version of the above example. Try defining a command called, +say, \cmdname{cost}. It should take one optional argument and +one mandatory argument. Without the optional argument, it +behaves in the same way as the \cmdname{price} example above, +so that, say, +\begin{codeS} +\begin{verbatim} +\cost{50} +\end{verbatim} +\end{codeS}% +will produce +\begin{resultS}[price3.html] +\pounds50 excl VAT @ 17.5\%\null +\end{resultS}% +but with the optional argument, you can change the +\verb|excl VAT @ 17.5\%| bit. So that, say, +\begin{codeS} +\begin{verbatim} +\cost[inc VAT]{50} +\end{verbatim} +\end{codeS}% +will produce +\begin{resultS}[price4.html] +\pounds50 inc VAT\mbox{}% LaTeX2HTML is getting confused! +\end{resultS} + +You can \downloadorview{newcomopt} the solution. + +\xminisec{For the more adventurous:} +If you did \exerciseref{ex:newcom} and you modified \cmdname{keyword} +so that it indexed the keyword, you may have noticed that +\begin{codeS} +\verb|\keyword{command}| +\end{codeS} +and +\begin{codeS} +\verb|\keyword{commands}| +\end{codeS} +produced separate entries in the index. It would be better to have an +optional argument to override the indexing mechanism. For example, +\begin{codeS} +\verb|\keyword{command}| +\end{codeS} +should print and index the word \dq{command}, +whereas +\begin{codeS} +\verb|\keyword[command]{commands}| +\end{codeS} +should print \dq{commands} +and index \dq{command}. In other words, we need an optional +argument that defaults to the mandatory argument if it is not +present. +This is how to achieve that type of effect:\footnote{Recall from \chapterref{ch:def} the percent symbol discards the space resulting from the end +of line character.} +\begin{code} +\glsni{newcommand}*\marg{\cmdname{keyword}}\oarg{2}\oarg{\cmdname{keywordentry}}\marg{\glsni{percentchar}\newline +\strut~~\icmdname{def}\cmdname{keywordentry}\marg{\glsni{hashchar}2}\glsni{percentchar}\newline +\strut~~\glsni{textsf}\marg{\glsni{hashchar}2}\glsni{percentchar}\newline +\strut~~\gls{index}\marg{\glsni{hashchar}1}\glsni{percentchar}\newline +} +\end{code} +In this example, the default value for the optional argument +is set to the command \cmdname{keywordentry}. At the start of +\cmdname{keyword} this is defined to be the mandatory argument +(as specified by \verb|#2|) using \gls{tex}['s] \cmdname{def} +command:\footnote{\cmdname{def} is too complicated for an +introductory \LaTeX\ guide but, if you're interested, read \emph{The +\TeX{}book}~\cite{texbook}.} +\begin{alltt} +\cmdname{def}\cmdname{keywordentry}\marg{\glsni{hashchar}2} +\end{alltt} +Then typeset the keyword (given in the mandatory +argument \texttt{\glsni{hashchar}2}) in a sans-serif font: +\begin{alltt} +\glsni{textsf}\marg{\glsni{hashchar}2} +\end{alltt} +Now index the term using the optional argument (\texttt{\glsni{hashchar}1}): +\begin{alltt} +\glsni{index}\marg{\glsni{hashchar}1} +\end{alltt} +If an optional argument is specified, \texttt{\glsni{hashchar}1} will be the given +argument, but if the optional argument is missing, \texttt{\glsni{hashchar}1} will +be \cmdname{keywordentry}, which has earlier been set to +the mandatory argument \texttt{\glsni{hashchar}2}. +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%%% Redefining Commands %%%%%%%%%%%%%%%%%%%%% + +\setnode{renewcom} +\section{Redefining Commands} +\label{sec:renewcom} + +Commands can be redefined using the command: +\begin{definition} +\gls{renewcommand}\marg{\meta{cmd}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{text}} +\end{definition}\reportpagebreak\noindent +This has exactly the same format as \gls{newcommand} but is +used for redefining existing commands. +Again there is a \htmlref{starred version}{itm:starredcommand} to indicate that the command +is a \gls{short}. + +\xminisec{Caveat:} + +\warning Never redefine a command whose existing function is unknown +to you or just because you want to use a particular command name, +regardless of its previous function. By way of illustration: as a +production editor, I~have to combine articles by different authors +into a single book. Each author supplies the \LaTeX\ code for their +own article. Every so often, I~get code that redefines a command for +the convenience of the author. Later on another author tries to use +the same command, on the assumption that the command behaves +according to its original definition. This tends to involve the +accent commands as they are short and that saves the author typing. +It usually goes along these lines: author~A redefines \gls{c} (the +cedilla accent command) to display a maths bold +\dq{\boldc} to indicate a +vector. Later, author~B, uses the cedilla accent, say, in the name +Fran\c{c}ois: +\begin{alltt} +Fran\gls{c}\marg{c}ois +\end{alltt} +Author~A's hack turns this into +Fran\boldc cois. + +\xminisec{Example (Redefining List Labels):} + +Recall the \gls{env-itemize} environment discussed in +\sectionref{sec:itemize}. You may have up to four nested +\gls{env-itemize} environments, the labels for the outer environment +are specified by the command \gls{labelitemi}, the labels for +the second level are specified by \gls{labelitemii}, the third +by \gls{labelitemiii} and the fourth by \gls{labelitemiv}. +By default, \glsni{labelitemi} is a bullet point (\makeimg{bullet +symbol}{\labelitemi}), +\glsni{labelitemii} is an en dash (\makeimg{en dash}{\labelitemii}), +\glsni{labelitemiii} is an +asterisk (\makeimg{asterisk}{\labelitemiii}) and +\glsni{labelitemiv} is a centred dot (\makeimg{centered +dot}{\labelitemiv}). These can be changed by redefining +\glsni{labelitemi} etc. + +Recall from \tableref{tab:symbols} that the command +\gls{dag} produces a dagger symbol, we can use this symbol +instead of a bullet point: +\begin{code} +\glsni{renewcommand}*\marg{\glsni{labelitemi}}\marg{\gls{dag}}\newline +\glsni{begin}\marg{itemize}\newline +\mbox{}\newline +\gls{item} Animal\newline +\mbox{}\newline +\glsni{item} Mineral\newline +\mbox{}\newline +\glsni{item} Vegetable\newline +\mbox{}\newline +\glsni{end}\marg{itemize} +\end{code}% +Output: +\begin{result}[List uses dagger symbol instead of a bullet point for +the marker] +\renewcommand*{\labelitemi}{\dag} + +\begin{itemize} + +\item Animal + +\item Mineral + +\item Vegetable + +\end{itemize} +\end{result} + +Here's another example, it uses the \Index{PostScript} +font ZapfDingbats via the \isty{pifont} package: +\begin{code} +\glsni{renewcommand}*\marg{\glsni{labelitemi}}\marg{\gls{ding}\marg{43}}\newline +\glsni{begin}\marg{itemize}\newline +\mbox{}\newline +\glsni{item} Animal\newline +\mbox{}\newline +\glsni{item} Mineral\newline +\mbox{}\newline +\glsni{item} Vegetable\newline +\mbox{}\newline +\glsni{end}\marg{itemize} +\end{code}\bookpagebreak\noindent +Output: +\begin{result}[List uses a pointing finger instead of a bullet point +for the marker] +\renewcommand*{\labelitemi}{\ding{43}} + +\begin{itemize} + +\item Animal + +\item Mineral + +\item Vegetable + +\end{itemize} +\end{result}% +In the above example, it would actually be easier to use the +\gls{env-dinglist} environment defined in the \isty{pifont} package: +\begin{code} +\begin{alltt} +\glsni{begin}\marg{dinglist}\marg{43} + +\glsni{item} Animal + +\glsni{item} Mineral + +\glsni{item} Vegetable\screenpagebreak + +\glsni{end}\marg{dinglist} +\end{alltt} +\end{code} + + +\xminisec{Example (Redefining the Default Font):} + +Recall from \sectionref{sec:changingfonts} that the default font +family is usually the serif (Roman) family. So what happens if you +need to write your entire document in, say, Helvetica? The default +font family name is stored in: +\begin{definition} +\gls{familydefault} +\end{definition} +This command is usually +defined to be just \gls{rmdefault}, which in turn stores the name of the +default serif font (initially \texttt{cmr}, Computer Modern Roman). If +you want the default font to be sans-serif, all you +need do is add the following line to the +\glsterm{preamble}: +\begin{codeS} +\glsni{renewcommand}\marg{\glsni{familydefault}}\marg{\gls{sfdefault}} +\end{codeS} +\glsni{sfdefault} stores the name of the default sans-serif font (initially \texttt{cmss}, +Computer Modern Sans-Serif) and +the \isty{helvet} package redefines \glsni{sfdefault} to \texttt{phv}, +which is the identifier for the Helvetica font. +So the following document will be in Helvetica: +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{usepackage}\marg{helvet} +\glsni{renewcommand}\marg{\glsni{familydefault}}\marg{\glsni{sfdefault}} + +\glsni{begin}\marg{document} +This is a sample document. +\glsni{end}\marg{document} +\end{alltt} +Similarly, if you want the default font to be monospaced (typewriter) then you'd need to do: +\begin{codeS} +\glsni{renewcommand}\marg{\glsni{familydefault}}\marg{\gls{ttdefault}} +\end{codeS} + +Incidentally, you may have noticed in \sectionref{sec:changingfonts} +that although I~said I'd used the \isty{anttor} and +\isty{libris} packages to set the serif and sans-serif families for +\latexhtml{this book}{the PDF version of this book}, I +didn't mention anything about the typewriter (monospaced) font. I~used +the TXTT font, but that doesn't have a corresponding package. You +just redefine \glsni{ttdefault} to \texttt{txtt}: +\begin{codeS} +\glsni{renewcommand}*\marg{\glsni{ttdefault}}\marg{txtt} +\end{codeS} + +\xminisec{Example (Redefining Fixed Names):} + +You may have noticed that \LaTeX\ automatically generates pieces of +text such as \dq{Chapter}, \dq{Figure}, \dq{Bibliography}. These are +generated by the commands shown in \tableref{tab:textlab}. + +\begin{table}[hbtp] +\caption[Predefined Names]{Predefined Names +(\supdag Book and report style classes (such as \icls{scrreprt} and \icls{scrbook}), +\supddag article-style classes (such as \icls{scrartcl}), +remainder book, report and article-style classes)} +\label{tab:textlab} +\centering +\begin{tabular}{ll} +\toprule +\bfseries Command & \bfseries Default Text\\ +\midrule +\gls{contentsname} & \contentsname\\ +\gls{listfigurename} & \listfigurename\\ +\gls{listtablename} & \listtablename\\ +\gls{bibname}\supdag & \bibname\\ +\gls{refname}\supddag & \refname\\ +\gls{indexname} & \indexname\\ +\gls{figurename} & \figurename\\ +\gls{tablename} & \tablename\\ +\gls{partname} & \partname\\ +\gls{chaptername}\supdag & \chaptername\\ +\gls{appendixname} & \appendixname\\ +\gls{abstractname} & \abstractname +\\\bottomrule +\end{tabular} +\end{table} + +You can change the defaults using \gls{renewcommand}. For +example, suppose you want the table of contents to be labelled +\dq{Table of Contents}, instead of the default \dq{Contents}, you +would need to do: +\begin{codeS} +\glsni{renewcommand}*\marg{\glsni{contentsname}}\marg{Table of Contents} +\end{codeS} +\faq{Changing the words babel uses}{latexwords}In fact, the +\isty{babel} package (see \sectionref{sec:babel}) uses this method +to redefine the commands in \tableref{tab:textlab} whenever you +switch language using \reportlinebreak\screenlinebreak +\gls{selectlanguage} or within the contents of +the \gls{env-otherlanguage} environment. This unfortunately has the +side-effect that means if you try to redefine these commands, +\sty{babel} will automatically overwrite your definition whenever +there's a language change, which includes at the beginning of the +\gls{env-document} environment. Instead you need to use +\sty{babel}'s \glsni{addto} mechanism. +\begin{definition} +\gls{addto}\marg{\meta{command}}\marg{\meta{code}} +\end{definition} +This patches the definition of a command (specified in the first +\gls{argument}) adding \meta{code} to the end of the command +definition. Whenever \sty{babel} switches the current language, it +uses the command \cmdname{captions}\meta{language}, which performs +all the redefinitions of commands like those listed in +\tableref{tab:textlab}. For example, if you are using \sty{babel} +with the \istyopt{babel}{english} option and you want to change +\glsni{contentsname} so that it does \dq{Table of Contents} instead +of \dq{Contents}, you need to do: +\begin{code} +\begin{alltt} +\glsni{addto}\marg{\cmdname{captionsenglish}}\marg{\glsni{percentchar} + \glsni{renewcommand}\marg{\glsni{contentsname}}\marg{Table of Contents}\glsni{percentchar} +} +\end{alltt} +\end{code} + +\xminisec{Notes:} + +\warning Take care if you want to patch an existing command. For +example, suppose you want to append something to the action of a +command. You might be tempted to do +\begin{alltt} +\wrong\glsni{renewcommand}*\marg{\cmdname{foo}}\marg{\cmdname{foo} Something else} +\end{alltt} +This will cause an infinite loop where \cmdname{foo} recursively +calls itself. Instead you should use one of the commands provided by +the \isty{etoolbox} package (such as \gls{appto}, which has the same +syntax as \sty{babel}'s \glsni{addto} described above). For further details, +read the \sty{etoolbox} \htmlref{documentation}{sec:texdoc}. + +\begin{exercise}{Renewing Commands}{ex:renewcom} +If you did Exercises~\ref{ex:figures} and \ref{ex:tables}, go back to +that document and changed the figures and tables so that they +are labelled \dq{Fig} and \dq{Tab} instead of \dq{Figure} and \dq{Table}. +Hint: you need to redefine \glsni{tablename} and \glsni{figurename}. + +You can \downloadorview{renewcom} the solution. +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%%%% MATHEMATICS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{mathematics} +\chapter{Mathematics} +\label{ch:maths} + +As mentioned in the \htmlref{introduction}{ch:intro}, \LaTeX\ is +particularly good at typesetting mathematics. In order to +use any of the maths commands we need to be in one of the +mathematics \glspl{environment}. There are two +basic types of mathematics: \keyword{in-line maths} and +\keyword{displayed maths}. In-line maths is mathematics that +occurs within a line of text, for example: +\begin{resultS}[inlinemaths.html] +The variable $x$ is transformed by the function $f(x)$. +\end{resultS}% +Displayed maths is mathematics that occurs on a line +of its own. For example: +\begin{result}[displaymath.html] +A polynomial is a function of the form +\[ +f(x) = \sum_{i=0}^na_ix^i +\] +\end{result} +The maths environments switch to \LaTeX's \dq{math mode}, which uses +specialist maths fonts and spacing rather than just using an italic +font. + +If you want to typeset any mathematics, I~strongly advise using the +\istystart{amsmath} package: +\begin{alltt} +\glsni{usepackage}\marg{amsmath} +\end{alltt} +This patches some existing \LaTeX\ commands and environments and +also provides many useful additions. + +This chapter is just an introduction to typesetting mathematics in +\LaTeX. If you want a comprehensive guide, I~recommend you read \emph{Math Mode} +by Herbert~Vo\ss~\cite{voss}, which can be access via +\appname{texdoc} (see \sectionref{sec:texdoc}): +\begin{verbatim} +texdoc mathmode +\end{verbatim} + +%%%%%%%%%%%%%%%% In-Line Mathematics %%%%%%%%%%%%%%%%%%% + +\setnode{inlinemaths} +\section{In-Line Mathematics} +\label{sec:inline} + +In-line mathematics is created using the \gls{env-math} +environment. (Note U.S. spelling --- \dq{math} not \dq{maths}). + +\xminisec{Example:} +\begin{code} +The variable \glsni{begin}\marg{math}x\glsni{end}\marg{math} is transformed +by the function \glsni{begin}\marg{math}f(x)\glsni{end}\marg{math}. +\end{code} +It's somewhat cumbersome having to type +\glsni{begin}\marg{math} and \glsni{end}\marg{math} and it also +makes the \gls{source} a little difficult to read so there +are shorthand notations that can be used instead: +\gls{beginmath} is equivalent to \glsni{begin}\marg{math} and +\gls{endmath} is equivalent to \glsni{end}\marg{math}. So +the example above can be rewritten: +\begin{codeS} +The variable \glsni{beginmath}x\glsni{endmath} is transformed by the function +\glsni{beginmath}f(x)\glsni{endmath}. +\end{codeS}% +There is an even shorter notation: +The \htmlref{special character}{sec:chars} \gls{dollarchar} is equivalent +to both \glsni{begin}\marg{math} and \glsni{end}\marg{math}: +\begin{codeS} +The variable \glsni{dollarchar}x\glsni{dollarchar} is transformed by the +function \glsni{dollarchar}f(x)\glsni{dollarchar}. +\end{codeS}% +This is considerably easier to type and +to read, but you need to make sure that all your \glsni{dollarchar} +symbols have matching pairs. The above code will look like: +\begin{resultS}[inlinemaths2.html] +The variable $x$ is transformed +by the function $f(x)$. +\end{resultS}% +The other advantage in using \glsni{dollarchar} over \glsni{beginmath} and +\glsni{endmath} is that \glsni{dollarchar} is a \gls{robust}, +whereas \glsni{beginmath} and \glsni{endmath} are +\glspl{fragile} and +will need to be protected if they occur in a \glslink{fragile}{moving +argument}.\casemedia{}{}{ (See \sectionref{sec:fragile}.)}{} + +Note: you should always make sure you are in maths mode to +typeset any variables (such as $x$, $y$, $z$), as this will +ensure that the correct maths fonts are used, as well as the +appropriate spacing. Similarly, don't use \glsni{dollarchar} +as a short cut for an italic font. +\begin{codeS}[\linewidth] +Notice the \glsni{dollarchar}difference\glsni{dollarchar} between +\glsni{dollarchar}(x', y', z')\glsni{dollarchar} and +\glsni{textit}\marg{(x', y', z')}. +\end{codeS}% +\begin{resultS}[Image of result: the brackets are upright in the +maths font but slanted in the italic font. The apostrophe becomes a +prime in the maths font. The spacing is also +different.] +Notice the $difference$ between $(x', y', z')$ and +\textit{(x', y', z')}. +\end{resultS} + +%%%%%%%%%%%%%%%% Displayed Mathematics %%%%%%%%%%%%%%%%%%%%%% + +\setnode{displayedmaths} +\section{Displayed Mathematics} +\label{sec:displayed} + +One-line unnumbered displayed mathematics can be created using: +\begin{definition} +\gls{begindispmath}\meta{maths}\gls{enddispmath} +\end{definition} +where \meta{maths} is the mathematics to be displayed. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +A linear function is a function of the form +\glsni{begindispmath} y = mx + c \glsni{enddispmath} +\end{alltt} +\end{code}% +Output: +\begin{result}[displaymath2.html] +A linear function is a function of the form +\[ y = mx + c \] +\end{result}% + +\warning Don't use the \envname{displaymath} environment or \verb|$$|\ldots\verb|$$|~\cite{l2tabu}. +Use \glsni{begindispmath} and \glsni{enddispmath} with +the \isty{amsmath} package. + +The \glsni{env-equation}\refstepcounter{object}\label{env:equation} +environment provides something similar to +\glsni{begindispmath} \glsni{enddispmath}, except +that the equation is numbered. Modifying the above example: +\begin{code} +\begin{alltt} +A linear function is a function of the form +\glsni{begin}\marg{equation} +y = mx + c +\glsni{end}\marg{equation} +\end{alltt} +\end{code}% +results in the following output: +\begin{result}[As before but the equation now has a number in +brackets on the right.] +A linear function is a function of the form +\begin{equation} +y = mx + c +\end{equation} +\end{result} +Normal text can be inserted into the equation using +\begin{definition} +\gls{text}\marg{\meta{text}} +\end{definition} +which is provided by the \isty{amsmath} package. + +\xminisec{Example:} +\begin{codeS} +\glsni{begindispmath} x = 2 \glsni{text}\marg{ and } y = -1 \glsni{enddispmath} +\end{codeS}% +results in the following output: +\begin{result}[x equals 2 and y equals minus 1 (the word 'and' is in normal text font)] +\[ x = 2 \text{ and } y = -1 \] +\end{result} + +\faq{Re-using an equation}{reuseq}% +Recall from \sectionref{sec:crossref} that we can +\htmlref{cross-reference}{sec:crossref} most things that \LaTeX\ +automatically numbers using \gls{ref} and \gls{label}. +Equations can be cross-referenced in the same way:\reportpagebreak +\begin{code} +\begin{alltt} +Equation\glsni{tildechar}\glsni{ref}\marg{eqn:linear} is a linear function. +\glsni{begin}\marg{equation} +\glsni{label}\marg{eqn:linear} +f(x) = mx + c +\glsni{end}\marg{equation}\screenpagebreak +\end{alltt} +\end{code} +\begin{result}[eqref.html] +Equation~\ref*{eqn:linear} is a linear function. +\begin{equation} +\label{eqn:linear} +f(x) = mx + c +\end{equation} +\end{result} +Equation numbers are usually given in parentheses, which can be done +using: +\begin{codeS} +Equation\glsni{tildechar}(\glsni{ref}\marg{eqn:linear}) +\end{codeS} +The \isty{amsmath} package provides a convenient short cut: +\begin{definition} +\gls{eqref}\marg{\meta{label}} +\end{definition} +So the above can be written as: +\begin{codeS} +Equation\glsni{tildechar}\glsni{eqref}\marg{eqn:linear} +\end{codeS} +\begin{resultS}[Equation (9.2)] +% fake it to suppress hyperlink +Equation~(\ref*{eqn:linear}) +\end{resultS} + +\xminisec{Note:} + +Both the \gls{env-equation} environment and +\gls{begindispmath}\ldots\gls{enddispmath} are only designed for one +line of maths. Therefore you must not have any line breaks or +paragraph breaks within them. +The following will cause an error: +\begin{alltt} +\glsni{begin}\marg{equation} +\wrong +f(x) = mx + c +\wrong +\glsni{end}\marg{equation} +\end{alltt} +Either remove the blank lines or comment them out: +\begin{alltt} +\glsni{begin}\marg{equation} +\glsni{percentchar}\correct +f(x) = mx + c +\glsni{percentchar}\correct +\glsni{end}\marg{equation} +\end{alltt} + +\setnode{align} +\section{Multiple Lines of Displayed Maths} +\label{sec:align} + +The \isty{amsmath} package provides the \gls{env-align} +and \gls{env-align*} environments for aligned equations. +The starred version doesn't number the equations. These environments +provide pairs of left- and right-aligned columns. +As with the \gls{env-tabular} environment, use \gls{ampchar} to +separate columns and \gls{tab.dbbackslashchar} to separate rows. +Unlike the \gls{env-tabular} environment, there is no argument as +the column specifiers are predefined. Another difference is that no +page breaks can occur in the \gls{env-tabular} environment, but it's +possible to allow a page break in \glsni{env-align} or +\glsni{env-align*} using +\begin{definition} +\gls{displaybreak}\oarg{\meta{n}} +\end{definition} +immediately before the \gls{tab.dbbackslashchar} where it is to take +effect. The optional argument is a number from~0 to~4 indicating the +desirability to break the page (from~0 the least to~4 the most). + +If you want to mix numbered and unnumbered rows, you can use +\begin{definition} +\gls{notag} +\end{definition} +to suppress the numbering for a particular row in the \glsni{env-align} environment. +This command must go before \gls{tab.dbbackslashchar} at the end of the +row. The default equation numbering can be overridden for a +particular row using: +\begin{definition} +\gls{tag}\marg{\meta{tag}} +\end{definition} +where \meta{tag} is the replacement for the equation number. + +\screenpagebreak\warning Don't use the \envname{eqnarray} or \envname{eqnarray*} +environments. They're obsolete~\cite{l2tabu}. + + +\xminisec{Example (Unnumbered):} + +\begin{code} +\glsni{begin}\marg{align*}\newline +y \glsni{ampchar}= 2x + 2\glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{ampchar}= 2(x+1)\newline +\glsni{end}\marg{align*} +\end{code} +\begin{result}[align.html] +\begin{align*} +y &= 2x + 2\\ + &= 2(x+1) +\end{align*} +\end{result} +Note that the equals sign is placed at the start of the second +column, \emph{after} the ampersand \gls{ampchar}. This ensures the +correct amount of spacing on either side. If the first line of the +above equation was changed to:\bookpagebreak +\begin{alltt} +\wrong y =\gls{ampchar} 2x + 2\gls{tab.dbbackslashchar} +\end{alltt} +there wouldn't be enough space on the right of the equal sign: +\begin{htmlresult}{y equals 2x + 2} +\begin{makeimage} +\begin{align*} +y =& 2x + 2 +\end{align*} +\end{makeimage} +\end{htmlresult} + +\xminisec{Example (One Row Numbered):} + +\begin{code} +\glsni{begin}\marg{align}\newline +y \glsni{ampchar}= 2x + 2\glsni{notag}\glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{ampchar}= 2(x+1)\newline +\glsni{end}\marg{align} +\end{code} +\begin{result}[Image of result: as the earlier example but the second equation has been numbered] +\begin{align} +y &= 2x + 2\notag\\ + &= 2(x+1) +\end{align} +\end{result}\screenpagebreak + +\xminisec{Example (Four Columns):} + +\begin{code} +\glsni{begin}\marg{align*}\newline +y \glsni{ampchar}= 2x + 2 \glsni{ampchar} z + \glsni{ampchar}= 6x + 3\glsni{tab.dbbackslashchar}\newline +\strut~~\glsni{ampchar}= 2(x+1) \glsni{ampchar}~~~\glsni{ampchar}= 3(2x+1)\newline +\glsni{end}\marg{align*} +\end{code} +\begin{result}[4colalign.html] +\begin{align*} +y &= 2x + 2 & z &= 6x + 3\\ + &= 2(x+1) & &= 3(2x+1) +\end{align*} +\end{result} + +As with \gls{env-equation}, you can cross-reference individual rows +of an \glsni{env-align} environment, but you must remember to +put \gls{label} \emph{before} the end of row \gls{tab.dbbackslashchar} +separator. You can reference a row in the \glsni{env-align*} +environment if you have assigned it a tag with \gls{tag}, but don't +try labelling a row in the \glsni{env-align} environment where the +numbering has been suppressed with \gls{notag}. + +\xminisec{Example (Cross-Referenced):} + +This example has two numbered equations in an \gls{env-align} environment, +both of which are labelled and referenced: +\begin{code} +The function \glsni{dollarchar}f(x)\glsni{dollarchar} is given in +Equation\glsni{tildechar}\glsni{eqref}\marg{eq:fx}, +and its derivative \glsni{dollarchar}f'(x)\glsni{dollarchar} is given in +Equation\glsni{tildechar}\glsni{eqref}\marg{eq:dfx}. +\newline +\glsni{begin}\marg{align}\newline +f(x) \glsni{ampchar}= 2x + 1 +\glsni{label}\marg{eq:fx}\glsni{tab.dbbackslashchar}\newline +f'(x) \glsni{ampchar}= 2 \glsni{label}\marg{eq:dfx}\newline +\glsni{end}\marg{align} +\end{code} +\begin{result}[alignref.html] +The function $f(x)$ is given in Equation~(\ref*{eq:fx}), and its +derivative $f'(x)$ is given in Equation~(\ref*{eq:dfx}). +\begin{align} +f(x) &= 2x + 1\label{eq:fx}\\ +f'(x) &= 2 \label{eq:dfx} +\end{align} +\end{result} + +Recall the command \gls{text}\marg{\meta{text}} from the +\htmlref{previous section}{sec:displayed}. This can be used +within cells of the \glsni{env-align} and \glsni{env-align*} +environments, but the \isty{amsmath} package also provides +\begin{definition} +\gls{intertext}\marg{\meta{text}} +\end{definition} +which can be used for a line of interjection between the rows. This +command may only go right after \gls{tab.dbbackslashchar}. + +\xminisec{Example} + +\begin{code} +\glsni{begin}\marg{align*}\newline +y \glsni{ampchar}= 2x + +2\glsni{tab.dbbackslashchar}\newline +\glsni{intertext}\marg{Using the distributive law:}\newline + \glsni{ampchar}= 2(x+1)\newline +\glsni{end}\marg{align*} +\end{code} +\begin{result}[intertext.html] +\begin{align*} +y &= 2x + 2\\ +\intertext{Using the distributive law:} + &= 2(x+1) +\end{align*} +\end{result}\bookpagebreak + +There are other environments for multiple-line displayed maths, but +they are beyond the scope of this book. See +the \isty{amsmath} documentation for further details. + +%%%%%%%%%%%%%%%% Mathematical Commands %%%%%%%%%%%%%%%%%%%% + +\setnode{mathscom} +\section{Mathematical Commands} +\label{sec:mathscom} + +Most of the \glspl{command} described in this +section may only be used in one of the mathematics environments. If +you try to use a mathematics command outside a maths environment you +will get a \dq{\texttt{Missing \$ inserted}} error message. + +%------------------ Maths Fonts ------------------ + +\setnode{mathsfonts} +\subsection{Maths Fonts} +\label{sec:mathsfonts} + +Just as we are able to \htmlref{change text fonts}{sec:fonts} using +the commands \gls{textrm}, \gls{textbf} etc, we can also +use commands to change the maths font. Basic maths font changing +commands are shown in \tableref{tab:mathsfonts}. + +\begin{table}[tbhp] +\caption{Maths Font Changing Commands} +\label{tab:mathsfonts} +\centering +\begin{tabular}{lll} +\toprule +\bfseries Command & \bfseries Example Input & \bfseries Corresponding Output\\ + & & (Computer Modern)\\ +\midrule +\begin{inlinedef}\gls{mathrm}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathrm{xyz}$| & $\cmmathrm{xyz}$\\ +\begin{inlinedef}\gls{mathsf}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathsf{xyz}$| & $\cmmathsf{xyz}$\\ +\begin{inlinedef}\gls{mathtt}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathtt{xyz}$| & $\cmmathtt{xyz}$\\ +\begin{inlinedef}\gls{mathit}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathit{xyz}$| & $\cmmathit{xyz}$\\ +\begin{inlinedef}\gls{mathbf}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathbf{xyz}$| & $\cmmathbf{xyz}$\\ +\begin{inlinedef}\gls{mathcal}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathcal{XYZ}$| & $\cmmathcal{XYZ}$ +\\\bottomrule +\end{tabular} +\end{table} + +The calligraphic fonts via \glsni{mathcal} are only available for upper-case +characters\faq{Better script fonts for maths}{scriptfonts}. +\tableref{tab:amsmathfont} lists additional font commands supplied +with the \isty{amsmath} and \isty{amsfonts} +\htmlref{packages}{sec:packages}. + +\begin{table}[hbtp] +\caption[The amsfonts and amsmath Font Commands]{The +\isty{amsfonts}\supddag\ and \isty{amsmath}\supdag\ Font Commands} +\label{tab:amsmathfont} +\centering +\begin{tabular}{lll} +\toprule +\bfseries Command & \bfseries Example Input & \bfseries Example Output\\ +\midrule +\begin{inlinedef}\supddag\gls{mathbb}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathbb{A+B=C}$| & $\mathbb{A+B=C}$\\ +\begin{inlinedef}\supddag\gls{mathfrak}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\mathfrak{A+B=C}$| & $\mathfrak{A+B=C}$\\ +\begin{inlinedef}\supdag\gls{boldsymbol}\marg{\meta{maths}}\end{inlinedef} & +\verb|$\boldsymbol{A+B=C}$| & $\boldsymbol{A+B=C}$\\ +\begin{inlinedef}\supdag\gls{pmb}\marg{\meta{symbol}}\end{inlinedef} & +\verb|$\pmb{+-=}$| & $\pmb{+-=}$ +\\\bottomrule +\end{tabular} +\end{table} + +%----------------- Greek Letters ----------------------- + +\setnode{greek} +\subsection{Greek Letters} +\label{sec:greek} + +Greek letters that differ from the corresponding Roman letters are +obtained by placing a backslash in front of the name.\footnote{So, +for example, there is no omicron since it looks the same as a Roman +o.} Lower case and upper case Greek letters are shown in +\tableref{tab:greek} and \tableref{tab:Greek}, respectively. There are +also some variants of certain symbols, such as \glsni{vartheta} as +opposed to \glsni{theta}. + +\begin{table}[htbp] +\caption{Lower Case Greek Letters} +\label{tab:greek} +\centering +\begin{tabular}{llllll} +\gls{alpha} & $\alpha$ & +\gls{beta} & $\beta$ & +\gls{gamma} & $\gamma$ \\ +\gls{delta} & $\delta$ & +\gls{epsilon} & $\epsilon$ & +\gls{varepsilon} & $\varepsilon$\\ +\gls{zeta} & $\zeta$ & +\gls{eta} & $\eta$ & +\gls{theta} & $\theta$ \\ +\gls{vartheta} & $\vartheta$ & +\gls{iota} & $\iota$ & +\gls{kappa} & $\kappa$ \\ +\gls{lambda} & $\lambda$ & +\gls{mu} & $\mu$ & +\gls{nu} & $\nu$ \\ +\gls{xi} & $\xi$ & +\gls{pi} & $\pi$ & +\gls{varpi} & $\varpi$\\ +\gls{rho} & $\rho$ & +\gls{varrho} & $\varrho$ & +\gls{sigma} & $\sigma$ \\ +\gls{varsigma} & $\varsigma$ & +\gls{tau} & $\tau$ & +\gls{upsilon} & $\upsilon$ \\ +\gls{phi} & $\phi$ & +\gls{varphi} & $\varphi$ & +\gls{chi} & $\chi$ \\ +\gls{psi} & $\psi$ & +\gls{omega} & $\omega$ +\end{tabular} +\end{table} + +\begin{table}[htbp] +\caption{Upper Case Greek Letters} +\label{tab:Greek} +\centering +\begin{tabular}{llllll} +\gls{Gamma} & $\Gamma$ & +\gls{Delta} & $\Delta$ & +\gls{Theta} & $\Theta$ \\ +\gls{Lambda} & $\Lambda$ & +\gls{Xi} & $\Xi$ & +\gls{Pi} & $\Pi$ \\ +\gls{Sigma} & $\Sigma$ & +\gls{Upsilon} & $\Upsilon$ & +\gls{Phi} & $\Phi$ \\ +\gls{Psi} & $\Psi$ & +\gls{Omega} & $\Omega$ +\end{tabular} +\end{table} + +\xminisec{Example:} + +The following code +\begin{codeS} +\glsni{begindispmath} x' = x + \glsni{Delta} x \glsni{enddispmath} +\end{codeS} +produces: +\begin{resultS}[x prime equals x plus capital Delta x] +\[ x' = x + \Delta x \] +\end{resultS} + +%------------- Subscripts and Superscripts ------------ + +\setnode{subsupscripts} +\subsection{Subscripts and Superscripts} +\label{sec:scripts} + +Subscripts are obtained either by the command +\begin{definition} +\gls{sb}\marg{\meta{maths}} +\end{definition}% +or by the \htmlref{special character}{sec:chars}: +\begin{definition} +\gls{underscorechar}\marg{\meta{maths}} +\end{definition}% +Superscripts are obtained either by the command +\begin{definition} +\gls{sp}\marg{\meta{maths}} +\end{definition}% +or by the special character: +\begin{definition} +\gls{circumchar}\marg{\meta{maths}} +\end{definition}% + +\xminisec{Examples:} +\begin{enumerate} +\item This example uses \glsni{sb} and \glsni{sp}: +\begin{codeS} +\glsni{begindispmath}y = x\glsni{sb}\marg{1}\glsni{sp}\marg{2} + +x\glsni{sb}\marg{2}\glsni{sp}\marg{2}\glsni{enddispmath} +\end{codeS}% + +\item This example uses \glsni{underscorechar} and \glsni{circumchar} +\begin{codeS} +\glsni{begindispmath}y = x\glsni{underscorechar}\marg{1}\glsni{circumchar}\marg{2} + + x\glsni{underscorechar}\marg{2}\glsni{circumchar}\marg{2}\glsni{enddispmath} +\end{codeS}% + +\item Recall from +\latexhtml{page~\pageref{itm:argnogrp}}{\htmlref{earlier}{itm:argnogrp}} that +\glspl{mandatory} only consisting of one +character don't need to be grouped, so the above code can also be +written as: +\begin{codeS} +\glsni{begindispmath}y = x\glsni{underscorechar}1\glsni{circumchar}2 + + x\glsni{underscorechar}2\glsni{circumchar}2\glsni{enddispmath} +\end{codeS}% +This is simpler than the first two examples. However it's a good idea to be in the +habit of always using braces in case you forgot them when they're +needed. +\end{enumerate} +All three of the above examples produce the same output: +\begin{resultS}[subsup.html] +\[y = x_1^2 + x_2^2\] +\end{resultS}% + +Notice how the subscript gets tucked under the slope of the $Y$ in: +\begin{codeS} +\glsni{begindispmath} +Y\glsni{underscorechar}\marg{1}\glsni{circumchar}\marg{2} +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[ysubsup1.html] +\[ Y_{1}^{2} \] +\end{resultS} +Compare with +\begin{codeS} +\glsni{begindispmath} +Y\marg{}\glsni{underscorechar}\marg{1}\glsni{circumchar}\marg{2} +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[ysubsup2.html] +\[ Y{}_{1}^{2} \] + +\end{resultS} + +\xminisec{Example (Nested)} + +Subscripts and superscripts can also be nested (note that +it is now necessary to group the argument to the superscript command): +\begin{codeS} +\glsni{begindispmath} + f(x) = e\glsni{circumchar}\marg{x\glsni{underscorechar}1} +\glsni{enddispmath} +\end{codeS}% +which produces +\begin{resultS}[nestedsup.html] +\[ +f(x) = e^{x_1} +\] +\end{resultS} + +This example isn't quite right as e isn't actually a variable +and shouldn't be typeset in italic. The correct way to do this +is:\bookpagebreak +\begin{codeS} +\glsni{begindispmath} + f(x) = +\gls{mathrm}\marg{e}\glsni{circumchar}\marg{x\glsni{underscorechar}1} +\glsni{enddispmath} +\end{codeS}% +which results in: +\begin{resultS}[Image: as above but the letter e is upright] +\[ f(x) = \mathrm{e}^{x_1} \] +\end{resultS} + +\refstepcounter{object}\label{obj:e}If you are going to use e a lot, +it will be simpler to \htmlref{define a new command}{ch:newcom} to do +this. The definition should go in the +\glsterm{preamble}: +\begin{codeS} +\gls{newcommand}\marg{\cmdname{e}}\marg{\glsni{mathrm}\marg{e}} +\end{codeS}% +Then in the document: +\begin{codeS} +\glsni{begindispmath} f(x\glsni{underscorechar}1, x\glsni{underscorechar}2) + = \cmdname{e}\glsni{circumchar}\marg{x\glsni{underscorechar}1\glsni{circumchar}2} + + +\cmdname{e}\glsni{circumchar}\marg{x\glsni{underscorechar}2\glsni{circumchar}2} +\glsni{enddispmath} +\end{codeS}% +\begin{resultS}[nestedsup2.html] +\[ +f(x_1, x_2) = \e^{x_1^2} + \e^{x_2^2} +\] +\end{resultS} + +Take care when nesting subscripts or superscripts. The following +\begin{alltt}\wrong +x\glsni{underscorechar}1\glsni{underscorechar}2 +\end{alltt} +will give a \texttt{!\ Double subscript} error. + +%-------------- Functional Names -------------- + +\setnode{functionnames} +\subsection{Functional Names} +\label{sec:funcnames} + +Functions such as log and tan can't simply be typed in as +\texttt{log} or \texttt{tan} otherwise they will come out looking +like the variables \mathorit{l} times +\mathorit{o} times \mathorit{g} (\makeimg{l o g}{$ l o g$}) +or \mathorit{t} times \mathorit{a} times \mathorit{n} +(\makeimg{t a n}{$ t a n$}). Instead you should use +one of the commands listed in \tableref{tab:fnnames}. +The functions denoted with \supdag\ can have limits by using +the subscript command \gls{underscorechar} or the superscript command \gls{circumchar}\faq{Sub- and +superscript positioning for operators}{limits}. +In addition, the modulo commands listed in \tableref{tab:mod} are also available. + +\begin{table}[bhtp] +\caption[Function Names]{Function Names (\supdag +indicates command may have limits, \supddag defined +by \protect\isty{amsmath}).} +\label{tab:fnnames} +\centering +\begin{tabular}{llllll} +\gls{arccos} & $\arccos$ & +\gls{arcsin} & $\arcsin$ & +\gls{arctan} & $\arctan$ \\ +\gls{arg} & $\arg$ & +\gls{cos} & $\cos$ & +\gls{cosh} & $\cosh$ \\ +\gls{cot} & $\cot$ & +\gls{coth} & $\coth$ & +\gls{csc} & $\csc$ \\ +\gls{deg} & $\deg$ & +\gls{det}\supdag & $\det$ & +\gls{dim} & $\dim$ \\ +\gls{exp} & $\exp$ & +\gls{gcd}\supdag & $\gcd$ & +\gls{hom} & $\hom$ \\ +\gls{inf}\supdag & $\inf$ & +\gls{injlim}\supdagddag & $\injlim$ & +\gls{ker} & $\ker$ \\ +\gls{lg} & $\lg$ & +\gls{lim}\supdag & $\lim$ & +\gls{liminf}\supdag & $\liminf$ \\ +\gls{limsup}\supdag & $\limsup$ & +\gls{ln} & $\ln$ & +\gls{log} & $\log$ \\ +\gls{max}\supdag & $\max$ & +\gls{min}\supdag & $\min$ & +\gls{Pr}\supdag & $\Pr$ \\ +\gls{projlim}\supdagddag & $\projlim$ & +\gls{sec} & $\sec$ & +\gls{sin} & $\sin$ \\ +\gls{sinh} & $\sinh$ & +\gls{sup}\supdag & $\sup$ & +\gls{tan} & $\tan$ \\ +\gls{tanh} & $\tanh$ & +\gls{varinjlim}\supdagddag & $\varinjlim$ & +\gls{varliminf}\supdagddag & $\varliminf$ \\ +\gls{varlimsup}\supdagddag & $\varlimsup$ & +\gls{varprojlim}\supdagddag & $\varprojlim$ & +\end{tabular} +\end{table} + +\begin{table}[htbp] +\caption[Modulo Commands]{Modulo Commands (\supddag +defined by \protect\isty{amsmath} package)} +\label{tab:mod} +\centering +\begin{tabular}{lll} +\toprule +\bfseries Command & \bfseries Example Input & \bfseries Example Output\\ +\midrule +\gls{bmod} & \verb|$m \bmod n$| & $m \bmod n$\\ +\gls{pmod}\marg{\meta{maths}} & \verb|$m \pmod{n}$| &$m \pmod{n}$\\ +\gls{mod}\marg{\meta{maths}}\supddag & \verb|$m \mod{n}$| &$m \mod{n}$\\ +\gls{pod}\marg{\meta{maths}}\supddag & \verb|$m \pod{n}$| &$m \pod{n}$ +\\\bottomrule +\end{tabular} +\end{table} + +\xminisec{Example (Trigonometric Functions):} + +This example uses the cos and sin functions and also the +\htmlref{Greek letter}{sec:greek} theta. +\begin{codeS} +\glsni{begindispmath} z = r(\glsni{cos}\glsni{theta} + i\glsni{sin}\glsni{theta}) +\glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: z equals r (cos theta plus i sign theta)] +\[ +z = r(\cos\theta + i\sin\theta) +\] +\end{resultS} + +\xminisec{Example (Limit):} + +The command \gls{infty} is the +infinity symbol \makeimg{image of infinity symbol}{$\infty$}, and the command \gls{to} displays an +arrow pointing to the right. Note the use of \gls{underscorechar} since the +limit is a subscript. +\begin{codeS} +\glsni{begindispmath} + \glsni{lim}\glsni{underscorechar}\marg{x\glsni{to}\glsni{infty}} f(x) +\glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: limit as x tends to infinity of f of x] +\[ +\lim_{x\to\infty} f(x) +\] +\end{resultS}% +The operators with limits behave differently depending on whether +they are in \htmlref{displayed}{sec:displayed} or +\htmlref{in-line}{sec:inline} maths. +Notice the difference when the same code appears in-line: +\begin{codeS} +In a line of text +\glsni{dollarchar}\glsni{lim}\glsni{underscorechar}\marg{x\glsni{to}\glsni{infty}} +f(x)\glsni{dollarchar} +\end{codeS}% +which now displays as: +\begin{resultS}[Image: the limit appears to the side of lim instead +of below it.] +In a line of text $\lim_{x\to\infty} f(x)$ +\end{resultS} + +\xminisec{Example (With Subscript):} + +This is another example of a functional name using a subscript: +\begin{codeS} +\glsni{begindispmath} \glsni{min}\glsni{underscorechar}x f(x) \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: the x appears below the word min.] +\[ +\min_x f(x) +\] +\end{resultS}% +Again, notice the difference when it is used in-line: +\begin{codeS} +In a line of text \glsni{dollarchar}\glsni{min}\glsni{underscorechar}x +f(x)\glsni{dollarchar} +\end{codeS}% +\begin{resultS}[Image: the x appears to the side of the word min.] +In a line of text $\min_x f(x)$ +\end{resultS} +\bookpagebreak + +\setnode{declaremathop} +\subsubsection{Defining New Functional Operators} +\label{sec:declaremathop} + +It may be that you want a function that isn't specified in +\tableref{tab:fnnames}. In this case, the \isty{amsmath} provides the +\textbf{\em \gls{preamble} only} command +\begin{definition} +\gls{DeclareMathOperator}\marg{\meta{cmd}}\marg{\meta{operator +name}} +\end{definition} +or its \htmlref{starred variant}{itm:starredcommand} +\begin{definition} +\glsni{DeclareMathOperator}*\marg{\meta{cmd}}\marg{\meta{operator +name}} +\end{definition} +\faq{Defining a new log-like function in LaTeX}{newfunction}% +Both versions define a command called \meta{cmd}, which must start +with a backslash, that typesets \meta{operator name} as a function +name. The starred version is for function names that can take +limits (like \gls{lim} and \gls{min} described above). + +\xminisec{Example (Operator Without Limits):} + +Suppose I want a function called card, which represents the +cardinality of a set $\mathcal{S}$. First I~need to define the new +operator command (which I'm going to call \cmdname{card}) \emph{in +the \gls{preamble}}: +\begin{codeS} +\glsni{DeclareMathOperator}\marg{\cmdname{card}}\marg{card} +\end{codeS} +This operator doesn't take any limits, so I~have used the unstarred +version. + +Later in the document, I~can use this new operator command: +\begin{codeS} +\glsni{begindispmath} n = \cmdname{card}(\glsni{mathcal}\marg{S}) \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: n equals card (S)] +\[ +n = \card(\mathcal{S}) +\] +\end{resultS}% +In this example \gls{mathcal} is used as sets are +typically represented in a calligraphic font. + +\xminisec{Example (Operator With Limits):} + +Suppose I~now want a function called mode, which represents the +mode of a set of numbers. First, I~define the operator command in the +preamble: +\begin{codeS} +\glsni{DeclareMathOperator}*\marg{\cmdname{mode}}\marg{mode} +\end{codeS} +This operator needs to be able to have a subscript, so I~have used +the starred version. + +Later in the document, I~can use this new operator command: +\begin{codeS} +\glsni{begindispmath} x\glsni{underscorechar}m = +\cmdname{mode}\glsni{underscorechar}\marg{x \glsni{in} \glsni{mathcal}\marg{S}}(x) +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[Image: x subscript m equals mode of x in S of x] +\[ +x_m = \mode_{x \in \mathcal{S}}(x) +\] +\end{resultS} + +%----------- Fractions ------------ + +\bookpagebreak +\setnode{fractions} +\subsection{Fractions} +\label{sec:fractions} + +Fractions are created using the command +\begin{definition} +\gls{frac}\marg{\meta{numerator}}\marg{\meta{denominator}} +\end{definition} +The \isty{amsmath} package also provides the command +\begin{definition} +\gls{cfrac}\oarg{\meta{pos}}\marg{\meta{numerator}}\marg{\meta{denominator}} +\end{definition} +which is designed for continued fractions. The optional argument +\texttt{pos} can be used for left (\texttt{l}) or right (\texttt{r}) +placement of any of the numerators. (The default is centred.) + +\xminisec{Example:} + +A simple fraction: +\begin{codeS} +\glsni{begindispmath} + \glsni{frac}\marg{1}\marg{1+x} +\glsni{enddispmath} +\end{codeS} +Produces: +\begin{resultS}[Image of fraction with 1 as the numerator and 1+x as +the denominator.] +\[ \frac{1}{1+x} \] +\end{resultS} +Compare with: +\begin{codeS} +In-line: +\glsni{dollarchar} + \glsni{frac}\marg{1}\marg{1+x} +\glsni{dollarchar} +\end{codeS} +which produces: +\begin{resultS}[Image: as before but fraction is smaller.] +In-line: $\frac{1}{1+x}$ +\end{resultS} + +\xminisec{Example (Nested):} +\begin{codeS} +\glsni{begindispmath} +\glsni{frac}\marg{1+\glsni{frac}\marg{1}\marg{x}}\marg{1+x+x\glsni{circumchar}2} +\glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image of fraction with (1+1/x) as the numerator and +(1 + x + x squared as the denominator.] +\[ +\frac{1+\frac{1}{x}}{1+x+x^2} +\] +\end{resultS} + +\xminisec{Example (Continued Fraction);} +A continued fraction (example taken from \isty{amsmath} +documentation and uses \glsni{sqrt}, described in \sectionref{sec:roots}, +and \glsni{dotsb}, described in +\sectionref{sec:mathssym}): +\begin{code} +\begin{alltt} +\glsni{begindispmath} +\glsni{cfrac}\marg{1}\marg{\glsni{sqrt}\marg{2}+ +\glsni{cfrac}\marg{1}\marg{\glsni{sqrt}\marg{2}+ +\glsni{cfrac}\marg{1}\marg{\glsni{sqrt}\marg{2}+\glsni{dotsb} +}}} +\glsni{enddispmath} +\end{alltt} +\end{code}\screenpagebreak +\begin{result}[Image of a continued fraction (the denominator has a +fraction with a fraction in its denominator etc).] +\[ +\cfrac{1}{\sqrt{2}+ +\cfrac{1}{\sqrt{2}+ +\cfrac{1}{\sqrt{2}+\dotsb +}}} +\] +\end{result} + +\xminisec{Example (A Derivative):} +\begin{codeS} +\glsni{begindispmath} f'(x) = \glsni{frac}\marg{df}\marg{dx} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: f'(x) = d f by d x] +\[ +f'(x) = \frac{df}{dx} +\] +\end{resultS}% +As with \dq{e}, the differential operator \dq{d} should +be in an upright font as it is not a variable: +\begin{code} +\begin{alltt} +\glsni{begindispmath} + f'(x) = \glsni{frac}\marg{\glsni{mathrm}\marg{d}f}\marg{\glsni{mathrm}\marg{d}x} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: as above but the letter d is upright] +\[ +f'(x) = \frac{\mathrm{d}f}{\mathrm{d}x} +\] +\end{resultS} + +The above example is rather cumbersome, particularly +if you have a lot of derivatives, so it might be easier to +\htmlref{define a new command}{ch:newcom}\latex{ (see \chapterref{ch:newcom})}. In the +\glsterm{preamble} define: +\begin{codeS} +\gls{newcommand}\marg{\cmdname{deriv}}\oarg{2}\marg{\glsni{frac}\marg{\glsni{mathrm}\marg{d}\glsni{hashchar}1}\marg{\glsni{mathrm}\marg{d}\glsni{hashchar}2}} +\end{codeS}% +Then in the document: +\begin{codeS} +\glsni{begindispmath} f'(x) = \cmdname{deriv}\marg{f}\marg{x} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: same as before] +\newcommand{\deriv}[2]{\frac{\mathrm{d}#1}{\mathrm{d}#2}} + +\[ f'(x) = \deriv{f}{x} \] +\end{resultS} + +\xminisec{Example (Partial Derivative):} +\label{itm:pderiv}% + +Partial derivatives can be obtained similarly +using the command \gls{partial} to display the partial +derivative symbol. As in the previous example, first define a new +command to format a partial derivative in the +\glsterm{preamble}: +\begin{codeS} +\gls{newcommand}\marg{\cmdname{pderiv}}\oarg{2}\marg{\glsni{frac}\marg{\glsni{partial} \glsni{hashchar}1}{\glsni{partial} \glsni{hashchar}2}} +\end{codeS}% +Then in the document: +\begin{codeS} +\glsni{begindispmath} f\glsni{underscorechar}x = \cmdname{pderiv}\marg{f}\marg{x} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: f subscript x = partial d f by partial d x] +\[ +f_x = \pderiv{f}{x} +\] +\end{resultS} + +\xminisec{Example (Double Partial Derivative):} + +\begin{code} +\begin{alltt} +\glsni{begindispmath} + f\glsni{underscorechar}\marg{xy} = \glsni{frac}\marg{\glsni{partial}\glsni{circumchar}2 f}\marg{\glsni{partial} x \glsni{partial} y} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: f subscript xy = partial d 2 f by partial d x partial d y.] +\[ +f_{xy} = \frac{\partial^2 f}{\partial x \partial y} +\] +\end{resultS} + +\xminisec{Example (First principles):} +\begin{code} +\glsni{begindispmath}\newline +\mbox{}\qquad f'(x) = \gls{lim}\gls{underscorechar}\marg{\gls{Delta} x \gls{to} +0}\newline +\mbox{}\qquad \glsni{frac}\marg{f(x + \gls{Delta} x)-f(x)}\marg{\gls{Delta} +x}\newline +\glsni{enddispmath} +\end{code} +\begin{resultS} +\[ +f'(x) = \lim_{\Delta x\to0} + \frac{f(x+\Delta x) - f(x)}{\Delta x} +\] +\end{resultS} + +%------------ Roots -------------- + +\setnode{roots} +\subsection{Roots} +\label{sec:roots} + +Roots are obtained using the command +\begin{definition} +\gls{sqrt}\oarg{\meta{order}}\marg{\meta{maths}} +\end{definition}% +without the optional argument \meta{order} +it will produce a simple square root. Cubic roots etc +can be obtained using the optional argument. + +\xminisec{Examples:} + +\begin{enumerate} +\item A square root: +\begin{codeS} +\glsni{begindispmath} \glsni{sqrt}\marg{a+b} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: square root of (a + b)] +\[ +\sqrt{a+b} +\] +\end{resultS} + +\item A cubic root: +\begin{codeS} +\glsni{begindispmath} \glsni{sqrt}\oarg{3}\marg{a+b} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: cubic root of (a + b)] +\[ +\sqrt[3]{a+b} +\] +\end{resultS} + +\item An \ensuremath{n}th root: +\begin{codeS} +\glsni{begindispmath} \glsni{sqrt}\oarg{n}\marg{a+b} \glsni{enddispmath} +\end{codeS}% +\begin{resultS}[Image: the nth root of (a + b)] +\[ +\sqrt[n]{a+b} +\] +\end{resultS} +\end{enumerate} + +%-------- Mathematical Symbols ------------- + +\setnode{mathssym} +\subsection{Mathematical Symbols} +\label{sec:mathssym} + +Relational symbols\faq{Where can I find the symbol for +\ldots}{symbols} are shown in \tableref{tab:relsym}. If you want a +negation that is not shown, you can obtain it by preceding the +symbol with the command \gls{not}. For example: +\glsni{not}\glsni{subset} produces the symbol +\makeimg{image of subset symbol with slash through it}{$\not\subset$}. + +\begin{table}[hbtp] +\caption{Relational Symbols} +\label{tab:relsym} +\centering +\begin{tabular}{llllll} +\gls{approx} & $\approx$ & +\gls{asymp} & $\asymp$ & +\gls{bowtie} & $\bowtie$ \\ +\gls{cong} & $\cong$ & +\gls{dashv} & $\dashv$ & +\gls{doteq} & $\doteq$ \\ +\gls{equiv} & $\equiv$ & +\gls{frown} & $\frown$ & +\gls{ge} or \gls{geq} & $\geq$ \\ +\gls{gg} & $\gg$ & +\gls{in} & $\in$ & +\gls{le} or \gls{leq} & $\leq$ \\ +\gls{ll} & $\ll$ & +\gls{mid} or \verb"|" & $\mid$ & +\gls{models} & $\models$ \\ +\gls{neq} & $\neq$ & +\gls{ni} & $\ni$ & +\gls{notin} & $\notin$ \\ +\gls{parallel} & $\parallel$ & +\gls{prec}& $\prec$ & +\gls{preceq}& $\preceq$ \\ +\gls{perp} & $\perp$ & +\gls{propto} & $\propto$ & +\gls{sim} & $\sim$ \\ +\gls{simeq} & $\simeq$ & +\gls{smile} & $\smile$ & +\gls{sqsubseteq} & $\sqsubseteq$ \\ +\gls{sqsupseteq} & $\sqsupseteq$ & +\gls{subset} & $\subset$ & +\gls{subseteq} & $\subseteq$ \\ +\gls{succ} & $\succ$ & +\gls{succeq} & $\succeq$ & +\gls{supset} & $\supset$ \\ +\gls{supseteq} & $\supseteq$ & +\gls{vdash} & $\vdash$ & +\end{tabular} +\end{table} + +Binary operator symbols are shown in \tableref{tab:binop}, and arrow +symbols are shown in \xtableref{tab:arrows}. There are also over and +under arrows (\xtableref{tab:overunderarrows}) that have an argument. +The over arrows put an extendible arrow over their argument, and the +under arrows put an extendible arrow under their argument. In +addition, the \isty{amsmath} package provides extensible arrows that +take a superscript and, optionally, a subscript: +\begin{definition} +\gls{xleftarrow}\oarg{\meta{subscript}}\marg{\meta{superscript}} +\end{definition} +\begin{definition} +\gls{xrightarrow}\oarg{\meta{subscript}}\marg{\meta{superscript}} +\end{definition} + +\xminisec{Example:} +\begin{code} +\glsni{begindispmath}\newline +\mbox{}\qquad A \glsni{xleftarrow}\marg{n+m-p} B + \glsni{xrightarrow}\oarg{X}\marg{n+p} C\newline +\glsni{enddispmath} +\end{code} +\begin{result}[Image of result: the arrow subscripts and superscript are centred over the arrow.] +\[ + A \xleftarrow{n+m-p} B \xrightarrow[X]{n+p} C +\] +\end{result} + +\begin{table}[tbhp] +\caption{Binary Operator Symbols} +\label{tab:binop} +\centering +\begin{tabular}{llllll} +\gls{amalg} & $\amalg$ & +\gls{ast} & $\ast$ & +\gls{bullet} & $\bullet$ \\ +\gls{bigcirc} & $\bigcirc$ & +\gls{bigtriangledown} & $\bigtriangledown$ & +\gls{bigtriangleup} & $\bigtriangleup$ \\ +\gls{cap} & $\cap$ & +\gls{cdot} & $\cdot$ & +\gls{circ} & $\circ$ \\ +\gls{cup} & $\cup$ & +\gls{dagger} & $\dagger$ & +\gls{ddagger} & $\ddagger$ \\ +\gls{diamond} & $\diamond$ & +\gls{div} & $\div$ & +\gls{mp} & $\mp$ \\ +\gls{odot} & $\odot$ & +\gls{ominus} & $\ominus$ & +\gls{oplus} & $\oplus$ \\ +\gls{oslash} & $\oslash$ & +\gls{otimes} & $\otimes$ & +\gls{pm} & $\pm$ \\ +\gls{setminus} & $\setminus$ & +\gls{sqcap} & $\sqcap$ & +\gls{sqcup} & $\sqcup$ \\ +\gls{star} & $\star$ & +\gls{times} & $\times$ & +\gls{triangleleft} & $\triangleleft$ \\ +\gls{triangleright} & $\triangleright$ & +\gls{uplus} & $\uplus$ & +\gls{vee} & $\vee$ \\ +\gls{wedge} & $\wedge$ & +\gls{wr} & $\wr$ +\end{tabular} +\end{table} + +\begin{table}[tbhp] +\caption{Arrow Symbols} +\label{tab:arrows} +\centering +\begin{tabular}{llll} +\gls{downarrow} & $\downarrow$ & +\gls{Downarrow} & $\Downarrow$ \\ +\gls{hookleftarrow} & $\hookleftarrow$ & +\gls{hookrightarrow} & $\hookrightarrow$ \\ +\gls{leftarrow} or \gls{gets} & $\leftarrow$ & +\gls{Leftarrow} & $\Leftarrow$ \\ +\gls{leftharpoondown} & $\leftharpoondown$ & +\gls{leftharpoonup} & $\leftharpoonup$ \\ +\gls{leftrightarrow} & $\leftrightarrow$ & +\gls{Leftrightarrow} & $\Leftrightarrow$ \\ +\gls{longleftarrow} & $\longleftarrow$ & +\gls{Longleftarrow} & $\Longleftarrow$ \\ +\gls{longleftrightarrow} & $\longleftrightarrow$ & +\gls{Longleftrightarrow} & $\Longleftrightarrow$ \\ +\gls{longmapsto} & $\longmapsto$ & +\gls{longrightarrow} & $\longrightarrow$ \\ +\gls{Longrightarrow} & $\Longrightarrow$ & +\gls{mapsto} & $\mapsto$ \\ +\gls{nearrow} & $\nearrow$ & +\gls{nwarrow} & $\nwarrow$ \\ +\gls{rightarrow} or \gls{to} & $\to$ & +\gls{Rightarrow} & $\Rightarrow$ \\ +\gls{rightharpoondown} & $\rightharpoondown$ & +\gls{rightharpoonup} & $\rightharpoonup$ \\ +\gls{rightleftharpoons} & $\rightleftharpoons$ & +\gls{searrow} & $\searrow$ \\ +\gls{swarrow} & $\swarrow$ & +\gls{uparrow} & $\uparrow$ \\ +\gls{Uparrow} & $\Uparrow$ & +\gls{updownarrow} & $\updownarrow$ \\ +\gls{Updownarrow} & $\Updownarrow$ & +\end{tabular} +\end{table} + +\begin{table}[htbp] +\caption[Over and Under Arrows]{Over and Under Arrows +(\supdag defined by \protect\isty{amsmath})} +\label{tab:overunderarrows} +\centering +\begin{tabular}{@{}lll@{}} +\toprule +\bfseries Definition & \multicolumn{2}{c}{\bfseries Example}\\ +\midrule +\begin{inlinedef}\gls{overleftarrow}\marg{\meta{maths}}\end{inlinedef} + & \verb|\overleftarrow{ABC}| & $\overleftarrow{ABC}$\\ +\begin{inlinedef}\gls{overrightarrow}\marg{\meta{maths}}\end{inlinedef} + & \verb|\overrightarrow{ABC}| & $\overrightarrow{ABC}$\\ +\begin{inlinedef}\gls{overleftrightarrow}\marg{\meta{maths}}\end{inlinedef}\supdag + & \verb|\overleftrightarrow{ABC}| & $\overleftrightarrow{ABC}$\\ +\begin{inlinedef}\gls{underleftarrow}\marg{\meta{maths}}\end{inlinedef}\supdag + & \verb|\underleftarrow{ABC}| & $\underleftarrow{ABC}$\\ +\begin{inlinedef}\gls{underrightarrow}\marg{\meta{maths}}\end{inlinedef}\supdag + & \verb|\underrightarrow{ABC}| & $\underrightarrow{ABC}$\\ +\begin{inlinedef}\gls{underleftrightarrow}\marg{\meta{maths}}\end{inlinedef}\supdag + & \verb|\underleftrightarrow{ABC}| & $\underleftrightarrow{ABC}$ +\\\bottomrule +\end{tabular} +\end{table} + +\bookpagebreak +\begin{table}[htbp] +\caption{Symbols with Limits} +\label{tab:symlim} +\centering +\begin{tabular}{llllll} +\gls{sum} & $\sum$ & +\gls{int} & $\int$ & +\gls{oint} & $\oint$ \\[5pt] +\gls{prod} & $\prod$ & +\gls{coprod} & $\coprod$ & +\gls{bigcap} & $\bigcap$ \\[5pt] +\gls{bigcup} & $\bigcup$ & +\gls{bigsqcup} & $\bigsqcup$ & +\gls{bigvee} & $\bigvee$ \\[5pt] +\gls{bigwedge} & $\bigwedge$ & +\gls{bigodot} & $\bigodot$ & +\gls{bigotimes} & $\bigotimes$ \\[5pt] +\gls{bigoplus} & $\bigoplus$ & +\gls{biguplus} & $\biguplus$ +\end{tabular} +\end{table} + +Symbols that can have limits are shown in \tableref{tab:symlim}. +The size of these symbols depends on whether they are in displayed +maths or in-line maths. + +\xminisec{Example (Displayed Summation and Product):} + +The limits of summations and products are placed above and below the +symbol in displayed maths: +\begin{code} +\begin{alltt} +\glsni{begindispmath} + f(x) = \glsni{sum}\glsni{underscorechar}\marg{i=1}\glsni{circumchar}\marg{n} x\glsni{underscorechar}i + \glsni{prod}\glsni{underscorechar}\marg{i=1}\glsni{circumchar}\marg{n} x\glsni{underscorechar}i +\glsni{enddispmath} +\end{alltt} +\end{code} +\begin{resultS}[Image: f(x) = sum from i equals 1 to n x subscript i ++ product from i equals 1 to n x subscript i.] +\[ +f(x) = \sum_{i=1}^{n} x_i + \prod_{i=1}^{n} x_i +\] +\end{resultS} + +\xminisec{Example (In-line Summation and Product):} + +The limits of summations and products are placed to the right of the +symbol in in-line maths: +\begin{code} +\begin{alltt} +In a line of text: +\glsni{begin}\marg{math} + f(x) = \glsni{sum}\glsni{underscorechar}\marg{i=1}\glsni{circumchar}\marg{n} x\glsni{underscorechar}i + \glsni{prod}\glsni{underscorechar}\marg{i=1}\glsni{circumchar}\marg{n} x\glsni{underscorechar}i +\glsni{end}\marg{math} +\end{alltt} +\end{code} +\begin{resultS}[Image: as before but summation and product symbols +are smaller and limits are to the side instead of above and below] +In a line of text: +\begin{math} +f(x) = \sum_{i=1}^{n} x_i + \prod_{i=1}^{n} x_i +\end{math} +\end{resultS} + +\xminisec{Multiline Sub- or Superscripts} + +The \isty{amsmath} package provides the command: +\begin{definition} +\gls{substack}\marg{\meta{maths}} +\end{definition} +which can be used for multiline sub- or superscripts. Within the +argument \meta{maths} use \gls{tab.dbbackslashchar} to separate +rows. For example: +\begin{code} +\glsni{begindispmath}\newline +\strut~\glsni{sum}\glsni{underscorechar}\marg{\newline +\strut~~\glsni{substack}\newline +\strut~~\marg{\newline +\strut~~~~i \glsni{in} +\glsni{mathcal}\marg{I}\glsni{tab.dbbackslashchar}\newline +\strut~~~~i \glsni{neq} 0\newline +\strut~~}\newline +\strut~}\newline +\strut~x\glsni{underscorechar}i\newline +\glsni{enddispmath} +\end{code} +\begin{result}[substack.html] +\[ + \sum_{ + \substack + { + i \in \mathcal{I}\\ + i \neq 0 + } + } + x_i +\] +\end{result} + +\setnode{ellipses} +\subsection{Ellipses} +\label{sec:ellipses} + +Ellipsis (omission mark)\index{ellipses (omission marks)|hyperpage} commands are +shown in \tableref{tab:ellipsis}. The \isty{amsmath} package also +provides: \glsni{dotsc} for dots with commas, \glsni{dotsb} for dots +with binary operators/relations, \glsni{dotsm} for multiplication +dots, \glsni{dotsi} for dots with integrals and \glsni{dotso} for other +dots, which can be used as replacements for \glsni{ldots} and +\glsni{cdots}. + +\begin{table}[hbtp] +\caption[Ellipses]{Ellipses (\supdag\ provided by \sty{amsmath} +package)} +\label{tab:ellipsis} +\centering +\begin{tabular}{ll@{\hspace{4\tabcolsep}}ll@{\hspace{4\tabcolsep}}llllll} +\gls{vdots} & $\vdots$ & +\gls{cdots} & $\cdots$ & +\gls{dotsb}\supdag & $\dotsb$ & +\gls{dotsi}\supdag & $\dotsi$ & +\gls{dotsm}\supdag & $\dotsm$\\ +\gls{ddots} & $\ddots$ & +\gls{ldots} & $\ldots$ & +\gls{dotsc}\supdag & $\dotsc$ & +\gls{dotso}\supdag & $\dotso$ +\end{tabular} +\end{table} + +\xminisec{Example (Low Ellipsis):} + +This example uses the command +\refstepcounter{object}\label{cmd:forall}\gls{forall} to produce +the \dq{for all} symbol $\forall$, and it also uses +\glsni{spacesym} (backslash space) to make a space before the for all symbol. The +\isty{amsmath} \dq{dots with commas} ellipsis \glsni{dotsc} is used rather +than the standard \glsni{ldots}: +\begin{code} +\begin{alltt} +\glsni{begindispmath} +a\glsni{underscorechar}ix\glsni{underscorechar}i = b\glsni{underscorechar}i\glsni{spacesym}\glsni{forall} i = 1,\glsni{dotsc}, n +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[forall.html] +\[ +a_ix_i = b_i\ \forall i = 1,\dotsc, n +\] +\end{resultS} + +\xminisec{Example (Centred ellipsis):} + +This example uses the \isty{amsmath} \dq{dots with binary operators\slash relations} +\glsni{dotsb} instead of the standard \glsni{cdots}: +\begin{code} +\begin{alltt} +\glsni{begindispmath} +y = a\glsni{underscorechar}1 + a\glsni{underscorechar}2 + \glsni{dotsb} + a\glsni{underscorechar}n +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[cdots.html] +\[ +y = a_1 + a_2 + \dotsb + a_n +\] +\end{resultS} + +\begin{exercise}{Maths: Fractions and Symbols}{ex:mathssym} +This exercise uses a fraction, a square root, subscripts, +superscripts and symbols. +Try to reproduce the following output: +\begin{result}[maths1ex.html] +The quadratic equation +\[ +\sum_{i=0}^{2} a_i x^i = 0 +\] +has solutions given by +\[ +x = \frac{-a_1 \pm \sqrt{a_1^2 - 4 a_2 a_0}}{2a_2} +\] +\end{result}% +Again you can \downloadorview{mathssym} the solution. +\end{exercise} + +%---------- Delimiters ------------ + +\setnode{delimiters} +\subsection{Delimiters} +\label{sec:delimiters} + +Placing brackets around a tall object in maths mode, such as +fractions, does not look right if you use normal sized brackets. +For example: +\begin{code} +\glsni{begindispmath}\newline +\strut~~(\glsni{frac}\marg{1}\marg{1+x})\newline +\glsni{enddispmath} +\end{code}% +results in: +\begin{resultS}[Image: normal sized brackets around fraction.] +\[ +(\frac{1}{1+x}) +\] +\end{resultS}\bookpagebreak\noindent +Instead, you can automatically resize the delimiters using the +commands: +\begin{definition} +\gls{left}\meta{delimiter} +\end{definition}% +and +\begin{definition} +\gls{right}\meta{delimiter} +\end{definition}% +Rewriting the above example: +\begin{code} +\begin{alltt} +\glsni{begindispmath} + \glsni{left}( \glsni{frac}\marg{1}\marg{1+x} \glsni{right}) +\glsni{enddispmath} +\end{alltt} +\end{code}% +produces: +\begin{resultS}[Image: brackets now the same size as the fraction.] +\[ + \left( \frac{1}{1+x} \right) +\] +\end{resultS}% + +Note that you must always have matching \cmdname{left} and +\cmdname{right} commands, although the delimiters used may be +different. \refstepcounter{object}\label{obj:invisdelim}If you want +one of the delimiters to be invisible, use a +\gls{delimiter.periodchar}\ (full stop) as the delimiter. Available +delimiters are shown in +\tableref{tab:delimiters}. (Note for a vertical bar +delimiter it's best to use \isty{amsmath}'s \glsni{lvert} command instead of +\gls{delim.barchar} and \glsni{lVert} instead of \gls{csbar}.) Sometimes using \glsni{left} and +\glsni{right} doesn't produce the optimal sized delimiters. In which +case you can use additional commands provided by the \isty{amsmath} +package shown in \tableref{tab:big}. + +\begin{table}[hbtp] +\caption[Delimiters]{Delimiters (\supdag defined by +\protect\isty{amsmath})} +\label{tab:delimiters} +\centering +\begin{tabular}{llllllll} +\begin{inlinedef}\gls{openparen}\end{inlinedef} & +\makeimg{open round bracket}{$($} & +\begin{inlinedef}\gls{closeparen}\end{inlinedef} & +\makeimg{close round bracket}{$)$} & +\begin{inlinedef}\gls{delimiter.opensq}\end{inlinedef} & +\makeimg{open square bracket}{$[$} & +\begin{inlinedef}\gls{delimiter.closesq}\end{inlinedef} & +\makeimg{close square bracket}{$]$} \\ +\begin{inlinedef}\gls{leftbrace}\end{inlinedef} & +\makeimg{open curly brace}{$\{$} & +\begin{inlinedef}\gls{rightbrace}\end{inlinedef} & +\makeimg{close curly brace}{$\}$} & +\begin{inlinedef}\gls{lvert}\supdag\end{inlinedef} & +\makeimg{left vertical bar}{$\lvert$} & +\begin{inlinedef}\gls{rvert}\supdag\end{inlinedef} & +\makeimg{right vertical bar}{$\rvert$} \\ +\begin{inlinedef}\gls{lVert}\supdag\end{inlinedef} & +\makeimg{left double vertical bar}{$\lVert$} & +\begin{inlinedef}\gls{rVert}\supdag\end{inlinedef} & +\makeimg{right double vertical bar}{$\rVert$} & +\begin{inlinedef}\gls{langle}\end{inlinedef} & +\makeimg{left angle bracket}{$\langle$} & +\begin{inlinedef}\gls{rangle}\end{inlinedef} & +\makeimg{right angle bracket}{$\rangle$} \\ +\begin{inlinedef}\gls{lfloor}\end{inlinedef} & +\makeimg{left floor}{$\lfloor$} & +\begin{inlinedef}\gls{rfloor}\end{inlinedef} & +\makeimg{right floor}{$\rfloor$} & +\begin{inlinedef}\gls{lceil}\end{inlinedef} & +\makeimg{left ceiling}{$\lceil$} & +\begin{inlinedef}\gls{rceil}\end{inlinedef} & +\makeimg{right ceiling}{$\rceil$}\\ +\begin{inlinedef}\gls{uparrow}\end{inlinedef} & +\makeimg{up arrow}{$\uparrow$} & +\begin{inlinedef}\gls{downarrow}\end{inlinedef} & +\makeimg{down arrow}{$\downarrow$} & +\begin{inlinedef}\gls{Uparrow}\end{inlinedef} & +\makeimg{double lined up arrow}{$\Uparrow$} & +\begin{inlinedef}\gls{Downarrow}\end{inlinedef} & +\makeimg{double lined down arrow}{$\Downarrow$}\\ +\begin{inlinedef}\gls{updownarrow}\end{inlinedef} & +\makeimg{up down arrow}{$\updownarrow$} & +\begin{inlinedef}\gls{Updownarrow}\end{inlinedef} & +\makeimg{double lined up down arrow}{$\Updownarrow$} & +\begin{inlinedef}\gls{delim.slash}\end{inlinedef} & +\makeimg{forward slash}{$/$} & +\begin{inlinedef}\gls{backslash}\end{inlinedef} & +\makeimg{backslash}{$\backslash$} +\end{tabular} +\end{table} + +\begin{table} +\caption[Delimiter Sizing]{Additional Commands Provided by +\protect\isty{amsmath} for Delimiter Sizing} +\label{tab:big} +\centering +\renewcommand*{\arraystretch}{2.2} +\begin{tabular}{@{}ll@{\hspace{4\tabcolsep}}ll@{}} +\toprule +\multicolumn{2}{c@{\hspace{4\tabcolsep}}}{\bfseries Definitions} & +\multicolumn{2}{c}{\bfseries Example}\\ +\midrule +\multicolumn{2}{c@{\hspace{4\tabcolsep}}}{\em Default Size} & \verb|$( X )$| & $(X)$\\ +\begin{inlinedef}\gls{bigl}\meta{delim}\end{inlinedef} & +\begin{inlinedef}\gls{bigr}\meta{delim}\end{inlinedef} & +\verb|$\bigl( X \bigr)$| & +\makeimg{(X)}{$\bigl(X\bigr)$} \\ +\begin{inlinedef}\gls{Bigl}\meta{delim}\end{inlinedef} & +\begin{inlinedef}\gls{Bigr}\meta{delim}\end{inlinedef} & +\verb|$\Bigl( X \Bigr)$| & +\makeimg{(X)}{$\Bigl(X\Bigr)$} \\ +\begin{inlinedef}\gls{biggl}\meta{delim}\end{inlinedef} & +\begin{inlinedef}\gls{biggr}\meta{delim}\end{inlinedef} & +\verb|$\bigl( X \biggr)$| & +\makeimg{(X)}{$\biggl(X\biggr)$} \\ +\begin{inlinedef}\gls{Biggl}\meta{delim}\end{inlinedef} & +\begin{inlinedef}\gls{Biggr}\meta{delim}\end{inlinedef} & +\verb|$\Biggl( X \Biggr)$| & +\makeimg{(X)}{$\Biggl(X\Biggr)$} \\ +\bottomrule +\end{tabular} +\renewcommand*{\arraystretch}{1}% Keep LaTeX2HTML happy +\end{table} + +\xminisec{Example (Vertical Bar Delimiters):} + +\begin{code} +\glsni{begindispmath}\newline +\glsni{left}\glsni{lvert}\newline +\glsni{frac}\marg{1}\marg{1+x}\newline +\glsni{right}\glsni{rvert}\newline +\glsni{enddispmath} +\end{code}% +\begin{resultS}[Image: vertical bars same height as fraction.] +\[ +\left\lvert\frac{1}{1+x}\right\rvert +\] +\end{resultS} + +\xminisec{Example (Delimiter with Subscript):} + +Delimiters can take limits: +\begin{code} +\glsni{begindispmath}\newline +\glsni{left}\glsni{lvert}\newline +\glsni{frac}\marg{1}\marg{1+x}\newline +\glsni{right}\glsni{rvert}\glsni{underscorechar}\marg{x=0}\newline +\glsni{enddispmath} +\end{code}\reportpagebreak +\begin{resultS}[Image: as before but the right vertical bar has a subscript.] +\[ +\left\lvert\frac{1}{1+x}\right\rvert_{x=0} +\] +\end{resultS} + +\xminisec{Example (Mismatch):} +The left and right delimiters don't have to match: +\begin{code} +\begin{alltt} +\glsni{begindispmath} +\glsni{left}\glsni{delimiter.opensq}\glsni{frac}\marg{1}\marg{1+x}\glsni{right}\glsni{rangle} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: large open square bracket followed by +fraction followed by large right angle bracket.] +\[ +\left[\frac{1}{1+x}\right\rangle +\] +\end{resultS} + +\xminisec{Example (An invisible delimiter):} + +Every \gls{right} must have a matching \gls{left} (and vice versa), so +use a \gls{delimiter.periodchar}\ (full stop) for an invisible +delimiter. +\begin{code} +\begin{alltt} +\glsni{begindispmath} + \glsni{left}\glsni{delimiter.periodchar} + \glsni{frac}\marg{\glsni{partial} f}\marg{\glsni{partial} x} + \glsni{right}\glsni{rvert}\glsni{underscorechar}\marg{x=0} +\glsni{enddispmath} +\end{alltt} +\end{code} +\begin{resultS}[Image: partial fraction followed by large vertical +line with a subscript.] +\[ +\left. +\frac{\partial f}{\partial x} +\right\rvert_{x=0} +\] +\end{resultS} + +\refstepcounter{object}\label{introeq} +We have now covered enough to reproduce the equation shown in +\chapterref{ch:intro}: +\begin{code} +\begin{alltt} +\glsni{newcommand}*\marg{\cmdname{pderiv}}\oarg{2}\marg{\glsni{frac}\marg{\glsni{partial} \glsni{hashchar}1}\marg{\glsni{partial} \glsni{hashchar}2}} +\glsni{newcommand}*\marg{\cmdname{e}}\marg{\glsni{mathrm}\marg{e}} + +\glsni{begindispmath} +\cmdname{pderiv}\marg{\glsni{circumchar}2\glsni{mathcal}\marg{L}}\marg{\marg{z\glsni{underscorechar}i\glsni{circumchar}\glsni{rho}}\glsni{circumchar}2} = +-\cmdname{pderiv}\marg{\glsni{rho}\glsni{underscorechar}i}\marg{z\glsni{underscorechar}i\glsni{circumchar}\glsni{rho}} +\glsni{left}( + \cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i} \glsni{frac}\marg{\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}}\marg{1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}} + + v\glsni{underscorechar}i \glsni{frac}\marg{\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}\cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i}(1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}) + +\cmdname{e}\glsni{circumchar}\marg{2v\glsni{underscorechar}i}\cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i}}\marg{(1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i})\glsni{circumchar}2} +\glsni{right}) +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{result}[Image showing a second order partial derivative.] +\[ +\pderiv{^2\mathcal{L}}{{z_i^\rho}^2} = +-\pderiv{\rho_i}{z_i^\rho} +\left( + \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} + + v_i \frac{\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i})+\e^{2v_i}\pderiv{v_i}{\rho_i}}{(1-\e^{v_i})^2} +\right) +\] +\end{result} + +\xminisec{Note:} +The above code looks a bit complicated, and there are +so many braces that it can be easy to lose track, so here are some +ways of making it a little easier to type: +\begin{enumerate} +\item Whenever you start a new environment type in the +\gls{begin} and \gls{end} bits first, and then insert +whatever goes inside the environment. This ensures that you always +have a matching \gls{begin} and \gls{end}. The same goes for +\glsni{begindispmath} and \glsni{enddispmath}. + +\item Whenever you type any braces, always type the opening and +closing braces first, and then insert whatever goes in between. This +will ensure that your braces always match up. +\end{enumerate} + +So keeping these notes in mind, let's try typing in the code in a +methodical manner:\screenpagebreak +\begin{enumerate} +\item Start and end the displayed maths mode: +\begin{code} +\glsni{begindispmath}\newline +\glsni{enddispmath} +\end{code} + +\item We now need a partial derivative. +(The command \cmdname{pderiv} is defined as described +\htmlref{earlier}{itm:pderiv}\latex{\ifscreenorother{}{\ on +page~\pageref{itm:pderiv}}}. Make sure you remember to define it, +preferably in the \gls{preamble}.) +\begin{code} +{\color{midgray} +\glsnl{begindispmath}}\newline +\cmdname{pderiv}\marg{}\marg{}\newline +{\color{midgray} +\glsnl{enddispmath}} +\end{code} + +\item Let's do the first argument. This partial derivative is +actually a double derivative, which means we need a squared bit on +the top along with a calligraphic L: +\begin{code} +\begin{alltt} +{\color{midgray}\glsnl{begindispmath} +\cmdname{pderiv}\marg*{\textcolor{black}{\glsni{circumchar}2 \glsni{mathcal}\marg{L}}}\marg*{} +\glsnl{enddispmath}} +\end{alltt} +\end{code} + +\item The second argument is the $z_i^\rho$ squared bit. This is a +nested superscript +\verb|{z_i^\rho}^2|: +\begin{code} +\begin{alltt} +\color{midgray}\glsnl{begindispmath} +\cmdname{pderiv}\marg*{\textasciicircum2 \cmdname{mathcal}\marg{L}}\marg*{\textcolor{black}{\marg{z\glsni{underscorechar}i\glsni{circumchar}\glsni{rho}}\glsni{circumchar}2}} +\glsnl{enddispmath} +\end{alltt} +\end{code} + +\item We can do the next partial derivative in the same way. This +one is slightly easier to do: +\begin{code} +{\color{midgray}\glsnl{begindispmath}\newline +\cmdname{pderiv}\marg*{\glsnl{circumchar}2 \glsnl{mathcal}{L}}\marg*{\marg*{z\glsnl{underscorechar}i\glsnl{circumchar}\glsnl{rho}}\glsnl{circumchar}2}} =\newline +-\cmdname{pderiv}\marg{\glsni{rho}\glsni{underscorechar}i}\marg{z\glsni{underscorechar}i\glsni{circumchar}\glsni{rho}}\newline +{\color{midgray}\glsnl{enddispmath}} +\end{code} + +\item Delimiters also need to occur in pairs, like curly braces and +\glsni{begin} and \glsni{end}, so let's do them next: +\begin{code} +{\color{midgray}\verb|\[|\\ +\verb|\pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} =|\\ +\verb|-\pderiv{\rho_i}{z_i^\rho}|}\\ +\strut~~\glsni{left}(\\ +\strut~~\glsni{right})\\ +{\color{midgray}\verb|\]|} +\end{code}\screenpagebreak + +\item Now we need to do the bits inside the brackets. First of all +we have yet another partial derivative: +\begin{code} +{\color{midgray}\verb|\[|\\ +\verb|\pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} =|\\ +\verb|-\pderiv{\rho_i}{z_i^\rho}|\\ +\strut~~\glsnl{left}\glsnl{openparen}}\\ +\strut~~~~\cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i}\\ +{\color{midgray}~~\glsnl{right}\glsnl{closeparen}\\ +\verb|\]|} +\end{code} + +\item Now we have a fraction following the partial derivative from +the previous step. +(Make sure you use braces for the exponential bit: \verb|\e^{v_i}| +($\e^{v_i}$) is not the same as \verb|\e^v_i| ($\e^v_i$). The +command \cmdname{e} is defined as described +\htmlref{earlier}{sec:scripts}\latex{ in \sectionref{sec:scripts}}. +Make sure you define it, preferably in the \gls{preamble}.) +\begin{code} +{\color{midgray}\verb|\[|\\ +\verb|\pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} =|\\ +\verb|-\pderiv{\rho_i}{z_i^\rho}|\\ +\strut~~\glsnl{left}\glsnl{openparen}\\ +\strut~~~~\cmdname{pderiv}\marg*{v\glsnl{underscorechar}i}\marg*{\glsnl{rho}\glsnl{underscorechar}i}} \glsni{frac}\marg{\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}}\marg{1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}}\\ +{\color{midgray}~~\glsnl{right}\glsnl{closeparen}\\ +\verb|\]|} +\end{code} + +\item This is followed by $v_i$ times another fraction: +\begin{code}\par\noindent +{\color{midgray}\verb|\[|\\ +\verb|\pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} =|\\ +\verb|-\pderiv{\rho_i}{z_i^\rho}|\\ +\strut~~\glsnl{left}\glsnl{openparen}\\ +\strut~~~~\cmdname{pderiv}\marg*{v\glsnl{underscorechar}i}\marg*{\glsnl{rho}\glsnl{underscorechar}i} \glsnl{frac}\marg*{\cmdname{e}\glsnl{circumchar}\marg*{v\glsnl{underscorechar}i}}\marg*{1-\cmdname{e}\glsnl{circumchar}\marg*{v\glsnl{underscorechar}i}}}\\ +\strut~~~~+ v\glsni{underscorechar}i \glsni{frac}\marg{}\marg{}\\ +{\color{midgray}~~\glsnl{right}\glsnl{closeparen}\\ +\color{midgray}\verb|\]|} +\end{code} + +\item The bottom part of the +fraction (the denominator) is easier than the top, so let's do that first: +\begin{code} +\color{midgray}\glsnl{begindispmath}\newline +\cmdname{pderiv}\marg*{\textasciicircum2 \cmdname{mathcal}\marg*{L}}\marg*{\marg*{z\_i\textasciicircum\cmdname{rho}}\textasciicircum2} =\newline +-\cmdname{pderiv}\marg*{\cmdname{rho}\_i}\marg*{z\_i\textasciicircum\cmdname{rho}}\newline +\strut~~\cmdname{left}(\newline +\strut~~~~\cmdname{pderiv}\marg*{v\_i}\marg*{\cmdname{rho}\_i} \cmdname{frac}\marg*{\cmdname{e}\textasciicircum\marg*{v\_i}}\marg*{1-\cmdname{e}\textasciicircum\marg*{v\_i}}\newline +\strut~~~~+ v\_i \cmdname{frac}\marg*{}\marg*{\textcolor{black}{(1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i})\glsni{circumchar}2}}\newline +\strut~~\cmdname{right})\newline +\glsnl{enddispmath} +\color{black} +\end{code} + +% Something weird is causing a shift in the +% frame here. +% Compensating by ending and restarting enumerate +% environment +\breakenumi + +\item Now for the top part of the fraction (the numerator). +To refresh your memory, it should look like: +\[ +\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i}) ++ \e^{2v_i}\pderiv{v_i}{\rho_i} +\] +That's a bit +complicated, so let's break it down: + +\begin{enumerate} + +\item The first term is: +\begin{alltt} +\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i} +\end{alltt} + +\item The next term is another partial derivative: +\begin{alltt} +\cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i} +\end{alltt} + +\item Then we have: +\begin{alltt} +(1-\cmdname{e}\glsni{circumchar}\marg{v\glsni{underscorechar}i}) +\end{alltt} + +\item Next we have to add on: +\begin{alltt} ++\cmdname{e}\glsni{circumchar}\marg{2v\glsni{underscorechar}i} +\end{alltt} + +\item And finally we have: +\begin{alltt} +\cmdname{pderiv}\marg{v\glsni{underscorechar}i}\marg{\glsni{rho}\glsni{underscorechar}i} +\end{alltt} +\end{enumerate} + +So the numerator is: +\begin{code} +\begin{verbatim} +\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i}) + + \e^{2v_i}\pderiv{v_i}{\rho_i} +\end{verbatim} +\end{code} + +Inserting this into our code:\reportpagebreak +\begin{code} +\begin{alltt} +\color{midgray}\glsnl{begindispmath} +\cmdname{pderiv}\marg*{\textasciicircum2\cmdname{mathcal}\marg*{L}}\marg*{\marg*{z\_i\textasciicircum\cmdname{rho}}\textasciicircum2} = +-\cmdname{pderiv}\marg*{\cmdname{rho}\_i}\marg*{z\_i\textasciicircum\cmdname{rho}} +\cmdname{left}( + \cmdname{pderiv}\marg*{v\_i}\marg*{\cmdname{rho}\_i} \cmdname{frac}\marg*{\cmdname{e}\textasciicircum\marg*{v\_i}}\marg*{1-\cmdname{e}\textasciicircum\marg*{v\_i}} + \color{midgray}+ v\_i \cmdname{frac}\marg*{\textcolor{black}{\cmdname{e}\textasciicircum\marg{v\_i}\cmdname{pderiv}\marg{v\_i}\marg{\cmdname{rho}\_i}(1-\cmdname{e}\textasciicircum\marg{v\_i}) + +\cmdname{e}\textasciicircum\marg{2v\_i}\cmdname{pderiv}\marg{v\_i}\marg{\cmdname{rho}\_i}}}\marg*{(1-\cmdname{e}\textasciicircum\marg*{v\_i})\textasciicircum2} +\cmdname{right}) +\glsnl{enddispmath} +\end{alltt} +\color{black} +\end{code} + +\end{enumerate} + + +%----------- Arrays ------------- + +\setnode{arrays} +\subsection{Arrays} +\label{sec:arrays} + +Mathematical structures such as matrices and vectors require elements +to be arranged in rows and columns. Just as we can align material in +rows and columns in text mode using the +\gls{env-tabular} environment (\sectionref{sec:tabular}), we can do the +same in maths mode using the \gls{env-array} environment. The +\glsni{env-array} environment has the same format as the +\gls{env-tabular} environment, however it must be in maths mode. +The column half-gaps are given by the \gls{length} register +\gls{arraycolsep} (analogous to \gls{tabcolsep}). + +\xminisec{Example:} + +\begin{code} +\glsni{begindispmath}\newline +\glsni{begin}\marg{array}\marg{rrr}\newline +0 \gls{ampchar} 1 \gls{ampchar} 19\gls{tab.dbbackslashchar}\newline +-6 \gls{ampchar} 10 \gls{ampchar} 200\newline +\glsni{end}\marg{array}\newline +\glsni{enddispmath} +\end{code} + +\begin{result}[Image shows 3 columns and 2 rows.] +\[ +\begin{array}{rrr} +0 & 1 & 19\\ +-6 & 10 & 200 +\end{array} +\] +\end{result} + +\xminisec{Example (Adding Delimiters):} + +\begin{code} +\begin{alltt} +\glsni{begindispmath} +\glsni{left}\glsni{openparen} + \glsni{begin}\marg{array}\marg{rrr} + 0 \glsni{ampchar} 1 \glsni{ampchar} 19\glsni{tab.dbbackslashchar} + -6 \glsni{ampchar} 10 \glsni{ampchar} 200 + \glsni{end}\marg{array} +\glsni{right}\glsni{closeparen} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: as before but has large round brackets on either +side.] +\[ +\left( +\begin{array}{rrr} +0 & 1 & 19\\ +-6 & 10 & 200 +\end{array} +\right) +\] +\end{resultS} + +\xminisec{Adding a Vertical Rule:} + +A vertical rule can be added using \gls{array.barchar} in the column +specifier. For example: +\begin{code} +\begin{alltt} +\glsni{begindispmath} +\glsni{left}\glsni{openparen} + \glsni{begin}\marg{array}\marg{rr\glsni{array.barchar}r} + 0 \glsni{ampchar} 1 \glsni{ampchar} 19\glsni{tab.dbbackslashchar} + -6 \glsni{ampchar} 10 \glsni{ampchar} 200 + \glsni{end}\marg{array} +\glsni{right}\glsni{closeparen} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: 3 columns and 2 rows with a vertical line +between the second and third column.] +\[ +\left( +\begin{array}{rr|r} +0 & 1 & 19\\ +-6 & 10 & 200 +\end{array} +\right) +\] +\end{resultS} + +\xminisec{Example (Cases):} +This example uses an +\htmlref{invisible delimiter}{obj:invisdelim}: +\begin{code} +\begin{alltt} +\glsni{begindispmath} +f(x) = + \glsni{left}\glsni{leftbrace} + \glsni{begin}\marg{array}\marg{rl} + -1 \glsni{ampchar} x \glsni{ltchar} 0\glsni{tab.dbbackslashchar} + 0 \glsni{ampchar} x = 0\glsni{tab.dbbackslashchar} + +1 \glsni{ampchar} x \glsni{gtchar} 0 + \glsni{end}\marg{array} + \glsni{right}\glsni{delimiter.periodchar} +\glsni{enddispmath} +\end{alltt} +\end{code}% +\begin{resultS}[Image: array has large open brace on the left and +nothing on the right of it.] +\[ +f(x) = +\left\{ +\begin{array}{rl} +-1 & x < 0\\ +0 & x = 0\\ ++1 & x > 0 +\end{array} +\right. +\] +\end{resultS} +This can be rewritten more compactly using the \isty{amsmath} +\gls{env-cases} environment: +\begin{code} +\gls{begindispmath}\newline +f(x) = \newline +\strut~\glsni{begin}\marg{cases}\newline +\strut~~-1 \glsni{ampchar} x < 0\glsni{tab.dbbackslashchar}\newline +\strut~~0 \glsni{ampchar} x = 0\glsni{tab.dbbackslashchar}\newline +\strut~~+1 \glsni{ampchar} x > 0\newline +\strut~\glsni{end}\marg{cases}\newline +\gls{enddispmath} +\end{code} +\begin{resultS}[Image: as previous example but first column is left +aligned.] +\[ +f(x) = +\begin{cases} +-1 & x < 0\\ +0 & x = 0\\ ++1 & x > 0 +\end{cases} +\] +\end{resultS} + +The \isty{amsmath} package provides some convenient environments to +typeset matrices: \gls{env-pmatrix}, \gls{env-bmatrix}, +\gls{env-Bmatrix}, \gls{env-vmatrix} and \gls{env-Vmatrix}. These +are similar to the \gls{env-array} environment except there is no +argument, and they add (respectively) $\bigl(~\bigr)$, +$\bigl[~\bigr]$, $\bigl\{~\bigr\}$, $\bigl\lvert~\bigr\rvert$ and +$\bigl\lVert~\bigr\rVert$ delimiters. There is also the +\gls{env-matrix} environment that doesn't have any delimiters. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +\glsni{begin}\marg{equation} + \glsni{begin}\marg{pmatrix} + a \glsni{ampchar} b\glsni{tab.dbbackslashchar} + c \glsni{ampchar} d + \glsni{end}\marg{pmatrix} +\glsni{end}\marg{equation} +\end{alltt} +\end{code} +\begin{result}[Image: 2 by 2 matrix with round delimiters and an +equation number.] +\begin{equation} +\begin{pmatrix} +a & b\\ +c & d +\end{pmatrix} +\end{equation} +\end{result} + +The \isty{amsmath} package also provides the environment +\gls{env-smallmatrix} designed for in-line use. You need to add any +delimiters explicitly. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +Here is a small matrix +\glsni{begin}\marg{math} + \glsni{left}\glsni{openparen} + \glsni{begin}\marg{smallmatrix} + a \glsni{ampchar} b\glsni{tab.dbbackslashchar} + c \glsni{ampchar} d + \glsni{end}\marg{smallmatrix} + \glsni{right}\glsni{closeparen} +\glsni{end}\marg{math} +in a line of text. +\end{alltt} +\end{code} +\begin{resultS}[Image: matrix is small enough to fit into the line +of text.] +Here is a small matrix +\begin{math} +\left( +\begin{smallmatrix} +a & b\\ +c & d +\end{smallmatrix} +\right) +\end{math} +in a line of text. +\end{resultS} + + +%----------- Vectors ------------ + +\setnode{vectors} +\subsection{Vectors} +\label{sec:vec} + +A variable representing a vector can be typeset using the command: +\begin{definition} +\gls{vec}\marg{\meta{variable}} +\end{definition}\screenpagebreak + +\xminisec{Example:} +\begin{codeS} +\glsni{begindispmath} +\glsni{vec}\marg{x} +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[Image: x with a small right arrow above it.] +\[ \vec{x} \] +\end{resultS} + +Vectors are often typeset in bold. This can be +done by \htmlref{redefining}{sec:renewcom} the \glsni{vec} +command\doifbook{ (see \sectionref{sec:renewcom})}. +You could use \gls{mathbf}, for example: +\begin{code} +\begin{alltt} +\gls{renewcommand}\marg{\glsni{vec}}\oarg{1}\marg{\glsni{mathbf}\marg{\glsni{hashchar}1}} + +\glsni{begindispmath} + \glsni{vec}\marg{x}\glsni{cdot}\glsni{vec}\marg{\glsni{xi}} = z +\glsni{enddispmath} +\end{alltt} +\end{code}\bookpagebreak\noindent +\begin{resultS}[Image: upright bold x centred dot xi equals z] +\[ +\mathbf{x}\cdot\mathbf{\xi} = z +\] +\end{resultS} +\refstepcounter{object}\label{cmd:vec}However, as you may have +noticed, the +Greek letter $\xi$ has not come out in bold. Here's an alternative +(using \gls{boldsymbol} defined in the \isty{amsfonts} \htmlref{package}{sec:packages}): +\begin{code} +\gls{renewcommand}\marg{\glsni{vec}}\oarg{1}\marg{\glsni{boldsymbol}\marg{\glsni{hashchar}1}}\newline +\glsni{begindispmath}\newline +\strut~~\glsni{vec}\marg{x}\glsni{cdot}\glsni{vec}\marg{\glsni{xi}} = z\newline +\glsni{enddispmath} +\end{code}% +\begin{resultS}[As before but x and xi in italic bold] +\[ +\boldsymbol{x}\cdot\boldsymbol{\xi} = z +\] +\end{resultS} + +Located (or position) vectors, on the other hand, are usually typeset with a right +arrow, but the default definition of \glsni{vec} produces an +arrow that is too small: +\begin{codeS} +\glsni{begindispmath} +\glsni{vec}\marg{OP} +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[Image: the letters O P with a small right arrow +above them.] +\[ +\vec{OP} +\] +\end{resultS} +Instead, use \gls{overrightarrow} (\tableref{tab:overunderarrows}): +\begin{codeS} +\glsni{begindispmath} +\glsni{overrightarrow}\marg{OP} +\glsni{enddispmath} +\end{codeS} +\begin{resultS}[Image: as above but with a longer arrow that spans +both letters.] +\[ +\overrightarrow{OP} +\] +\end{resultS} +You might prefer to define separate commands for a located vector and a vector +variable. + +\xminisec{Example:} +In the \glsterm{preamble}, define \cmdname{lvec} for a +located vector and \cmdname{bvec} for a vector variable: +\begin{code} +\begin{alltt} +\gls{newcommand}*\marg{\cmdname{lvec}}\oarg{1}\marg{\glsni{overrightarrow}\marg{\glsni{hashchar}1}} +\glsni{newcommand}*\marg{\cmdname{bvec}}\oarg{1}\marg{\glsni{boldsymbol}\marg{\glsni{hashchar}1}} +\end{alltt} +\end{code} +Later in the document: +\begin{code} +Let \glsni{dollarchar}\cmdname{bvec}\marg{u}=(x, y)\glsni{dollarchar} +represent \glsni{dollarchar}\cmdname{lvec}\marg{OP}\glsni{dollarchar}, then\newline +\glsni{begindispmath}\newline +\strut~~\glsni{lVert} \cmdname{bvec}\marg{u} \glsni{rVert} + = \glsni{sqrt}\marg{x\glsni{circumchar}2 + y\glsni{circumchar}2}\newline +\glsni{enddispmath} +\end{code} +\begin{result}[Image: the vector u appeas in italic bold and the +letters O P are as above.] +\newcommand*{\lvec}[1]{\overrightarrow{#1}}% +\newcommand*{\bvec}[1]{\boldsymbol{#1}}% +Let $\bvec{u}=(x, y)$ represent $\lvec{OP}$, then +\[ + \lVert \bvec{u} \rVert = \sqrt{x^2 + y^2} +\] +\end{result} +\bookpagebreak + +\begin{exercise}{Maths: Vectors and Arrays}{ex:vectors} +Try to produce the following: +\renewcommand{\vec}[1]{\boldsymbol{#1}} +\begin{result}[maths2ex.html] +\[ +\boldsymbol{A}\vec{x} = +\begin{pmatrix} +0 & 1\\ +2 & 3 +\end{pmatrix} +\begin{pmatrix} +1\\ +2 +\end{pmatrix} += +\begin{pmatrix} +2\\ +8 +\end{pmatrix} += \vec{y} +\] +\end{result}% +As before, you can \downloadorview{vectors} the solution. +\end{exercise} + +%--------------- Mathematical Spacing ------------------- + +\setnode{mathssp} +\subsection{Mathematical Spacing} +\label{sec:mathsspacing} + +\LaTeX\ deals with mathematical spacing fairly well, but sometimes +you may find you want to adjust the spacing yourself. Available +spacing commands are listed in \tableref{tab:spacing}. + +\begin{table}[hbtp] +\caption[Mathematical Spacing Commands]{Mathematical Spacing Commands +(\supdag provided by \protect\istyend{amsmath})} +\label{tab:spacing} +\centering +\begin{tabular}{lll} +\toprule +\bfseries Command & \bfseries Example Input & \bfseries Example Output\\ +\midrule + & \verb|$AB$| & $AB$ \\ +\gls{thinspace} or \gls{comma} & \verb|$A\,B$| & $A\,B$\\ +\gls{medspace}\supdag\ or \gls{colon} & \verb|$A\:B$| & $A\:B$\\ +\gls{thickspace}\supdag\ or \gls{semicolon} & \verb|$A\;B$| & $A\;B$\\ +\gls{quad} & \verb|$A\quad B$| & $A\quad B$\\ +\gls{qquad} & \verb|$A\qquad B$| & $A\qquad B$\\ +\gls{negthinspace} or \gls{exclam} & \verb|$A\!B$| & $A\!B$ \\ +\gls{negmedspace}\supdag & \verb|$A\negmedspace B$| & $A\negmedspace B$ \\ +\gls{negthickspace}\supdag & \verb|$A\negthickspace B$| & $A\negthickspace B$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{exercise}{More Mathematics}{ex:moremaths} +This exercise uses the spacing command \glsni{qquad}. In addition, +it has a +\htmlref{function name}{sec:declaremathop}, diag, and it uses the +\gls{forall} and \htmlref{ellipses}{sec:ellipses} symbols. It also +\htmlref{redefines the \cmdname{vec} +command}{cmd:vec}\indexCom{vec}, as was done in the previous +section, uses the +\gls{env-bmatrix} environment (see \sectionref{sec:arrays}), and has \htmlref{subscripts and superscripts}{sec:scripts}. + +Try to reproduce the following output: +\begin{result}[maths3ex.html] +\renewcommand{\vec}[1]{\boldsymbol{#1}} +The set of linear equations: +\[ +a_ix_i = b_i \qquad \forall i=1, \ldots, n +\] +can be written as a matrix equation: +\[ +\diag(\vec{a})\vec{x} = \vec{b} +\] +where $\vec{x} = (x_1, \ldots, x_n)^T$, $\vec{b} = (b_1, \ldots, b_n)^T$ +and +\[ +\diag(\vec{a}) = +\begin{bmatrix} +a_1 & 0 & \cdots & 0\\ +0 & a_2 & \ddots & \vdots\\ +\vdots & \ddots & \ddots & 0\\ +0 & \cdots & 0 & a_n +\end{bmatrix} +\] +\end{result} + +Again, you can \downloadorview{moremaths} the solution. +\end{exercise} + +%%%%%%%%%%%%%%%%%% DEFINING ENVIRONMENTS %%%%%%%%%%%%%%%% + +\setnode{newenv} +\chapter{Defining Environments} +\label{ch:newenv} + +Just as you can \htmlref{define new commands}{ch:newcom}, you can +also define new \glspl{environment}. The command +\begin{definition} +\gls{newenvironment}\marg{\meta{env-name}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{begin-code}}\marg{\meta{end-code}} +\end{definition}% +is used to define a new environment. As with new commands, you can +use the optional argument \meta{n-args} to define an environment with +arguments, and \meta{default} to define an environment with an +optional argument. + +The first argument \meta{env-name} is the name of your new +environment. Remember that the environment name must not have a +backslash. The mandatory arguments \meta{begin-code} and +\meta{end-code} indicate what \LaTeX\ \reportlinebreak should do at the beginning and +end of the environment. Note that although \meta{begin-code} can +reference the arguments using \gls{hashchar}\texttt{1} etc, the +\meta{end-code} part can't. + +\xminisec{Example (An Exercise Environment):} + +Let's first consider an example of an +environment without any arguments. Let's make an environment called, +say, \envname{exercise} that prints \textbf{Exercise} in bold and +typesets the contents of the environment in italic, with a gap +between the title and the contents. In other words, +we want the following code: +\begin{code} +\glsni{begin}\marg{exercise}\newline +This is a sample.\newline +\glsni{end}\marg{exercise} +\end{code} +to produce the following output: +\begin{result}[newenv1.html] +\par\noindent +\textbf{Exercise} +\begin{itshape} +\par +\vspace{\baselineskip}% +\noindent +This is a sample. +\end{itshape} +\end{result} +(In the \htmlref{next chapter}{ch:counters} we will add numbering.) + +Let's first consider what we want this environment to do: we can get +the word \dq{Exercise} in bold using \gls{textbf}, +and the italic font can be +obtained by using the \gls{env-itshape} environment (recall +\sectionref{sec:fonts}). +So, at the start of our +new environment we need +\begin{codeS} +\glsni{textbf}\marg{Exercise}\glsni{begin}\marg{itshape} +\end{codeS} +and at the end of our new +environment we need to end the \glsni{env-itshape} environment: +\begin{codeS} +\glsni{end}\marg{itshape} +\end{codeS} +Putting the above together into the new environment definition: +\begin{code}\obeyspaces +\glsni{newenvironment}\marg{exercise}\glsni{percentchar} environment name\newline +\marg{\glsni{percentchar} begin code\newline +\strut~~\glsni{textbf}\marg{Exercise}\glsni{begin}\marg{itshape}\glsni{percentchar}\newline +}\glsni{percentchar}\newline +\marg{\glsni{end}\marg{itshape}}\glsni{percentchar} end code +\end{code} +Let's try it out: +\begin{code} +\begin{verbatim} +\begin{exercise} +This is a sample. +\end{exercise} +\end{verbatim} +\end{code}% +\begin{resultS}[newenv2.html] +\textbf{Exercise} +\begin{itshape} +This is a sample. +\end{itshape} +\end{resultS} +Not quite right. Let's put a paragraph break after +\textbf{Exercise}, and put one before it as well. The command +\gls{par} can be used to make a paragraph break and the extra bit of +vertical spacing can be produced using \glsni{vspace}. The +\gls{length} \gls{baselineskip} is the interline spacing. +Modifications are shown in bold \modification{like this}. +\begin{code}\obeyspaces +\glsnl{newenvironment}\marg*{exercise}\glsnl{percentchar} environment name\newline +\marg*{\glsnl{percentchar} begin code\newline +\strut~~\modification{\glsni{par}\glsni{vspace}\marg{\glsni{baselineskip}}\glsni{percentchar}}\newline +\strut~~\glsnl{textbf}\marg*{Exercise}\glsnl{begin}\marg*{itshape}\glsnl{percentchar}\newline +\strut~~\modification{\glsni{par}\glsni{vspace}\marg{\glsni{baselineskip}}\glsni{percentchar}}\newline +}\glsnl{percentchar}\newline +\marg*{\glsnl{end}\marg*{itshape}}\glsnl{percentchar} end code +\end{code}% +Let's have a look at the output now: +\begin{result} +\dohtmlcolorbox{% +\par\vspace{\baselineskip}% +\textbf{Exercise}\begin{itshape}% +\par\vspace{\baselineskip} +This is a sample. +\end{itshape} +} +\end{result} +\faq{There's a space added after my environment}{spaftend}% +The indent at the start of each line is caused by the normal +paragraph indentation. This can be suppressed using \gls{noindent}. +It's also a good idea to suppress +any spaces immediately following \verb|\begin{exercise}| and \verb|\end{exercise}|, which can be done +using \gls{ignorespaces} and \reportlinebreak\screenlinebreak\gls{ignorespacesafterend}. +Modifications are again shown in bold \modification{like this}. +\begin{code}\obeyspaces +\glsnl{newenvironment}\marg*{exercise}\glsnl{percentchar} environment name\newline +\marg*{\glsnl{percentchar} begin code\newline +\strut~~\glsnl{par}\glsnl{vspace}\marg*{\glsnl{baselineskip}}\modification{\glsni{noindent}}\newline +\strut~~\glsnl{textbf}\marg*{Exercise}\glsnl{begin}\marg*{itshape}\glsnl{percentchar}\newline +\strut~~\glsnl{par}\glsnl{vspace}\marg*{\glsnl{baselineskip}}\modification{\glsni{noindent}\glsni{ignorespaces}}\newline +}\glsnl{percentchar}\newline +\marg*{\glsnl{percentchar} end code\newline +\strut~~\glsnl{end}\marg{itshape}\modification{\glsni{ignorespacesafterend}}\newline +} +\end{code}% +The \envname{exercise} environment now appears as: +\begin{result} +\par\vspace{\baselineskip}\noindent +\textbf{Exercise}\begin{itshape}% +\par\vspace{\baselineskip}\noindent +This is a sample. +\end{itshape} +\end{result} + +Now let's modify our code so that the environment takes an +argument. The argument should indicate the exercise topic. +For example, the following code: +\begin{code} +\begin{verbatim} +\begin{exercise}{An Example} +This is a sample. +\end{exercise} +\end{verbatim} +\end{code}% +should produce the following result: +\begin{result}[newenv3.html] +\par\vspace{\baselineskip}\noindent\textbf{Exercise (An Example)} +\begin{itshape}\par\vspace{\baselineskip}\noindent +This is a sample. +\end{itshape} +\end{result}% +As with \gls{newcommand}, \gls{hashchar}\texttt{1} is +used to indicate the first argument. We can now modify the code as +follows: +\begin{code}\obeyspaces +\glsnl{newenvironment}\marg*{exercise}\modification{\oarg{1}}\glsnl{percentchar} environment name\newline +\marg*{\glsnl{percentchar} begin code\newline +\strut~~\glsnl{par}\glsnl{vspace}\marg*{\glsnl{baselineskip}}\glsnl{noindent}\newline +\strut~~\glsnl{textbf}\marg*{Exercise\modification{ (\glsni{hashchar}1)}}\glsnl{begin}\marg*{itshape}\glsnl{percentchar}\newline +\strut~~\glsnl{par}\glsnl{vspace}\marg*{\glsnl{baselineskip}}\glsnl{noindent}\glsnl{ignorespaces}\newline +}\glsnl{percentchar}\newline +\marg*{\glsnl{percentchar} end code\newline +\strut~~\glsnl{end}\marg*{itshape}\glsnl{ignorespacesafterend}\newline +} +\end{code} + +\setnode{renewenv} +\section{Redefining Environments} +\label{sec:renewenv} + +It is also possible to redefine an environment using: +\begin{definition}[\linewidth] +\gls{renewenvironment}\marg{\meta{env-name}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{begin-code}}\marg{\meta{end-code}} +\end{definition}% +As with \gls{renewcommand}, only redefine an existing environment if +you want a modified version of that environment rather than because +you like the environment name. + +\begin{exercise}{Defining a New Environment}{ex:newenv} +If you did any of the exercises from \exerciseref{ex:section} +to \exerciseref{ex:tables}, go back to the document you +created and define the \envname{exercise} environment as in +the example above. Then try creating some exercises using this +environment. You could, maybe, put an exercise in the first +chapter, and then another one in the second chapter. +Again you can \downloadorview{newenv} an example. +\end{exercise} + +%%%%%%%%%%%%%%%%% Counters %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{counters} +\chapter{Counters} +\label{ch:counters} + +As we have seen, \LaTeX\ automatically generates numbers for +chapters, sections, equations etc. These numbers are stored in +\keyword{counters}. The names of these counters are usually the same +as the name of the object with which it is associated but without +any backslash. For example, the \gls{chapter} command has an associated +counter called \icounter{chapter}, the \gls{footnote} command has an +associated counter called \icounter{footnote}, the +\gls{env-equation} environment has an associated counter called +\icounter{equation}, the \gls{env-figure} environment has an associated counter +called \icounter{figure} and the \gls{env-table} environment has an associated +counter called \icounter{table}. There is also a counter called +\icounter{page} that keeps track of the current page number. + +The value of a counter can be displayed using the command +\begin{definition} +\icmdname{the}\meta{counter} +\end{definition}% +where \meta{counter} is the name of the associated counter. Note +that \meta{counter} does not go in curly braces and adjoins +\cmdname{the} (for example, \gls{thepage}\faq{Page number is wrong at +start of page}{wrongpn}, \reportlinebreak\gls{thesection} or +\gls{thechapter}). In fact, we have already encountered +\reportlinebreak\screenlinebreak\gls{thefigure} in \sectionref{sec:subfloats}. + +\xminisec{Example:} +\begin{code} +\begin{alltt} +This page is Page\glsni{tildechar}\glsni{thepage}. +The current chapter is Chapter\glsni{tildechar}\glsni{thechapter}. +\end{alltt} +\end{code}\label{example:thepage}% +\begin{resultS}[This page is Page 226. The current chapter is Chapter 11.] +% LaTeX2HTML doesn't store the page number in the image file +% so use \pageref to fake \thepage instead +This page is Page~\pageref*{example:thepage}. +The current chapter is Chapter~\thechapter. +\end{resultS}% +New counters can be created using the command: +\begin{definition} +\gls{newcounter}\marg{\meta{counter-name}}\oarg{\meta{outer-counter}} +\end{definition}% +The \gls{mandatory} \meta{counter-name} +is the name of your new counter (no backslash in the name). For +example, let's define a counter called \texttt{exercise} to keep +track of each exercise. (Recall the exercise example from +\chapterref{ch:newenv}.) +\begin{codeS} +\glsni{newcounter}\marg{exercise} +\end{codeS}% +We can now display the value of the counter using +the command \cmdname{theexercise}. At the moment the counter +has the value zero, the value can be changed using one +of the following commands: + +\begin{fwlist}{\cmdname{addtocounter}\marg{\meta{counter}}\marg{\meta{num}}} +\fwitem{\gls{stepcounter}\marg{\meta{counter}}} Increments +\meta{counter} by 1 + +\fwitem{\gls{refstepcounter}\marg{\meta{counter}}} As above, but +allows you to cross-\reportlinebreak reference the counter using \gls{label} and +\gls{ref} + +\fwitem{\gls{setcounter}\marg{\meta{counter}}\marg{\meta{num}}} +Sets the counter to \meta{num} + +\fwitem{\gls{addtocounter}\marg{\meta{counter}}\marg{\meta{num}}} +Adds \meta{num} to \meta{counter} +\end{fwlist} + +A couple of the commands above take a number \meta{num} as one of +the arguments. If you want to use another counter for this argument, +you need to use +\begin{definition} +\gls{value}\marg{\meta{counter}} +\end{definition}% +For example, if you want to set our new \texttt{exercise} counter to +the same value as the \texttt{page} counter, you would do +\begin{codeS} +\glsni{setcounter}\marg{exercise}\marg{\glsni{value}\marg{page}} +\end{codeS}% +Let's go back to the \envname{exercise} environment you +created in \exerciseref{ex:newenv}. The exercises really ought to have +an associated number, and this number should be incremented each time +we use the exercise environment. So let's modify our code to do this. +Modifications are illustrated in bold \modification{like this}: +\begin{code}\obeyspaces +\modification{\cmdname{newcounter}\marg{exercise}}\newline +\strut\newline +\glsni{newenvironment}\marg{exercise}\oarg{1}\glsni{percentchar} environment name\newline +\marg{\glsni{percentchar} begin code\newline +\strut~~\glsni{par}\glsni{vspace}\marg{\glsni{baselineskip}}\glsni{noindent}\newline +\strut~~\modification{\glsni{refstepcounter}\marg{exercise}}\glsni{percentchar}\newline +\strut~~\glsni{textbf}\marg{Exercise \modification{\cmdname{theexercise}\glsni{spacesym}}(\glsni{hashchar}1)}\glsni{percentchar}\newline +\strut~~\glsni{begin}\marg{itshape}\glsni{percentchar}\newline +\strut~~\glsni{par}\glsni{vspace}\marg{\glsni{baselineskip}}\glsni{percentchar}\newline +\strut~~\glsni{noindent}\glsni{ignorespaces}\newline +}\glsni{percentchar}\newline +\marg{\glsni{percentchar} end code\newline +\strut~~\glsni{end}\marg{itshape}\glsni{percentchar}\newline +\strut~~\modification{\glsni{par}\glsni{vspace}\marg{\glsni{baselineskip}}\glsni{percentchar}}\newline +\strut~~\modification{\glsni{noindent}}\glsni{ignorespacesafterend}\newline +} +\end{code}% +Note that the counter needs to be incremented before it is used. +I've also added an extra \gls{vspace} at the end of the +environment and a paragraph break. +Since we've used \glsni{refstepcounter} instead of +\glsni{stepcounter} we can cross-reference our +\envname{exercise} environment:\reportpagebreak +\begin{code} +\begin{alltt} +Exercise\glsni{tildechar}\glsni{ref}\marg{ex:simple} is a simple exercise. + +\glsni{begin}\marg{exercise}\marg{Simple Exercise} +\glsni{label}\marg{ex:simple}\glsni{percentchar} +This is a simple exercise. +\glsni{end}\marg{exercise} +\end{alltt} +\end{code}% +This produces +the following output: +\begin{result}[newcounter.html] +Exercise~1 is a simple exercise. +\par\vspace{\baselineskip}\noindent\textbf{Exercise 1 (Simple Exercise)}% +\begin{itshape}\par\vspace{\baselineskip}\noindent +This is a simple exercise. +\end{itshape} +\end{result} + +The counter representation can be changed by redefining +\cmdname{theexercise}\faq{Redefining counters' +\cmdname{the}-commands}{the-commands} using the \gls{renewcommand} +command described in \sectionref{sec:renewcom}. +The following commands can be used to display the counter: + +\begin{fwlist}{\cmdname{fnsymbol}\marg{\meta{counter}}} +\fwitem{\gls{arabic}\marg{\meta{counter}}} Arabic numeral (1, 2, 3, \ldots) + +\fwitem{\gls{Roman}\marg{\meta{counter}}} Upper case Roman numeral +(I, II, III, \ldots) + +\fwitem{\gls{roman}\marg{\meta{counter}}} Lower case Roman numeral +(i, ii, iii, \ldots) + +\fwitem{\gls{alph}\marg{\meta{counter}}} Lower case letter +(a, b, c, \ldots, z) + +\fwitem{\gls{Alph}\marg{\meta{counter}}} Upper case letter +(A, B, C, \ldots, Z) + +\fwitem{\gls{fnsymbol}\marg{\meta{counter}}} +A footnote symbol +(\makeimg{asterisk dagger double dagger section mark +paragraph mark double bar double asterisk two single daggers +two double daggers}{\footnotesymbols}) +\end{fwlist} + +\xminisec{Example:} + +To make the chapter numbers appear as upper case Roman +numerals you would do: +\begin{codeS} +\gls{renewcommand}\marg{\gls{thechapter}}\marg{\glsni{Roman}\marg{chapter}} +\end{codeS} + +You may have noticed that \gls{newcounter} has an optional +argument \meta{outer-counter}. This is for use if you require the +new counter to be reset every time \meta{outer-counter} is +incremented\faq{Master and slave counters}{addtoreset}. For example, +the section numbers in the \icls{scrbook} class are dependent on the +chapter numbers. Each time a new chapter is started, the section +numbers are reset. Suppose we want our \texttt{exercise} counter to +be dependent on the \icounter{chapter} counter, we would do +\begin{codeS} +\gls{newcounter}\marg{exercise}\oarg{chapter} +\end{codeS} + +Note that if you make a counter dependent on another counter like +this, the default action of \cmdname{the}\meta{counter} remains the +same, so \cmdname{theexercise} won't print the chapter number. +To make the chapter number appear as well, we need to redefine +\cmdname{theexercise} (recall \sectionref{sec:renewcom}): +\begin{codeS} +\gls{renewcommand}\marg{\cmdname{theexercise}}\marg{\glsni{thechapter}.\glsni{arabic}\marg{exercise}} +\end{codeS}% +Notice the use of \gls{thechapter} instead of, +say, \verb|\arabic{chapter}|. This way +we don't need to keep track of the \icounter{chapter} counter format. + +\xminisec{Example (Footnote Markers):} + +The \icounter{footnote} counter is reset at the start of each +chapter but by default the chapter number isn't displayed in +\gls{thefootnote}. In \latexhtml{this book}{the PDF version of +this document} \glsni{thefootnote} was redefined so that it +displays the chapter number: +\begin{codeS} +\gls{renewcommand}\marg{\glsni{thefootnote}}\marg{\glsni{thechapter}.\glsni{arabic}\marg{footnote}} +\end{codeS} + +\begin{exercise}{Using Counters}{ex:counters} +Modify the document from \exerciseref{ex:newenv} so that +the \envname{exercise} environment has a counter. +Make the counter dependent on the chapter. +You can \downloadorview{counters} an example. +\end{exercise} + +%%%%%%%%%%%%%%%%%%%%%% APPENDICES %%%%%%%%%%%%%%%%%% + +\appendix + +%%%%%%%%%%%%%%%%%%% Installing Packages %%%%%%%%%%%%%% + +\setnode{installsty} +\chapter{Downloading and Installing Packages} +\label{ch:installsty} + +New \LaTeX\ packages are being created all the time\faq{Installing things +on a (La)TeX system}{instpackages}, so you may find that there are some +packages that you don't have on your installation. In this case, if +you don't have the package you want, you can download +it\faq{Installation using MiKTeX package manager}{inst-miktex*} from +\gls{ctan}. Before discussing installing new packages, it is +a good idea for you to understand the \gls{tds}\faq{What is the TDS?}{tds}. + +All the files that make up the \TeX\ distribution are stored in a +standard hierarchical structure. The root directory of the main +distribution is usually called \texttt{texmf} or \texttt{texmf-dist}. Its location +depends on your system. For example, if you are using +\itexdistro{TeX~Live}~2012 on UNIX/Linux, it will probably be located in +\texttt{/usr\slash local\slash texlive\slash 2012\slash texmf-dist} or if you are using \itexdistro{MiKTeX} it +may be located in \verb|c:\texmf| or \texttt{c:\backslashsym Program +Files\backslashsym texmf}. Whichever system you are using, I~shall +refer to this directory as \meta{TEXMF}. So, if you are using +\texdistro{TeX~Live}~2012, \meta{TEXMF}\texttt{\slash doc} refers to the directory +\texttt{/usr\slash local\slash texlive\slash 2012\slash texmf-dist\slash doc}, or if you are using +\texdistro{MiKTeX}, \meta{TEXMF}\verb|\doc| refers to the folder +\verb|c:\texmf\doc| or \texttt{c:\backslashsym Program +Files\backslashsym texmf\backslashsym doc}. +In general, you should not make any modifications to the +\meta{TEXMF} directory tree as it will get overridden whenever you +update your \TeX\ distribution. + +You should also have a local texmf tree. Again, the location of the +local texmf tree depends on your system. If you are using +\texdistro{TeX~Live}, it may be +\texttt{/usr\slash local\slash texlive\slash texmf-local}. +If you are using \texdistro{MiKTeX}, it +may be \texttt{c:\backslashsym localtexmf} or +\texttt{c:\backslashsym Program Files\backslashsym localtexmf}. +Whichever system you are using, I~shall refer to this directory as +\meta{TEXMF-LOCAL}. There is also the \meta{TEXMF-HOME} directory. +On UNIX-like systems this is usually \verb|~/texmf|. On Windows it's +usually in your user folder. This is the one where you typically +install any new classes or packages. + +These directories must all have the same structure. The principle +sub-directories relating to \LaTeX\ are illustrated in +\figureref{fig:tds}. It may be that your \meta{TEXMF-HOME} directory +doesn't exist or doesn't contain some of these sub-directories, if +so, you will need to create them. + +You can use the \iappname{kpsewhich} application to find out the +locations of \meta{TEXMF-LOCAL} and +\meta{TEXMF-HOME}. Since \appname{kpsewhich} is a command-line +application, you will need a \htmlref{command prompt or terminal}{sec:terminal} +open\latex{ (see \sectionref{sec:terminal})}. +At the command prompt, type +\begin{verbatim} +kpsewhich -var-value=TEXMFHOME +\end{verbatim} +to display the location of \meta{TEXMF-HOME} or +\begin{verbatim} +kpsewhich -var-value=TEXMFLOCAL +\end{verbatim} +to display the location of \meta{TEXMF-LOCAL}. +(Remember to press the enter \enter\ key at the end of the line.) + +\refstepcounter{object}\label{obj:docdir}% +The documentation for \LaTeX\ classes and packages can be found +in the \texttt{doc\slash latex} sub-directories: \meta{TEXMF}\texttt{\slash doc\slash latex}, +\meta{TEXMF-LOCAL}\texttt{\slash doc\slash latex} and \meta{TEXMF-HOME}\texttt{\slash doc\slash latex}. + +\begin{figure}[htbp] +\figconts + {pictures/tds} + {% + \caption{The \protect\TeX\protect\space Directory Structure (TDS) Showing + the Main \protect\LaTeX-Related Sub-Directories.}% + }% + {fig:tds} +\end{figure} + +Some packages are supplied in this format.\footnote{Complete list at \url{http://mirror.ctan.org/install/macros/latex/contrib/}.} For example, the package +\sty{sample-package} may be distributed in a compressed file \texttt{sample-package.tds.zip}, +which contains the files +\begin{verbatim} +doc/latex/sample-package/sample-package.pdf +tex/latex/sample-package/sample-package.sty +tex/latex/sample-package/sample-foo.sty +tex/latex/sample-package/sample-bar.sty +\end{verbatim} +In this case all you need to do is decompress the contents of +the archive into the +\meta{TEXMF-LOCAL} or \meta{TEXMF-HOME} directory. + +\refstepcounter{object}\label{obj:runtexhash}% +On older \TeX-distributions, you would then need to \htmlref{refresh the +\TeX\ database}{sec:refresh}\latex{ (described in +\sectionref{sec:refresh}\ifscreenorother{}{\ on +page~\pageref{sec:refresh}})}. With new distributions, you don't +need to do this if you are installing a new package into your +\meta{TEXMF-HOME} directory. + +\xminisec{Example (Unix-Like):} +To install \texttt{sample-package.tds.zip} (assuming you're in the +same directory as that file): +\begin{verbatim} +unzip -d ~/texmf sample-package.tds.zip +\end{verbatim} + +\setnode{dtxins} +\section{DTX and INS Files} +\label{sec:dtx} +\faq{Documented LaTeX sources (.dtx files)}{dtx}Not all packages are +provided in the \gls{tds} format. Instead (or additionally) many are supplied +with the code and documentation all bundled together in one file. +This file usually has the extension \texttt{.dtx}, and it usually +comes with an installation script that has the extension +\texttt{.ins}. Once you have downloaded the \texttt{.dtx} and +\texttt{.ins} files, you will then have to extract the code before +you can use it. Let's go back to the previous example. The package +\sty{sample-package} is now distributed in a DTX file, so the +\texttt{sample-package.zip} archive contains the files +\begin{verbatim} +sample-package.dtx sample-package.ins +\end{verbatim} +(with hopefully a \texttt{README} or \texttt{INSTALL} file). Note +that this archive, unlike the TDS one, doesn't contain any +\texttt{.sty} files. The documentation source and the package code +(\texttt{sample-package.sty}, \texttt{sample-foo.sty} and +\texttt{sample-bar.sty}) are all contained in the file +\texttt{sample-package.dtx}. This is how to extract them: +\begin{enumerate} +\item Extract the contents of \texttt{sample-package.zip} to a +temporary directory. + +\item\label{itm:ins} Run \LaTeX\ on the file \texttt{sample-package.ins}. If +you are using a \latexhtml{terminal}{\htmlref{terminal}{sec:terminal}}, you can type the +following at the command prompt: +\begin{verbatim} +latex sample-package.ins +\end{verbatim} +If you are using a front-end, such as TeXWorks, open the +\texttt{.ins} file +(for example \texttt{sample-package.ins}), and click on the build/typeset button. + +This will create the files containing the package code. In this +example it will create the main package file \texttt{sample-package.sty} +and supplementary packages \texttt{sample-foo.sty} and \texttt{sample-bar.sty}. + +\item Make a sub-directory of \meta{TEXMF-LOCAL}\texttt{/tex/latex}% +\footnote{or \meta{TEXMF-LOCAL}\texttt{\backslashsym tex\backslashsym latex} on +Windows} in which to place these files. In this example, the package is +called \dq{sample-package}, so make a sub-directory called \texttt{sample-package}. + +\item Move the files created in \objectref{Step}{itm:ins} into +the new sub-directory you created in the previous step. + +\item\label{itm:dtx} Run \iPDFLaTeX\ on the file \texttt{sample-package.dtx}. +(The same as in \objectref{Step}{itm:ins}, but use the file +\texttt{sample-package.dtx} instead of \texttt{sample-package.ins}.) This will +create a file called \texttt{sample-package.pdf}. You may need to repeat +this step to ensure that the cross references are up-to-date. +Check the \texttt{README} file or \texttt{INSTALL} file to see +if there is anything else you need to do. (If you have downloaded +the package from CTAN, it's possible that the documentation has +already been supplied, as package authors are encouraged to supply +a PDF version of the documentation for on-line viewing. If so, +you can omit this step.) + +\item Make a sub-directory of \meta{TEXMF-LOCAL}\texttt{/doc/latex}% +\footnote{or \meta{TEXMF-LOCAL}\texttt{\backslashsym doc\backslashsym latex} on +Windows} in which to place the documentation. In this example, the package is +called \dq{sample-package}, so make a sub-directory called +\texttt{sample-package}. + +\item Move the files created in \objectref{Step}{itm:dtx} into +the new sub-directory you created in the previous step. + +\end{enumerate} + +As mentioned \htmlref{above}{obj:runtexhash}, on older +\TeX-distributions, you would then need to \htmlref{refresh the +\TeX\ database}{sec:refresh}, but this isn't required for +\meta{TEXMF-HOME} installs on new distributions. + +\setnode{texhash} +\section{Refreshing the \texorpdfstring{\protect\TeX}{TeX}\protect\space Database} +\label{sec:refresh} + +On older \gls{tex} distributions you had to refresh the \TeX\ +database whenever you installed new classes or packages. With newer +installations you don't need to do this if you install them in your +\meta{TEXMF-HOME} directory, except under certain circumstances (for +example, you're using using a networked drive). If it turns out that +\TeX\ can't find a new class or package you have installed in +\meta{TEXMF-HOME} you will need to update the database using the +\iappname{texhash} (or \iappname{mktexlsr}) application. This is a +command-line application, so you need a \htmlref{terminal or command +prompt}{sec:terminal}\latex{ (see \sectionref{sec:terminal})}. + +For example, on UNIX/Linux, to update \meta{TEXMF-HOME} (the +directory \verb|~/texmf|) you need to type the following at the +command prompt: +\begin{verbatim} +texhash ~/texmf +\end{verbatim} + +If you are using a modern \TeX\ distribution, such as +\itexdistro{MiKTeX}, \itexdistro{TeX~Live} or \itexdistro{MacTeX} there +should be a package manager that has a package installation +and refresh facility. For example, \texdistro{TeX~Live} comes with +the TeX~Live Manager (\iappname{tlmgr} or \iappname{mactlmgr}) and +recent versions of \texdistro{MiKTeX} have an application called +\appname{MiKTeX Update Wizard} which can automatically download and +install known packages. + +If you experience any problems, contact your system administrator for help +or try one of the resources listed in \appendixref{ch:help}. + +\xminisec{Related \gls{ukfaq} topics:} +\begin{itemize} +\item \faqlink{Installing things on a (La)TeX system}{instpackages} +\item \faqlink{Installing files \dq{where (La)TeX can find them}}{wherefiles} +\item \faqlink{Installation using MiKTeX package manager}{inst-miktex*} +\item \faqlink{\dq{Temporary} installation of (La)TeX files}{tempinst} +\item \faqlink{\dq{Private} installations of files}{privinst} +\end{itemize} + + +%%%%%%%%%%%%%%%%%%%%%% ERRORS %%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{commonerrors} +\chapter{Common Errors} +\label{ch:errors} + +\begin{itemize} +\item +If you're running \LaTeX\ from a \gls{terminal} and the only message that gets displayed is: +\begin{verbatim} +latex: Command not found. +\end{verbatim} +or +\begin{verbatim} +Bad command or file name +\end{verbatim} +then you have either mistyped the command name, or you +don't have \LaTeX\ installed on your computer, or your path hasn't +been set up correctly. First check that you have typed the command +correctly, then check to see if you have \TeX\ installed. Failing +that, contact your system administrator for help or try one of the +resources listed in \appendixref{ch:help}. + +\item +If you're running \LaTeX\ from a \gls{terminal} and you get the message (or something similar): +\begin{verbatim} +This is TeX, Version 3.14159 (Web2C 7.3.1) +! I can't find file `sample'. +<*> sample + +Please type another input file name: +\end{verbatim} +then you have either misspelt the filename or you are in the wrong +directory. If you have misspelt the filename, simply type in the +correct name at the prompt. If you are in the wrong directory or you +want to quit, type \texttt{X} followed by the return character \enter. +To check you are in +the right directory, on a Unix-like system you can type: +\begin{verbatim} +ls +\end{verbatim} +This will list the contents of +the directory. If you are certain that you have spelt the filename +correctly and that you are in the right directory, there may be +something wrong with your path, in which case contact your system +administrator. + +\item +Error messages will usually look something like: +\begin{verbatim} +! Undefined control sequence. +l.1 \docmentclass + [12pt]{scrartcl} +? +\end{verbatim} +The first line is the error message. In this example I~have misspelt +the command \cmdname{documentclass}. The next line begins with +\texttt{l.}\ followed by a number. This is the line number in the +source code where the error occurred. In this case the error +occurred on line~1. Following the line number is the input line +\LaTeX\ has processed so far, and staggered on the next line is the +remainder of the input line. + +Here's another example. Suppose line~8 of my +\gls{source} +looks like: +\begin{verbatim} +The date today is: \toady, which is nice to know. +\end{verbatim} +The error in this case is the misspelling of the command +\cmdname{today}. The error message will appear as follows: + +\begin{latexonly} +\noindent +\begin{tabular}{l@{}l} +\multicolumn{2}{l}{% +\texttt{!\ Undefined control sequence.}\rlap{\color{blue}% +\tikz[baseline=-1ex]{\draw[latex-] (0em,0ex) -- (4em,2ex); +\pgftext[left,center,at={\pgfpoint{4em}{2ex}}]{Error Message} +}}}\\ +\texttt{l.}\smash{\llap{\color{blue}% +\tikz[baseline]{\draw[latex-] (0em,0ex) -- (-3em,-4ex); +\pgftext[right,top,at={\pgfpoint{-3em}{-3ex}}]{\shortstack{Line\\Number}}}}}% +\texttt{8 The date today is }% +\smash{\llap{\color{blue}% +\tikz[baseline]{\draw[latex-] (0em,0ex) -- (-3em,-3ex); +\pgftext[right,top,at={\pgfpoint{-3em}{-3ex}}]{Error}}}}% +\cmdname{toady}% +\smash{\rlap{\color{blue}% +\tikz[baseline]{\draw[latex-] (0em,0ex) -- (0em,-6ex); +\pgftext[left,top,at={\pgfpoint{0em}{-6.5ex}}]{This is how far \LaTeX\ has got}}}}\\ + &\texttt{, which is nice to know.}\smash{\rlap{\color{blue}% +\tikz[baseline]{\draw[latex-] (0em,0.5ex) -- (3em,0.5ex); +\pgftext[left,center,at={\pgfpoint{3em}{0.5ex}}]{\shortstack{Rest of\\the line}}}}}\\ +\texttt{?}\color{blue}% +\tikz[baseline]{\draw[latex-] (0em,0ex) -- (2em,-4ex); +\pgftext[left,top,at={\pgfpoint{2em}{-4ex}}]{\LaTeX\ prompt}} +\end{tabular} + +\vspace{\baselineskip} +\end{latexonly} +\html{\htmladdimg[alt="annotated error message"]{pictures/errormessage.png}} + +At the \LaTeX\ prompt, you can either type \texttt{h} for a help +message, or type \texttt{x} to exit \LaTeX\ and go back to your +source code and fix the problem. +\end{itemize} + +There follows below a list of common error messages. If your +problem isn't listed there, try the \gls{ukfaq}. + +%%%%%%%%%%%%%%%%%%%% * (No message) %%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{asteriskprompt} +\section{* (No message, just an asterisk prompt!)} + +You've gone into \gls{tex}! This is probably because +you've forgotten the \texttt{\gls{end}\marg{document}}. The asterisk is the +\TeX\ prompt. At this point the best thing to do is to abort the +\TeX\ run. + +%%%%%%%%%%%%% Argument of \cline has an extra } %%%%%%%%%%%%%%%% + +\setnode{clineextrabrace} +\section{Argument of \textbackslash cline has an extra \}} + +If this error occurred on the first line in your \gls{env-tabular} +\glsterm{environment}, you may have forgotten the +\glsterm{argument} to the \gls*{env-tabular} environment. + +%%%%%%%%%%%%% Argument of \multicolumn has an extra } %%%%%%%%%%%%%%%% + +\setnode{multicolumnextrabrace} +\section{Argument of \textbackslash multicolumn has an extra \}} + +If this error occurred on the first line in your \gls{env-tabular} +\glsterm{environment}, you may have forgotten the +\glsterm{argument} to the \gls*{env-tabular} environment. + +%%%%%%%%%%%%%%%% \begin{...} ended by \end{...} %%%%%%%%%%%%%%%%%%%% + +\setnode{mismatchedend} +\section{\textbackslash begin\{\texorpdfstring{\ldots}{...}\} ended by +\textbackslash end\{\texorpdfstring{\ldots}{...}\}} + +The beginning of your environment doesn't have a matching end. +\begin{itemize} +\item Check to make sure you have spelt the name of the environment +correctly. + +You will get this error message if you do, say, +\begin{alltt}\wrong +\glsni{end}\marg{docment} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{end}\marg{document} +\end{alltt} + +\item Check that for every \gls{begin} you have a corresponding +\gls{end} with the same name. +\end{itemize} + +%%%%%%%%%%%%%%%%%%% Bad math environment delimiter %%%%%%%%%%%%%%%% + +\setnode{badmathdelim} +\section{Bad math environment delimiter} + +Only a certain type of character may be used as a +\htmlref{delimiter}{sec:delimiters} (for example, +\gls{openparen} \gls{closeparen} \gls{delimiter.opensq} +\gls{delimiter.closesq}), check which one you have specified. This error may +also occur if you have forgotten a \gls{right} or not used it in the +same \glslink{group}{scope}. +(Remember to use a \gls{delimiter.periodchar} if you want an invisible delimiter) or +you may have forgotten to end your array environment with +\verb|\end{array}|. + +%%%%%%%%%%%%%%%%%%%% Can only be used in preamble %%%%%%%%%%%%%%%%%% + +\setnode{onlypreamble} +\section{Can only be used in preamble.} + +Some commands, such as \gls{usepackage} may only appear in the +\gls{preamble}. Check to see where you have put +it. For example, this error will be caused by doing: +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{begin}\marg{document}\wrong + +\glsni{usepackage}\marg{graphicx} +\end{alltt} +instead of +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{usepackage}\marg{graphicx}\correct + +\glsni{begin}\marg{document} +\end{alltt} + +%%%%%%%%%%%%%%%%%% Command ... already defined %%%%%%%%%%%%%%%%%%%%% + +\setnode{alreadydef} +\section{Command \texorpdfstring{\protect\ldots}{...}\protect\space already defined} + +You have tried to define a \gls{command} which +already exists. Try giving it a different name. Remember never to +redefine a command if you don't know what the command originally +does. + +Alternatively, you have tried to define an +\gls{environment} which already exists. Give the new +environment a different name. Again, never redefine an environment +where you don't know what the original environment does. + +%%%%%%%%%%%%% Display math should end with $$ %%%%%%%%%%%%%%%%%%%%% + +\setnode{missingenddispmath} +\section{Display math should end with \$\$} + +You may have a dollar sign (\gls{dollarchar}) in a displayed maths +environment, such as the \gls{env-equation} environment. +Remember that \verb|$| is short hand for \verb|\begin{math}| or +\verb|\end{math}|, so you can't end one of the other environments +with a \verb|$|. (This error message is in fact a bit confusing, +as it seems to be suggesting that you end a displayed maths +environment with \verb|$$| which you also shouldn't do\faq{Why use +\glsnl{begindispmath}\ldots\glsnl{enddispmath} in place of \$\$\ldots\$\$}{dolldoll}.) + +%%%%%%%%%%%%%% Environment ... undefined %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{envundefined} +\section{Environment \texorpdfstring{\protect\ldots}{...}\protect\space undefined} + +\LaTeX\ doesn't recognise the environment you have specified. + +\begin{itemize} +\item Check you have spelt the environment name correctly. + +You will get this error if you do, say, +\begin{alltt}\wrong +\glsni{begin}\marg{docment} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{document} +\end{alltt} + +\item If it's your own environment, check you have defined the +environment before using it. + +\item If the environment is defined in a package, check you +have included the package using the +\htmlref{\cmdname{usepackage}}{sec:packages} command. + +\end{itemize} + +%%%%%%%%%% Extra alignment tab has been changed to \cr %%%%%%%%%%%% + +\setnode{tab2cr} +\section{Extra alignment tab has been changed to \textbackslash cr} + +You have too many ampersands (\gls{ampchar}) in one row. The most +probable cause is that you have forgotten the end of row command +\gls{tab.dbbackslashchar} on the previous row. Remember also that if you have a +\gls{multicolumn} command to span more than one column, you +should have fewer \glsni{ampchar}s in that row. This error can also occur +from a confusion over the two meanings of \gls{dbbackslashchar}: a +line break within a paragraph cell and a row break. In which case, +you need to use \gls{tabularnewline} instead of +\gls{tab.dbbackslashchar}. + +%%%%%%%%%%%%%%%%%%%%%%%%% Extra \right %%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{extraright} +\section{Extra \textbackslash right} + +There are a number of possible causes. The most probable is that you +have a \gls{right} that doesn't have a matching \gls{left}. +(Remember left comes before right.) Another possible cause is that +you have missed out \verb|\end{array}|. (Remember that +\glspl{environment} provide implicit +\glsing{group}, and \glsni{left} and its matching +\glsni{right} must appear within the same group level.) + +%%%%%%%%%%%%%% File ended while scanning use of ... %%%%%%%%%%%%% + +\setnode{fileendedwhilescanning} +\section{File ended while scanning use of \texorpdfstring{\ldots}{...}} + +The most usual cause of this error is a missing closing brace. + +You will get this error if you do, say, +\begin{alltt}\wrong +\glsni{end}\glsni{leftbracechar}document +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{end}\marg{document} +\end{alltt} + +%%%%%%%%%%%%%%%%%%%%%% File not found %%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{filenotfound} +\section{File not found} + +\LaTeX\ can't find the file you have specified. You will be given +the opportunity to type in the correct filename at the prompt. If +you want to quit, simply type \texttt{X} followed by the return +character \enter. + +\begin{itemize} + +\item Make sure that you have spelt the filename correctly. + +This error will be caused by, say, +\begin{alltt}\wrong +\gls{documentclass}\marg{scrarticle} +\end{alltt} +instead of +\begin{alltt}\correct +\gls{documentclass}\marg{scrartcl} +\end{alltt} + +If this is the case, simply type in the correct name at the prompt +(followed by the return character \enter) then go back and fix the +spelling in the \gls{source}. + +\item Make sure that the file is in the same directory as your +document or in the \LaTeX\ path. If the file is in another directory +(not in the \LaTeX\ path), you will need to specify the pathname, but +remember that when using \LaTeX\ under Windows, you need to use a +forward slash (\glsi{dir.slash}) as the directory divider, as a backslash would be +interpreted as a command. For example, if you have a file called +\texttt{shapes.pdf} in the subdirectory \texttt{pictures} then you +would get a \dq{file not found} error message if you did +\begin{alltt}\wrong +\gls{includegraphics}\marg{shapes} +\end{alltt} +instead of +\begin{alltt}\correct +\gls{includegraphics}\marg{pictures/shapes} +\end{alltt} + +\item If the file is a \htmlref{package}{sec:packages} or +\htmlref{class file}{sec:cls}, it's possible that you don't have that +file installed on your computer. If this is the case you will need +to download and install it as described in +\appendixref{ch:installsty}. Remember that you need to +refresh the database after installing a new package or class file. + +\end{itemize} + +%%%%%%%%%%%%%%%%%%%% Illegal character in array arg %%%%%%%%%%%%%%%%%% + +\setnode{illegalarraychar} +\section{Illegal character in array arg} + +You have used a character in the \gls{argument} of a +\gls{env-tabular} or \gls{env-array} environment that is not +allowed. The standard available characters are: \texttt{r} (right +justified), \texttt{l} (left justified), \texttt{c} (centred) and +\texttt{p}, as well as \gls{atchar}\marg{\meta{inter-col text}}. +Remember that if you want to use the \gls{gtcol}\marg{\meta{decl}} or +\gls{ltcol}\marg{\meta{decl}} specifiers, you must include the +\isty{array} package. + +This error will also occur if you have forgotten the argument to the +\gls*{env-tabular} or \gls*{env-array} environment. + +%%%%%%%%%%%%%%%%%%% Illegal parameter number in definition %%%%%%%%%% + +\setnode{illegalparamnum} +\section{Illegal parameter number in definition} + +You have referred to a \htmlref{parameter (argument) +number}{sec:newcomarg} that is greater than the number of parameters +you have specified. For example, suppose you defined the command to +have only one parameter, then you can't use \gls{hashchar}\texttt{2} +which refers to the second, non-existent, parameter. Remember that +you need to specify how many parameters you want in the +\gls{optional} to \glsni{newcommand}, otherwise it will be assumed +that the command has no arguments. + +%%%%%%%%%%%%%%%%%%%%% Illegal unit of measure %%%%%%%%%%%%%%%%%%%%%%% + +\setnode{illegalunit} +\section{Illegal unit of measure (pt inserted)} + +You have either not specified a unit when giving a \gls{length} (even zero +lengths must have a unit) or you have specified an invalid unit or +you have misspelt the unit. Available units are listed in +\tableref{tab:units}. + +%%%%%%%%%%%%%%%%% Lonely \item %%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{lonelyitem} +\section{Lonely \textbackslash item} + +The command \gls{item} may only appear in one of the list making +environments (such as \gls{env-itemize}). Make sure you haven't +forgotten your environment. + +%%%%%%%%%%%%%%% Misplaced alignment tab character & %%%%%%%%%%%%%%%%% + +\setnode{misplacedtab} +\section{Misplaced alignment tab character \&} + +You have used the special character \gls{ampchar} where you shouldn't +have. Recall from \sectionref{sec:chars} that if you want an \& sign +to appear you need to do \gls{amp} not just \glsni{ampchar}. + +You would have got this error message if you had done, say, +\begin{alltt}\wrong +\glsni{ampchar} our equipment +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{amp} our equipment +\end{alltt} + +%%%%%%%%%%%%%%%%%%%%% Missing } inserted %%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{missingendbrace} +\section{Missing \} inserted} + +You have missed a closing curly brace, or you may have missed out an +argument. + +\xminisec{Example:} +If the following line occurs in a tabular environment: +\begin{alltt}\wrong + \gls{ampchar} \gls{multicolumn}\marg{2}\marg{c}\gls{tab.dbbackslashchar} +\end{alltt} +this will produce the error. (The third argument to +\gls{multicolumn} has been omitted.) + +%%%%%%%%%%%%%%%%%%%%% Missing $ inserted %%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{missingdollar} +\section{Missing \$ inserted} + +This message can be caused by a number of errors: +\begin{itemize} +\item You might have missed the beginning of one of the mathematics +\glspl{environment} (that is, you've used a +\gls{command} that must only appear in maths mode). + +\item You may have typed \gls{dollarchar} instead of \gls{dollar} (you +actually want a dollar symbol to appear). Recall from +\sectionref{sec:chars} that if you +want a \$ sign to appear you need to do \glsni{dollar} not just \glsni{dollarchar}. + +You would have got this error message if you had done, say, +\begin{alltt}\wrong +expenditure came to \glsni{dollarchar}2000.00 +\end{alltt} +instead of +\begin{alltt}\correct +expenditure came to \glsni{dollar}2000.00 +\end{alltt} + +\item You may have missed the end of a mathematics environment, or +you may have a paragraph break within an in-line or +displayed maths environment, where it is +not permitted. Make sure you don't have any blank lines within the +environment. If you want a blank line in your code to make it easier +to edit, try having a percent sign at the start of an empty line to +ensure that the line is ignored by \LaTeX. For example: +\begin{alltt} +\glsni{begin}\marg{equation} +\glsni{percentchar} +E = mc\glsni{circumchar}2 +\glsni{percentchar} +\glsni{end}\marg{equation} +\end{alltt} +\end{itemize} + +%%%%%%%%%%%%%%% Missing \begin{document} %%%%%%%%%%%%%%%%% + +\setnode{missingbegindoc} +\section{Missing \textbackslash begin\{document\}} + +You have put some text outside of the document +\glsterm{environment}. Check the following: +\begin{itemize} +\item You have remembered \verb|\begin{document}| + +This error would be caused by, say, +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} +\wrong +This is a simple document +\end{alltt} +instead of +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{begin}\marg{document}\correct +This is a simple document. +\end{alltt} + +\item You haven't placed any text before \verb|\begin{document}|. +For example: +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +This is a simple document\wrong +\glsni{begin}\marg{document} +\end{alltt} +instead of +\begin{alltt} +\glsni{documentclass}\marg{scrartcl} + +\glsni{begin}\marg{document}\correct +This is a simple document +\end{alltt} + +\item You haven't missed out the backslash at the start of either +\gls{documentclass} or \glsni{begin}\marg{document} + +This error would be caused by, say, +\begin{alltt}\wrong +documentclass\marg{scrartcl} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{documentclass}\marg{scrartcl} +\end{alltt} +\end{itemize} + +%%%%%%%%%%%%%%%%%%% Missing delimiter %%%%%%%%%%%%%%%%%%%%%%% + +\setnode{missingdelim} +\section{Missing delimiter} + +You have forgotten to specify the type of delimiter you want (for +example, +\gls{openparen} \gls{closeparen} \gls{delimiter.opensq} \gls{delimiter.closesq} +\gls{leftbrace} \gls{rightbrace}). (Remember to use a \gls{delimiter.periodchar} if you want +an invisible delimiter, and remember that if you want a +curly brace, you must have a backslash followed by the curly brace.) + +\xminisec{Example:} + +This error will occur if you do, say, +\begin{alltt}\wrong +f(x) = \glsni{left}\glsni{leftbracechar} +\glsni{begin}\marg{array}\marg{ll} +0 \glsni{ampchar} x \cmdname{leq} 0\gls{tab.dbbackslashchar} +1 \glsni{ampchar} x > 1 +\glsni{end}\marg{array} +\glsni{right}. +\end{alltt} +instead of +\begin{alltt}\correct +f(x) = \glsni{left}\glsni{leftbrace} +\glsni{begin}\marg{array}\marg{ll} +0 \glsni{ampchar} x \cmdname{leq} 0\gls{tab.dbbackslashchar} +1 \glsni{ampchar} x > 1 +\glsni{end}\marg{array} +\glsni{right}. +\end{alltt} + +%%%%%%%%%%%%%%%% Missing \endcsname inserted %%%%%%%%%%%%%%%% + +\setnode{missingendcsname} +\section{Missing \textbackslash endcsname inserted} + +This is a \gls{tex} error rather than a \LaTeX\ error +which makes it harder to determine the cause, however it can be +caused by placing a backslash in front of the name of an +\gls{environment}. (Remember that +\gls{environment} names do not contain a backslash.) + +This error will be caused by, say, +\begin{alltt}\wrong +\glsni{begin}\marg{\glsni{sffamily}} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{sffamily} +\end{alltt} + +%%%%%%%%%%%%%% Missing \endgroup inserted %%%%%%%%%%%%%%%%%% + +\setnode{missingendgroup} +\section{Missing \textbackslash endgroup inserted} + +A number of things could have caused this. You may have missed out +the end of an \gls{environment}, or you may have an +environment inside of another environment it's not allowed to be in. +For example, this error can be caused by placing an +\envname{eqnarray} environment inside a \envname{displaymath} +environment, which is not allowed. (But, of course, you haven't +used either of those obsolete environments~\cite{l2tabu}, have you?) + +%%%%%%%%%%%%%%% Missing number %%%%%%%%%%%%%%%%%% + +\setnode{missingnum} +\section{Missing number, treated as zero} + +\LaTeX\ is expecting a number. If your command takes more than one +\gls{argument}, check to make sure the arguments are in +the correct order. For example, if you are using a +\gls{env-minipage} environment, you might have +omitted the \gls{mandatory} which +specifies the width of the minipage, or you may have the +\glspl{optional} the wrong way round. The placement specifier +should come first, followed by the height. + +If you are using \gls{addtocounter} or \gls{setcounter} +remember that the second argument must be a number, so if you want +the value of a counter as the argument you must use \gls{value}. +This error can be caused by, say, +\begin{alltt}\wrong +\glsni{setcounter}\marg{exercise}\marg{chapter} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{setcounter}\marg{exercise}\marg{\glsni{value}\marg{chapter}} +\end{alltt} + +%%%%%%%%%%%%%% Paragraph ended %%%%%%%%%% + +\setnode{parended} +\section{Paragraph ended before \textbackslash begin was complete} + +You've probably missed a closing brace at the end of the argument to +\gls{begin}. This error will be caused by, say, +\begin{alltt}\wrong +\glsni{begin}\glsni{leftbracechar}document +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{document} +\end{alltt} + +%%%%%%%%%%%%%%%%%%% Runaway argument %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{runawayarg} +\section{Runaway argument} + +There are a number of possible causes of this error: + +\begin{itemize} + +\item Paragraph breaks are not permitted in the +\glspl{argument} of \glspl{short}. +If there is a corresponding \gls{environment} then you +should use that instead. For example, this error message will be +generated by doing, say, +\begin{alltt} +\glsni{textbf}\glsni{leftbracechar}This is a simple document. +Here is the first paragraph. +\wrong +Here is the second paragraph.\glsni{rightbracechar} +\end{alltt} +instead of\bookpagebreak +\begin{alltt} +\glsni{begin}\marg{bfseries} +This is a simple document. +Here is the first paragraph. +\correct +Here is the second paragraph. +\glsni{end}\marg{bfseries} +\end{alltt} + +\item The closing brace of a +\gls{mandatory} is missing: +This error will be caused by, say, +\begin{alltt}\wrong +\glsni{title}\glsni{leftbracechar}A Simple Document +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{title}\marg{A Simple Document} +\end{alltt} + +\item This error can also be caused by omitting the +\gls{mandatory} of an \gls{environment}. For example, +this error will occur +if you do, say, +\begin{alltt}\wrong +\glsni{begin}\marg{thebibliography} +\glsni{bibitem}\marg{kopka95} A Guide to \glsni{LaTeXe} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{thebibliography}\marg{1} +\glsni{bibitem}\marg{kopka95} A Guide to \glsni{LaTeXe} +\end{alltt} + +\end{itemize} + +%%%%%%%%%%%%%%% Something's wrong--perhaps a missing \item %%%%%%%%%%%%%%%% + +\setnode{missingitem} +\section{Something's wrong--perhaps a missing \textbackslash item} + +You may have missed an \gls{item} command. The first object in +a list environment must either be an \gls{item} command, or another +list environment. + +This error will be caused by, say, +\begin{alltt}\wrong +\glsni{begin}\marg{itemize} +Animal +\glsni{item} Vegetable +\glsni{item} Mineral +\glsni{end}\marg{itemize} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{itemize} +\glsni{item} Animal +\glsni{item} Vegetable +\glsni{item} Mineral +\glsni{end}\marg{itemize} +\end{alltt} + +\bookpagebreak +This error can also be caused by a missing \gls{bibitem} in the +\htmlref{bibliography}{sec:bib}. For example, the error will occur +if you do, say, +\begin{alltt}\wrong +\glsni{begin}\marg{thebibliography}\marg{1} +A Guide to \glsni{LaTeXe} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{begin}\marg{thebibliography}\marg{1} +\glsni{bibitem}\marg{kopka95} A Guide to \glsni{LaTeXe} +\end{alltt} + +See also \gls{ukfaq} entry: \faqlink{Perhaps a missing \cmdname{item}?}{errmissitem}. + +%%%%%%%%%%%%%%%%% There's no line here to end %%%%%%%%%%%%%%%%%%%%% + +\setnode{nolinetoend} +\section{There's no line here to end} + +You have placed a line breaking command (such as \gls{newline.dbbackslashchar}, +\gls{newline} or \gls{linebreak}) where it doesn't make +sense to have one. + +%%%%%%%%%%%%%%%%% Undefined control sequence %%%%%%%%%%%%%%%%%%%%%% + +\setnode{csundefined} +\section{Undefined control sequence} + +\LaTeX\ doesn't understand the \gls{command} you +have used. + +\begin{itemize} +\item Check to see if you have misspelt the command name (remember +that all \LaTeX\ command names are case-sensitive.) + +You will get this error if you do, say, +\begin{alltt}\wrong +This is a simple \cmdname{Latex}\glsni{spacesym}document +\end{alltt} +instead of +\begin{alltt}\correct +This is a simple \gls{LaTeX}\glsni{spacesym}document +\end{alltt} + +\item Check that you have remembered the space when typing +\gls{spacesym} (backslash space). +For example, this error will occur if you do, say, +\begin{alltt}\wrong +This is a \cmdname{LaTeX}\cmdname{sample} document. +\end{alltt} +instead of +\begin{alltt}\correct +This is a \glsni{LaTeX}\glsni{spacesym}sample document +\end{alltt} + +\item If you are using a command that is defined in a +\htmlref{package}{sec:packages} make sure you have included the +package using \gls{usepackage}. + +\item Check that your command name hasn't run into the next piece +of text. For example, +you can do +\begin{alltt} +man\glsni{oe}\marg{}uvre +\end{alltt} +or +\begin{alltt} +man\glsni{oe} uvre +\end{alltt} +or (not recommended) +\begin{alltt} +man\marg{\glsni{oe}}uvre +\end{alltt} +but not +\begin{alltt}\wrong +man\cmdname{oeuvre} +\end{alltt} + +\item Check if you have used a backslash instead of a forward slash as a +directory divider. (Remember that when using \LaTeX\ under Windows, +you need to use a forward slash (\glsi{dir.slash}) as the directory divider, as a +backslash would be interpreted as a command.) + +For example, suppose you have a file called \texttt{shapes.pdf} in a +subdirectory called \texttt{pictures}, then you would get an error +if you did +\begin{alltt}\wrong +\glsni{includegraphics}\marg{pictures\cmdname{shapes}} +\end{alltt} +instead of +\begin{alltt}\correct +\glsni{includegraphics}\marg{pictures/shapes} +\end{alltt} + +\end{itemize} + +%%%%%%%%%% You can't use `macro parameter character #' in horizontal mode %%%%%%%%%%%%%%% + +\setnode{hashinhmode} +\section{You can't use `macro parameter character \#' in horizontal mode} + +You have used the special character \gls{hashchar} where you shouldn't +have. Recall from \sectionref{sec:chars} that if you want a \# sign to appear you need +to do \gls{hash} not just \glsni{hashchar}. + +This error message will be caused by doing, say, +\begin{alltt}\wrong +Item \glsni{hashchar}1 +\end{alltt} +instead of +\begin{alltt}\correct +Item \glsni{hash}1 +\end{alltt} + +\setnode{help} +\chapter{Need More Help?} +\label{ch:help} + +First, try to find your query in the \gls{ukfaq}. \Gls{tug} +also has a list of useful resources at +\url{http://tug.org/interest.html}. If you're still stuck, you can +post your question on a (La)TeX forum, newsgroup or mailing list, +such as those listed below. If you do post a question, remember +you're asking people who only have an altruistic interest in +helping. No one is paying them to help you. Most of the class files +and packages were written for free by people who had a need to solve +a particular problem and decided to make their work publicly +available. So no matter how frustrated you're feeling, stick to +being polite. If you can't work out how to use a particular class or +package, don't start by heaping offensive, unconstructive criticism on it as there's a chance +the author will read the message. There's no sense in alienating the +person most qualified to answer your question. In your message, +stick to the following guidelines: +\begin{enumerate} +\item Cut to the chase. In other words, be concise about the nature +of the problem. Don't write lots of long-winded paragraphs. + +\item Provide a minimal +example\footnote{see \url{http://www.dickimaw-books.com/latex/minexample/}} that +illustrates the problem. + +\end{enumerate} + +\xminisec{Example:} +\begin{verbatim} +I'm trying to use the \foo command in the "bar" package, +but I'm getting the following error message: +! Undefined control sequence. +l.4 \foo + +Here's a minimal example: +\documentclass{scrartcl} +\usepackage{bar} +\begin{document} +\foo{Blah} +\end{document} + +I'm using bar version 1.0 (2012/06/30). +\end{verbatim} + +\xminisec{Another example:} +\begin{verbatim} +I'm using the \foo command in the "bar" package. According +to the documentation, this command should display its argument +in a bold font, but it's coming out in italic instead. +Anyone know why? + +Here's a minimal example: +\documentclass{scrartcl} +\usepackage{bar} +\begin{document} +\foo{Blah} +\end{document} + +I'm using bar version 1.1 (2012/07/30). +\end{verbatim} + +There's no guarantee that you will get an answer, but if you follow +the above guidelines, you will increase your chances. + +\xminisec{Resources} +\begin{itemize} + +\item The \LaTeX\ Community (\url{http://www.latex-community.org/}). + +\item \TeX/\LaTeX\ on StackExchange +(\url{http://tex.stackexchange.com/}). + +\item \htmladdnormallink{\texttt{comp.text.tex} +newsgroup}{http://groups.google.com/group/comp.text.tex} (use a +newsreader rather than the Google interface if you want to avoid the +spam). + +\item \htmladdnormallink{\texttt{texhax} archives}{http://tug.org/pipermail/texhax/}\doifbook{~\cite{texhax}}. + +\end{itemize} +I~strongly recommend that you also have a look at the On-Line +Catalogue~\cite{texcat}. +It's also a good idea to look at the documentation that was +installed with your \TeX/\LaTeX\ distribution (see +\sectionref{sec:texdoc}). If you are using \itexdistro{MiKTeX} you can access the +on-line help via the Start Menu: \startmenu{MiKTeX \menuto\ Help} + +(Please don't send your problems to me, unless you want to hire a +consultant. I~read both the \LaTeX\ Community Forum and +\texttt{comp.text.tex} and answer relevant questions if I~have time, +but it clogs up my inbox if people keep sending attachments that are in +the order of several megabytes in size.) Besides, you'll reach a +wide group of experts if you post to a newsgroup, forum or mailing +list, rather than a single busy individual. + +%%%%%%%%%%%%%%%%%%%%%%%%%% Supplemental Material %%%%%%%%%%%%%%%%%%% + +\ifpdf\else\input{supplemental}\fi + +\backmatter + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Bibliography %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\clearpage\phantomsection +\setnode{bibliography} +\bibliographystyle{plain} +\bibliography{novices} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% GLOSSARIES %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{acronyms} +\printglossary[type=acronym,nonumberlist,style=acronyms] + +\setnode{summary} +\setdoublecolumnglo +\printglossary[style=summary] + +\setnode{bookindex} +\printindex + +%%%%%%%%%%%%%%%%%%%%%%%%% LICENCE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{licence} +\chapter{GNU Free Documentation License} +\input{../fdl} + +%%%%%%%%%%%%%%%%%%%%%%%%%% HISTORY %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setnode{history} +\chapter{History}\markright{History} + +\historyitem{25th Sept 2012 (Version 1.4)} + +\begin{itemize} +\item Paperback edition~1 produced. +\item Added TeXWorks section. +\item Moved \dq{Text editor and Terminal approach}, \dq{TeXnicCenter} +and \dq{WinEdt} sections to new supplementary material. +\item Added hardcopy-related code. +\item Change to \koma\ classes (both for examples and for pdf +versions of this document). +\item Changed from using \sty{subfloat} to \sty{subcaption} package. +\item Added section on inter-sentence spacing. +\item Moved \dq{Errors} and \dq{Where to get Help?} to appendices. +\item Moved section \dq{Downloading and Installing Packages} to +new appendix chapter. +\item Moved introduction to packages to \dq{Creating a Simple +Document}. +\item Moved datetime section to \dq{Creating a Simple Document} +chapter. (Removed reference to ukdate package.) +\item Moved babel section to \dq{Structuring Your Document} chapter. +\item Moved graphicx section to its own chapter. +\item Added section on align. +\item Added \cmdname{cfrac}, \cmdname{substack} and \sty{amsmath} ellipses to maths chapter. +\item Added extensible arrows and \cmdname{bigl} etc to maths +chapter. +\item Added booktabs. +\item Moved lengths chapter to section in definitions. +\item Added summary chapter with commands hyperlinked to their +definitions in the summary. +\item Changed definitions chapter to use a glossary structure. +\item Moved bibliography into bib file. +\item Added \sty{varioref}. +\item Removed dependency on \sty{html} package (for pdf versions) +to avoid conflict between \sty{html} and \sty{varioref} +(\sty{html} package functions not defined by \sty{hyperref} +now emulated; \sty{comment} package loaded to provide +\envname{htmlonly} environment). +\item Removed image of equation written in Word (Microsoft have +improved their equation rendering) and added link to +Murray Sargent~III blog~\cite{sargentiii}. +\item Added section on what a terminal/command prompt is. +\item Added section on auxiliary files. +\item Added section on Perl. +\item Added information about latexmk +\item Mentioned grffile package. +\item Mentioned on-the-fly EPS conversion. +\item Mentioned \sty{etoolbox}'s \cmdname{appto} and \sty{babel}'s +\cmdname{addto}. +\item Changed to UTF-8 and mostly changed to using code points +instead of named entities in HTML files. +\item Moved the document's home page from +\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/novices/} to +\url{http://www.dickimaw-books.com/latex/novices/}. +\end{itemize} + +\historyitem{15th Jan 2008 (Version 1.3)} + +The main reason behind this change was to increase accessibility and +conform to W3C guidelines. If you are experiencing problems relating +to accessibility, please let me know (clearly stating the problem). +\begin{itemize} +\item Corrected error in the university's post code on the +title page +\item Added alternative text tags to more of the images, and made +some of the images hyperlinks to a more detailed description of the +image. +\item Added information on how to break ligatures. +\item Moved information on TeX to the introduction, and removed +section on TeX that was in the "Some Definitions" chapter. +\item Document nodes now have permanent names instead of the generic +node\meta{n}.html which \LaTeX2HTML generates by default. +\item Went back to using straight double quotes in the HTML document +as the fancy typographic double quotes are nonstandard. + +\end{itemize} + +\historyitem{8th May 2007 (Version 1.2)} + +\begin{itemize} +\item Links to \gls{ukfaq} added. +\item Overview made into a separate section, and tidied up a bit. +\item Added some extra definitions: moving arguments and fragile +commands, robust commands, short and long commands. +\item Changed \dq{Text editor and Terminal approach} to deal with +Unix-type systems rather than MS-DOS. +\item Moved section on \envname{tabular} environment. +\item Added section on boxes and mini-pages. +\item Segmented section on font changing commands. +\item Segmented section describing \sty{graphicx}. +\item Added section on the \sty{babel} package. +\item Updated and segmented section on downloading and installing +new packages. +\item Added section on side-by-side figures. +\item Updated section on sub-figures to use the new \sty{subfloat} +package instead of the obsolete \sty{subfigure} package. +\item Added \dq{Need More Help?} chapter. +\end{itemize} + +\backcoverheading +(See \url{http://www.gnu.org/licenses/fdl-howto-opt.html#SEC2}.) + +\backcovertext +\end{document} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/glsentries.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/glsentries.tex new file mode 100644 index 00000000000..683140fcd6c --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/glsentries.tex @@ -0,0 +1,5157 @@ +\renewcommand{\summarypreamble}{% +Commands or environments defined in the \LaTeX\ kernel are always +available.% +} + +\defgactivechar + {backslashchar} + {\backslashsym} + {} + {\LaTeX\ Kernel} + {Escape character (indicates a command).} + {} + +\defgactivechar + {dbbackslashchar} + {\dbbackslashsym} + {\oarg{\meta{height}}} + {\LaTeX\ Kernel} + {\nopostdesc} + {% + \BeginArgList + \csentryargitem{height} Extra vertical space. + \EndArgList + } + +\defgchildactivechar + {newline.dbbackslashchar} + {dbbackslashchar} + {\dbbackslashsym} + {Breaks a line without justification (\protect\htmlref{starred form}{itm:starredcommand} + forbids a page break)} + +\defgchildactivechar + {tab.dbbackslashchar} + {dbbackslashchar} + {\dbbackslashsym} + {Starts a new row in tabular-style environments} + +\defgcs{tabularnewline}% + {}% + {\LaTeX\ Kernel}% + {Behaves like \nxglsi{tab.dbbackslashchar} in a + \nxglsni{env-tabular}-like environment but helps to disambiguate a + \nxglslink{newline.dbbackslashchar}{line break} in a paragraph + cell from a \nxglslink{tab.dbbackslashchar}{row separator}.}% + {} + +\defgidxactivechar + {leftbracechar} + {\leftbracesym} + {} + {\LaTeX\ Kernel} + {Marks the beginning of a \nxglsi{group}.} + {} + +\defgidxactivechar + {rightbracechar} + {\rightbracesym} + {} + {\LaTeX\ Kernel} + {Marks the end of a \nxglsi{group}.} + {} + +\defgidxactivecharcs + {leftbrace} + {\leftbracesym} + {} + {\LaTeX\ Kernel} + {Left brace \{ character. In math mode may be used as a delimiter.} + {} + +\defgidxactivecharcs + {rightbrace} + {\rightbracesym} + {} + {\LaTeX\ Kernel} + {Right brace \{ character. In math mode may be used as a delimiter.} + {} + +\defgidxactivechar + {emdash}% + {\emDashcs}% + {}% + {\LaTeX\ Kernel}% + {Em-dash \textemdash\ symbol. (Normally used to + indicate omissions or interruptions or to highlight a parenthetical element.) + See also \nxglsni{textemdash}.}% + {} + +\defgidxactivechar + {endash}% + {\enDashcs}% + {}% + {\LaTeX\ Kernel}% + {En-dash \textendash\ symbol. (Normally used for number ranges.) + See also \nxglsni{textendash}.}% + {} + +\defgidxactivechar + {questiondown}% + {\questiondowncs}% + {}% + {\LaTeX\ Kernel}% + {Upside-down question mark \textquestiondown\ symbol. See also \nxglsni{textquestiondown}.}% + {} + +\defgidxactivechar + [!Y] + {exclamdown}% + {\exclamdowncs}% + {}% + {\LaTeX\ Kernel}% + {Upside-down exclamation mark \textexclamdown\ symbol. See also \nxglsni{textexclamdown}.}% + {} + +\defgchar + {quoteleft}% + {\quoteleftcs}% + {}% + {\LaTeX\ Kernel}% + {Open quote \textquoteleft\ symbol. See also \nxglsni{textquoteleft}.}% + {} + +\defgchar + {quotedblleft}% + {\quotedblleftcs}% + {}% + {\LaTeX\ Kernel}% + {Open double quote \textquotedblleft\ symbol. See also \nxglsni{textquotedblleft}.}% + {} + +\defgchar + {quoteright}% + {\quoterightcs}% + {}% + {\LaTeX\ Kernel}% + {Closing quote or apostrophe \textquoteright\ symbol in text mode + or prime symbol \ensuremath{'} in math mode. See also \nxglsni{textquoteright}.}% + {} + +\defgchar + {quotedblright}% + {\quotedblrightcs}% + {}% + {\LaTeX\ Kernel}% + {Closing double quote \textquotedblright\ symbol in text mode + or double prime \ensuremath{''} in math mode. See also \nxglsni{textquotedblright}.}% + {} + +\defgchar + {dash}% + {\dashcs}% + {}% + {\LaTeX\ Kernel}% + {Hyphen - in text mode or minus sign $-$ in math mode.}% + {} + +\defgidxactivecharcs + {exclam} + {\exclamsym} + {} + {\LaTeX\ Kernel (Math Mode)} + {Negative thin space.} + {} + +\defgidxactivechar + {exclamchar} + {\exclamsym} + {} + {} + {\nopostdesc} + {} + +\defgchildidxactivechar + {sentence.exclamchar} + {exclamchar} + {\exclamsym} + {Exclamation symbol (end of sentence marker)} + + +\defgchildidxactivechar + {makeindex.exclamchar} + {exclamchar} + {\exclamsym} + {\nxiappname{makeindex} sublevel special character} + +\defgchildidxactivechar + {resizebox.exclamchar} + {exclamchar} + {\exclamsym} + {Used in \nxglsi{resizebox} to maintain aspect ratio} + +\defgidxactivecharcs + {csbar} + {\vbarsym} + {} + {\LaTeX\ Kernel (Math Mode)} + {Double vertical bar \doublebar{} delimiter} + {} + +\defgidxactivechar + {barchar} + {\vbarsym} + {} + {\LaTeX\ Kernel} + {\nopostdesc} + {} + +\defgchildidxactivechar + {delim.barchar} + {barchar} + {\vbarsym} + {Delimiter. (Math mode only. Use \nxglsni{textbar} in text mode.)} + +\defgchildidxactivechar + {array.barchar} + {barchar} + {\vbarsym} + {Vertical rule specifier (\nxglsi{env-tabular} or + \nxglsi{env-array})} + +\defgchar + {slashchar} + {\slashsym} + {} + {} + {\nopostdesc} + {} + +\defgchildchar + {text.slash} + {slashchar} + {\slashsym} + {Forward slash symbol (see also \nxglsi{slash})} + +\defgxchildchar + {dir.slash} + {slashchar} + {\slashsym} + {Directory divider} + {directory divider} + +\defgchildchar + {delim.slash} + {slashchar} + {\slashsym} + {Forward slash delimiter (math mode)} + +\defgidxactivechar + [!Z] + {visiblespace} + {\textvisiblespace} + {} + {} + {A visual indication of a space in the code. When you type up + the code, replace all instances of this symbol with a space via the space bar on your + keyboard.} + {} + +\defgidxactivecharcs + {at} + {\atsym} + {} + {\LaTeX\ Kernel} + {Used when a sentence ends with a capital letter. + This command should be placed after the letter and before the + punctuation mark.} + {} + +\defgidxactivechar + {atchar} + {\atsym} + {\marg{\meta{text}}} + {\LaTeX\ Kernel} + {% + Used in the argument of \nxglsi{env-tabular} or + \nxglsi{env-array} like environments to specify text to insert between columns.% + } + {% + \BeginArgList + \csentryargitem{text} Text to insert between columns + \EndArgList + } + +\defgidxactivechar + {questionchar} + {\questionsym} + {} + {} + {Question mark (end of sentence marker).} + {} + +\defgchar + {ltchar} + {\lesssym} + {} + {\LaTeX\ Kernel (Math Mode)} + {Less than symbol. (Use \nxglsni{textless} in text mode.)} + {} + +\defgchar + {gtchar} + {\greatersym} + {} + {\LaTeX\ Kernel (Math Mode)} + {Greater than symbol. (Use \nxglsni{textgreater} in text mode.)} + {} + +\defgchar + {gtcol} + {\greatersym} + {\marg{\meta{decl}}} + {\nxisty{array} package} + {% + Used in \nxglsi{env-tabular} or \nxglsi{env-array} column specifiers before + \texttt{l}, \texttt{r}, \texttt{c}, \texttt{p}, \texttt{m} or + \texttt{b} to insert \meta{decl} directly in front of the entry + for that column.% + } + {% + \BeginArgList + \csentryargitem{decl} The code to insert at the start of the + column. + \EndArgList + } + +\defgchar + {ltcol} + {\lesssym} + {\marg{\meta{decl}}} + {\nxisty{array} package} + {% + Used in \nxglsi{env-tabular} or \nxglsi{env-array} column specifiers after + \texttt{l}, \texttt{r}, \texttt{c}, \texttt{p}, \texttt{m} or + \texttt{b} to insert \meta{decl} directly after the entry + for that column.% + } + {% + \BeginArgList + \csentryargitem{decl} The code to insert at the end of the + column. + \EndArgList + } + +\defgcs{begin}% + {\marg{\meta{env-name}}\oarg{\meta{env-option}}\marg{\meta{env-arg-1}}\ldots\marg{\meta{env-arg-n}}}% + {\LaTeX\ Kernel}% + {% + Starts an environment. (Must have a matching \nxglsi{end}.) + }% + {% + \BeginArgList + \csentryargitem{env-name} The name of the environment. (\emph{No + backslash.}) + \csentryargitem{env-option} An optional argument that may be + passed to the environment. Not all environments have optional + arguments. + \csentryargitem{env-arg-1}\ldots\meta{env-arg-n} Any mandatory + arguments required by the environment. Not all environments + require arguments. + \EndArgList + } + +\defgcs{end}% + {\marg{\meta{env-name}}}% + {\LaTeX\ Kernel}% + {Ends an environment. (Must have a matching \nxglsi{begin}.)} + {% + \BeginArgList + \csentryargitem{env-name} The name of the environment. + \EndArgList + } + +\defgcs{documentclass}% + {\oarg{\meta{option-list}}\marg{\meta{class-name}}}% + {\LaTeX\ Kernel}% + {% + Loads the document class file, which sets up the type of document + you wish to write.% + }% + {% + \BeginArgList + \csentryargitem{option-list} A comma-separated list of options to + pass to the class file or any packages that will later be + loaded. + \csentryargitem{class-name} The name of the document class. This + corresponds to a file called \meta{class-name}\texttt{.cls}, + which must be installed. + \EndArgList + } + +\defgcs{usepackage}% + {\oarg{\meta{option-list}}\marg{\meta{package-list}}}% + {\LaTeX\ Kernel}% + {% + Loads the named packages.% + }% + {% + \BeginArgList + \csentryargitem{option-list} A comma-separated list of options to + pass to the package. + \csentryargitem{package-list} A comma-separated list of package + names (without the \texttt{.sty} extension). + \EndArgList + } + +\defgcs{footnote}% + {\oarg{\meta{number}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Inserts a footnote.}% + {% + \BeginArgList + \csentryargitem{number} Overrides the default footnote number with + the specified \meta{number}. + \csentryargitem{text} The footnote text. + \EndArgList + }% + +\defgcs{textbackslash}% + {}% + {\LaTeX\ Kernel (Text Mode)}% + {Backlash \textbackslash\ symbol. (Use + \nxglsi{backslash} for math mode.)}% + {} + +\defgcs{backslash}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Backslash \protect\ensuremath{\protect\backslash} symbol, which may be used + as a delimiter. (Use + \nxglsi{textbackslash} for text mode.)}% + {} + +\defgactivecharcs + [\underscoresym] + {underscore} + {\textunderscore} + {} + {\LaTeX\ Kernel} + {Underscore \_ symbol (see also \nxglsni{textunderscore}).} + {} + +\defgcs{textunderscore} + {} + {\LaTeX\ Kernel} + {Underscore \textunderscore\ symbol (see also \nxglsni{textunderscore}).} + {} + +\defgactivechar + [\underscoresym] + {underscorechar} + {\_} + {\marg{\meta{maths}}} + {\LaTeX\ Kernel (Math Mode)} + {Displays its argument as a subscript.} + {% + \BeginArgList + \csentryargitem{maths} The subscript. + \EndArgList + } + +\defgcs{textgreater}% + {}% + {\LaTeX\ Kernel (Text Mode)}% + {Greater than \textgreater\ symbol. (Just use \texttt{\textgreater} in math mode.)}% + {} + +\defgcs{textless}% + {}% + {\LaTeX\ Kernel (Text Mode)}% + {Less than \textless\ symbol. (Just use \texttt{\textless} in math mode.)}% + {} + +\defgcs{textasciicircum}% + {}% + {\LaTeX\ Kernel}% + {Circumflex \textasciicircum\ symbol.}% + {}% + +\defgcs[][cshyphenation]{hyphenation} + {\marg{\meta{word}}} + {\LaTeX\ Kernel} + {Specifies hyphenation points.} + {% + \BeginArgList + \csentryargitem{word} Word with hyphen points indicated with a + dash (\texttt{-}). + \EndArgList + } + +\defgsymcs[hyphen]{\dashcs} + {} + {\LaTeX\ Kernel} + {Insert discretionary hyphen.} + {} + +\defgactivecharcs + {dollar} + {\dollarsym} + {} + {\LaTeX\ Kernel} + {Dollar \$ symbol.} + {} + +\defgactivechar + {dollarchar} + {\dollarsym} + {} + {\LaTeX\ Kernel} + {Switches in and out of in-line math mode.} + {} + +\defgcs{textasciitilde}% + {}% + {\LaTeX\ Kernel}% + {Tilde \textasciitilde\ symbol. (If you are typing an + URL, use the \nxisty{url} package, which provides \nxglsi{url}\marg{\meta{address}} + that allows you to directly type \textasciitilde\ in the address.)}% + {}% + +\defgcs{url}% + {\marg{\meta{address}}}% + {\nxisty{url} package}% + {Typesets an URL in a typewriter font and allows you to use + characters such as \textasciitilde.}% + {% + \BeginArgList + \csentryargitem{address} The web address. + \EndArgList + }% + +\defgcs{dag}% + {}% + {\LaTeX\ Kernel}% + {Dagger \dag\ symbol.}% + {} + +\defgcs{ddag}% + {}% + {\LaTeX\ Kernel}% + {Double-dagger \ddag\ symbol.}% + {} + +\defgcs{textregistered}% + {}% + {\LaTeX\ Kernel}% + {Registered \textregistered\ symbol.}% + {} + +\defgcs{texttrademark}% + {}% + {\LaTeX\ Kernel}% + {Trademark \texttrademark\ symbol.}% + {} + +\defgcs{copyright}% + {}% + {\LaTeX\ Kernel}% + {Copyright \copyright\ symbol.}% + {} + +\defgcs{textquoteright}% + {}% + {\LaTeX\ Kernel}% + {Closing single quote (or apostrophe) \textquoteright\ symbol.}% + {} + +\defgcs{textquoteleft}% + {}% + {\LaTeX\ Kernel}% + {Opening single quote \textquoteleft\ symbol.}% + {} + +\defgcs{textquotedblright}% + {}% + {\LaTeX\ Kernel}% + {Closing double quote \textquotedblright\ symbol.}% + {} + +\defgcs{textquotedblleft}% + {}% + {\LaTeX\ Kernel}% + {Opening double quote \textquotedblleft\ symbol.}% + {} + +\defgcs{textbullet}% + {}% + {\LaTeX\ Kernel (Text Mode)}% + {Bullet \textbullet\ symbol.}% + {} + +\defgcs{textquestiondown}% + {}% + {\LaTeX\ Kernel}% + {Upside-down question mark \textquestiondown\ symbol.}% + {} + +\defgcs{textexclamdown}% + {}% + {\LaTeX\ Kernel}% + {Upside-down exclamation mark \textexclamdown\ symbol.}% + {} + +\defgcs{textendash}% + {}% + {\LaTeX\ Kernel}% + {En-dash \textendash\ symbol. (Normally used for number ranges.) + See also \nxglsni{endash}.}% + {} + +\defgcs{textemdash}% + {}% + {\LaTeX\ Kernel}% + {Em-dash \textemdash\ symbol. (Normally used to + indicate omissions or interruptions or to highlight a parenthetical element.) + See also \nxglsni{emdash}.}% + {} + +\defgcs{textperiodcentered}% + {}% + {\LaTeX\ Kernel (Text Mode)}% + {Centred period \textperiodcentered\ symbol.}% + {} + +\defgcs{i}% + {}% + {\LaTeX\ Kernel}% + {Dotless i character: \i.}% + {} + +\defgcs{j}% + {}% + {\LaTeX\ Kernel}% + {Dotless j character: \dotlessj.}% + {} + +\defgactivecharcs + {hash} + {\hashsym} + {} + {\LaTeX\ Kernel} + {Hash \# symbol.} + {} + +\defgactivechar + {hashchar} + {\hashsym} + {\meta{digit}} + {\LaTeX\ Kernel} + {Replacement text for argument \meta{digit}.} + {} + +\defgactivecharcs + {percent} + {\percentsym} + {} + {\LaTeX\ Kernel} + {Percent \% symbol} + {} + +\defgactivechar + {percentchar} + {\percentsym} + {} + {\LaTeX\ Kernel} + {Comment character used to ignore everything up to and including + the newline character in the \nxgls{source}.} + {} + +\defgactivecharcs + {amp} + {\ampsym} + {} + {\LaTeX\ Kernel} + {Ampersand \& symbol} + {} + +\defgactivechar + {ampchar} + {\ampsym} + {} + {\LaTeX\ Kernel} + {Alignment tab.} + {} + +\defgcs{S}% + {}% + {\LaTeX\ Kernel}% + {Sectional \S\ symbol.}% + {} + +\defgcs{P}% + {}% + {\LaTeX\ Kernel}% + {Paragraph \P\ symbol.}% + {} + +\defgcs{slash}% + {}% + {\LaTeX\ Kernel}% + {Forward slash \slash\ symbol.}% + {} + +\defgcs{AE}% + {}% + {\LaTeX\ Kernel}% + {\protect\AE\ ligature.}% + {} + +\defgcs{ae}% + {}% + {\LaTeX\ Kernel}% + {\protect\ae\ ligature.}% + {} + +\defgcs{OE}% + {}% + {\LaTeX\ Kernel}% + {\protect\OE\ ligature.}% + {} + +\defgcs{oe}% + {}% + {\LaTeX\ Kernel}% + {\protect\oe\ ligature.}% + {} + +\defgcs{AA}% + {}% + {\LaTeX\ Kernel}% + {Upper case A-ring \AA\ character.}% + {} + +\defgcs{aa}% + {}% + {\LaTeX\ Kernel}% + {Lower case a-ring \aa\ character.}% + {} + +\defgcs{L}% + {}% + {\LaTeX\ Kernel}% + {Upper case L-bar \L\ character.}% + {} + +\defgcs{l}% + {}% + {\LaTeX\ Kernel}% + {Lower case l-bar \l\ character.}% + {} + +\defgcs{O}% + {}% + {\LaTeX\ Kernel}% + {Upper case slashed-O \O\ character.}% + {} + +\defgcs{o}% + {}% + {\LaTeX\ Kernel}% + {Lower case slashed-o \o\ character.}% + {} + +\defgcs{ss}% + {}% + {\LaTeX\ Kernel}% + {Eszett \ss\ character.}% + {} + +\defgcs{SS}% + {}% + {\LaTeX\ Kernel}% + {SS (upper case \ss).}% + {} + +\defgcs{left} + {\meta{delimiter}} + {\LaTeX\ Kernel (Math Mode)} + {Indicates a left stretchable delimiter. Must have a matching + \nxglsi{right}.} + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{openparen}, or a delimiter command, such as \nxglsni{langle}. + \EndArgList + } + +\defgcs{right} + {\meta{delimiter}} + {\LaTeX\ Kernel (Math Mode)} + {Indicates a right stretchable delimiter. Must have a matching + \nxglsi{left}.} + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{closeparen}, or a delimiter command, such as \nxglsni{rangle}. + \EndArgList + } + +\defgcs{bigl}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Left delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{openparen}, or a delimiter command, such as \nxglsni{langle}. + \EndArgList + } + +\defgcs{bigr}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Right delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{closeparen}, or a delimiter command, such as \nxglsni{rangle}. + \EndArgList + } + +\defgcs{Bigl}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Left delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{openparen}, or a delimiter command, such as \nxglsni{langle}. + \EndArgList + } + +\defgcs{Bigr}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Right delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{closeparen}, or a delimiter command, such as \nxglsni{rangle}. + \EndArgList + } + +\defgcs{biggl}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Left delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{openparen}, or a delimiter command, such as \nxglsni{langle}. + \EndArgList + } + +\defgcs{biggr}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Right delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{closeparen}, or a delimiter command, such as \nxglsni{rangle}. + \EndArgList + } + +\defgcs{Biggl}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Left delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{openparen}, or a delimiter command, such as \nxglsni{langle}. + \EndArgList + } + +\defgcs{Biggr}% + {\meta{delimiter}}% + {\nxisty{amsmath} package (Math Mode)}% + {Right delimiter sizing.}% + {% + \BeginArgList + \csentryargitem{delimiter} A delimiter symbol, such as + \nxglsni{closeparen}, or a delimiter command, such as \nxglsni{rangle}. + \EndArgList + } + +\defgcs{pounds}% + {}% + {\LaTeX\ Kernel}% + {Pound \pounds\ symbol.}% + {}% + + +\defgcs{v}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Caron diacritic over \meta{c}. Example: + \cmdname{v}\marg{o} produces \ocaron.}% + {% + \BeginArgList + \csentryargitem{c} The character that requires the caron + diacritic. + \EndArgList + } + +\defgcs{u}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Breve diacritic over \meta{c}. Example: + \cmdname{u}\marg{o} produces \obreve.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the breve + diacritic. + \EndArgList + } + +\defgcs{H}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Double acute diacritic over \meta{c}. Example: + \cmdname{H}\marg{o} produces \odoubleacute.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the double + acute diacritic. + \EndArgList + } + +\defgcs{t}% + {\marg{\meta{characters}}}% + {\LaTeX\ Kernel}% + {Tie over \meta{characters}. Example: + \cmdname{t}\marg{xy} produces \xytie.% + }% + {% + \BeginArgList + \csentryargitem{characters} The characters that require the tie. + \EndArgList + } + +\defgcs{c}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Cedilla under \meta{c}. Example: + \cmdname{c}\marg{o} produces \ocedilla.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the cedilla. + \EndArgList + } + +\defgcs{d}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Dot under \meta{c}. Example: + \cmdname{d}\marg{o} produces \odotunder.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the dot + under it. + \EndArgList + } + +\defgcs{b}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Bar under \meta{c}. Example: + \cmdname{b}\marg{r} produces \rbarunder.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the bar + under it. + \EndArgList + } + +\defgcs{r}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Ring over \meta{c}. Example: + \cmdname{r}\marg{u} produces \uring.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires the ring + over it. + \EndArgList + } + +\defgsymcs[acute]{\quoterightcs}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Acute accent over \meta{c}. Example: + \cmdname{'}\marg{o} produces \protect\'{o}.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires an acute + accent over it. + \EndArgList + } + +\defgsymcs[grave]{\quoteleftcs}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Grave accent over \meta{c}. Example: + \cmdname{`}\marg{o} produces \protect\`{o}.}% + {% + \BeginArgList + \csentryargitem{c} The character that requires a grave + accent over it. + \EndArgList + } + +\defgsymcs[period]{\periodsym}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Dot over \meta{c}. Example: + \cmdname{.}\marg{o} produces \odotover.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires a dot + over it. + \EndArgList + } + +\defgchar + {periodchar} + {\periodsym} + {} + {\LaTeX\ Kernel} + {\nopostdesc} + {} + +\defgchildchar + {sentence.periodchar} + {periodchar} + {\periodsym} + {period (full stop) or decimal point} + +\defgchildchar + {delimiter.periodchar} + {periodchar} + {\periodsym} + {invisible delimiter} + +\defgsymcs[macron]{\equalsym}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel}% + {Macron accent over \meta{c}. Example: + \cmdname{=}\marg{o} produces \omacron.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires a macron + accent over it. + \EndArgList + } + +\defgactivecharcs + [\circumsym\space] + {circum} + {\textasciicircum} + {\marg{\meta{c}}} + {\LaTeX\ Kernel} + {% + Circumflex accent over \meta{c}. Example: + \cmdname{\textasciicircum}\marg{o} produces \ocircum.% + } + {% + \BeginArgList + \csentryargitem{c} The character that requires a + circumflex accent over it. + \EndArgList + } + +\defgactivechar + [\circumsym] + {circumchar} + {\textasciicircum} + {\marg{\meta{maths}}} + {\LaTeX\ Kernel (Math Mode)} + {Displays its argument as a superscript.} + {% + \BeginArgList + \csentryargitem{maths} The superscript. + \EndArgList + } + +\defgactivecharcs + [\tildesym\space] + {tilde} + {\textasciitilde} + {\marg{\meta{c}}} + {\LaTeX\ Kernel} + {% + Tilde accent over \meta{c}. Example: + \cmdname{\textasciitilde}\marg{o} produces \otilde.% + } + {% + \BeginArgList + \csentryargitem{c} The character that requires a + tilde accent over it. + \EndArgList + } + +\defgactivechar + [\tildesym] + {tildechar} + {\textasciitilde} + {} + {\LaTeX\ Kernel} + {Unbreakable space.} + {} + +\defgidxactivecharcs + {doublequote} + {\doublequotesym} + {\marg{\meta{c}}} + {\LaTeX\ Kernel}% + {% + Umlaut over \meta{c}. Example: + \quotecs\marg{o} produces \oumlaut.% + }% + {% + \BeginArgList + \csentryargitem{c} The character that requires an umlaut + over it. + \EndArgList + } + +\defgcs{item}% + {\oarg{\meta{marker}}}% + {\LaTeX\ Kernel}% + {Specifies the start of an item in a list. (Only allowed inside one of + the list making environments.)}% + {% + \BeginArgList + \csentryargitem{marker} If specified, the default item marker is + replaced with \meta{marker}. + \EndArgList + } + +\defgsymcs[itcorr]{\slashsym}% + {}% + {\LaTeX\ Kernel}% + {Italic correction.}% + {} + +\defgcs{textrm}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} in the predefined serif font. (Defaults to + Computer Modern Roman.)}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textsf}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} in the predefined sans-serif font. (Defaults to + Computer Modern Sans.)}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{texttt}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} in the predefined monospaced font. (Defaults to + Computer Modern Typewriter.)}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textmd}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with a medium weight in the current font + family.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textbf}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with a bold weight in the current font family, if it exists.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textup}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with the upright form of the current font family.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textit}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with the italic form of the current font family, if it exists.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textsl}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with the slanted form of the current font family, if it exists.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textsc}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} with the small-caps form of the current font family, if it exists.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{emph}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Toggles the upright and italic\slash slanted rendering of \meta{text}.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{textnormal}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Renders \meta{text} in the default font style.}% + {% + \BeginArgList + \csentryargitem{text} The text on which to apply the font change. + \EndArgList + } + +\defgcs{ttdefault}% + {}% + {\LaTeX\ Kernel}% + {The name of the default typewriter family as used by \nxglsni{ttfamily}. + Defaults to \texttt{cmtt} (Computer Modern Typewriter).}% + {} + +\defgcs{rmdefault}% + {}% + {\LaTeX\ Kernel}% + {The name of the default serif family as used by \nxglsni{rmfamily}. + Defaults to \texttt{cmr} (Computer Modern Roman).}% + {} + +\defgcs{sfdefault}% + {}% + {\LaTeX\ Kernel}% + {The name of the default sans-serif family as used by \nxglsni{sffamily}. + Defaults to \texttt{cmss} (Computer Modern Sans-serif).}% + {} + +\defgcs{familydefault}% + {}% + {\LaTeX\ Kernel}% + {Specifies the default font family. Defaults to + \nxglsi{rmdefault} but may be redefined by certain classes.}% + {} + +\defgcs{rmfamily}% + {}% + {\LaTeX\ Kernel}% + {Switches to the predefined serif font. (Defaults to + Computer Modern Roman.)}% + {} + +\defgcs{sffamily}% + {}% + {\LaTeX\ Kernel}% + {Switches to the predefined sans-serif font. (Defaults to + Computer Modern Sans.)}% + {} + +\defgcs{ttfamily}% + {}% + {\LaTeX\ Kernel}% + {Switches to the predefined monospaced font. (Defaults to + Computer Modern Typewriter.)}% + {} + +\defgcs{mdseries}% + {}% + {\LaTeX\ Kernel}% + {Switches to the medium weight in the current font + family.}% + {} + +\defgcs{bfseries}% + {}% + {\LaTeX\ Kernel}% + {Switches to the bold weight in the current font + family.}% + {} + + +\defgcs{upshape}% + {}% + {\LaTeX\ Kernel}% + {Switches to the upright form of the current font family.}% + {} + +\defgcs{itshape}% + {}% + {\LaTeX\ Kernel}% + {Switches to the italic form of the current font family, if it exists.}% + {} + +\defgcs{slshape}% + {}% + {\LaTeX\ Kernel}% + {Switches to the slanted form of the current font family, if it exists.}% + {} + +\defgcs{scshape}% + {}% + {\LaTeX\ Kernel}% + {Switches to the small-caps form of the current font family, if it exists.}% + {} + +\defgcs{em}% + {}% + {\LaTeX\ Kernel}% + {Toggles the upright and italic\slash slanted form of the current font family.}% + {} + +\defgcs{normalfont}% + {}% + {\LaTeX\ Kernel}% + {Switches to the default font style.}% + {} + +\defgcs{tiny}% + {}% + {Most document classes}% + {Switches to tiny sized text.}% + {} + +\defgcs{scriptsize}% + {}% + {Most document classes}% + {Switches to sub- or superscript sized text.}% + {} + +\defgcs{footnotesize}% + {}% + {Most document classes}% + {Switches to footnote sized text.}% + {} + +\defgcs{small}% + {}% + {Most document classes}% + {Switches to small sized text.}% + {} + +\defgcs{normalsize}% + {}% + {\LaTeX\ Kernel}% + {Switches to normal sized text.}% + {% + } + +\defgcs{large}% + {}% + {Most document classes}% + {Switches to large sized text.}% + {% + } + +\defgcs{Large}% + {}% + {Most document classes}% + {Switches to extra-large sized text.}% + {% + } + +\defgcs{LARGE}% + {}% + {Most document classes}% + {Switches to extra-extra-large sized text.}% + {% + } + +\defgcs{huge}% + {}% + {Most document classes}% + {Switches to huge sized text.}% + {% + } + +\defgcs{Huge}% + {}% + {Most document classes}% + {Switches to extra-huge sized text.}% + {% + } + +\defgcs{multicolumn}% + {\marg{\meta{cols spanned}}\marg{\meta{col specifier}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Spans multiple columns in a tabular-style environment.}% + {% + \BeginArgList + \csentryargitem{cols spanned} The number of columns to span. + \csentryargitem{col specifier} The alignment of this column-spanning entry. + \csentryargitem{text} The contents of this column-spanning entry. + \EndArgList + } + +\defgcs{toprule}% + {\oarg{\meta{wd}}}% + {\nxisty{booktabs} package}% + {Horizontal rule for the top of a \nxglsi{env-tabular} environment.}% + {% + \BeginArgList + \csentryargitem{wd} Thickness of the rule (dimension). + \EndArgList + } + +\defgcs{bottomrule}% + {\oarg{\meta{wd}}}% + {\nxisty{booktabs} package}% + {Horizontal rule for the bottom of a \nxglsi{env-tabular} environment.}% + {% + \BeginArgList + \csentryargitem{wd} Thickness of the rule (dimension). + \EndArgList + } + +\defgcs{midrule}% + {\oarg{\meta{wd}}}% + {\nxisty{booktabs} package}% + {Horizontal rule to go below headings row of a \nxglsi{env-tabular} environment.}% + {% + \BeginArgList + \csentryargitem{wd} Thickness of the rule (dimension). + \EndArgList + } + +\defgcs{cmidrule}% + {\oarg{\meta{wd}}\parg{\meta{trim}}\marg{\meta{n}-\meta{m}}}% + {\nxisty{booktabs} package}% + {Like \nxglsi{midrule} but only spans column \meta{n} to column + \meta{m}.}% + {% + \BeginArgList + \csentryargitem{wd} Thickness of the rule (dimension). + \csentryargitem{trim} Trimming commands. Specifications: + \texttt{r}, \texttt{r}\marg{\meta{wd}}, \texttt{l} and + \texttt{l}\marg{\meta{wd}} + \csentryargitem{n} Index of start column. + \csentryargitem{m} Index of end column. + \EndArgList + } + +\defgcs{heavyrulewidth}% + {}% + {\nxisty{booktabs} package}% + {\nxGls{length} register specifying the thickness of \nxglsi{toprule} and + \nxglsi{bottomrule}.}% + {} + +\defgcs{lightrulewidth}% + {}% + {\nxisty{booktabs} package}% + {\nxGls{length} register specifying the thickness of \nxglsi{midrule}.}% + {} + +\defgcs{addlinespace}% + {\oarg{\meta{wd}}}% + {\nxisty{booktabs} package}% + {Adds extra vertical space (\meta{wd} if specified, otherwise + \nxglsi{defaultaddspace}) in a row of + a \nxglsi{env-tabular} environment. (Must be inserted after + \nxglsi{dbbackslashchar} marker.)}% + {% + \BeginArgList + \csentryargitem{wd} Height of space (dimension). Default is + \nxglsi{defaultaddspace}. + \EndArgList + } + +\defgcs{defaultaddspace}% + {}% + {\nxisty{booktabs} package}% + {Default extra space before or after an adjacent rule.}% + {} + +\defgcs{parbox}% + {\oarg{\meta{pos}}\oarg{\meta{height}}\marg{\meta{width}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Makes a box with line-wrapped contents. (More restrictive than + \nxglsi{env-minipage}.)}% + {% + \BeginArgList + \csentryargitem{pos} The vertical alignment of the box relative to + the surrounding text. (Centred if omitted.) + \csentryargitem{height} The height of the box. (If omitted the + height is the natural height of the contents of the box.) + \csentryargitem{width} The width of the box. + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{author}% + {\marg{\meta{name}}}% + {Most classes that have the concept of a title page}% + {Specifies the document author (or authors). This command doesn't + display any text so may be used in the preamble, but if it's not + in the preamble it must be placed before \nxglsi{maketitle}.}% + {% + \BeginArgList + \csentryargitem{name} The name (or names) of the document author + (or authors). + \EndArgList + Note that some classes, such as those supplied by journals or + conference proceedings, may also define an optional argument + that can be used to specify an abbreviated author list for the + page headers. + } + +\defgcs{title}% + {\marg{\meta{text}}}% + {Most classes that have the concept of a title page}% + {Specifies the document title. This command doesn't + display any text so may be used in the preamble, but if it's not + in the preamble it must be placed before \nxglsi{maketitle}.}% + {% + \BeginArgList + \csentryargitem{text} The title of the document. + \EndArgList + Note that some classes, such as those supplied by journals or + conference proceedings, may also define an optional argument + that can be used to specify an abbreviated title for the page + headers. + } + +\defgcs{date}% + {\marg{\meta{text}}}% + {Most classes that have the concept of a title page}% + {Specifies the document date. This command doesn't + display any text so may be used in the preamble, but if it's not + in the preamble it must be placed before \nxglsi{maketitle}. If omitted, most + classes assume the current date (as provided by \nxglsi{today}).}% + {% + \BeginArgList + \csentryargitem{text} The document date. + \EndArgList + } + +\defgcs{titlehead}% + {\marg{\meta{text}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt}, \nxicls{scrbook} classes}% + {Specifies the title header (typeset at the top of the title page).}% + {% + \BeginArgList + \csentryargitem{text} The title header text. + \EndArgList + } + +\defgcs{subtitle}% + {\marg{\meta{text}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt}, \nxicls{scrbook} classes}% + {Specifies the subtitle (typeset just below the title).}% + {% + \BeginArgList + \csentryargitem{text} The subtitle text. + \EndArgList + } + +\defgcs{subject}% + {\marg{\meta{text}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt}, \nxicls{scrbook} classes}% + {Specifies the subject (typeset just above the title).}% + {% + \BeginArgList + \csentryargitem{text} The subject. + \EndArgList + } + +\defgcs{publishers}% + {\marg{\meta{text}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt}, \nxicls{scrbook} classes}% + {Specifies the publisher (typeset after all the other titling + information).}% + {% + \BeginArgList + \csentryargitem{text} The publisher text. + \EndArgList + } + +\defgcs{maketitle}% + {}% + {Most classes that have the concept of a title page}% + {Generates the title page (or title block). This command is usually + placed at the beginning of the document environment.}% + {} + +\defgcs{thanks}% + {\marg{\meta{text}}}% + {Most classes that have the concept of a title page}% + {Inserts a special type of footnote in one of the titling fields, + such as \nxglsi{author} or \nxglsni{title}. Usually used for some form of + acknowledgement or affiliation.}% + {} + +\defgcs{today}% + {}% + {Most of the commonly-used classes}% + {Inserts into the output file the date when the \LaTeX\ + application created it from the source code.}% + {} + +\defgcs{part}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a part sectional unit. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the part counter. + } + +\defgcs{chapter}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Book-style classes (such as \nxicls{scrbook} or \nxicls{scrreprt}) that have + the concept of chapters}% + {Inserts a chapter heading. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the chapter counter. + } + +\defgcs{section}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a section header. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the section counter. + } + +\defgcs{subsection}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a subsection header. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the subsection counter. + } + +\defgcs{subsubsection}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a subsubsection header. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the subsubsection counter. + } + +\defgcs{paragraph}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a subsubsubsection header. Most classes default to an + unnumbered running header for + this sectional unit. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the associated counter. + } + +\defgcs{subparagraph}% + {\oarg{\meta{short title}}\marg{\meta{title}}}% + {Most classes that have the concept of document structure}% + {Inserts a subsubsubsubsection header. Most classes default + to an unnumbered running header for + this sectional unit. \textbf{This command has a \htmlref{moving + argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short title} An abbreviated form of the title to + go in the table of contents or the page header. + \csentryargitem{title} The title. + \EndArgList + The starred form of this command doesn't have an optional + argument and doesn't increment or display the associated counter. + } + +\defgcs{minisec}% + {\marg{\meta{heading}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt} and + \nxicls{scrbook} classes}% + {An unnumbered heading not associated with any structuring level.}% + {% + \BeginArgList + \csentryargitem{heading} The heading text. + \EndArgList + } + +\defgcs{addtokomafont}% + {\marg{\meta{element name}}\marg{\meta{commands}}}% + {\nxicls{scrartcl}, \nxicls{scrreprt} and + \nxicls{scrbook} classes}% + {Sets the font characteristics for the given \koma\ element.}% + {% + \BeginArgList + \csentryargitem{element name} The element's name, for example + \texttt{chapter}. See the \koma\ manual for a full list + of defined elements. + \csentryargitem{commands} The font changing commands to apply + to that element. + \EndArgList + } + +\defgcs{appendix}% + {}% + {Most classes that have the concept of document structure}% + {Indicates (but doesn't print anything) that the document is + switching to the appendices. If chapters exist, the chapter + numbering is reset and switched to a different format + (usually upper case letters) otherwise the section numbering + is reset and switched to a different format.}% + {} + +\defgcs{tableofcontents} + {}% + {Most classes that have the concept of document structure}% + {Inserts the table of contents. A second (possibly third) run + is required to ensure the page numbering is correct.}% + {} + +\defgcs{addcontentsline}% + {\marg{\meta{toc}}\marg{\meta{section unit}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Adds a sectional unit header to the contents list.}% + {% + \BeginArgList + \csentryargitem{toc} The extension of the required external file + without the dot (for example, \texttt{toc} for the table of + contents or \texttt{lof} for the list of figures). + \csentryargitem{section unit} The name of the sectional unit (for + example, \texttt{chapter}). + \csentryargitem{text} The text to be added to the contents list. + \EndArgList + } + +\defgcs{label}% + {\marg{\meta{string}}}% + {\LaTeX\ Kernel}% + {Assigns a unique textual label linked to the most recently + incremented cross-referencing counter in the current \nxglslink{group}{scope} (see + also \nxglsi{ref}).}% + {% + \BeginArgList + \csentryargitem{string} A unique label that can be referenced + elsewhere in the document with \nxglsi{ref}. (It's best to + just use alphanumerics and non-active punctuation characters in + the label.) + \EndArgList + } + +\defgcs{ref}% + {\marg{\meta{string}}}% + {\LaTeX\ Kernel}% + {References the value of the counter linked to the given label. + A second (possibly third) run of \LaTeX\ is required to ensure the cross-references + are up-to-date. + }% + {% + \BeginArgList + \csentryargitem{string} The required label that was used in the + corresponding \nxglsi{label}. + \EndArgList + } + +\defgcs{pageref}% + {\marg{\meta{string}}}% + {\LaTeX\ Kernel}% + {Similar to \nxglsi{ref} but inserts the page number where the given + label was defined. + A second (possibly third) run of \LaTeX\ is required to ensure the cross-references + are up-to-date. + }% + {% + \BeginArgList + \csentryargitem{string} The required label that was used in the + corresponding \nxglsi{label}. + \EndArgList + } + +\defgcs{vref}% + {\marg{\meta{string}}}% + {\nxisty{varioref} package}% + {Like \nxglsi{ref} but also adds information about the location, such + as \dq{on page~\meta{n}} or \dq{on the following page}. + }% + {% + \BeginArgList + \csentryargitem{string} The required label that was used in the + corresponding \nxglsi{label}. + \EndArgList + } + +\defgcs{bibitem}% + {\oarg{\meta{tag}}\marg{\meta{key}}}% + {\LaTeX\ Kernel}% + {Indicates the start of a new reference in the bibliography. May + only be used inside the contents of \nxglsi{env-thebibliography} environment}% + {% + \BeginArgList + \csentryargitem{tag} If present, overrides the marker at the + start of the reference. + \csentryargitem{key} A unique key that identifies this reference so + it can be cited elsewhere in the document using \nxglsi{cite}. + \EndArgList + } + +\defgcs{cite}% + {\oarg{\meta{text}}\marg{\meta{key list}}}% + {\LaTeX\ Kernel}% + {Inserts the citation markers of each reference identified in the + key list. A second run is required to ensure the reference is + correct.}% + {% + \BeginArgList + \csentryargitem{text} Additional text to insert into the citation + (such as the chapter number, or a particular page or + page range within the citation). + \csentryargitem{key list} A comma-separated list of keys used in + the corresponding \nxglsi{cite}. + \EndArgList + } + +\defgcs{pagenumbering}% + {\marg{\meta{style}}}% + {\LaTeX\ Kernel}% + {Sets the style of the page numbers.}% + {% + \BeginArgList + \csentryargitem{style} The page numbering style (e.g.\ + \texttt{roman} for lower case Roman numerals). + \EndArgList + } + +\defgcs{pagestyle}% + {\marg{\meta{style}}}% + {\LaTeX\ Kernel}% + {Sets the style of the headers and footers.}% + {% + \BeginArgList + \csentryargitem{style} The name of the page style. The \LaTeX\ + kernel defines only two styles: \nxipagestyle{empty} and + \nxipagestyle{plain}. Most of the standard classes also provide + the \nxipagestyle{headings} style. + \EndArgList + } + +\defgcs{thispagestyle}% + {\marg{\meta{style}}}% + {\LaTeX\ Kernel}% + {Like \nxglsi{pagestyle} but only affects the current page.}% + {% + \BeginArgList + \csentryargitem{style} The name of the page style. + \EndArgList + } + +\defgcs{markboth}% + {\marg{\meta{left head}}\marg{\meta{right head}}}% + {\LaTeX\ Kernel}% + {Specifies information for the left and right page headers. Not all + page styles use this information, in which case the arguments are + ignored.}% + {% + \BeginArgList + \csentryargitem{left head} Text for the left (even) page header, + if the document has been identified as a double-sided document + (usually with the \nxclsopt{twoside} class option). + + \csentryargitem{right head} Text for the right page header, + if the \nxclsopt{twoside} option has been used. Otherwise used + for both odd and even page headers. + \EndArgList + } + +\defgcs{markright}% + {\marg{\meta{right head}}}% + {\LaTeX\ Kernel}% + {Specifies information for the right (odd) page header. Not all + page styles use this information, in which case the argument is + ignored.}% + {% + \BeginArgList + \csentryargitem{right head} Text for the right page header, + if the \nxclsopt{twoside} option has been used. Otherwise used + for both odd and even page headers. + \EndArgList + } + +\defgcs{includegraphics}% + {\oarg{\meta{key vals}}\marg{\meta{filename}}}% + {\nxisty{graphicx} package}% + {Inserts a graphics file into the document.}% + {% + \BeginArgList + \csentryargitem{key vals} Comma-separated list of options that can + be used to change the way the image is displayed. + \EndArgList + } + +\defgcs{DeclareGraphicsExtensions}% + {\marg{\meta{ext-list}}}% + {\nxisty{graphicx} package}% + {Specify the file extensions to look for if no extension is used in + \nxglsi{includegraphics}}% + {% + \BeginArgList + \csentryargitem{ext-list} A comma-separated list of extensions. + \EndArgList + } + +\defgcs{selectlanguage} + {\marg{\meta{language name}}}% + {\nxisty{babel} package}% + {Switches to the named language. Predefined textual elements, such + as the date given by \nxglsi{today} or prefixes like \dq{Chapter}, + are redefined to those supplied by the given language.}% + {% + \BeginArgList + \csentryargitem{language} The language identifier. + \EndArgList + } + +\defgcs{foreignlanguage}% + {\marg{\meta{language name}}\marg{\meta{text}}}% + {\nxisty{babel} package}% + {Typesets the given text using any predefined names or date formats supplied by the + given language. + }% + {% + \BeginArgList + \csentryargitem{language} The language identifier. + \csentryargitem{text} The foreign text. + \EndArgList + } + +\defgcs{iflanguage}% + {\marg{\meta{language name}}\marg{\meta{true text}}\marg{\meta{false +text}}}% + {\nxisty{babel} package}% + {Tests the current language.}% + {% + \BeginArgList + \csentryargitem{language} The language identifier. + \csentryargitem{true text} The text to typeset if true. + \csentryargitem{false text} The text to typeset if not true. + \EndArgList + } + +\defgcs{caption}% + {\oarg{\meta{short caption}}\marg{\meta{caption text}}}% + {\LaTeX\ Kernel}% + {Inserts the caption for a float such as a figure or table. + \textbf{This command has a \htmlref{moving argument}{sec:fragile}.}}% + {% + \BeginArgList + \csentryargitem{short caption} If provided, an abbreviated caption + to go in the list of figures\slash tables etc. + \csentryargitem{caption text} The caption contents. + \EndArgList + } + +\defgcs{listoffigures}% + {}% + {Most classes that have the concept of document structure}% + {Inserts the list of figures. A second (possibly third) run + is required to ensure the page numbering is correct.}% + {} + +\defgcs{listoftables}% + {}% + {Most classes that have the concept of document structure}% + {Inserts the list of tables. A second (possibly third) run + is required to ensure the page numbering is correct.}% + {} + +\defgcs{hspace}% + {\marg{\meta{length}}}% + {\LaTeX\ Kernel}% + {Inserts a horizontal gap of the given width.}% + {% + \BeginArgList + \csentryargitem{length} The width of the horizontal gap. + \EndArgList + } + +\defgcs{vspace}% + {\marg{\meta{length}}}% + {\LaTeX\ Kernel}% + {Inserts a vertical gap of the given height.}% + {% + \BeginArgList + \csentryargitem{length} The \protect\htmlref{height}{sec:length} of the vertical gap. + \EndArgList + } + +\defgcs{baselineskip}% + {}% + {\LaTeX\ Kernel}% + {A \nxglsi{length} register that stores the current interline spacing. + This is recalculated whenever the font changes.}% + {} + +\defgcs{parskip}% + {}% + {\LaTeX\ Kernel}% + {A \nxglsi{length} register that stores the spacing between paragraphs. + (If you're using one of the \koma\ classes, use the \nxscrclsopt{parskip} + option to set it to full or half line height.)}% + {} + +\defgcs{twocolumn}% + {\oarg{\meta{header text}}}% + {\LaTeX\ Kernel}% + {Starts a new page and switches to two column mode.}% + {% + \BeginArgList + \csentryargitem{header text} If present, this header text will be + placed at the top of the page spanning both columns. (For + example, as used by \nxglsi{maketitle} in two column articles.) + \EndArgList + } + +\defgcs{onecolumn}% + {}% + {\LaTeX\ Kernel}% + {Starts a new page and switches to one column mode.}% + {} + +\defgcs{TeX}% + {}% + {\LaTeX\ Kernel}% + {Typesets the \TeX\ logo.}% + {} + +\defgcs{LaTeX}% + {}% + {\LaTeX\ Kernel}% + {Typesets the \makeimg{LaTeX}{\LaTeX}\ logo.}% + {} + +\defgcs{LaTeXe}% + {}% + {\LaTeX\ Kernel}% + {Typesets the \makeimg{LaTeX2e}{\LaTeXe}\ logo.}% + {} + +\defgcs{framebox}% + {\oarg{\meta{width}}\oarg{\meta{align}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Puts a frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{width} The width of the box. (If omitted, this value is + the natural width of the box contents.) + \csentryargitem{align} Horizontal alignment of box contents + (\texttt{c} if omitted). + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{fbox}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Puts a frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{shadowbox}% + {\marg{\meta{text}}}% + {\nxisty{fancybox} package}% + {Puts a shadow frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{doublebox}% + {\marg{\meta{text}}}% + {\nxisty{fancybox} package}% + {Puts a double-lined frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{ovalbox}% + {\marg{\meta{text}}}% + {\nxisty{fancybox} package}% + {Puts a thin-lined oval frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{Ovalbox}% + {\marg{\meta{text}}}% + {\nxisty{fancybox} package}% + {Puts a thick-lined oval frame around its contents, prohibiting a line break in the + contents.}% + {% + \BeginArgList + \csentryargitem{text} The contents of the box. + \EndArgList + } + +\defgcs{protect}% + {\meta{command}}% + {\LaTeX\ Kernel}% + {Used in a moving argument to prevent a fragile command from expanding.}% + {% + \BeginArgList + \csentryargitem{command} The fragile command that needs protecting. + \EndArgList + } + +\defgcs{par}% + {}% + {\LaTeX\ Kernel}% + {Insert a paragraph break.}% + {} + +\defgcs{linewidth}% + {}% + {\LaTeX\ Kernel}% + {A length containing the desired current line width. This is + usually the width of the typeblock, but inside a \nxglsi{env-minipage} + or \nxglsi{parbox} it will be the width the box. Note that + the actual contents of the line may fall short of the line width + (underfull hbox) or extend beyond it (overfull hbox).}% + {} + +\defgcs{textwidth}% + {}% + {\LaTeX\ Kernel}% + {A length containing the width of the typeblock. Note that + the actual contents of the line may fall short of the line width + (underfull hbox) or extend beyond it (overfull hbox). This width + does not include the area for marginal notes.}% + {} + +\defgcs{textheight}% + {}% + {\LaTeX\ Kernel}% + {A length containing the height of the typeblock. Note that + the actual contents of the page may fall short of the text height + (underfull vbox) or extend beyond it (overfull vbox). This + measurement does not include the header and footer areas.}% + {} + +\defgcs{and}% + {}% + {\LaTeX\ Kernel}% + {Used to separate authors in \nxglsi{author}}% + {} + +\defgcs{clearpage}% + {}% + {\LaTeX\ Kernel}% + {Inserts a page break and processes any unprocessed floats}% + {} + +\defgcs{rotatebox}% + {\oarg{\meta{option list}}\marg{\meta{angle}}\marg{\meta{text}}}% + {\nxisty{graphicx} package}% + {Rotates the given contents by the given angle.}% + {% + \BeginArgList + \csentryargitem{option list} A comma-separated list of options: + \protect\begin{itemize} + \protect\item \nxikeyvalopt{rotatebox}{origin}=\meta{label} + \protect\item \nxikeyvalopt{rotatebox}{x}=\meta{dimen} + \protect\item \nxikeyvalopt{rotatebox}{y}=\meta{dimen} + \protect\item \nxikeyvalopt{rotatebox}{units}=\meta{number} + \protect\end{itemize} + + \csentryargitem{angle} The angle of rotation. + + \csentryargitem{text} The text to be rotated. + \EndArgList + } + +\defgcs{scalebox}% + {\marg{\meta{h scale}}\oarg{\meta{v scale}}\marg{\meta{text}}}% + {\nxisty{graphicx} package}% + {Scales the specified contents.}% + {% + \BeginArgList + \csentryargitem{h scale} The horizontal scale factor. + \csentryargitem{v scale} The vertical scale factor. If omitted, + the same as \meta{h scale}. + \csentryargitem{text} The text to be scaled. + \EndArgList + } + +\defgcs{reflectbox}% + {\marg{\meta{text}}}% + {\nxisty{graphicx} package}% + {Reflects the specified contents in the \makeimg{y}{\ensuremath{y}}-axis.)}% + {% + \BeginArgList + \csentryargitem{text} The text to be reflected. + \EndArgList + } + +\defgcs{resizebox}% + {\marg{\meta{h length}}\marg{\meta{v length}}\marg{\meta{text}}}% + {\nxisty{graphicx} package}% + {Scales the specified contents to the given dimensions.}% + {% + \BeginArgList + \csentryargitem{h length} The required width or \texttt{!} to keep + the aspect ratio. + \csentryargitem{v length} The required height or \texttt{!} to keep + the aspect ratio. + \csentryargitem{text} The text to be scaled. + \EndArgList + } + +\defgcs{centering}% + {}% + {\LaTeX\ Kernel}% + {Switches the paragraph alignment to centred.}% + {} + +\defgcs{newcommand}% + {\marg{\meta{cmd}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Defines a new command.}% + {% + \BeginArgList + \csentryargitem{cmd} The new command name (including initial backslash). + \csentryargitem{n-args} The number of arguments this new command + should have. + \csentryargitem{default} If the first argument should be optional, + the default value if omitted. + \csentryargitem{text} What actions the command should perform. + \EndArgList + } + +\defgcs{renewcommand}% + {\marg{\meta{cmd}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Redefines an existing command.}% + {% + \BeginArgList + \csentryargitem{cmd} The command name (including initial backslash). + \csentryargitem{n-args} The number of arguments this command + should have. + \csentryargitem{default} If the first argument should be optional, + the default value if omitted. + \csentryargitem{text} What actions the command should perform. + \EndArgList + } + +\defgcs{newenvironment}% + {\marg{\meta{env-name}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{begin-code}}\marg{\meta{end-code}}}% + {\LaTeX\ Kernel}% + {Defines a new environment.}% + {% + \BeginArgList + \csentryargitem{env-name} The new environment name (\emph{no} backslash). + \csentryargitem{n-args} The number of arguments this new + environment should have. + \csentryargitem{default} If the first argument should be optional, + the default value if omitted. + \csentryargitem{begin-code} Actions to perform at the start of the + environment. + \csentryargitem{end-code} Actions to perform at the end of the + environment. + \EndArgList + } + +\defgcs{renewenvironment}% + {\marg{\meta{env-name}}\oarg{\meta{n-args}}\oarg{\meta{default}}\marg{\meta{begin-code}}\marg{end-code}}% + {\LaTeX\ Kernel}% + {Redefines an existing environment.}% + {% + \BeginArgList + \csentryargitem{env-name} The environment name (\emph{no} backslash). + \csentryargitem{n-args} The number of arguments this new + environment should have. + \csentryargitem{default} If the first argument should be optional, + the default value if omitted. + \csentryargitem{begin-code} Actions to perform at the start of the + environment. + \csentryargitem{end-code} Actions to perform at the end of the + environment. + \EndArgList + } + +\defgcs{labelitemi}% + {}% + {Classes that define the \nxglsni{env-itemize} environment}% + {The default label for the first level \nxglsni{env-itemize}.}% + {} + +\defgcs{labelitemii}% + {}% + {Classes that define the \nxglsni{env-itemize} environment}% + {The default label for the second level \nxglsni{env-itemize}.}% + {} + +\defgcs{labelitemiii}% + {}% + {Classes that define the \nxglsni{env-itemize} environment}% + {The default label for the third level \nxglsni{env-itemize}.}% + {} + +\defgcs{labelitemiv}% + {}% + {Classes that define the \nxglsni{env-itemize} environment}% + {The default label for the fourth level \nxglsni{env-itemize}.}% + {} + +\defgcs{mbox}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Ensures that the given text doesn't contain a line break.}% + {} + +\defgcs{text}% + {\marg{\meta{text}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Displays its argument in the normal text font (as opposed to the + current maths font).}% + {% + \BeginArgList + \csentryargitem{text} The text to be displayed in the normal text font. + \EndArgList + } + +\defgcs{intertext}% + {\marg{\meta{text}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Used for a short interjection in the middle of a multi-line + displayed maths, such as in an \nxglsi{env-align} environment. + May only appear right after \nxglsi{dbbackslashchar}.}% + {% + \BeginArgList + \csentryargitem{text} The interjection text. + \EndArgList + } + +\defgcs{overleftarrow}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Puts an extendible left arrow over \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths over which to put the arrow. + \EndArgList + } + +\defgcs{overrightarrow}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Puts an extendible right arrow over \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths over which to put the arrow. + \EndArgList + } + +\defgcs{overleftrightarrow}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Puts an extendible left-right arrow over \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths over which to put the arrow. + \EndArgList + } + +\defgcs{underleftarrow}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Puts an extendible left arrow under \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths under which to put the arrow. + \EndArgList + } + +\defgcs{underrightarrow}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Puts an extendible right arrow under \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths under which to put the arrow. + \EndArgList + } + +\defgcs{underleftrightarrow}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Puts an extendible left-right arrow under \meta{maths}}% + {% + \BeginArgList + \csentryargitem{maths} The maths under which to put the arrow. + \EndArgList + } + +\defgcs{xrightarrow}% + {\oarg{\meta{subscript}}\marg{\meta{superscript}}}% + {\nxisty{amsmath} package (Math Mode)}% + {An extendible right arrow with a superscript and optionally a + subscript.}% + {% + \BeginArgList + \csentryargitem{subscript} The subscript to go under the arrow. + \csentryargitem{superscript} The superscript to go over the arrow. + \EndArgList + } + +\defgcs{xleftarrow}% + {\oarg{\meta{subscript}}\marg{\meta{superscript}}}% + {\nxisty{amsmath} package (Math Mode)}% + {An extendible left arrow with a superscript and optionally a + subscript.}% + {% + \BeginArgList + \csentryargitem{subscript} The subscript to go under the arrow. + \csentryargitem{superscript} The superscript to go over the arrow. + \EndArgList + } + +\defgcs{rightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right arrow \ensuremath{\rightarrow}.}% + {} + +\defgcs{to}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right arrow \ensuremath{\to}.}% + {} + +\defgcs{Rightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-lined right arrow \ensuremath{\Rightarrow}.}% + {} + +\defgcs{leftarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left arrow \ensuremath{\leftarrow}.}% + {} + +\defgcs{gets}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left arrow \ensuremath{\gets}.}% + {} + +\defgcs{Leftarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-lined left arrow \ensuremath{\Leftarrow}.}% + {} + +\defgcs{downarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Down arrow \ensuremath{\downarrow}. (May be used as a delimiter.)}% + {} + +\defgcs{Downarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-lined down arrow \ensuremath{\Downarrow}. (May be used as a delimiter.)}% + {} + +\defgcs{uparrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Up arrow \ensuremath{\uparrow}. (May be used as a delimiter.)}% + {} + +\defgcs{Uparrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-lined up arrow \ensuremath{\Uparrow}. (May be used as a delimiter.)}% + {} + +\defgcs{updownarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-ended vertical arrow \ensuremath{\updownarrow}. (May be used as a delimiter.)}% + {} + +\defgcs{Updownarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-ended double-lined vertical arrow \ensuremath{\Updownarrow}. (May be used as a delimiter.)}% + {} + +\defgcs{hookrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Hooked right arrow \ensuremath{\hookrightarrow}.}% + {} + +\defgcs{hookleftarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Hooked left arrow \ensuremath{\hookleftarrow}.}% + {} + +\defgcs{leftharpoondown}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left down harpoon \ensuremath{\leftharpoondown}.}% + {} + +\defgcs{leftharpoonup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left up harpoon \ensuremath{\leftharpoonup}.}% + {} + +\defgcs{rightharpoondown}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right down harpoon \ensuremath{\rightharpoondown}.}% + {} + +\defgcs{rightharpoonup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right up harpoon \ensuremath{\rightharpoonup}.}% + {} + +\defgcs{rightleftharpoons}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right-left harpoons \ensuremath{\rightleftharpoons}.}% + {} + +\defgcs{leftrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-ended horizontal arrow \ensuremath{\leftrightarrow}.}% + {} + +\defgcs{Leftrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Double-ended double-lined horizontal arrow \ensuremath{\Leftrightarrow}.}% + {} + +\defgcs{longrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long right arrow \ensuremath{\longrightarrow}.}% + {} + +\defgcs{longleftarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long left arrow \ensuremath{\longleftarrow}.}% + {} + +\defgcs{longleftrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long double-ended horizontal arrow \ensuremath{\longleftrightarrow}.}% + {} + +\defgcs{Longrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long double-lined right arrow \ensuremath{\Longrightarrow}.}% + {} + +\defgcs{Longleftarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long double-lined left arrow \ensuremath{\Longleftarrow}.}% + {} + +\defgcs{Longleftrightarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long double-lined double-ended horizontal arrow \ensuremath{\Longleftrightarrow}.}% + {} + +\defgcs{longmapsto}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Long mapping arrow \ensuremath{\longmapsto}.}% + {} + +\defgcs{mapsto}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Mapping arrow \ensuremath{\mapsto}.}% + {} + +\defgcs{nearrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {North-East arrow \ensuremath{\nearrow}.}% + {} + +\defgcs{nwarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {North-West arrow \ensuremath{\nwarrow}.}% + {} + +\defgcs{searrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {South-East arrow \ensuremath{\searrow}.}% + {} + +\defgcs{swarrow}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {South-West arrow \ensuremath{\swarrow}.}% + {} + +\defgcs{makeindex}% + {}% + {\LaTeX\ Kernel (Preamble Only)}% + {Enables \nxglsi{index}.}% + {} + +\defgcs{index}% + {\marg{\meta{text}}}% + {\LaTeX\ Kernel}% + {Adds indexing information to an external index file. The command + \nxglsi{makeindex} must be used in the preamble to enable + this command. The external index file must be post-processed with + an indexing application, such as \nxiappname{makeindex}.}% + {% + \BeginArgList + \csentryargitem{text} The text to go in the index. + \EndArgList + } + +\defgcs{printindex}% + {}% + {\nxisty{makeidx} package}% + {Prints the index. Must be used with \nxglsi{makeindex} and \nxglsi{index}. + (The external index file must first be processed by an indexing application.)}% + {} + +\defgcs{alpha}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case alpha \ensuremath{\alpha}.}% + {} + +\defgcs{beta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case beta \ensuremath{\beta}.}% + {} + +\defgcs{gamma}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case gamma \ensuremath{\gamma}.}% + {} + +\defgcs{delta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case delta \ensuremath{\delta}.}% + {} + +\defgcs{epsilon}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case epsilon \ensuremath{\epsilon}.}% + {} + +\defgcs{varepsilon}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Variant Greek lower case alpha \ensuremath{\varepsilon}.}% + {} + +\defgcs{zeta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case zeta \ensuremath{\zeta}.}% + {} + +\defgcs{eta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case eta \ensuremath{\eta}.}% + {} + +\defgcs{theta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case theta \ensuremath{\theta}.}% + {} + +\defgcs{vartheta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {A variant Greek lower case theta \ensuremath{\vartheta}.}% + {} + +\defgcs{iota}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case iota \ensuremath{\iota}.}% + {} + +\defgcs{kappa}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case kappa \ensuremath{\kappa}.}% + {} + +\defgcs{lambda}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case lambda \ensuremath{\lambda}.}% + {} + +\defgcs{mu}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case mu \ensuremath{\mu}.}% + {} + +\defgcs{nu}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case nu \ensuremath{\nu}.}% + {} + +\defgcs{xi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case xi \ensuremath{\xi}.}% + {} + +\defgcs{pi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case pi \ensuremath{\pi}.}% + {} + +\defgcs{varpi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Variant Greek lower case pi \ensuremath{\varpi}.}% + {} + +\defgcs{rho}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case rho \ensuremath{\rho}.}% + {} + +\defgcs{varrho}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Variant Greek lower case rho \ensuremath{\varrho}.}% + {} + +\defgcs{sigma}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case sigma \ensuremath{\sigma}.}% + {} + +\defgcs{varsigma}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Variant Greek lower case sigma \ensuremath{\varsigma}.}% + {} + +\defgcs{tau}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case tau \ensuremath{\tau}.}% + {} + +\defgcs{upsilon}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case upsilon \ensuremath{\upsilon}.}% + {} + +\defgcs{phi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case phi \ensuremath{\phi}.}% + {} + +\defgcs{varphi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Variant Greek lower case phi \ensuremath{\varphi}.}% + {} + +\defgcs{chi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case chi \ensuremath{\chi}.}% + {} + +\defgcs{psi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case psi \ensuremath{\psi}.}% + {} + +\defgcs{omega}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek lower case omega \ensuremath{\omega}.}% + {} + +\defgcs{Gamma}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case gamma \ensuremath{\Gamma}.}% + {} + +\defgcs{Delta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case delta \ensuremath{\Delta}.}% + {} + +\defgcs{Theta}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case theta \ensuremath{\Theta}.}% + {} + +\defgcs{Lambda}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case lambda \ensuremath{\Lambda}.}% + {} + +\defgcs{Xi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case xi \ensuremath{\Xi}.}% + {} + +\defgcs{Pi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case pi \ensuremath{\Pi}.}% + {} + +\defgcs{Sigma}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case sigma \ensuremath{\Sigma}.}% + {} + +\defgcs{Upsilon}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case upsilon \ensuremath{\Upsilon}.}% + {} + +\defgcs{Phi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case phi \ensuremath{\Phi}.}% + {} + +\defgcs{Psi}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case psi \ensuremath{\Psi}.}% + {} + +\defgcs{Omega}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Greek upper case omega \ensuremath{\Omega}.}% + {} + +\defgcs{sb}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Displays its argument as a subscript.}% + {% + \BeginArgList + \csentryargitem{maths} The subscript. + \EndArgList + } + +\defgcs{sp}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Displays its argument as a superscript.}% + {% + \BeginArgList + \csentryargitem{maths} The superscript. + \EndArgList + } + +\defgcs{pmod}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Modulo operator with parentheses.}% + {% + \BeginArgList + \csentryargitem{maths} The modulo (placed in parentheses). + \EndArgList + } + +\defgcs{mod}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} (Math Mode)}% + {Modulo operator without parentheses.}% + {% + \BeginArgList + \csentryargitem{maths} The modulo (placed in parentheses). + \EndArgList + } + +\defgcs{pod}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} (Math Mode)}% + {Modulo operator with parentheses but no \dq{mod}.}% + {% + \BeginArgList + \csentryargitem{maths} The modulo (placed in parentheses). + \EndArgList + } + +\defgcs{bmod}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Modulo operator.}% + {} + +\defgcs{arccos}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\arccos} function name.}% + {} + +\defgcs{arcsin}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\arcsin} function name.}% + {} + +\defgcs{arctan}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\arctan} function name.}% + {} + +\defgcs{arg}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\arg} function name.}% + {} + +\defgcs{cos}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\cos} function name.}% + {} + +\defgcs{cosh}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\cosh} function name.}% + {} + +\defgcs{cot}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\cot} function name.}% + {} + +\defgcs{coth}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\coth} function name.}% + {} + +\defgcs{csc}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\csc} function name.}% + {} + +\defgcs{deg}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\deg} function name.}% + {} + +\defgcs{det}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\det} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{dim}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\dim} function name.}% + {} + +\defgcs{exp}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\exp} function name.}% + {} + +\defgcs{gcd}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\gcd} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{hom}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\hom} function name.}% + {} + +\defgcs{inf}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\inf} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{injlim}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\injlim} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{projlim}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\projlim} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{varlimsup}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\varlimsup} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{varliminf}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\varliminf} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{varinjlim}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\varinjlim} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{varprojlim}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Typesets \ensuremath{\varprojlim} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{ker}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\ker} function name.}% + {} + +\defgcs{lg}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\lg} function name.}% + {} + +\defgcs{lim}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\lim} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{liminf}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\liminf} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{limsup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\limsup} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{ln}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\ln} function name.}% + {} + +\defgcs{log}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\log} function name.}% + {} + +\defgcs{max}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\max} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{min}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\min} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{Pr}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\Pr} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{sec}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\sec} function name.}% + {} + +\defgcs{sin}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\sin} function name.}% + {} + +\defgcs{sinh}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\sinh} function name.}% + {} + +\defgcs{sup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\sup} function name (may have limits via \nxglsi{underscorechar} or \nxglsi{circumchar}).}% + {} + +\defgcs{tan}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\tan} function name.}% + {} + +\defgcs{tanh}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets \ensuremath{\tanh} function name.}% + {} + +\defgcs{infty}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Infinity \ensuremath{\infty} symbol.}% + {} + +\defgcs{partial}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Partial \ensuremath{\partial} symbol.}% + {} + +\defgcs{subset}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Subset \ensuremath{\subset} symbol.}% + {} + +\defgcs{approx}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\approx} symbol.}% + {} + +\defgcs{asymp}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\asymp} symbol.}% + {} + +\defgcs{bowtie}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\bowtie} symbol.}% + {} + +\defgcs{cong}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\cong} symbol.}% + {} + +\defgcs{dashv}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\dashv} symbol.}% + {} + +\defgcs{doteq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{equals symbol with dot on top}{\ensuremath{\doteq}} symbol.}% + {} + +\defgcs{equiv}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{equivalent}{\ensuremath{\equiv}} symbol.}% + {} + +\defgcs{frown}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\frown} symbol.}% + {} + +\defgcs{ge}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{greater than or equal to}{\ensuremath{\ge}} symbol.}% + {} + +\defgcs{geq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{greater than or equal to}{\ensuremath{\geq}} symbol.}% + {} + +\defgcs{gg}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{much greater than}{\ensuremath{\gg}} symbol.}% + {} + +\defgcs{in}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\in} symbol.}% + {} + +\defgcs{le}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{less than or equal to}{\ensuremath{\le}} symbol.}% + {} + +\defgcs{leq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{less than or equal to}{\ensuremath{\leq}} symbol.}% + {} + +\defgcs{ll}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{much less than}{\ensuremath{\ll}} symbol.}% + {} + +\defgcs{mid}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\mid} symbol.}% + {} + +\defgcs{models}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\models} symbol.}% + {} + +\defgcs{neq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{not equal to}{\ensuremath{\neq}} symbol.}% + {} + +\defgcs{ni}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{contains element}{\ensuremath{\ni}} symbol.}% + {} + +\defgcs{notin}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{not element of}{\ensuremath{\notin}} symbol.}% + {} + +\defgcs{parallel}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\parallel} symbol.}% + {} + +\defgcs{prec}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\prec} symbol.}% + {} + +\defgcs{preceq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\preceq} symbol.}% + {} + +\defgcs{perp}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{perpendicular to}{\ensuremath{\perp}} symbol.}% + {} + +\defgcs{propto}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \makeimg{proportional to}{\ensuremath{\propto}} symbol.}% + {} + +\defgcs{sim}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\sim} symbol.}% + {} + +\defgcs{simeq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\simeq} symbol.}% + {} + +\defgcs{smile}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\smile} symbol.}% + {} + +\defgcs{sqsubseteq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\sqsubseteq} symbol.}% + {} + +\defgcs{sqsupseteq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\sqsupseteq} symbol.}% + {} + +\defgcs{subseteq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\subseteq} symbol.}% + {} + +\defgcs{succ}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\succ} symbol.}% + {} + +\defgcs{succeq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\succeq} symbol.}% + {} + +\defgcs{supset}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\supset} symbol.}% + {} + +\defgcs{supseteq}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\supseteq} symbol.}% + {} + +\defgcs{vdash}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Relational \ensuremath{\vdash} symbol.}% + {} + +\defgcs{amalg}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\amalg} symbol.}% + {} + +\defgcs{ast}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \makeimg{asterisk}{\ensuremath{\ast}} symbol.}% + {} + +\defgcs{bullet}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \makeimg{bullet point}{\ensuremath{\bullet}} symbol.}% + {} + +\defgcs{bigcirc}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\bigcirc} symbol.}% + {} + +\defgcs{bigtriangledown}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\bigtriangledown} symbol.}% + {} + +\defgcs{bigtriangleup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\bigtriangleup} symbol.}% + {} + +\defgcs{cap}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\cap} symbol.}% + {} + +\defgcs{cdot}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Centred dot \ensuremath{\cdot} symbol.}% + {} + +\defgcs{circ}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Circle \ensuremath{\circ} symbol.}% + {} + +\defgcs{cup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\cup} symbol.}% + {} + +\defgcs{dagger}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\dagger} symbol.}% + {} + +\defgcs{ddagger}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\ddagger} symbol.}% + {} + +\defgcs{diamond}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\diamond} symbol.}% + {} + +\defgcs{div}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Division operator \ensuremath{\div} symbol.}% + {} + +\defgcs{mp}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Minus or plus operator \makeimg{minus or plus}{\ensuremath{\mp}} symbol.}% + {} + +\defgcs{odot}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\odot} symbol.}% + {} + +\defgcs{ominus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\ominus} symbol.}% + {} + +\defgcs{oplus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\oplus} symbol.}% + {} + +\defgcs{oslash}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\oslash} symbol.}% + {} + +\defgcs{otimes}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\otimes} symbol.}% + {} + +\defgcs{pm}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \makeimg{plus or minus}{\ensuremath{\pm}} symbol.}% + {} + +\defgcs{setminus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\setminus} symbol.}% + {} + +\defgcs{sqcap}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\sqcap} symbol.}% + {} + +\defgcs{sqcup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\sqcup} symbol.}% + {} + +\defgcs{star}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\star} symbol.}% + {} + +\defgcs{times}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\times} symbol.}% + {} + +\defgcs{triangleleft}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\triangleleft} symbol.}% + {} + +\defgcs{triangleright}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Binary operator \ensuremath{\triangleright} symbol.}% + {} + +\defgcs{uplus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\uplus} symbol.}% + {} + +\defgcs{vee}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\vee} symbol.}% + {} + +\defgcs{wedge}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\wedge} symbol.}% + {} + +\defgcs{wr}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Operator \ensuremath{\wr} symbol.}% + {} + +\defgcs{sum}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Summation \ensuremath{\sum} symbol (may take limits).}% + {} + +\defgcs{int}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Integral \ensuremath{\int} symbol (may take limits).}% + {} + +\defgcs{oint}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Closed path integral \ensuremath{\oint} symbol (may take limits).}% + {} + +\defgcs{prod}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Product \ensuremath{\prod} symbol (may take limits).}% + {} + +\defgcs{coprod}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Co-product \ensuremath{\coprod} symbol (may take limits).}% + {} + +\defgcs{bigcap}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Collection intersection \ensuremath{\bigcap} symbol (may take limits).}% + {} + +\defgcs{bigcup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Collection union \ensuremath{\bigcup} symbol (may take limits).}% + {} + +\defgcs{bigsqcup}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigsqcup} (may take limits).}% + {} + +\defgcs{bigvee}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigvee} (may take limits).}% + {} + +\defgcs{bigwedge}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigwedge} (may take limits).}% + {} + +\defgcs{bigodot}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigodot} (may take limits).}% + {} + +\defgcs{bigotimes}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigotimes} (may take limits).}% + {} + +\defgcs{bigoplus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\bigoplus} (may take limits).}% + {} + +\defgcs{biguplus}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Big operator \ensuremath{\biguplus} (may take limits).}% + {} + +\defgcs{not}% + {\meta{symbol command}}% + {\LaTeX\ Kernel (Math Mode)}% + {Negates the following symbol. Example: \cmdname{not}\nxglsi{subset} produces + \ensuremath{\not\subset}.}% + {% + \BeginArgList + \csentryargitem{symbol command} The symbol to be negated. + \EndArgList + } + +\defgcs{ldots}% + {}% + {\LaTeX\ Kernel}% + {Ellipses \ldots\ symbol.}% + {} + +\defgcs{cdots}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Centred ellipses \ensuremath{\cdots} symbol.}% + {} + +\defgcs{vdots}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Vertical ellipses \ensuremath{\vdots} symbol.}% + {} + +\defgcs{ddots}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Diagonal ellipses \ensuremath{\ddots} symbol.}% + {} + +\defgcs{dotsc}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Ellipses \ensuremath{\dotsc} for dots with commas.}% + {} + +\defgcs{dotsb}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Ellipses \ensuremath{\dotsb} for dots with binary + operators\slash relations.}% + {} + +\defgcs{dotsm}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Ellipses \ensuremath{\dotsm} for dots with multiplications.}% + {} + +\defgcs{dotsi}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Ellipses \ensuremath{\dotsi} for dots with integrals.}% + {} + +\defgcs{dotso}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Ellipses \ensuremath{\dotso} for general dots.}% + {} + +\defgcs{langle}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left-angled \ensuremath{\langle} delimiter.}% + {} + +\defgcs{rangle}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right-angled \ensuremath{\rangle} delimiter.}% + {} + +\defgcs{lfloor}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left floor \ensuremath{\lfloor} delimiter.}% + {} + +\defgcs{rfloor}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right floor \ensuremath{\rfloor} delimiter.}% + {} + +\defgcs{lceil}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Left ceil \ensuremath{\lceil} delimiter.}% + {} + +\defgcs{rceil}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Right ceil \ensuremath{\rceil} delimiter.}% + {} + +\defgcs{lvert}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Left vertical bar \ensuremath{\lvert} delimiter.}% + {} + +\defgcs{rvert}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Right vertical bar \ensuremath{\rvert} delimiter.}% + {} + +\defgcs{lVert}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Left double vertical bar \ensuremath{\lVert} delimiter.}% + {} + +\defgcs{rVert}% + {}% + {\nxisty{amsmath} (Math Mode)}% + {Right double vertical bar \ensuremath{\rVert} delimiter.}% + {} + +\defgcs{vec}% + {\marg{\meta{c}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets its argument as a vector (defaults to a right arrow + accent).}% + {% + \BeginArgList + \csentryargitem{c} The character or symbol that represents a vector. + \EndArgList + } + +\defgcs{forall}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {\dq{For all} \ensuremath{\forall} symbol.}% + {} + + +\defgcs{noindent}% + {}% + {\LaTeX\ Kernel}% + {Suppress the indentation that would usually occur at the start of + the next paragraph.}% + {} + +\defgcs{refstepcounter}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Increments the value of the given counter by one and allows the + counter to be cross-referenced using \nxglsni{ref} and \nxglsi{label}.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter that needs + incrementing. + \EndArgList + } + +\defgcs{stepcounter}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Increments the value of the given counter by one.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter that needs + incrementing. + \EndArgList + } + +\defgcs{setcounter}% + {\marg{\meta{counter}}\marg{\meta{number}}}% + {\LaTeX\ Kernel}% + {Sets the value of a counter.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter that needs + changing. + \csentryargitem{number} The new value. (Must be an integer.) + \EndArgList + } + +\defgcs{addtocounter}% + {\marg{\meta{counter}}\marg{\meta{increment}}}% + {\LaTeX\ Kernel}% + {Increments the value of a counter by the given amount.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter that needs + changing. + \csentryargitem{number} The amount by which to increment the counter. (Must be an integer.) + \EndArgList + } + +\defgcs{newcounter}% + {\marg{\meta{counter}}\oarg{\meta{outer counter}}}% + {\LaTeX\ Kernel}% + {Defines a new counter.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the new counter. + \csentryargitem{outer counter} The name of the parent counter. + \EndArgList + } + + +\defgcs{value}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {References the value of the given counter where a number rather + than a counter name is required.}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{parindent}% + {}% + {\LaTeX\ Kernel}% + {A \nxglsi{length} register that stores the indentation at the start of paragraphs.}% + {} + + +\defgcs{setlength}% + {\marg{\meta{register}}\marg{\meta{dimension}}}% + {\LaTeX\ Kernel}% + {Sets the value of a length register.}% + {% + \BeginArgList + \csentryargitem{register} The name of the length register (for + example \nxglsi{parindent}). + \csentryargitem{dimension} The new dimension. + \EndArgList + } + +\defgcs{addtolength}% + {\marg{\meta{register}}\marg{\meta{dimension}}}% + {\LaTeX\ Kernel}% + {Adds \meta{dimension} to the value of the given length register.}% + {% + \BeginArgList + \csentryargitem{register} The name of the length register (for + example \nxglsi{parindent}). + \csentryargitem{dimension} The dimension to add to the length. + \EndArgList + } + +\defgcs{currenttime}% + {}% + {\nxisty{datetime} package}% + {Inserts into the output file the time when the \LaTeX\ + application created it from the source code.}% + {} + +\defgcs{ddmmyyyydate}% + {}% + {\nxisty{datetime} package}% + {Changes the format of \nxglsi{today} so that it displays the date in + the form {\ddmmyyyydate\today} (day\slash month\slash year in digits).}% + {} + +\defgcs{subref}% + {\marg{\meta{label}}}% + {\nxisty{subcaption} package}% + {Analogous to \nxglsi{ref} but only references the subfigure + or subtable caption.}% + {% + \BeginArgList + \csentryargitem{label} The required label that was used in the + corresponding \nxglsi{label}. + \EndArgList + } + +\defgcs{eqref}% + {\marg{\meta{label}}}% + {\nxisty{amsmath} package}% + {Short cut for \texttt{(\nxglsi{ref}\marg{\meta{label}})} for + referencing equations.}% + {% + \BeginArgList + \csentryargitem{label} The required label that was used in the + corresponding \nxglsi{label}. + \EndArgList + } + +\defgcs{frenchspacing}% + {}% + {\LaTeX\ Kernel}% + {Switch to French spacing.}% + {} + +\defgcs{nonfrenchspacing}% + {}% + {\LaTeX\ Kernel}% + {Switch to English spacing.}% + {} + +\defgcs{newline}% + {}% + {\LaTeX\ Kernel}% + {Forces a line break.}% + {} + +\defgcs{linebreak}% + {\oarg{\meta{n}}}% + {\LaTeX\ Kernel}% + {Requests a line break, ensuring the paragraph remains justified. + This may cause excess white space in the paragraph.}% + {% + \BeginArgList + \csentryargitem{n} An integer from~0 to~4 indicating how strongly + you want a line break to occur. The higher the number, the + stronger the request to break the line. + \EndArgList + } + +\defgcs{displaybreak}% + {\oarg{\meta{n}}}% + {\nxisty{amsmath} package}% + {Allows a page break in multi-lined maths environments, such as + \nxglsi{env-align}.}% + {% + \BeginArgList + \csentryargitem{n} An integer from~0 to~4 indicating how strongly + you want a page break to occur. The higher the number, the + stronger the request. + \EndArgList + } + +\defgsymcs[beginmath]{\openparensym}% + {}% + {\LaTeX\ Kernel}% + {Equivalent to \nxglsni{begin}\marg{math}.}% + {} + +\defgsymcs[endmath]{\closeparensym}% + {}% + {\LaTeX\ Kernel}% + {Equivalent to \nxglsni{end}\marg{math}.}% + {} + +\defgchar + {openparen} + {\openparensym} + {} + {\LaTeX\ Kernel} + {% + Opening parenthesis in text mode or left round bracket + delimiter in math mode.% + } + {} + +\defgchar + {closeparen} + {\closeparensym} + {} + {\LaTeX\ Kernel} + {% + Closing parenthesis in text mode or right round bracket + delimiter in math mode.% + } + {} + +\defgsymcs[begindispmath]{\opensqsym}% + {}% + {\LaTeX\ Kernel (inconsistency corrected in \nxisty{amsmath})}% + {Starts an unnumbered single-line of displayed maths.}% + {} + +\defgsymcs[enddispmath]{\closesqsym}% + {}% + {\LaTeX\ Kernel (inconsistency corrected in \nxisty{amsmath})}% + {Ends an unnumbered single-line of displayed maths.}% + {} + +\defgchar + {opensq} + {\opensqsym} + {} + {\LaTeX\ Kernel} + {\nopostdesc} + {} + +\defgchildchar + {opt.opensq} + {opensq} + {\opensqsym} + {Open delimiter of an \nxglsi{optional}} + +\defgchildchar + {text.opensq} + {opensq} + {\opensqsym} + {Open square bracket in text mode} + +\defgchildchar + {delimiter.opensq} + {opensq} + {\opensqsym} + {Left square bracket delimiter in math mode} + +\defgchar + {closesq} + {\closesqsym} + {} + {\LaTeX\ Kernel} + {\nopostdesc} + {} + +\defgchildchar + {opt.closesq} + {closesq} + {\closesqsym} + {Closing delimiter of an \nxglsi{optional}} + +\defgchildchar + {text.closesq} + {closesq} + {\closesqsym} + {Closing square bracket in text mode} + +\defgchildchar + {delimiter.closesq} + {closesq} + {\closesqsym} + {Right square bracket delimiter in math mode} + +\defgsymcs[comma]{\commasym}% + {}% + {\LaTeX\ Kernel}% + {Thin space.}% + {} + +\defgcs{thinspace}% + {}% + {\LaTeX\ Kernel}% + {Thin space.}% + {} + +\defgsymcs[colon]{\colonsym}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Medium space.}% + {} + +\defgcs{medspace}% + {}% + {\nxisty{amsmath} package}% + {Medium space.}% + {} + +\defgsymcs[semicolon]{\semicolonsym}% + {}% + {\LaTeX\ Kernel (Math Mode)}% + {Thick space.}% + {} + +\defgcs{thickspace}% + {}% + {\nxisty{amsmath} package}% + {Thick space.}% + {} + +\defgcs{qquad}% + {}% + {\LaTeX\ Kernel}% + {Horizontal spacing command (twice as wide as \nxglsni{quad}).}% + {} + +\defgsymcs[spacesym]{\textvisiblespace}% + {}% + {\LaTeX\ Kernel}% + {(Backslash followed by space character.) Horizontal spacing command.}% + {} + +\defgcs{enspace}% + {}% + {\LaTeX\ Kernel}% + {Horizontal spacing command (half as wide as \nxglsi{quad}).}% + {} + +\defgcs{quad}% + {}% + {\LaTeX\ Kernel}% + {Horizontal spacing command equal to the current font's \protect\htmlref{em}{sec:length} value.}% + {} + +\defgcs{negthinspace}% + {}% + {\LaTeX\ Kernel}% + {Negative thin space.}% + {} + +\defgcs{negmedspace}% + {}% + {\nxisty{amsmath} package}% + {Negative medium space.}% + {} + +\defgcs{negthickspace}% + {}% + {\nxisty{amsmath} package}% + {Negative thick space.}% + {} + +\defgcs{contentsname}% + {}% + {Classes or packages that define a table of contents}% + {Text used for table of contents heading.}% + {} + +\defgcs{listfigurename}% + {}% + {Classes or packages that define a list of figures}% + {Text used for list of figures heading.}% + {} + +\defgcs{listtablename}% + {}% + {Classes or packages that define a list of tables}% + {Text used for list of tables heading.}% + {} + +\defgcs{bibname}% + {}% + {Report or book style classes that define a bibliography chapter}% + {Text used for bibliography chapter heading. (See also + \nxglsi{refname}.)}% + {} + +\defgcs{refname}% + {}% + {Article style classes that define a bibliography section}% + {Text used for bibliography section heading. (See also + \nxglsi{bibname}.)}% + {} + +\defgcs{indexname}% + {}% + {Classes or packages that define an index section}% + {Text used for index heading.}% + {} + +\defgcs{figurename}% + {}% + {Classes or packages that define figures}% + {Number prefix used in figure captions.}% + {} + +\defgcs{tablename}% + {}% + {Classes or packages that define tables}% + {Number prefix used in table captions.}% + {} + +\defgcs{partname}% + {}% + {Classes or packages that define parts with a number prefix}% + {Number prefix used in part headings.}% + {} + +\defgcs{chaptername}% + {}% + {Classes or packages that define chapters}% + {Number prefix used in chapter headings.}% + {} + +\defgcs{appendixname}% + {}% + {Classes or packages that define chapters}% + {Number prefix used in appendix headings.}% + {} + +\defgcs{abstractname}% + {}% + {Classes or packages that define an \nxglsni{env-abstract} + environment}% + {Text used in abstract heading.}% + {} + +\defgcs{addto}% + {\marg{\meta{command}}\marg{\meta{code}}} + {\nxisty{babel} package} + {Adds \meta{code} to the definition of \meta{command}. (See also \nxglsni{appto}.)} + {% + \BeginArgList + \csentryargitem{command} The command that needs patching. + \csentryargitem{code} The additional code to add to the command +definition. + \EndArgList + } + +\defgcs{appto}% + {\marg{\meta{command}}\marg{\meta{code}}} + {\nxisty{etoolbox} package} + {Adds \meta{code} to the definition of \meta{command}.} + {% + \BeginArgList + \csentryargitem{command} The command that needs patching. + \csentryargitem{code} The additional code to add to the command definition. + \EndArgList + } + +\defgcs{mathrm}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Renders \meta{maths} in the predefined maths serif font.}% + {% + \BeginArgList + \csentryargitem{maths} The text on which to apply the font change. + \EndArgList + } + +\defgcs{mathsf}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Renders \meta{maths} in the predefined maths sans-serif font.}% + {% + \BeginArgList + \csentryargitem{maths} The text on which to apply the font change. + \EndArgList + } + +\defgcs{mathtt}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Renders \meta{maths} in the predefined maths typewriter font.}% + {% + \BeginArgList + \csentryargitem{maths} The text on which to apply the font change. + \EndArgList + } + +\defgcs{mathit}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Renders \meta{maths} in the predefined maths italic font.}% + {% + \BeginArgList + \csentryargitem{maths} The text on which to apply the font change. + \EndArgList + } + +\defgcs{mathbf}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Renders \meta{maths} in the predefined maths bold font. (Doesn't + work with numbers and nonalphabetical symbols.) See also \nxglsi{boldsymbol}.}% + {% + \BeginArgList + \csentryargitem{maths} The text on which to apply the font change. + \EndArgList + } + +\defgcs{boldsymbol}% + {\marg{\meta{symbol}}}% + {\nxisty{amsmath} package (Math Mode)}% + {Like \nxglsi{mathbf} but also works for numbers and + many nonalphabetical symbols. (See also \nxglsi{pmb}.)}% + {% + \BeginArgList + \csentryargitem{symbol} The character or symbol on which to apply the font change. + \EndArgList + } + +\defgcs{pmb}% + {\marg{\meta{symbol}}}% + {\nxisty{amsmath} package (Math Mode)}% + {\dq{Poor man's bold.} Overlays multiple copies of the symbol to + produce a bold effect for symbols that don't work with + \nxglsi{boldsymbol}.}% + {% + \BeginArgList + \csentryargitem{symbol} The symbol on which to apply the bold + effect. + \EndArgList + } + +\defgcs{mathcal}% + {\marg{\meta{maths}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Typesets its argument in the maths calligraphic font. + Example: \nxglsni{beginmath}\protect\cmdname{mathcal}\marg{S}\nxglsni{endmath} produces + \ensuremath{\mathcal{S}}.}% + {% + \BeginArgList + \csentryargitem{maths} The maths to be displayed in a calligraphic + font. + \EndArgList + } + +\defgcs{mathbb}% + {\marg{\meta{maths}}}% + {\nxisty{amsfonts} package (Math Mode)}% + {Typesets its argument in the blackboard bold font. + Example: \nxglsni{beginmath}\protect\cmdname{mathbb}\marg{R}\nxglsni{endmath} produces + \ensuremath{\mathbb{R}}.}% + {% + \BeginArgList + \csentryargitem{maths} The maths to be displayed in a blackboard + bold font. + \EndArgList + } + +\defgcs{mathfrak}% + {\marg{\meta{maths}}}% + {\nxisty{amsfonts} package (Math Mode)}% + {Typesets its argument in Euler Fraktur letters. + Example: \nxglsni{beginmath}\protect\cmdname{mathfrak}\marg{U}\nxglsni{endmath} produces + \ensuremath{\mathfrak{U}}.}% + {% + \BeginArgList + \csentryargitem{maths} The maths to be displayed in Euler Fraktur + letters. + \EndArgList + } + +\defgcs{DeclareMathOperator}% + {\marg{\meta{cmd}}\marg{\meta{operator-name}}}% + {\nxisty{amsmath} package (Preamble Only)}% + {Defines a new maths operator. The starred version allows limits.}% + {% + \BeginArgList + \csentryargitem{cmd} The name of the new operator command (must + begin with a backslash). + \csentryargitem{operator name} The name of the maths operator. + \EndArgList + } + +\defgcs{frac}% + {\marg{\meta{numerator}}\marg{\meta{denominator}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Displays a fraction.}% + {% + \BeginArgList + \csentryargitem{numerator} The numerator (above the line). + \csentryargitem{denominator} The denominator (below the line). + \EndArgList + } + +\defgcs{cfrac}% + {\oarg{\meta{pos}}\marg{\meta{numerator}}\marg{\meta{denominator}}}% + {\nxisty{amsmath} (Math Mode)}% + {Displays a continued fraction.}% + {% + \BeginArgList + \csentryargitem{pos} May be \texttt{l} (left) or \texttt{r} + (right). + \csentryargitem{numerator} The numerator (above the line). + \csentryargitem{denominator} The denominator (below the line). + \EndArgList + } + +\defgcs{sqrt}% + {\oarg{\meta{order}}\marg{\meta{operand}}}% + {\LaTeX\ Kernel (Math Mode)}% + {Displays a root.}% + {% + \BeginArgList + \csentryargitem{order} The order of the root. (If omitted, a + square root). + \csentryargitem{operand} The operand. + \EndArgList + } + +\defgcs{arabic}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as an Arabic number. (1, 2, 3, \ldots)}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{roman}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as a lower case Roman number. (i, ii, iii, \ldots)}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{Roman}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as an upper case Roman number. (I, II, III, \ldots)}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{alph}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as a lower case letter. (a, b, c, \ldots, z)}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{Alph}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as an upper case letter. (A, B, C, \ldots, Z)}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgcs{fnsymbol}% + {\marg{\meta{counter}}}% + {\LaTeX\ Kernel}% + {Displays counter value as footnote symbol. (\makeimg{asterisk + dagger double dagger section mark + paragraph mark double bar double asterisk two single daggers + two double daggers}{\footnotesymbols})}% + {% + \BeginArgList + \csentryargitem{counter} The name of the counter. + \EndArgList + } + +\defgenv{bfseries}% + {}% + {\LaTeX\ Kernel}% + {Typesets the environment contents in a bold font.}% + {} + +\defgenv{itshape}% + {}% + {\LaTeX\ Kernel}% + {Typesets the environment contents in an italic font.}% + {} + +\defgenv{em}% + {}% + {\LaTeX\ Kernel}% + {Typesets the environment contents in an emphasized font. (Switches + to italic\slash slanted if the surrounding font is upright, or switches to + upright if the surrounding font is italic\slash slanted.)}% + {} + +\defgenv{itemize}% + {}% + {\LaTeX\ Kernel}% + {Unordered list.}% + {} + +\defgenv{enumerate}% + {}% + {\LaTeX\ Kernel}% + {Ordered list.}% + {} + +\defgenv{description}% + {}% + {Most class files}% + {Labelled list.}% + {} + +\defgenv{document}% + {}% + {\LaTeX\ Kernel}% + {The body of the document.}% + {} + +\defgenv{tabular}% + {\oarg{\meta{v-pos}}\marg{\meta{column specifiers}}}% + {\LaTeX\ Kernel (Text Mode)}% + {% + Environment for lining things up in rows and columns. + Use \nxglsi{env-array} for math mode. + }% + {% + \BeginArgList + \csentryargitem{v-pos} Vertical alignment of the entire + environment with respect to the surrounding baseline. May be + one of \texttt{t} (top), \texttt{b} (bottom) or \texttt{c} + (centered). + \csentryargitem{column specifiers} Indicates how to align the + columns. + \EndArgList + } + +\defgenv{array}% + {\oarg{\meta{v-pos}}\marg{\meta{column specifiers}}}% + {\LaTeX\ Kernel (Math Mode)}% + {% + Environment for lining things up in rows and columns. + Use \nxglsi{env-tabular} for text mode. + }% + {% + \BeginArgList + \csentryargitem{v-pos} Vertical alignment of the entire + environment with respect to the surrounding baseline. May be + one of \texttt{t} (top), \texttt{b} (bottom) or \texttt{c} + (centered). + \csentryargitem{column specifiers} Indicates how to align the + columns. + \EndArgList + } + +\defgenv{align} + {} + {\nxisty{amsmath} package} + {Used for numbered aligned equations.} + {} + +\defgenv{align*} + {} + {\nxisty{amsmath} package} + {Used for unnumbered aligned equations.} + {} + +\defgenv{minipage}% + {\oarg{\meta{pos}}\oarg{\meta{height}}\marg{\meta{width}}}% + {\LaTeX\ Kernel}% + {Makes a box with line-wrapped contents. (See also \nxglsi{parbox}.)}% + {% + \BeginArgList + \csentryargitem{pos} The vertical alignment of the box relative to + the surrounding text. (Centred if omitted.) + \csentryargitem{height} The height of the box. (If omitted the + height is the natural height of the contents of the box.) + \csentryargitem{width} The width of the box. + \EndArgList + } + +\defgenv{abstract}% + {}% + {Most article- or report-style classes, such as \nxicls{scrartcl} or + \nxicls{scrreprt}. Not usually defined in book-style classes, such + as \nxicls{scrbook}, but is defined in \nxicls{memoir}}% + {Displays its contents as an abstract.}% + {} + +\defgenv{thebibliography}% + {\marg{\meta{widest entry label}}}% + {Most classes that define sectioning commands}% + {Bibliographic list. (See also \nxglsi{bibitem} and + \nxglsi{cite}).}% + {% + \BeginArgList + \csentryargitem{widest entry label} The widest label in the + bibliography list. + \EndArgList + } + +\defgenv{otherlanguage} + {\marg{\meta{language name}}}% + {\nxisty{babel} package}% + {Within the environment contents, predefined textual elements, such + as the date given by \nxglsi{today} or prefixes like \dq{Chapter}, + are set to those supplied by the given language.}% + {% + \BeginArgList + \csentryargitem{language} The language identifier. + \EndArgList + } + +\defgenv{figure} + {\oarg{\meta{placement}}}% + {Most classes that define sectioning commands}% + {% + Floats the contents to the nearest location according to the + preferred placement options, if possible. Within the environment, + \nxglsi{caption} may be used one or more times, as required. + The caption will usually include the prefix given by + \nxglsni{figurename}. + }% + {% + \BeginArgList + \csentryargitem{placement} The preferred placement. + \EndArgList + } + +\defgenv{sidewaysfigure}% + {}% + {\nxisty{rotating} package}% + {Like the \nxglsi{env-figure} environment but rotates the entire + figure (including caption) sideways.}% + {} + +\defgenv{table} + {\oarg{\meta{placement}}}% + {Most classes that define sectioning commands}% + {% + Floats the contents to the nearest location according to the + preferred placement options, if possible. Within the environment, + \nxglsi{caption} may be used one or more times, as required. + The caption will usually include the prefix given by + \nxglsni{tablename}. + }% + {% + \BeginArgList + \csentryargitem{placement} The preferred placement. + \EndArgList + } + +\defgenv{sidewaystable}% + {}% + {\nxisty{rotating} package}% + {Like the \nxglsi{env-table} environment but rotates the entire + table (including caption) sideways.}% + {} + +\defgenv{subfigure}% + {\oarg{\meta{pos}}\marg{\meta{width}}}% + {\nxisty{subcaption} package}% + {Used to form a subfigure within a \nxglsi{env-figure} + environment. The \nxglsi{caption} command may be used in this + environment to produce a subcaption.}% + {% + \BeginArgList + \csentryargitem{pos} The vertical alignment of the box relative to + the surrounding text. (Centred if omitted.) + \csentryargitem{width} The width of the box. + \EndArgList + } + +\defgenv{subtable}% + {\oarg{\meta{pos}}\marg{\meta{width}}}% + {\nxisty{subcaption} package}% + {Used to form a subtable within a \nxglsni{env-table} + environment. The \nxglsi{caption} command may be used in this + environment to produce a subcaption.}% + {% + \BeginArgList + \csentryargitem{pos} The vertical alignment of the box relative to + the surrounding text. (Centred if omitted.) + \csentryargitem{width} The width of the box. + \EndArgList + } + +\defgenv{equation}% + {}% + {\LaTeX\ Kernel}% + {Displays its contents as a single-lined numbered equation.}% + {} + +\defgenv{displaymath}% + {}% + {\LaTeX\ Kernel}% + {Displays its contents as a single-lined unnumbered equation.}% + {} + +\defgenv{math}% + {}% + {\LaTeX\ Kernel}% + {Sets its contents in in-line math mode.}% + {} + +\defgenv{cases}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but adds a left + brace start delimiter and an invisible end delimiter. + }% + {} + +\defgenv{matrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument. + }% + {} + +\defgenv{pmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument and adds round bracket delimiters. + }% + {} + +\defgenv{smallmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment but doesn't have an + argument and is designed for in-line maths. + }% + {} + +\defgenv{bmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument and adds square bracket delimiters. + }% + {} + +\defgenv{Bmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument and adds curly brace delimiters. + }% + {} + +\defgenv{vmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument and adds single vertical bar delimiters. + }% + {} + +\defgenv{Vmatrix}% + {}% + {\nxisty{amsmath} package (Math Mode)}% + {% + Like the \nxglsi{env-array} environment, but doesn't have an + argument and adds double vertical bar delimiters. + }% + {} + +\defgcs{raggedright}% + {}% + {\LaTeX\ Kernel}% + {Ragged-right paragraph justification.}% + {} + +\defgcs{raggedleft}% + {}% + {\LaTeX\ Kernel}% + {Ragged-left paragraph justification.}% + {} + +\defgcs{frontmatter} + {}% + {Most book-style classes, such as \nxicls{scrbook}}% + {Switches to lower case Roman numeral page numbering. Also suppresses + chapter and section numbering, but still adds unstarred sectional + units to the table of contents. (See also \nxglsi{mainmatter} + and \nxglsi{backmatter}.)}% + {} + +\defgcs{mainmatter} + {}% + {Most book-style classes, such as \nxicls{scrbook}}% + {Switches to Arabic page numbering and enables + chapter and section numbering. (See also + \nxglsi{frontmatter} and \nxglsi{backmatter}.)}% + {} + +\defgcs{backmatter} + {}% + {Most book-style classes, such as \nxicls{scrbook}}% + {Suppresses chapter and section numbering, but still adds unstarred + sectional units to the table of contents. (See also \nxglsi{frontmatter} + and \nxglsi{mainmatter}.)}% + {} + +\defgenv{dinglist} + {\marg{\meta{number}}} + {\nxisty{pifont} package} + {A list where the item marker is given by character \meta{number} + in the Zapf Dingbats font.} + {% + \BeginArgList + \csentryargitem{number} The character code for the item marker. + \EndArgList + } + +\defgcs{notag}% + {}% + {\nxisty{amsmath} package}% + {Suppresses equation numbering for the current row in environments such as + \nxglsi{env-align}.}% + {} + +\defgcs{tag}% + {\marg{\meta{tag}}}% + {\nxisty{amsmath} package}% + {Overrides equation numbering for the current row in environments such as + \nxglsi{env-align}.}% + {% + \BeginArgList + \csentryargitem{tag} The replacement for the equation number. + \EndArgList + } + +\defgcs{ding}% + {\marg{\meta{n}}}% + {\nxisty{pifont} package}% + {Inserts PostScript ZapfDingbats character with code \meta{n}, + which must be an integer.}% + {% + \BeginArgList + \csentryargitem{n} The decimal code of the required character. + \EndArgList + } + +\defgcs{color}% + {\oarg{\meta{model}}\marg{\meta{specs}}}% + {\nxisty{color} and \nxisty{xcolor} packages}% + {A declaration that switches the current foreground colour to the given specification.}% + {% + \BeginArgList + \csentryargitem{model} The colour model, for example + \texttt{rgb} or \texttt{named}. + \csentryargitem{specs} The colour specification for the + given model. For example, if the \texttt{rgb} model is chosen, + \meta{specs} must be a comma-separated list of three numbers + each between~0 and~1. + \EndArgList + } + +\defgcs{textcolor}% + {\oarg{\meta{model}}\marg{\meta{specs}}\marg{\meta{text}}}% + {\nxisty{color} and \nxisty{xcolor} packages}% + {Sets \meta{text} with the foreground colour according to the given \meta{specs}.}% + {% + \BeginArgList + \csentryargitem{\meta{model}} The colour model, for example + \texttt{rgb} or \texttt{named}. + \csentryargitem{\meta{specs}} The colour specification for the + given model. For example, if the \texttt{rgb} model is chosen, + \meta{specs} must be a comma-separated list of three numbers + each between~0 and~1. + \csentryargitem{\meta{text}} The text to be displayed in the + given colour. + \EndArgList + } + +\defgcs{tabcolsep} + {}% + {\LaTeX\ Kernel}% + {\nxGls{length} register specifying half the gap between + columns in a \nxglsni{env-tabular} environment.}% + {} + +\defgcs{arraycolsep} + {}% + {\LaTeX\ Kernel}% + {\nxGls{length} register specifying half the gap between + columns in an \nxglsni{env-array} environment.}% + {} + + +\defgcs{labelformat}% + {\marg{\meta{ctr}}\marg{\meta{defn}}}% + {\nxisty{fncylab} package}% + {Defines how the label for the counter \meta{ctr} should be + formatted. The definition \meta{defn} should use \texttt{\nxglsi{hashchar}1} to + indicate the label value.}% + {% + \BeginArgList + \csentryargitem{ctr} The name of the counter. + \csentryargitem{defn} How to display the value of the counter. + \EndArgList + } + +\defgcs{thefootnote}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{footnote} counter}% + {} + +\defgcs{thechapter}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{chapter} counter}% + {} + +\defgcs{thesection}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{section} counter}% + {} + +\defgcs{thepage}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{page} counter}% + {} + +\defgcs{thefigure}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{figure} counter}% + {} + +\defgcs{thetable}% + {}% + {\LaTeX\ Kernel}% + {Displays the current value of the \nxicounter{table} counter}% + {} + +\defgcs{ignorespaces} + {} + {\LaTeX\ Kernel} + {Used in begin environment code to suppress any spaces occurring + at the start of the environment (see also \nxglsni{ignorespacesafterend}).} + {} + +\defgcs{ignorespacesafterend}% + {}% + {\LaTeX\ Kernel}% + {Used in end environment code to suppress any spaces following the + end of the environment.}% + {} + +\defgcs{textbar}% + {}% + {\LaTeX\ Kernel}% + {Vertical bar \textbar\ symbol.}% + {} + +\defgcs{the}% + {\meta{register}}% + {\LaTeX\ Kernel}% + {Displays the value of the given register (such as a \nxglsi{length} register). + Not to be confused with \cmdname{the}\meta{ctr} commands, such as \nxglsni{thefigure}.}% + {% + \BeginArgList + \csentryargitem{register} The name of the register. + \EndArgList + } + +\defgcs{substack}% + {\marg{\meta{maths}}}% + {\nxisty{amsmath} package}% + {Can be used to produce a multiline subscript or superscript. Lines + are separated using \nxglsi{tab.dbbackslashchar}.}% + {% + \BeginArgList + \csentryargitem{maths} The subscript or superscript maths with rows + ended using \nxglsi{tab.dbbackslashchar} + \EndArgList + } + +\defgcs{DeclareCaptionLabelFormat} + {\marg{\meta{name}}\marg{\meta{code}}} + {\nxisty{caption}} + {Used to defined your own caption label formats.} + {% + \BeginArgList + \csentryargitem{name} The name used to identify this new format + \csentryargitem{code} The code that defines this format + (\nxglsi{hashchar}1 gets replaced with the name and \nxglsni{hashchar}2 + gets replaced with the reference number.) + \EndArgList + } + +\defgcs{captionsetup} + {\oarg{\meta{float type}}\marg{\meta{options}}} + {\nxisty{caption} package} + {Used to set up the options affecting float captions.} + {% + \BeginArgList + \csentryargitem{float type} The float type. + \csentryargitem{options} A \meta{key}=\meta{value} + comma-separated list of options. + \EndArgList + } + diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/keywords.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/keywords.tex new file mode 100644 index 00000000000..710054f547d --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/keywords.tex @@ -0,0 +1,129 @@ +\newkeyword[\glstockey={Source Code}]{source}{source code} + +\newkeyword[\glstockey={Output File}]{output}{output file} + +\newkeyword + [firstplural={\protect\emph{DVI (DeVice Independent) files}}, + \glstockey={DVI File}] +{dvi}{DVI file} + +\newkeyword + [\glsindexkey={auxiliary file (.aux)@auxiliary file (\texttt{.aux})}, + \glsextrakey={\extraindexaux}, + name={Auxiliary Files},\glstockey={Auxiliary Files}] + {auxiliary}{auxiliary file} + +\newkeyword + [name={Terminal or Command Prompt},% + \glsextrakey={\extraindexterminal}, + \glstockey={Terminal or Command Prompt} + ] +{terminal}{terminal} + +\newkeyword + [name={Commands},\glstockey={Commands}] + {command}{command} + +\newkeyword + [name={Grouping (or Scope)},% + \glsextrakey={\extraindexgroup}, + \glstockey={Grouping (or Scope)} + ] + {group}{group}% + +\newkeyword + [name={Arguments (also called \dq{Parameters})},% + \glsextrakey={\extraindexarg}, + \glstockey={Arguments} + ] +{argument}{argument}% + +\newkeyword + [parent=argument, + \glsindexkey={argument!mandatory}, + \glsextrakey={\extraindexmandatory}, + first={mandatory (or compulsory) argument}, + firstplural={mandatory (or compulsory) arguments}, + name={Mandatory Arguments}, + \glstockey={Mandatory Arguments} + ] +{mandatory}{mandatory argument} + +\newkeyword + [parent=argument, + \glsindexkey={argument!optional}, + \glsextrakey={\extraindexoptional}, + name={Optional Arguments}, + \glstockey={Optional Arguments} +] +{optional}{optional argument} + + +\newkeyword + [\glsextrakey={\extraindexfragile}, + \glsindexkey={command!fragile}, + \glstockey={Moving Arguments and Fragile Commands}, + name={Moving Arguments and Fragile Commands} + ] +{fragile}{fragile command} + +\newkeyword + [name={Robust Commands}, + \glstockey={Robust Commands}, + \glsindexkey={command!robust}, + \glsextrakey={\extraindexrobust} + ] +{robust}{robust command}% + +\newkeyword + [name={Short and Long Commands}, + \glstockey={Short and Long Commands}, + \glsindexkey={command!short}, + \glsextrakey={\extraindexshortlong}] +{short}{short command}% + + +\newkeyword +[name={Declarations},\glstockey={Declarations}] +{declaration}{declaration} + + +\newkeyword +[name={Inter-Sentence Spacing}, + \glstockey={Inter-Sentence Spacing}, + \glsindexkey={spacing!inter-sentence}, + \glsextrakey={\extraindexsentencespacing} +] +{intersentencespacing}{inter-sentence spacing}% + +\newkeyword + [\glsingkey={hyphenating}, + \glsdkey={hyphenated}, + \glstockey={Hyphenation}] + {hyphenation}{hyphenation} + +\newkeyword +[name={Environments}, + \glstockey={Environments}] +{environment}{environment}% + +\newkeyword +[name={The Preamble}, + \glstockey={The Preamble}] +{preamble}{preamble}% + + +\newkeyword +[name={Lengths},\glstockey={Lengths}] +{length}{length} + +\newkeyword[\glstockey={Class File}]{cls}{class file}% + +\newkeyword +[\glsindexkey={TeX@\protect\TeX},\glstockey={\texorpdfstring{\protect\TeX}{TeX}}] +{tex}{\TeX} + +\newkeyword{perl}{Perl} + +\glsaddall[types=keywords] +\glsunsetall[keywords] diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-a4paper.sty b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-a4paper.sty new file mode 100644 index 00000000000..83f13d7c143 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-a4paper.sty @@ -0,0 +1,56 @@ +% This is part of the source code for "LaTeX for Complete Novices" +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{novices-a4paper} +\DeclareOption{draft}{\PassOptionsToPackage{draft}{flowfram}} +\DeclareOption{final}{\PassOptionsToPackage{final}{flowfram}} +\DeclareOption{rotate}{\PassOptionsToPackage{rotate}{flowfram}} +\DeclareOption{norotate}{\PassOptionsToPackage{norotate}{flowfram}} +\DeclareOption{ttbtitle}{\PassOptionsToPackage{ttbtitle}{flowfram}} +\DeclareOption{ttbnotitle}{\PassOptionsToPackage{ttbnotitle}{flowfram}} +\DeclareOption{ttbnum}{\PassOptionsToPackage{ttbnum}{flowfram}} +\DeclareOption{ttbnonum}{\PassOptionsToPackage{ttbnonum}{flowfram}} +\DeclareOption{color}{\PassOptionsToPackage{color}{flowfram}} +\DeclareOption{nocolor}{\PassOptionsToPackage{nocolor}{flowfram}} +\ProcessOptions +\RequirePackage{flowfram} +\RequirePackage{pgf} +\RequirePackage[a4paper,portrait]{geometry} +\geometry{lmargin=72.0bp,rmargin=72.0bp,tmargin=72.0bp,bmargin=72.0bp} +\newflowframe[none]{454.599976bp}{699.400024bp}{-0.5bp}{-1.008956bp}[title] + +\newflowframe[all]{411.496185bp}{699.400024bp}{-0.535362bp}{-1.008956bp}[main] + +\newdynamicframe[none]{87.388458bp}{699.400024bp}{424.311615bp}{-1.008956bp}[sidepanel] + +\setdynamicframe*{sidepanel}{valign=t} +\newdynamicframe[all]{411.529968bp}{22.599998bp}{-0.561401bp}{711.79107bp}[header] + +\setdynamicframe*{header}{valign=t} +\newdynamicframe[all]{411.529938bp}{22.600037bp}{-0.562958bp}{-37.008956bp}[footer] + +\setdynamicframe*{footer}{valign=t} +\newflowframe[none]{194.866699bp}{699.400024bp}{-0.189491bp}{-1.008956bp}[left] + +\newflowframe[none]{194.863831bp}{699.400024bp}{215.810486bp}{-1.008956bp}[right] + +\newflowframe[none]{411.268066bp}{162.321106bp}{-0.430183bp}{535.4442bp}[header] + +\newflowframe[none]{194.866699bp}{522.889465bp}{-0.189491bp}{-1.157531bp}[leftshort] + +\newflowframe[none]{194.866699bp}{522.889465bp}{215.810516bp}{-1.157531bp}[rightshort] + +\renewcommand{\@dothehead}{}% +\renewcommand{\@dodynamicthehead}{% +\@dynamicframeid{header}% +\expandafter +\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{% +\vfill\@thehead\vfill}% +}% +\renewcommand{\@dothefoot}{}% +\renewcommand{\@dodynamicthefoot}{% +\@dynamicframeid{footer}% +\expandafter +\def\csname @dynamicframe@\romannumeral\ff@id\endcsname{% +\vfill\@thefoot\vfill}% +}% +\endinput diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-index.ist b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-index.ist new file mode 100644 index 00000000000..7988340cddd --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices-index.ist @@ -0,0 +1,18 @@ +% MakeIndex style file novices.ist +heading_prefix "\\indexheader{" +heading_suffix "}\\relax " +headings_flag 1 + +group_skip "" +item_0 "\n \\mainindexitem{" +delim_0 "}{" +item_x1 "}\\relax\n \\subindexitem{" +delim_t "}\\relax " +item_1 "\n \\subindexitem{" +item_2 "\n \\subsubindexitem{" +item_01 "\n \\subindexitem{" +item_12 "\n \\subsubindexitem{" + +delim_1 "}{" +delim_2 "}{" + diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.bib b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.bib new file mode 100644 index 00000000000..64667a11d43 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.bib @@ -0,0 +1,182 @@ +@preamble{"\latex{\addcontentsline{toc}{chapter}{Bibliography}} +\label{ch:bib}"} + +@book{lamport94, + author = "Leslie Lamport", + title = "{\LaTeX}\space: a document preparation system", + publisher = "Addison-Wesley", + edition="2nd", + year = 1994 +} + +@book{kopka95, + author = "Helmut Kopka and Patrick W. Daly", + title = "A guide to {\LaTeXe}: document preparation + for beginners and advanced users", + publisher = "Addison-Wesley", + year = 1995 +} + +@book{goossens94, + author = "Michel Goossens and Frank Mittelbach and Alexander Samarin", + title = "The {\LaTeX}\space companion", + publisher = "Addison-Wesley", + year = 1994 +} + +@book{goossens97, + author = "Michel Goossens and Sebastian Rahtz and Frank Mittelbach", + title = "The {\LaTeX}\space graphics companion", + publisher = "Addison-Wesley", + year = 1997 +} + +@book{goossens99, + author = "Michel Goossens and Sebastian Rahtz and others", + title = "The {\LaTeX}\space web companion", + publisher = "Addison-Wesley", + year = 1999 +} + +@book{kottwitz, + author = "Stefan Kottwitz", + title = "{\LaTeX}\space Beginner's Guide", + publisher = "Packt Publishing", + year = 2011 +} + +@book{vandongen, + author = "Marc van Dongen", + title = "{\LaTeX}\space and Friends", + publisher = "Springer", + year = 2012 +} + +@book{oxford, + author = "R. M. Ritter", + title = "Oxford Style Manual", + publisher = "Oxford University Press", + year = 2003 +} + +@book{turabian96, + author = "Kate L. Turabian", + title = "A Manual for Writers of Term Papers, Theses, and + Dissertations", + edition = "sixth", + publisher = "The University of Chicago Press", + year = 1996 +} + +@book{texbook, + author = "Donald Ervin Knuth", + title = "The {\TeX{}book}", + publisher = "Addison-Wesley", + year = 1986 +} + +@book{thesis, + author = "Nicola L. C. Talbot", + title = "Using {\LaTeX}\space to Write a Ph.D. Thesis", + volume = 2, + publisher = "Dickmaw Books", + series = "The Dickimaw {\LaTeX}\space Series", + note = "\url{\baseurl/latex/thesis/}", + year = 2012 +} + +@article{pakin09, + author = "Scott Pakin", + title = "The Comprehensive {\LaTeX}\space Symbol List", + note = "\url{http://mirror.ctan.org/info/symbols/comprehensive} or + \texttt{texdoc symbols}", + year = 2009 +} + +@article{l2tabu, + author = {Mark Trettin and J\"urgen Fenn}, + title = "An essential guide to {\LaTeXe}\space usage: obsolete commands + and packages", + year = 2007, + note = "\url{http://mirror.ctan.org/info/l2tabu/english} or + \texttt{texdoc l2tabu-en}" +} + +@misc{texarchive, + key = "UKTeX", + title = "The {UK} {\TeX}\space {Archive}", + note = "\url{http://www.tex.ac.uk/}\index{TeX Archive@\TeX \ Archive}" +} + +@misc{comptexttex, + key="comp.text.tex", + title = "The \texttt{comp.text.tex} news group", + note = "\url{http://groups.google.com/group/comp.text.tex}" +} + +@misc{texhax, + key="texhax", + title = "The \texttt{texhax} archives", + note = "\url{http://tug.org/pipermail/texhax/}" +} + +@misc{fontcat, + key="font", + title = "The {\LaTeX}\space Font Catalogue", + note = "\url{http://www.tug.dk/FontCatalogue/}" +} + +@misc{ukfaq, + key="UKFAQ", + title = "{UK} List of {\TeX}\space Frequently Asked Questions", + note = "\url{http://www.tex.ac.uk/faq}" +} + +@misc{tds, + key="TDS", + title = "What is the {TDS}?", + note = "\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=tds}" +} + +@misc{ctan, + key="CTAN", + title = "The Comprehensive {\TeX}\space Archive Network", + note = "\url{http://mirror.ctan.org/}" +} + +@misc{tug, + key="TUG", + title = "The {\TeX}\space User Group", + note = "\url{http://tug.org/}" +} + +@misc{uktug, + key="UKTUG", + title = "The {UK} {\TeX}\space User Group", + note = "\url{http://uk.tug.org/}" +} + +@misc{texcat, + author = "Graham Williams", + title = "{\TeX}\space Catalogue", + note = "\url{http://mirror.ctan.org/help/Catalogue/}" +} + +@misc{sargentiii, + author = "Murray {Sargent III}", + title = "High-Quality Editing and Display of Mathematical Text in +Office 2007", + note = +"\url{http://blogs.msdn.com/b/murrays/archive/2006/09/13/752206.aspx}", + month = SEP, + year = 2006 +} + +@misc{voss, + author = "Herbert {Vo\ss}", + title = "Math Mode", + note = +"\url{http://mirror.ctan.org/info/math/voss/mathmode/Mathmode.pdf} +or \texttt{texdoc mathmode}", + year = 2010 +} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.cls b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.cls new file mode 100644 index 00000000000..85b732d5323 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/novices.cls @@ -0,0 +1,2828 @@ +% Class file for ``LaTeX for Complete Novices'' +% This is part of the source code for "LaTeX for Complete Novices" +% It includes some code that was used to generate other formats of +% this tutorial that aren't included in this distribution. +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{novices} + +\newif\ifscreen +\screenfalse + +\newcommand*{\extra@stuff}{} + +\newcommand{\dosummarymark}[1]{% + \def\@summarymarker{#1}% + \@onelevel@sanitize\@summarymarker + \edef\do@writeout{% + \noexpand\protected@write\noexpand\@auxout{}{% + \string\summarymarker{\noexpand\thepage}{\@summarymarker}% + }% + }% + \do@writeout +} + +% Default is report +\def\novices@loadsty{novices-a4paper} +\def\novices@ptsize{12pt} +\newcount\novicemedia +\def\NOVICEreport{0} +\def\NOVICEscreen{1} +\def\NOVICEbook{2} +\novicemedia=\NOVICEreport\relax +\PassOptionsToClass{chapterprefix=true,oneside,captions=tableheading,numbers=noenddot}{scrbook}% + +\DeclareOption{report}{% + \screenfalse + \def\novices@loadsty{novices-a4paper}% + \def\novices@ptsize{12pt}% + \novicemedia=\NOVICEreport\relax + \PassOptionsToClass{chapterprefix=true,oneside,captions=tableheading,numbers=noenddot}{scrbook}% +} +\DeclareOption{html}{% + \screenfalse + \def\novices@loadsty{novices-html}% + \def\novices@ptsize{12pt}% + \novicemedia=\NOVICEreport\relax + \PassOptionsToClass{chapterprefix=true,oneside,captions=tableheading,numbers=noenddot}{scrbook}% + \renewcommand*{\extra@stuff}{% + \hypersetup{linkcolor=black,citecolor=black,urlcolor=black}% + \renewcommand{\tableref}[1]{\tablename~\ref{##1}}% + \renewcommand{\vfigureref}[1]{\figurename~\ref{##1}}% + \renewcommand{\figureref}[1]{\figurename~\ref{##1}}% + }% + \renewcommand{\dosummarymark}[1]{}% +} +\DeclareOption{screen}{% + \screentrue + \def\novices@loadsty{novices-screen}% + \def\novices@ptsize{8pt} + \novicemedia=\NOVICEscreen\relax + \PassOptionsToClass{chapterprefix=false,oneside,headings=small,captions=tableheading,numbers=noenddot}{scrbook}% +} +\DeclareOption{book}{% + \screenfalse + \def\novices@loadsty{novices-book}% + \def\novices@ptsize{10pt} + \novicemedia=\NOVICEbook\relax + \PassOptionsToClass{chapterprefix=true,twoside,headings=normal,captions=tableheading,numbers=noenddot}{scrbook}% +} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}} + +\ProcessOptions + +\LoadClass{scrbook} + +\expandafter\RequirePackage\expandafter[\novices@ptsize]{extsizes} + +\RequirePackage{graphicx} +\RequirePackage{amsmath} + +% Requires at least version 1.08 of the flowfram package +\RequirePackage{\novices@loadsty} + +\ifnum\novicemedia=\NOVICEbook + \setlength{\marginparwidth}{0.7in} + \newlength\@even@offset + \setlength{\@even@offset}{0.3in} + + \setflowframe*{main,header,left,leftshort}{margin=outer} + + \@flowframeid{right} + \expandafter\addtolength\csname col@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + \@flowframeid{rightshort} + \expandafter\addtolength\csname col@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + + \@flowframeid{left} + \expandafter\addtolength\csname col@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + \@flowframeid{leftshort} + \expandafter\addtolength\csname col@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + + \@flowframeid{main} + \expandafter\addtolength\csname col@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + + \@dynamicframeid{header} + \expandafter\addtolength\csname @df@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + + \@dynamicframeid{footer} + \expandafter\addtolength\csname @df@\romannumeral\ff@id @evenx\endcsname{\@even@offset} + + \@dynamicframeid{indextab} + \expandafter\computeleftedgeeven + \csname @df@\romannumeral\ff@id @evenx\endcsname +% \expandafter\addtolength +% \csname @df@\romannumeral\ff@id @evenx\endcsname +% {0mm}% + \expandafter\addtolength + \csname @df@\romannumeral\ff@id @posx\endcsname + {3mm}% + + \setdynamiccontents{\ff@id}{% + \color{white}\LARGE\bfseries\scshape\centering + \ifodd\c@page\relax + \hspace*{-1ex}\rotatebox[origin=cb]{-90}{Index}% + \else + \hspace*{1ex}\rotatebox[origin=cb]{90}{Index}% + \fi + \par + } + + \@dynamicframeid{summarytab} + \expandafter\computeleftedgeeven + \csname @df@\romannumeral\ff@id @evenx\endcsname +% \expandafter\addtolength +% \csname @df@\romannumeral\ff@id @evenx\endcsname +% {0mm}% + \expandafter\addtolength + \csname @df@\romannumeral\ff@id @posx\endcsname + {3mm}% + + \setdynamiccontents{\ff@id}{% + \color{white}\LARGE\bfseries\scshape\centering + \ifodd\c@page\relax + \hspace*{-1ex}\rotatebox[origin=cb]{-90}{Summary}% + \else + \hspace*{1ex}\rotatebox[origin=cb]{90}{Summary}% + \fi + \par + } + +\fi + +\RequirePackage[T1]{fontenc} +\RequirePackage{pifont} +\RequirePackage{ifthen} +\RequirePackage{ifpdf} +\RequirePackage{url} +\RequirePackage[french]{datetime} +\RequirePackage{etoolbox} +\RequirePackage{makeidx} + +% html package conflicts with varioref+hyperref, so emulate it: +\RequirePackage{comment} +\specialcomment{htmlonly}{}{} +\excludecomment{htmlonly} +\newenvironment{latexonly}{\ignorespaces}{\ignorespacesafterend} +\newenvironment{makeimage}{}{} +\newcommand{\latex}[1]{#1} +\newcommand{\latexhtml}[2]{#1} +\newcommand{\html}[1]{} +\newcommand{\htmlimage}[2]{} +\newcommand{\mathorit}[1]{\ensuremath{#1}} + +\RequirePackage{varioref} +\RequirePackage[hyperindex=false]{hyperref} +\RequirePackage[toc,subentrycounter, + sanitizesort=false, + acronym,indexonlyfirst, + counter=section,numberedsection=nolabel,savewrites]{glossaries} +\usepackage{glossary-inline} + +% don't check for makeindex special characters, as they're dealt +% with explicitly +\let\@gls@checkmkidxchars\@gobble + +\longdate + +\ifnum\novicemedia=\NOVICEbook + \hypersetup{draft} +\else + \hypersetup{colorlinks,plainpages=false, + linkcolor=blue,menucolor=blue,citecolor=blue, + urlcolor=magenta,filecolor=magenta} +\fi + +\newcommand{\vfigureref}[1]{\figurename~\vref{#1}} + +\ifnum\novicemedia=\NOVICEbook + \newcommand{\figureref}[1]{\figurename~\vref{#1}} + \newcommand{\tableref}[1]{\tablename~\vref{#1}} +\else + \newcommand{\figureref}[1]{\hyperlink{#1top}{\figurename~\ref*{#1}}} + \newcommand{\tableref}[1]{\htmlref{\tablename~\ref*{#1}}{#1}} +\fi + +\extra@stuff + +\robustify\htmlref + +\renewcommand*{\headfont}{\em} + +\ifnum\novicemedia=\NOVICEscreen\relax + \renewcommand*{\footfont}{\small\scshape} +\else + \renewcommand*{\footfont}{\em} +\fi + +\newcommand*{\leftfootmark}{} +\newcommand*{\rightfootmark}{} +\renewcommand*{\ps@headings}{% + \let\@mkboth\markboth + \renewcommand*{\@evenhead}{\normalfont\headfont\thepage\hfill\leftmark}% + \renewcommand*{\@oddhead}{\normalfont\headfont\rightmark\hfill\thepage}% + \renewcommand*{\@evenfoot}{\normalfont\footfont\leftfootmark\@leftfoothook\hfill}% + \renewcommand*{\@oddfoot}{\hfill\normalfont\footfont\rightfootmark\@rightfoothook}% +} + +\renewcommand*{\ps@plain}{% + \renewcommand*{\@oddhead}{}% + \renewcommand*{\@evenhead}{}% + \renewcommand*{\@oddfoot}{\normalfont\footfont\mbox{}\hfill\thepage\@rightfoothook}% + \renewcommand*{\@evenfoot}{\normalfont\footfont\thepage\hfill\mbox{}\@leftfoothook}% +} + +\pagestyle{headings} + +\newcommand*{\@leftfoothook}{} +\newcommand*{\@rightfoothook}{} + +\newcommand*{\setleftfootmark}[1]{} + +\newcommand*{\@setleftfootmark}[1]{% + \gdef\leftfootmark{#1}% + \global\let\setleftfootmark\@gobble +} + +\newcommand*{\setrightfootmark}[1]{} + +\newcommand*{\@setrightfootmark}[1]{% + \gdef\rightfootmark{#1}% +} + +\ifnum\novicemedia=\NOVICEbook + \newcommand*{\enablefoothooks}{% + \let\setrightfootmark\@setrightfootmark + \let\setleftfootmark\@setleftfootmark + \renewcommand*{\@rightfoothook}{% + \global\let\setleftfootmark\@setleftfootmark + }% + \renewcommand*{\@leftfoothook}{% + \global\let\setleftfootmark\@setleftfootmark + }% + } +\else + \newcommand*{\enablefoothooks}{} +\fi + +\newcommand*{\disablefoothooks}{% + \global\let\leftfootmark\@empty + \global\let\rightfootmark\@empty + \global\let\setrightfootmark\@gobble + \global\let\setleftfootmark\@gobble + \global\let\@leftfoothook\@empty + \global\let\@rightfoothook\@empty +} + +\providecommand{\abstractname}{Abstract} + +\newcommand*{\@edition}{} +\newcommand*{\edition}[1]{\renewcommand*{\@edition}{#1}} +\newcommand*{\theversion}{} +\newcommand*{\version}[1]{\renewcommand*{\theversion}{#1}} +\newcommand*{\thevolume}{} +\newcommand*{\volume}[1]{\renewcommand*{\thevolume}{#1}} +\newcommand*{\theseries}{} +\newcommand*{\series}[1]{\renewcommand*{\theseries}{#1}} + +\newcommand*{\theseriesurl}{} +\newcommand*{\seriesurl}[1]{\renewcommand*{\theseriesurl}{#1}} + +\newcommand{\navigationbar}{{% +\ifthenelse{\equal{\thepage}{a}}{\textcolor[gray]{.75}{Previous}}{% +\Acrobatmenu{PrevPage}{Previous}}\enspace +\ifthenelse{\boolean{lastpg}}{\textcolor[gray]{.75}{Next}}{% +\Acrobatmenu{NextPage}{Next}}\enspace +\Acrobatmenu{FirstPage}{First}\enspace +\Acrobatmenu{LastPage}{Last}\enspace +\Acrobatmenu{GoBack}{Back}\enspace +\Acrobatmenu{GoForward}{Forward}\enspace +\htmlref{Summary}{ch:glossary}\enspace +\htmlref{Index}{ch:index}}} + +\newcommand{\ps@online}{% +\renewcommand{\@oddhead}{{\normalfont\headfont\rightmark}\hfil}% +\renewcommand{\@evenhead}{{\normalfont\hfil\headfont\leftmark}}% +\renewcommand{\@oddfoot}{\normalfont\footfont\hfill +\navigationbar +\hfill\thepage} +\renewcommand{\@evenfoot}{\@oddfoot}} + + +\ifscreen +\pagestyle{online} + +\renewcommand{\ps@plain}{% +\renewcommand{\@oddhead}{}% +\renewcommand{\@evenhead}{}% +\renewcommand{\@oddfoot}{\normalfont\footfont\hfill +\navigationbar +\hfill\thepage} +\renewcommand{\@evenfoot}{\@oddfoot}} + +\renewcommand{\ps@empty}{% +\renewcommand{\@oddhead}{}% +\renewcommand{\@evenhead}{}% +\renewcommand{\@oddfoot}{\normalfont\footfont\hfill +\navigationbar \hfill\mbox{}} +\renewcommand{\@evenfoot}{\@oddfoot}} + +\fi + +\ifnum\novicemedia=\NOVICEscreen\relax + \renewcommand*{\chapterformat}{% + \chapappifchapterprefix{\ }\textup{\thechapter}.\enspace} + \addtokomafont{chapter}{\centering\rmfamily\scshape} +\else + \renewcommand*{\chapterformat}{% + \chapappifchapterprefix{\ }\thechapter} + \addtokomafont{chapter}{\raggedleft\rmfamily\scshape} +\fi + +\addtokomafont{chapterentry}{\large\rmfamily\scshape} +\addtokomafont{chapterentrypagenumber}{\large\rmfamily\upshape} +\addtokomafont{section}{\rmfamily\bfseries} +\addtokomafont{subsection}{\rmfamily\bfseries} +\addtokomafont{subsubsection}{\rmfamily\bfseries} +\addtokomafont{minisec}{\rmfamily\bfseries\scshape} + +\ifnum\novicemedia=\NOVICEreport + \renewcommand{\chapterheadstartvskip}{% + \vspace*{1.5\baselineskip}% + } +\fi + +\renewcommand*\l@chapter[2]{% + \ifnum\c@tocdepth>\m@ne + \ifnum\lastpenalty<20010 + \addpenalty{-\@highpenalty}% + \fi + \vskip 1.0em \@plus \p@ + \setlength \@tempdima{2em}% + \if@tocleft + \ifx\toc@l@number\@empty + \else + \setlength \@tempdima{0\toc@l@number}% + \fi + \fi + \begingroup + \raggedchapterentry + \parindent\z@ + \advance\rightskip\@pnumwidth + \parfillskip -\@pnumwidth + \interlinepenalty\@M + \leavevmode + \advance\leftskip \@tempdima + \null\nobreak + \hskip -\leftskip + \usekomafont{chapterentry}% + {% + #1\nobreak + \usekomafont{chapterentrypagenumber}% + {% + \hfill + \nobreak + \hb@xt@\@pnumwidth{\hss #2}% + }% + }% + \par + \ifnum\scr@compatibility>\@nameuse{scr@v@2.96}% + \relax + \endgroup + \penalty 20009 + \else + \penalty\@highpenalty + \endgroup + \fi + \fi +} + +\renewcommand*{\l@section}{% + \bprot@dottedtocline {1}{1.5em}{3em}% +} + +\renewcommand*{\captionformat}{\space} + +\renewcommand{\title}[2][]{\ifthenelse{\equal{#1}{}}{% +\renewcommand{\@pdftitle}{#2}}{ +\ifthenelse{\equal{\@pdftitle}{}}{\renewcommand{\@pdftitle}{#1}}{}}% +\renewcommand{\@title}{#2}} + +\renewcommand{\author}[2][]{\ifthenelse{\equal{#1}{}}{% +\ifthenelse{\equal{\@pdfauthor}{}}{% +\renewcommand{\@pdfauthor}{#2}}{}}{\renewcommand{\@pdfauthor}{#1}}% +\renewcommand{\@author}{#2}} + +\newcommand{\keywords}[1]{\renewcommand{\@pdfkeywords}{#1}} + +\providecommand{\subject}[1]{% +\renewcommand{\@pdfsubject}{#1}} + +\newcommand*{\@affiliation}{} +\newcommand*{\thepublisher}{\@affiliation} +\newcommand*{\@affiliationurl}{} +\newcommand*{\@affiliationaddress}{} + +\newcommand*{\affiliation}[3]{% + \renewcommand{\@affiliation}{#1}% + \renewcommand{\@affiliationurl}{\url{#2}}% + \renewcommand{\@affiliationaddress}{#3}% +} + +\ifpdf + \DeclareGraphicsExtensions{.pdf,.png,.jpg} +\else + \DeclareGraphicsExtensions{.ps,.eps} +\fi + +\ifnum\novicemedia=\NOVICEbook + % book doesn't have sidepanel +\else + % get the dimensions of sidepanel (values are stored in \ffareax, \ffareay, \ffareawidth and \ffareaheight) + \getdynamicbounds*{sidepanel} + + % set the margin width to be the same as the width of sidepanel + \setlength{\marginparwidth}{\ffareawidth} +\fi + +\newcommand*{\index@preamble}{} +\newcommand{\indexpreamble}[1]{% + \renewcommand{\index@preamble}{#1}% +} + +% renew theindex environment so that it appears in the table of contents +% and set up index frames + +\renewenvironment{theindex} +{% + \clearpage + \begingroup + \normalfont\sectfont + \chapterheadstartvskip + \phantomsection + \size@chapter{\indexname}% + \thispagestyle{plain}% + \label{ch:index}% + \par + \endgroup + \markboth{\indexname}{\indexname}% + \addcontentsline{toc}{chapter}{\indexname}% + \parindent\z@ + \index@preamble\par + \enablefoothooks +% \parskip\z@ \@plus .3\p@\relax + \let\item\@idxitem + \ifnum\novicemedia=\NOVICEbook\relax + \setleftfootmark{\doindextopmark}% + \setrightfootmark{\doindexbottommark}% + \else + \setdynamiccontents*{sidepanel}{% + \hfil\ifscreen\normalsize\else\large\fi\indexbar\hfil}% + \fi + \ifscreen\small\fi + \newpage + \ignorespacesafterend +} +{% + \protected@write\@auxout{}{\string\@flow@endindex{\thepage}}% + \protected@write\@auxout{}{\string\@flow@old@last@idx@page{\number\@last@idx@page}}% + \setrightfootmark{\doindexbottommark\disablefoothooks}% + \setleftfootmark{\doindextopmark\disablefoothooks}% +} + +\newcount\@first@idx@page +\newcount\@last@idx@page +\newcommand*{\@flow@endindex}[1]{\global\@last@idx@page=#1\relax} + +\newcommand*{\@old@last@idx@page}{-1} +\newcommand*{\@flow@old@last@idx@page}[1]{% + \gdef\@old@last@idx@page{#1}% +} + +\newcount\@last@summary@page +\newcommand*{\@flow@endsummary}[1]{% + \global\@last@summary@page=#1\relax + \global\@first@idx@page=\@last@summary@page + \global\advance\@first@idx@page by 1\relax + \ifnum\novicemedia=\NOVICEbook\relax + \ifodd\@first@idx@page + \relax + \else + \global\advance\@first@idx@page by 1\relax + \fi + \fi +} + +\newcount\@first@summary@page + +\newcount\@last@acr@page +\newcommand*{\@flow@endacr}[1]{\global\@last@acr@page=#1\relax} + +\newcommand*{\@flow@startsummary}[1]{% + \global\@first@summary@page=#1\relax + \ifnum\novicemedia=\NOVICEbook\relax + \ifodd\@first@summary@page + \relax + \else + \global\advance\@first@summary@page by 1\relax + \fi + \fi +} + + +% Put glossary in double-column + +\newcommand*{\setdoublecolumnglo}{% + \let\glossarysection\dblglossarysection +} + +\newcount\tmp@count + +\newcommand{\@setup@pages}{% + \ifnum\novicemedia=\NOVICEbook\relax + \setdynamicframe*{summarytab}{pages={\number\@first@summary@page-\number\@last@summary@page}}% + \setdynamicframe*{indextab}{pages={\number\@first@idx@page-\number\@last@idx@page}}% + \else + \setdynamicframe*{sidepanel}% + {pages={\number\@first@summary@page-\number\@last@summary@page,% + \number\@first@idx@page-\number\@last@idx@page}}% + \fi + \ifnum\@first@summary@page>0\relax + \@ff@tmpN=\@first@summary@page + \advance\@ff@tmpN by 1\relax + \tmp@count=\@first@idx@page + \advance\tmp@count by 1\relax + \edef\@nv@set@flf{\noexpand\setflowframe*{left,right}% + {pages={\number\@ff@tmpN-\number\@last@summary@page + ,\number\tmp@count-\number\@last@idx@page}}}% + \@nv@set@flf + \setflowframe*{main}% + {pages={<\number\@last@acr@page,\number\@last@acr@page,>\number\@last@idx@page}} + \setflowframe*{header,leftshort,rightshort}% + {pages={\number\@first@summary@page,\number\@first@idx@page}} + \fi +} + +\AtBeginDocument{\@setup@pages} + +\newcommand*{\dblglossarysection}[2][\@gls@title]{% + \doifnotbook + {% + \setdynamiccontents*{sidepanel}{% + \hfil\ifscreen\normalsize\else\large\fi\summarybar\hfil}% + }% + \clearpage + \protected@write\@auxout{}{\string\@flow@startsummary{\thepage}}% + \begingroup + \normalfont\sectfont + \chapterheadstartvskip + \phantomsection + \size@chapter{#2}% + \thispagestyle{plain}% + \label{ch:glossary}% + \par + \endgroup + \markboth{\glossarytoctitle}{\glossarytoctitle}% + \addcontentsline{toc}{chapter}{#1}% + \vskip\baselineskip + \noindent + \emph{\summarypreamble}\par + \newpage +} + +\def\summarypreamble{} + +\newif\iflastpg +\AtEndDocument +{% + \lastpgtrue + \ifnum\@last@idx@page=\@old@last@idx@page + \relax + \else + \ClassWarningNoLine{novices}{Rerun required to get frames up-to-date}% + \fi +} + +\renewcommand{\maketitle}{% + \pagenumbering{alph}% for PDF bookmarks + \ifpdf + \pdfinfo + {% + /Author (\@pdfauthor) + /Title (\@pdftitle) + /Keywords (\@pdfkeywords) + /Subject (\@pdfsubject) + /ModDate (D:\pdfdate) + /CreationDate (D:20040706000000) + }% + \fi + \begin{titlepage}% + \@maketitle + \end{titlepage}% + \thispagestyle{empty}% + \newpage + \bgroup + \thecopyrighttext + \par + \egroup + \setcounter{footnote}{0}% + \global\let\thetitle\@title + \global\let\theauthor\@author + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax + \normalfont +} + +\providecommand{\theauthoryear}{} +\providecommand{\theauthorsurname}{} +\providecommand{\theauthorforenames}{} + +\newcommand*{\authordetails}[3]{% + \renewcommand*{\theauthoryear}{#1}% + \renewcommand*{\theauthorsurname}{#2}% + \renewcommand*{\theauthorforenames}{#3}% + \renewcommand*{\@author}{#3\ #2}% +} + +\newcommand\thetitle{\@title} + +\providecommand*{\maketitlehook}{} + +\providecommand{\thecopyrighttext}{} + +\newcommand{\copyrighttext}[1]{% + \appto\thecopyrighttext{#1}% +} + +\ifcase\novicemedia + + % report version + \newcommand{\indexbar}{% + \begin{tabular}[t]{|c} + \idxheaderlink{Symbols} \\ + \idxheaderlink{A} \\ + \idxheaderlink{B} \\ + \idxheaderlink{C} \\ + \idxheaderlink{D} \\ + \idxheaderlink{E} \\ + \idxheaderlink{F} \\ + \idxheaderlink{G} \\ + \idxheaderlink{H} \\ + \idxheaderlink{I} \\ + \idxheaderlink{J} \\ + \idxheaderlink{K} \\ + \idxheaderlink{L} \\ + \idxheaderlink{M} \\ + \idxheaderlink{N} \\ + \idxheaderlink{O} \\ + \idxheaderlink{P} \\ + \idxheaderlink{Q} \\ + \idxheaderlink{R} \\ + \idxheaderlink{S} \\ + \idxheaderlink{T} \\ + \idxheaderlink{U} \\ + \idxheaderlink{V} \\ + \idxheaderlink{W} \\ + \idxheaderlink{X} \\ + \idxheaderlink{Y} \\ + \idxheaderlink{Z} + \end{tabular}% + } + + \newcommand{\summarybar}{% + \begin{tabular}[t]{|c} + \glsheaderlink{glssymbols} \\ + \glsheaderlink{A} \\ + \glsheaderlink{B} \\ + \glsheaderlink{C} \\ + \glsheaderlink{D} \\ + \glsheaderlink{E} \\ + \glsheaderlink{F} \\ + \glsheaderlink{G} \\ + \glsheaderlink{H} \\ + \glsheaderlink{I} \\ + \glsheaderlink{J} \\ + \glsheaderlink{K} \\ + \glsheaderlink{L} \\ + \glsheaderlink{M} \\ + \glsheaderlink{N} \\ + \glsheaderlink{O} \\ + \glsheaderlink{P} \\ + \glsheaderlink{Q} \\ + \glsheaderlink{R} \\ + \glsheaderlink{S} \\ + \glsheaderlink{T} \\ + \glsheaderlink{U} \\ + \glsheaderlink{V} \\ + \glsheaderlink{W} \\ + \glsheaderlink{X} \\ + \glsheaderlink{Y} \\ + \glsheaderlink{Z} + \end{tabular}% + } + + \renewcommand{\@maketitle}{% + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks + \null\vfil + \vskip 60\p@ + \begin{center}% + {\LARGE \@title \par}% + \vskip 2ex% + {\large Version \theversion\par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large + \begin{tabular}[t]{c} + \@affiliation\\ + \@affiliationurl + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par + \@thanks + \vfil\null +} + +\or + % screen version + \newcommand{\indexbar}{% + \begin{tabular}[t]{|cc} + \multicolumn{2}{|c}{\idxheaderlink{Symbols}}\\ + \idxheaderlink{A} & + \idxheaderlink{N} \\ + \idxheaderlink{B} & + \idxheaderlink{O} \\ + \idxheaderlink{C} & + \idxheaderlink{P} \\ + \idxheaderlink{D} & + \idxheaderlink{Q} \\ + \idxheaderlink{E} & + \idxheaderlink{R} \\ + \idxheaderlink{F} & + \idxheaderlink{S} \\ + \idxheaderlink{G} & + \idxheaderlink{T} \\ + \idxheaderlink{H} & + \idxheaderlink{U} \\ + \idxheaderlink{I} & + \idxheaderlink{V} \\ + \idxheaderlink{J} & + \idxheaderlink{W} \\ + \idxheaderlink{K} & + \idxheaderlink{X} \\ + \idxheaderlink{L} & + \idxheaderlink{Y} \\ + \idxheaderlink{M} & + \idxheaderlink{Z} + \end{tabular}% + } + + \newcommand{\summarybar}{% + \begin{tabular}[t]{|cc} + \multicolumn{2}{|c}{\glsheaderlink{glssymbols}}\\ + \glsheaderlink{A} & + \glsheaderlink{N} \\ + \glsheaderlink{B} & + \glsheaderlink{O} \\ + \glsheaderlink{C} & + \glsheaderlink{P} \\ + \glsheaderlink{D} & + \glsheaderlink{Q} \\ + \glsheaderlink{E} & + \glsheaderlink{R} \\ + \glsheaderlink{F} & + \glsheaderlink{S} \\ + \glsheaderlink{G} & + \glsheaderlink{T} \\ + \glsheaderlink{H} & + \glsheaderlink{U} \\ + \glsheaderlink{I} & + \glsheaderlink{V} \\ + \glsheaderlink{J} & + \glsheaderlink{W} \\ + \glsheaderlink{K} & + \glsheaderlink{X} \\ + \glsheaderlink{L} & + \glsheaderlink{Y} \\ + \glsheaderlink{M} & + \glsheaderlink{Z} + \end{tabular}% + } + + \renewcommand\@maketitle{% + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks + \null\vfil + \begin{center}% + {\LARGE \@title \par}% + \vskip 2ex% + {\large Version \theversion\par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large + \begin{tabular}[t]{c} + \@affiliation\\ + \@affiliationurl + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par + \@thanks + \vfil\null +} + +\or + % book version + + \let\indexbar\relax + \let\summarybar\relax + + \renewcommand\@maketitle{% + \null\par + \vskip4ex + \centering + \bfseries\scshape + \Huge + \@title + \vskip4ex + \Large + \@author + \par + \vfill + \normalsize + Volume~\thevolume~of\par + \theseries + \par + \vfill + \maketitlehook + \Large + \mdseries + \vskip2ex + \@affiliation + \par + \vskip1ex + \small + \@affiliationaddress + \par + \vskip4ex + \par\null + } + +\fi + +\newlength\indexheaderskip + +\setlength{\indexheaderskip}{2ex plus .5ex minus .5ex} + +\newcommand{\indexheader}[1]{% + \par\noindent + \vskip\indexheaderskip + \makebox[\linewidth][c]% + {% + \ifnum\novicemedia=\NOVICEbook\relax + \textbf{#1}% + \else + \hypertarget{idx:#1}{\textbf{#1}}% + \protected@write\@auxout{}{\string\idx@header{#1}}% + \fi + }% + \\*[\indexheaderskip]% +} + + +\newcommand*{\idx@header}[1]{% + \csgdef{idx@header@#1}{\hyperlink{idx:#1}{\textbf{#1}}}% +} + +\newcommand*{\gls@header}[1]{% + \csgdef{gls@header@#1}{\hyperlink{gls:#1}{\textbf{\glsgetgrouptitle{#1}}}}% +} + +\newcommand*{\idxheaderlink}[1]{% + \ifcsdef{idx@header@#1}% + {\csname idx@header@#1\endcsname}% + {\textbf{\color{gray}#1}}% +} + +\newcommand*{\glsheaderlink}[1]{% + \ifcsdef{gls@header@#1}% + {\csname gls@header@#1\endcsname}% + {\textbf{\color{gray}\glsgetgrouptitle{#1}}}% +} + +\newtoks\indexmarktok + +\newcommand{\doindexmark}[1]{% + \def\@indexmarker{#1}% + \@onelevel@sanitize\@indexmarker + \edef\do@writeout{% + \noexpand\protected@write\noexpand\@auxout{}{% + \string\indexmarker{\noexpand\thepage}{\@indexmarker}% + }% + }% + \do@writeout +} + +\newcommand{\indexmarker}[2]{% + \ifcsundef{@index@top@marker@\romannumeral#1}% + {\csgdef{@index@top@marker@\romannumeral#1}{#2}}% + {}% + \csgdef{@index@bottom@marker@\romannumeral#1}{#2}% +} + +\newcommand*{\doindextopmark}{% + \csname @index@top@marker@\romannumeral\c@page\endcsname +} + +\newcommand*{\doindexbottommark}{% + \csname @index@bottom@marker@\romannumeral\c@page\endcsname +} + +\newcommand{\summarymarker}[2]{% + \ifcsundef{@summary@top@marker@\romannumeral#1}% + {\csgdef{@summary@top@marker@\romannumeral#1}{#2}}% + {}% + \csgdef{@summary@bottom@marker@\romannumeral#1}{#2}% +} + +\newcommand*{\dosummarytopmark}{% + \csname @summary@top@marker@\romannumeral\c@page\endcsname +} + +\newcommand*{\dosummarybottommark}{% + \csname @summary@bottom@marker@\romannumeral\c@page\endcsname +} + +\newlength\indexitemskip +\setlength\indexitemskip{1pt plus .5pt} + +\ifnum\novicemedia=\NOVICEbook + + \newcommand{\mainindexitem}[2]{% + \vbox{\item #1\doindexmark{#1}\space\hfill#2}% + \par\vskip\indexitemskip + } + +\else + \newcommand{\mainindexitem}[2]{% + \vbox{\item #1\space\hfill#2}\par + \par\vskip\indexitemskip + } + +\fi + +\newcommand{\subindexitem}[2]{\vbox{\subitem #1\space\hfill #2}\par} +\newcommand{\subsubindexitem}[2]{\vbox{\subsubitem #1\space\hfill #2}\par} + +% put headers and footers into the dynamic frames labelled +% 'header' and 'footer' +\renewcommand{\@dothehead}{}% +\renewcommand{\@dothefoot}{}% +\renewcommand{\@dodynamicthehead}{} +\renewcommand{\@dodynamicthefoot}{} + +\ifnum\novicemedia=\NOVICEbook\relax + \setdynamiccontents*{header}{\vfill\ifodd\c@page\relax\@oddhead\else\@evenhead\fi\vfill} + \setdynamiccontents*{footer}{\vfill\ifodd\c@page\relax\@oddfoot\else\@evenfoot\fi\vfill} +\else + \setdynamiccontents*{header}{\vfill\@oddhead\vfill} + \setdynamiccontents*{footer}{\vfill\@oddfoot\vfill} +\fi + +\newcommand{\@frontmatter}{\mbox{}\par\vfill\framebreak\clearpage +\pagenumbering{roman}% +\setflowframe*{title}{pages=none}} + +\@ifundefined{frontmatter} + {% + \let\frontmatter\@frontmatter + } + {% + \let\orgfrontmatter\frontmatter + \def\frontmatter{\@frontmatter\orgfrontmatter} + } + +\newwrite\tf@hloe + +\newcommand{\listofexercises}{% + \chapter*{List of Exercises} + \@starttoc{loe} + \immediate\openout\tf@hloe \jobname.hloe\relax + \immediate\write\tf@hloe{\string\begin{exerciselist}}% +} + +\AtEndDocument{\immediate\write\tf@hloe{\string\end{exerciselist}}} + +\newcommand{\l@exercise}{\@dottedtocline{1}{1.5em}{2.3em}} + +\newcommand*{\htmlexerciseref}[4]{\htmlref{#1}{#2}} +\newcommand*{\htmlexerciseitem}{\item \htmlexerciseref} + +\newenvironment{exerciselist}{\begin{enumerate}}{\end{enumerate}} + +\newcommand*{\@html@nodename}{\jobname} +\newcommand*{\setnode}[1]{\renewcommand*{\@html@nodename}{#1}} + +\newcounter{exercise} +%\begin{exercise}[html backref]{title}{label} +\newenvironment{exercise}[3][\@htmlex@backref]{% + \def\@htmlex@backref{\@html@nodename}% + \vskip10pt plus 5pt minus 1pt\relax + \par\noindent + \refstepcounter{exercise}\label{#3}% + \textbf{\large Exercise \theexercise\ (#2)}% + \par\nopagebreak + \vspace{10pt}\nopagebreak + \def\@the@exercisetitle{#2}% + \@onelevel@sanitize\@the@exercisetitle + \immediate\write\tf@hloe{\string\htmlexerciseitem{\@the@exercisetitle}{#3}{#1}{\theexercise}}% + \addcontentsline{loe}{exercise}{\protect\numberline{\theexercise}{\@the@exercisetitle}}\nopagebreak +}% +{% + \vskip5pt plus 2pt minus 1pt\relax + \par\noindent\null\hfill + \rule{1in}{1pt}% + \hfill\null\par + \vskip5pt plus 5pt minus 1pt\relax +} + +\newcommand{\faqlink}[2]{% + \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=#2}{#1}% +} + +\newcommand{\faq}[2]{% + \marginpar + {% + \parbox[t]{\marginparwidth}{% + \raggedright + \ifcase\novicemedia + \small + \or + \footnotesize + \or + \footnotesize\em + \fi + [FAQ: \faqlink{#1}{#2}]% + }\par + }% +} + +\newcommand{\ukenglishdate}{% + \renewcommand{\fmtord}[1]{##1}% + \renewcommand*{\formatdate}[3]{% + \@day=##1\relax\@month=##2\relax\@year=##3\relax + \ordinalnum{\the\@day}\ \monthname[\@month] \the\@year}% +} + +\DeclareMathOperator{\card}{card} +\DeclareMathOperator{\diag}{diag} +\DeclareMathOperator*{\mode}{mode} + +\newcommand*{\refname}{References} + +\newcommand*{\backslashcircumsort}{% + \string\~% +} + +\newcommand*{\backslashtildesort}{% + \string\~% +} + +% option format +\newcommand*{\optfmt}[1]{\texttt{#1}} + +% display and index class files: + +\DeclareRobustCommand*{\icls}[1]{% + \cls{#1}% + \index{class files (.cls)@class files (\texttt{.cls})!#1@\cls{#1}|hyperpage}% + \index{#1@\cls{#1} class|hyperpage}% +} + +\DeclareRobustCommand*{\clsopt}[1]{% + \optfmt{#1}% + \index{class file options!#1@\optfmt{#1}|hyperpage}% +} + +\let\nxclsopt\clsopt + + +% display and index package: +\DeclareRobustCommand*{\isty}[1]{\sty{#1}\index{#1 package@\sty{#1} +package|hyperpage}} + +\DeclareRobustCommand*{\istystart}[1]{\sty{#1}\index{#1 +package@\sty{#1} package|(hyperpage}} +\DeclareRobustCommand*{\istyend}[1]{\sty{#1}\index{#1 +package@\sty{#1} package|)hyperpage}} + +% display option, index package and option +% \istyopt{package}{option} +\DeclareRobustCommand*{\istyopt}[2]{\optfmt{#2}% +\index{#1 package@\sty{#1} package!#2@\optfmt{#2}|hyperpage}} + +% KOMA Script class option +\DeclareRobustCommand*{\scrclsopt}[2][]{% + \ifstrempty{#1}% + {% + \optfmt{#2}% + }% + {% + \optfmt{#2\discretionary{}{}{}=\discretionary{}{}{}#1}% + }% + \index{KOMA Script class options!#2@\optfmt{#2}|hyperpage}% + \index{class file options!#2@\optfmt{#2} (KOMA)|hyperpage}% +} + +\let\nxscrclsopt\scrclsopt + +% Command key-val option +% \ikeyvalopt{csname}{key} +\DeclareRobustCommand*{\ikeyvalopt}[2]{\index{#1@\protect\cmdname{#1}!#2@\texttt{#2}|hyperpage}\texttt{#2}} +\DeclareRobustCommand*{\keyvalopt}[1]{\texttt{#1}} + +% index page style +\newcommand{\idxpagestyle}[1]{\index{page +style!#1@\texttt{#1}|hyperpage}} +% display and index page style +\DeclareRobustCommand*{\ipagestyle}[1]{\pagestylefmt{#1}\idxpagestyle{#1}} + +\newcommand{\pagestylefmt}[1]{\texttt{#1}} + +\newcommand{\pagenumberingfmt}[1]{\texttt{#1}} +% index page numbering +\newcommand{\indexpagenumbering}[1]{% + \index{page numbering!#1@\pagenumberingfmt{#1}|hyperpage}% +} +% display page numbering +\newcommand{\ipagenumbering}[1]{% + \pagenumberingfmt{#1}\indexpagenumbering{#1}% +} + +% display and index unit of measurement +\newcommand*{\iunit}[2]{\texttt{#1}\index{#1 (#2)@\texttt{#1} +(#2)|hyperpage}\index{units!#1 (#2)@\texttt{#1} (#2)|hyperpage}} + +\renewcommand{\see}[2]{\par\qquad\emph{\seename} #1} + +\newcommand{\ibackslashcircumdef}{\cmdname{\textasciicircum}% +\index{\string\^@\protect\cmdname{\protect\textasciicircum}|indexdef}} + +\newcommand{\ibackslashtildedef}{\cmdname{\textasciitilde}% +\index{\string\~@\protect\cmdname{\protect\textasciitilde}|indexdef}} + +\newcommand{\iquestiondowncmd}{\glsi{questiondown}} +\newcommand{\iexclamdowncmd}{\glsi{exclamdown}} + +\newcommand*{\boldc}{\ensuremath{\boldsymbol{c}}} + +\newcommand*{\supdag}{\textsuperscript{\dag}} +\newcommand*{\supddag}{\textsuperscript{\ddag}} +\newcommand*{\supdagddag}{\textsuperscript{\dag\ddag}} + +\edef\percentsym{\expandafter\@gobble\string\%} +\edef\hashsym{\expandafter\@gobble\string\#} +\edef\ampsym{\expandafter\@gobble\string\&} +\edef\dollarsym{\expandafter\@gobble\string\$} +\edef\underscoresym{\expandafter\@gobble\string\_} +\edef\circumsym{\expandafter\@gobble\string\^} +\edef\tildesym{\expandafter\@gobble\string\~} +\edef\leftbracesym{\expandafter\@gobble\string\{} +\edef\rightbracesym{\expandafter\@gobble\string\}} +\edef\dbbackslashsym{\string\\} +\edef\backslashsym{\expandafter\@gobble\dbbackslashsym} + +% protected makeindex special characters +\newcommand*{\pleftbracesym}{"\leftbracesym} +\newcommand*{\prightbracesym}{"\rightbracesym} + +\DeclareRobustCommand*{\quotecs}{\cmdname{"}} +\DeclareRobustCommand*{\umlautaccent}[1]{\"{#1}} + +\DeclareRobustCommand*{\doublebar}[1]{\ensuremath{\|}} + +\newcommand{\exclamsym}{!} +\newcommand{\questionsym}{?} +\newcommand{\atsym}{@} +\newcommand{\xatsym}{"@} +\newcommand{\vbarsym}{|} +\newcommand{\doublequotesym}{"} +\newcommand{\slashsym}{/} +\newcommand{\emDashcs}{-{}-{}-} +\newcommand{\enDashcs}{-{}-} +\newcommand{\dashcs}{-} + +\newcommand{\quoteleftcs}{`} +\newcommand{\quotedblleftcs}{`{}`} +\newcommand{\quoterightcs}{'} +\newcommand{\quotedblrightcs}{'{}'} +\newcommand{\questiondowncs}{?{}`} +\newcommand{\exclamdowncs}{!{}`} +\newcommand{\opensqsym}{[} +\newcommand{\closesqsym}{]} +\newcommand{\openparensym}{(} +\newcommand{\closeparensym}{)} +\newcommand{\commasym}{,} +\newcommand{\colonsym}{:} +\newcommand{\semicolonsym}{;} +\newcommand{\lesssym}{<} +\newcommand{\greatersym}{>} +\newcommand{\periodsym}{.} +\newcommand{\equalsym}{=} + +\newcommand{\dash}{\,---\,} + +\newcommand{\doublequestionmark}{% + ??\index{"?"? (undefined reference)}% +} + +\DeclareRobustCommand{\symbolcmddef}[1]{% + \cmdname{#1}% + \indexsymbolcmddef{#1}% +} + +\DeclareRobustCommand{\indexsymbolcmddef}[1]{% + \index{\backslashsym#1@\protect\cmdname{#1}|indexdef}% +} + +\DeclareRobustCommand{\indexspsymbolcmddef}[1]{% +{\edef\sortkey{\expandafter\string\csname#1\endcsname}% +\index{\sortkey @\protect\cmdname{"#1}|indexdef}}} + +\DeclareRobustCommand{\indexspsymbolcmd}[1]{% +{\edef\sortkey{\expandafter\string\csname#1\endcsname}% +\index{\sortkey @\protect\cmdname{"#1}|hyperpage}}} + +\DeclareRobustCommand{\symbolcmd}[1]{% + \cmdname{#1}% + \indexsymbolcmd{#1}% +} + +\DeclareRobustCommand{\indexsymbolcmd}[1]{% + \index{\backslashsym#1@\protect\cmdname{#1}|hyperpage}% +} + +% index a command definition, but don't display it in the text +\newcommand{\indexComdef}[1]{\index{#1@\protect\cmdname{#1}|indexdef}} + +% index a command name, but don't display it in the text +\newcommand{\indexCom}[1]{\index{#1@\protect\cmdname{#1}|hyperpage}} + +\DeclareRobustCommand{\indexspsymbol}[1]{% +{\edef\sortkey{\expandafter\string\csname#1\endcsname}% +\index{\sortkey @\protect\texttt{"#1}|hyperpage}}} + +\newcommand*{\keywordfmt}[1]{\emph{#1}} + +\newcommand*{\keyword}[2][\keywordtext]{% + \def\keywordtext{#2}% + \keywordfmt{#1}\index{#2|hyperpage}% +} + +\renewcommand{\glossarysection}[2][\@gls@title]{% + \def\@gls@title{#2}% + \protected@edef\do@def@glo@section{\noexpand\chapter[#1]{#2}}% + \do@def@glo@section +} + +\newcommand{\enter}{\scalebox{0.8}{\input{pictures/entersymbol}}} + +\DeclareRobustCommand{\cmdname}[1]{\texttt{\char`\\#1}} +\DeclareRobustCommand{\parg}[1]{% + \discretionary{}{}{}\texttt(#1\texttt)} +\DeclareRobustCommand{\meta}[1]{\textnormal{\ensuremath{\langle}\emph{#1}\ensuremath{\rangle}}} + +\DeclareRobustCommand{\marg}{% + \@ifstar\@smeta\@meta +} + +\DeclareRobustCommand{\@meta}[1]{% + \discretionary{}{}{}\glsni{leftbracechar}#1\glsni{rightbracechar}% +} + +\DeclareRobustCommand{\@smeta}[1]{% + \discretionary{}{}{}\texttt{\leftbracesym}#1\texttt{\rightbracesym}% +} + +\DeclareRobustCommand{\oarg}{% + \@ifstar\@soarg\@oarg +} + +\DeclareRobustCommand{\@oarg}[1]{% + \discretionary{}{}{}\glsni{opt.opensq}#1\glsni{opt.closesq}} + +\DeclareRobustCommand{\@soarg}[1]{% + \discretionary{}{}{}\texttt[#1\texttt]} + +\DeclareRobustCommand{\comma}{,\discretionary{}{}{}} + +\DeclareRobustCommand{\envname}[1]{\textsf{#1}} + +\DeclareRobustCommand{\cls}[1]{\textsf{#1}} +\DeclareRobustCommand{\sty}[1]{\textsf{#1}} +\newcommand{\counter}[1]{\textsf{#1}} + +\newcommand{\appname}[1]{\texttt{#1}} +\newcommand{\iappname}[2][\appnamesort]{% +{\def\appnamesort{#2}% +\appname{#2}% +\index{#1@\appname{#2}|hyperpage}}} + +\newcommand{\texdistro}[1]{\texttt{#1}} +\newcommand{\itexdistro}[2][\distrosort]{% +{% + \def\distrosort{#2}% + \texdistro{#2}% + \index{#1@\texdistro{#2}|hyperpage}% + \index{TeX Distributions@\protect\TeX\ Distributions!#1@\protect\texdistro{#2}|hyperpage}% +}% +} + +\newcommand{\perldistro}[1]{\texttt{#1}} + +\newcommand{\menuto}{\discretionary{}{}{}$\rightarrow$\discretionary{}{}{}} + +\newcommand{\startmenu}[1]{\begin{center}\sffamily Start$\rightarrow$ Programs $\rightarrow$ #1\end{center}} + +\newcommand{\menu}[1]{\textsf{#1}} + +\DeclareRobustCommand{\BiBTeX}{\textsc{Bib}\TeX} +\newcommand{\PDFLaTeX}{PDF\LaTeX} + +\newcommand{\dq}[1]{``#1''} +\newcommand{\sq}[1]{`#1'} + +\newcommand{\footnotesymbols}{% +\@fnsymbol1 \@fnsymbol2 \@fnsymbol3 \@fnsymbol4 \@fnsymbol5 +\@fnsymbol6 \@fnsymbol7 \@fnsymbol8 \@fnsymbol9} + +\newlength\imgHeight +\newlength\maxImageHeight + +\setlength{\maxImageHeight}{0.8\textheight} + +\newlength\imgWidth +\newlength\maxImageWidth +\setlength{\maxImageWidth}{\textwidth} + +\define@key{Gin}{alt}{} + +\newcommand{\incGraphics}[2][]{% + \setlength{\maxImageWidth}{\linewidth}% + \settoheight{\imgHeight}{\includegraphics[#1]{#2}}% + \ifdim\imgHeight>\maxImageHeight + \settowidth{\imgWidth}{\includegraphics[#1,height=\maxImageHeight]{#2}}% + \ifdim\imgWidth>\maxImageWidth + \includegraphics[#1,width=\maxImageWidth]{#2}% + \else + \includegraphics[#1,height=\maxImageHeight]{#2}% + \fi + \else + \settowidth{\imgWidth}{\includegraphics[#1]{#2}}% + \ifdim\imgWidth>\maxImageWidth + \includegraphics[#1,width=\maxImageWidth]{#2}% + \else + \includegraphics[#1]{#2}% + \fi + \fi +} + +\newsavebox{\boxcontents} + +\newcommand*{\includeteximage}[2][]{% + \setlength{\maxImageWidth}{\linewidth}% + \def\Gin@req@sizes{% + \Gin@req@height\Gin@nat@height + \Gin@req@width\Gin@nat@width}% + \begingroup + \@tempswafalse + \let\input@path\Ginput@path + \toks@{\InputIfFileExists{#2}{}{\@warning{File `#1' not found}}}% + \setkeys{Gin}{#1}% + \Gin@esetsize + \sbox\boxcontents{\the\toks@}% + \settoheight{\imgHeight}{\usebox\boxcontents}% + \settodepth{\@ff@tmp@y}{\usebox\boxcontents}% + \addtolength{\imgHeight}{\@ff@tmp@y}% + \ifdim\imgHeight>\maxImageHeight + \ifdim\maxImageHeight<\maxImageWidth\relax + \resizebox{!}{\maxImageHeight}{\usebox\boxcontents}% + \else + \settowidth{\imgWidth}{\usebox\boxcontents}% + \ifdim\imgWidth>\maxImageWidth + \resizebox{\maxImageWidth}{!}{\usebox\boxcontents}% + \else + \resizebox{!}{\maxImageHeight}{\usebox\boxcontents}% + \fi + \fi + \else + \settowidth{\imgWidth}{\usebox\boxcontents}% + \ifdim\imgWidth>\maxImageWidth + \resizebox{\maxImageWidth}{!}{\usebox\boxcontents}% + \else + \usebox\boxcontents + \fi + \fi + \endgroup +} + +\newcommand*{\incPgfOrGraphics}[2][]{% + \IfFileExists{#2}{\includeteximage[#1]{#2}}{\incGraphics[#1]{#2}}% +} + +\newcommand{\indexdef}[1]{\textit{\hyperpage{#1}}} + +% footnotes for minipage examples +\newcommand{\mpexfootnote}[1]{% +\renewcommand{\thempfootnote}{\textcolor{black}{\alph{mpfootnote}}}% +\footnote{#1}} + +\newcommand{\labelledbox}[2]{\begin{tabular}{r}\doublebox{#1}\\\scriptsize\textsf{#2}\end{tabular}} +\newcommand{\labelled}[2]{\begin{tabular}{r}#1\\\scriptsize\textsf{#2}\end{tabular}} + +\ifnum\novicemedia=\NOVICEbook + \definecolor{inputcol}{gray}{0.6} + \definecolor{outputcol}{gray}{0.4} +\else + \definecolor{inputcol}{cmyk}{1,0,0,0} + \definecolor{outputcol}{rgb}{0.6,0,1} +\fi + +\newcommand{\inputlabelformat}[1]{\textcolor{inputcol}{\scriptsize\sffamily #1}} +\newcommand{\outputlabelformat}[1]{\textcolor{outputcol}{\scriptsize\sffamily #1}} + +\newcommand{\toparrow}{\ensuremath{\overline\uparrow}} +\newcommand{\botarrow}{\ensuremath{\underline\downarrow}} + +\newlength\minremainspace + +\ifnum\novicemedia=\NOVICEbook + + \newcommand*{\marginblocklabel}[2]{% + \ifthispageodd + {% + \makebox[\marginparwidth][l]{#1 #2}% + }% + {% + \makebox[\marginparwidth][r]{#2 #1}% + }% + } + + \newcommand*{\marginlabel}[1]{% + \ifthispageodd + {% + \makebox[\marginparwidth][l]{#1}% + }% + {% + \makebox[\marginparwidth][r]{#1}% + }% + } + + \setlength\minremainspace{50pt} + +\else + \newcommand*{\marginblocklabel}[2]{#1 #2} + \newcommand*{\marginlabel}[1]{#1} + \setlength\minremainspace{42pt} +\fi + +% Changing the colour in the margin occasionally causes problems +% so store the coloured marginal text in save boxes. + +\newsavebox\Input +\newsavebox\Output +\newsavebox\InputT +\newsavebox\OutputT +\newsavebox\CodeT +\newsavebox\InputB +\newsavebox\OutputB +\newsavebox\CodeB +\newsavebox\Code + +\sbox\Input{\inputlabelformat{Input}} +\sbox\Output{\outputlabelformat{Output}} +\sbox\Code{\inputlabelformat{Code}} + +\sbox\InputT{\inputlabelformat{% + \toparrow +}} + +\sbox\OutputT{\outputlabelformat{% + \toparrow + }} + +\sbox\CodeT{\inputlabelformat{% + \toparrow +}} + +\sbox\InputB{\inputlabelformat{% + \botarrow +}} + +\sbox\OutputB{\outputlabelformat{% + \botarrow +}} + +\sbox\CodeB{\inputlabelformat{% + \botarrow +}} + +\newcommand{\inputruleB}{% + \vspace*{-5pt}\par\noindent + \textcolor{inputcol}{\rule{0.4pt}{5pt}\leaders\hrule\hfill\rule{0.4pt}{5pt}}} +\newcommand{\outputruleB}{\par\noindent + \textcolor{outputcol}{\rule{0.4pt}{5pt}\leaders\hrule\hfill\rule{0.4pt}{5pt}}} +\newcommand{\coderuleB}{\par\noindent + \textcolor{inputcol}{\rule{0.4pt}{5pt}\leaders\hrule\hfill\rule{0.4pt}{5pt}}} +\newcommand{\inputruleT}{\par\noindent + \textcolor{inputcol}{\rule[-5pt]{0.4pt}{5pt}\leaders\hrule\hfill\rule[-5pt]{0.4pt}{5pt}}} +\newcommand{\outputruleT}{\par\noindent + \textcolor{outputcol}{\rule[-5pt]{0.4pt}{5pt}\leaders\hrule\hfill\rule[-5pt]{0.4pt}{5pt}}} +\newcommand{\coderuleT}{\par\noindent + \textcolor{inputcol}{\rule[-5pt]{0.4pt}{5pt}\leaders\hrule\hfill\rule[-5pt]{0.4pt}{5pt}}} + +\newcommand*{\xminisec}[1]{% + \@check@remainingspace[3.5\baselineskip]% + \minisec{#1}% +} + +\newcommand*{\@check@remainingspace}[1][\minremainspace]{% + \par + \mbox{}% + \@tempdimc\pagegoal + \advance\@tempdimc-\pagetotal + \penalty -100\noindent + \setlength{\@tempdimb}{#1}% + \ifdim\@tempdimb>\@tempdimc\relax + \pagebreak + \else + \vskip-\baselineskip + \fi +} + +% define commands governing how input code and +% corresponding output should be displayed + +\newenvironment{bcode}% + {% + \@check@remainingspace + \par\vspace{10pt plus 2pt minus 1pt}% + \coderuleT + \marginpar{\raisebox{-8pt}{% + \marginblocklabel{\usebox\CodeT}{\usebox\Code}}}% + \ttfamily\frenchspacing\obeyspaces\par\raggedright\noindent\ignorespaces + }% + {% + \par\coderuleB + \marginpar{\raisebox{4pt}{% + \marginblocklabel{\usebox\CodeB}{\usebox\Code}}}% + \par\vspace{10pt plus 2pt minus 1pt}% + \noindent\ignorespacesafterend + } + +%Single line of input +\newenvironment{codeS}[1][0.9\linewidth]% +{% + \par + \vspace{5pt plus 4pt minus 2pt}% + \noindent + \marginpar{\mbox{\marginlabel{\usebox\Input}}}% + \begin{minipage}{#1}\ttfamily\raggedright\frenchspacing +}% +{% + \par\end{minipage}% + \par\vspace{5pt plus 4pt minus 2pt}% + \noindent\ignorespacesafterend +} + +%Multiple lines of input +\newenvironment{code}[1][0.9\linewidth]% +{% + \@check@remainingspace + \vskip5pt plus 4pt minus 2pt\relax + \inputruleT + \marginpar{\raisebox{-8pt}{% + \marginblocklabel{\usebox\InputT}{\usebox\Input}}}% + \nopagebreak + \begin{ttfamily}\nopagebreak\par\noindent\raggedright\frenchspacing +}% +{% + \par\end{ttfamily}\nopagebreak + \inputruleB + \marginpar{\raisebox{4pt}{% + \marginblocklabel{\usebox\InputB}{\usebox\Input}}}% + \par\vspace{5pt plus 4pt minus 2pt}% + \noindent\ignorespacesafterend +} + +\newcommand*{\ltxresultwidth}{0.9\linewidth} + +%Single line of output +\newenvironment{ltxresultS}[1][]% +{% + \vskip5pt plus 4pt minus 2pt\relax + \par\noindent + \marginpar{\mbox{\marginlabel{\usebox\Output}}}% + \begin{minipage}{\ltxresultwidth}% +}% +{% + \end{minipage}% + \vskip5pt plus 4pt minus 2pt\relax + \noindent\ignorespacesafterend +} + +%Multiple lines of output +\newenvironment{ltxresultM}[1][]% +{% + \@check@remainingspace + \vskip5pt plus 4pt minus 2pt\relax + \outputruleT + \nopagebreak + \marginpar{\raisebox{-8pt}{% + \marginblocklabel{\usebox\OutputT}{\usebox\Output}}}% + \nopagebreak + \par\nopagebreak +}% +{% + \nopagebreak\outputruleB + \marginpar{\raisebox{4pt}{% + \marginblocklabel{\usebox\OutputB}{\usebox\Output}}}% + \par\vspace{5pt plus 4pt minus 2pt}% + \noindent\ignorespacesafterend +} + +\newenvironment{htmlresult}[1]{\ignorespaces}{\ignorespacesafterend} + +\newenvironment{definition}[1][\linewidth]% +{% + \par\vspace{10pt plus 1pt minus 1pt}% + \noindent + \marginpar{\mbox{\marginlabel{\scriptsize\sffamily Definition}}}% + \begin{lrbox}{\boxcontents} + \begin{minipage}{#1}\ttfamily\raggedright\frenchspacing +}% +{% + \par + \end{minipage}\end{lrbox}% + \usebox{\boxcontents}% + \par\vspace{10pt plus 1pt minus 1pt}% + \noindent\ignorespacesafterend +} + +\DeclareRobustCommand{\csentryargitem}[1]{\item{\meta{#1}}} + +\DeclareRobustCommand{\BeginArgList}{\begin{description}} +\DeclareRobustCommand{\EndArgList}{\end{description}} + +\protected@write\@auxout{}{% +\string\html{\string\gdef\string\newlabelxx +\string#1\string#2\string#3\string#4\string#5\string#6{% +\string\oldnewlabel{\string#1}{{\string#2}{\string#3}}% +\string\sectionlabel{\string#1}{\string#4}}}} + +\ifnum\novicemedia=\NOVICEbook + \DeclareRobustCommand*{\appendixref}[2][]{Appendix~\ref{#2} + (\protect\nameref{#2})} + \DeclareRobustCommand*{\chapterref}[2][]{Chapter~\ref{#2} + (\protect\nameref{#2})} + \DeclareRobustCommand*{\sectionref}[2][]{Section~\ref*{#2}} +\else + \DeclareRobustCommand*{\appendixref}[2][]{\htmlref{Appendix~\ref*{#2}}{#2} + (\protect\nameref*{#2})} + \DeclareRobustCommand*{\chapterref}[2][]{\htmlref{Chapter~\ref*{#2}}{#2} + (\protect\nameref*{#2})} + \DeclareRobustCommand*{\sectionref}[2][]{\htmlref{Section~\ref*{#2}}{#2}} +\fi + +\renewcommand*{\thefootnote}{\thechapter.\arabic{footnote}} + +\let\@mkboth\markboth + +\newcommand*{\warning}{% + \marginpar + {% + \marginlabel + {% + {% + \LARGE + \fontencoding {U}% + \fontfamily{futs}\selectfont + \char 66\relax + }% + }% + }% +} +\newcommand*{\wrong}{\marginpar{\marginlabel{\LARGE\color{red}\ding{56}}}} +\newcommand*{\correct}{\marginpar{\marginlabel{\LARGE\color{green}\ding{52}}}} + +% Computer Modern maths fonts +\DeclareMathAlphabet{\cmmathrm}{T1}{cmr}{m}{n} +\DeclareMathAlphabet{\cmmathit}{T1}{cmr}{m}{it} +\DeclareMathAlphabet{\cmmathtt}{T1}{cmtt}{m}{n} +\DeclareMathAlphabet{\cmmathsf}{T1}{cmss}{m}{n} +\DeclareMathAlphabet{\cmmathbf}{T1}{cmr}{bx}{n} +\DeclareSymbolFontAlphabet{\cmmathcal}{symbols} +\DeclareSymbolFontAlphabet{\cmmathnormal}{letters} + +\newcommand*{\cmr}[1]{{\fontfamily{cmr}\selectfont #1}} + +% keywords stuff + +\newglossarystyle{keywords}% +{% + \setglossarystyle{inline}% + \renewcommand{\glossaryheader}{% + \keywordpreamble + \renewcommand{\glssubentryitem}[1]{}% + }% + \renewcommand{\glsinlinenameformat}[2]{% + \setnode{##1}% + \section[\glstoc{##1}]{\glstarget{##1}{##2}}% + \label{sec:##1}% + \index{\glsindex{##1}|indexdef}% + \glsextra{##1}% + \glsreset{##1}% + }% + \renewcommand{\glsinlinesubnameformat}[2]{% + \setnode{##1}% + \subsection[\glstoc{##1}]{\glstarget{##1}{##2}}% + \label{sec:##1}% + \glsreset{##1}% + }% + \renewcommand*{\glsinlineseparator}{}% + \renewcommand*{\glsinlinesubseparator}{}% + \renewcommand*{\glsinlineparentchildseparator}{}% + \renewcommand*{\glspostinline}{}% + \renewcommand{\glsinlinedescformat}[3]{##1}% + \renewcommand{\glsinlinesubdescformat}[3]{##1}% +} + +\newcommand{\keywordpreamble}{\input{term-defs/introduction}} + +\newcommand*{\glsd}[2][]{% + \ifglsused{#2}% + {% + \glsuseri[#1]{#2}\indexglsindex{#2}% + }% + {% + \emph{\glsuseri[hyper=false,#1]{#2}}% + \glsunset{#2}% + }% +} + +\newcommand*{\glsing}[2][]{% + \ifglsused{#2}% + {% + \glsuserii[#1]{#2}% + \indexglsindex{#2}% + }% + {% + \emph{\glsuserii[hyper=false,#1]{#2}}% + \glsunset{#2}% + }% +} + +\newcommand*{\glstoc}[1]{\glsentryuseriii{#1}} +\newcommand*{\glsterm}[2][]{\glsuseriv[#1]{#2}} +\newcommand*{\glsindex}[1]{\glsentryuserv{#1}} +\newcommand*{\glsextra}[1]{\glsdoifexists{#1}{\glsentryuservi{#1}}} + +\def\glsdkey{user1} +\def\glsingkey{user2} +\def\glstockey{user3} +\def\glstermkey{user4} +\def\glsindexkey{user5} +\def\glsextrakey{user6} + +\newcounter{keyword} + +% \newkeyword[options][plural]{label}{name} + +\newcommand*{\newkeyword}[1][]{% + \def\keyword@options{#1}% + \@newkeyword +} + +\newcommand*{\@newkeyword}[3][\keyword@plural]{% + \def\keyword@plural{#3s}% + \protected@edef\@do@newkeyword{\noexpand\@@newkeyword + {\keyword@options}% + {#1}% + {#2}% + {#3}% + }% + \@do@newkeyword +} + +\DeclareRobustCommand*{\indexglsindex}[1]{% + \index{\glsindex{#1}|hyperpage}% +} + +\newcommand{\four@digits}[1]{% + \ifnum #1<1000 0\fi\ifnum #1<100 0\fi\ifnum #1<10 0\fi \number #1% +} + +\newcommand*{\@@newkeyword}[4]{% + \stepcounter{keyword}% + \newglossaryentry{#3}{% + sort={\four@digits{\c@keyword}}, + type=keywords, + name={\protect\capitalisewords{#4}}, + \glsindexkey={#4}, + \glsextrakey={}, + first={\protect\keywordfmt{#4}}, + firstplural={\protect\keywordfmt{#2}}, + text={#4\indexglsindex{#3}}, + plural={#2\indexglsindex{#3}}, + \glsdkey={#4ed}, + \glsingkey={#4ing}, + description={\protect\input{term-defs/#3}}, + \glstockey={#4}, + \glstermkey={#4}, + #1 + }% +} + +\newglossary[klg]{keywords}{kls}{klo}{Some Definitions} + +\newcommand{\printkeywords}{% + \printglossary[type=keywords,style=keywords] +} + +% \newacr{label}{short}{long}{url} + +\newcommand*{\newacr}[4]{% + \newglossaryentry{#1}{% + type=acronym, + sort={#2}, + name={#2\gloindex{#2}}, + text={#2\protect\index{#2|hyperpage}\latex{~\cite{#1}}}, + first={#3\protect\footnote{\protect\url{#4}}\protect\index{#2|hyperpage} +(#2)}, + description={\makefirstuc{#3}. \protect\url{#4}} + }% +} + +% \newacrx{label}{short}{long} + +\newcommand*{\newacrx}[3]{% + \newglossaryentry{#1}{% + type=acronym, + sort={#2}, + name={#2\gloindex{#2}}, + text={#2\protect\index{#2|hyperpage}\latex{~\cite{#1}}}, + first={#3\protect\index{#2|hyperpage} (#2)}, + description={\makefirstuc{#3}.} + }% +} + +% \newacrnocite{label}{short}{long} + +\newcommand*{\newacrnocite}[3]{% + \newglossaryentry{#1}{% + type=acronym, + sort={#2}, + name={#2\gloindex{#2}}, + text={#2\protect\index{#2|hyperpage}}, + first={#3\protect\index{#2|hyperpage} (#2)}, + description={\makefirstuc{#3}.} + }% +} + +\newglossarystyle{acronyms}{% + \setglossarystyle{list}% + \renewcommand*{\glsgroupskip}{}% + \renewenvironment{theglossary}% + {\begin{description}} + {% + \end{description}% + \protected@write\@auxout{}{\string\@flow@endacr{\thepage}}% + }% +} + +% Code optimized for book, but some tweaking may be required +\ifnum\novicemedia=\NOVICEbook + \DeclareRobustCommand{\bookpagebreak}{\par\pagebreak} + \DeclareRobustCommand{\booklinebreak}{\linebreak} +\else + \newcommand*{\bookpagebreak}{} + \newcommand*{\booklinebreak}{} +\fi +\ifnum\novicemedia=\NOVICEreport + \DeclareRobustCommand{\reportpagebreak}{\par\pagebreak} + \DeclareRobustCommand*{\reportlinebreak}{\linebreak} +\else + \newcommand*{\reportpagebreak}{} + \newcommand*{\reportlinebreak}{} +\fi +\ifnum\novicemedia=\NOVICEscreen + \newcommand*{\screenpagebreak}{\par\pagebreak} + \newcommand*{\screenlinebreak}{\linebreak} +\else + \newcommand*{\screenpagebreak}{} + \newcommand*{\screenlinebreak}{} +\fi + +% index and display application name with hyperlink to application's +% home page + \ifnum\novicemedia=\NOVICEbook + + \newcommand{\iappnamelink}[3][]{% + \appname{#2}#1\footnote{\url{#3}}% + \index{#2@\appname{#2}}} + + \newcommand{\iperldistro}[3][]{% + \perldistro{#2}#1\footnote{\url{#3}}% + \index{#2@\protect\perldistro{#2}|hyperpage}% + } + + \newcommand{\itexdistrolink}[3][]{% + {% + \texdistro{#2}#3\footnote{\url{#3}}% + \index{#2@\protect\texdistro{#2}|hyperpage}% + \index{TeX Distributions@\protect\TeX\ Distributions!#2@\protect\texdistro{#2}|hyperpage}% + }% + } + + \else + \newcommand{\iappnamelink}[3][]{% + \htmladdnormallink{\appname{#2}}{#3}#1% + \index{#2@\appname{#2}|hyperpage}} + + \newcommand{\iperldistro}[3][]{% + \htmladdnormallink{\perldistro{#2}}{#3}#1% + \index{#2@\protect\perldistro{#2}|hyperpage}} + + \newcommand{\itexdistrolink}[3][]{% + {% + \htmladdnormallink{\texdistro{#2}}{#3}#1% + \index{#2@\texdistro{#2}|hyperpage}% + \index{TeX Distributions@\protect\TeX\ Distributions!#2@\protect\texdistro{#2}|hyperpage}% + }% + } + + \fi + +\newcommand{\suppmaterial}[2][]{#2#1\footnote{\url{\baseurl/latex/novices/html/supplemental.html}}} +\newcommand{\suppref}[3][]{#2#1\footnote{\url{\baseurl/latex/novices/html/#3.html}}} + +\newcommand{\objectref}[2]{\htmlref{#1~\ref*{#2}}{#2}} + +\newcommand{\xfigureref}[1]{\figurename~\ref{#1}} + +\newcommand{\xpageref}[2]{\vpageref{#2}} + +\newcommand{\figuretop}[1]{\hypertarget{#1top}{}} +\newcommand{\makeimg}[2]{{#2}} +\let\oelig\oe + +\newlength\rightmargini +\newlength\rightmarginii +\newlength\rightmarginiii +\newlength\rightmarginiv + +\def\itemize{% + \ifnum\@itemdepth>\thr@@ + \@toodeep + \else + \setlength{\rightmargini}{5em}% + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter\list\csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}}% + \fi +} + +\def\enumerate{% + \ifnum\@enumdepth>\thr@@ + \@toodeep + \else + \advance \@enumdepth\@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \expandafter\list\csname label\@enumctr\endcsname + {% + \usecounter\@enumctr + \setlength{\rightmargin}% + {\csname rightmargin\romannumeral\the\@enumdepth\endcsname}% + \def\makelabel##1{\hss\llap{##1}}% + }% + \fi +} + +\newcommand{\fwitem}[1]{\item[{\makebox[\labelwidth][l]{#1}}]} + +\newenvironment{fwlist}[1]{% +\begin{list}{}{% +\settowidth{\labelwidth}{#1}\setlength{\itemindent}{0pt} +\setlength{\leftmargin}{\labelwidth} +\addtolength{\leftmargin}{\labelsep}} +}{ +\end{list}} + +\newcommand{\exerciseref}[1]{\objectref{Exercise}{#1}% + \ifnum\novicemedia=\NOVICEbook\relax + \space (page~\pageref{#1})% + \fi +} + +\newcommand{\modification}[1]{\textbf{\ttfamily #1}} + +\newcommand{\comptexttex}{\texttt{comp.text.tex}~\cite{comptexttex}} +\newcommand{\texhax}{\texttt{texhax}~\cite{texhax}} + + \ifcase\novicemedia + % report + \newcommand{\latexthesis}{% + \htmladdnormallink{\emph{Using \LaTeX\ to Write a PhD Thesis}}% + {\baseurl/latex/thesis/index.html}~\cite{thesis}% + } + \or + % screen + + \newcommand{\latexthesis}{% + \htmladdnormallink{\emph{Using \LaTeX\ to Write a PhD Thesis}}% + {\baseurl/latex/thesis/index.html}~\cite{thesis}% + }% + \or + % book + + \newcommand{\latexthesis}{% + \emph{Using \LaTeX\ to Write a PhD Thesis}~\cite{thesis}% + } + \fi + +\newcommand{\latexpdfdoc}{% + \begin{em}% + \htmladdnormallink{Creating}{\baseurl/latex/pdfdoc/} + \htmladdnormallink{a}{\baseurl/latex/pdfdoc/} + \htmladdnormallink{PDF}{\baseurl/latex/pdfdoc/} + \htmladdnormallink{Document}{\baseurl/latex/pdfdoc/} + \htmladdnormallink{using}{\baseurl/latex/pdfdoc/} + \htmladdnormallink{PDFLaTeX}{\baseurl/latex/pdfdoc/}% + \end{em}% + \ifscreen\else \footnote{\url{\baseurl/latex/pdfdoc/}}\fi +} + +\newenvironment{resultS*}[1][]% +{\begin{ltxresultS}}% +{\end{ltxresultS}\ignorespacesafterend} + +\newenvironment{resultS}[1][]% +{\begin{ltxresultS}}% +{\end{ltxresultS}\ignorespacesafterend} + +\newenvironment{result}[1][]% +{\begin{ltxresultM}}% +{\end{ltxresultM}\ignorespacesafterend} + +\newcounter{object} + +\newenvironment{inlinedef}{\begin{ttfamily}}{\end{ttfamily}} + +% \casemedia{A4}{screen}{book}{html} +\newcommand{\casemedia}[4]{% + \ifcase\novicemedia#1\or#2\or#3\fi% +} + +\newcommand{\download}[1]{% +\casemedia + {\htmladdnormallink{download}{\exerciseurl/#1.tex}}% report + {\htmladdnormallink{download}{\exerciseurl/#1.tex}}% screen + {download\footnote{\url{\exerciseurl/#1.tex}}}% book + {\htmladdnormallink{download}{\exerciseurl/#1.tex}}% html +} + +\newcommand{\downloadorview}[1]{% +\casemedia + {\htmladdnormallink{download}{\exerciseurl/#1.tex} or +\htmladdnormallink{view}{\exerciseurl/#1.html}}% report + {\htmladdnormallink{download}{\exerciseurl/#1.tex} or +\htmladdnormallink{view}{\exerciseurl/#1.html}}% screen + {download\footnote{\url{\exerciseurl/#1.tex}}}% book + {\htmladdnormallink{download}{\exerciseurl/#1.tex} or +\htmladdnormallink{view}{\exerciseurl/#1.html}}% html +} + +\newcommand*{\ifbookorother}[2]{% + \ifnum\novicemedia=\NOVICEbook\relax + #1% + \else + #2% + \fi +} + +\newcommand*{\ifscreenorother}[2]{% + \ifnum\novicemedia=\NOVICEscreen\relax + #1% + \else + \ifpdf + #2% + \else + #1% + \fi + \fi +} + +\newcommand*{\doifreport}[1]{% + \ifnum\novicemedia=\NOVICEreport\relax + #1% + \fi +} + +\newcommand*{\doifbook}[1]{% + \ifnum\novicemedia=\NOVICEbook\relax + #1% + \fi +} + +\newcommand*{\doifnotbook}[1]{% + \ifnum\novicemedia=\NOVICEbook + \else + #1% + \fi +} + +\newcommand*{\breakenumi}{% + \xdef\currentenumi{\arabic{enumi}} + \end{enumerate} + \begin{enumerate} + \setcounter{enumi}{\currentenumi} +} + +%\dosidewaysfigure{label}{image}{caption} +\newcommand*{\dosidewaysfigure}[3]{% + \ifscreenorother + {% + \begin{figure} + \figuretop{#1} + \rotatebox{90}% + {% + \begin{minipage}[c][\textwidth]{0.75\textheight}% + \centering + #2% image + \caption{#3}% caption + \label{#1}% + \end{minipage} + } + \end{figure} + }% + {% + \begin{sidewaysfigure} + \figuretop{#1} + \centering + #2% image + \caption{#3}% caption + \label{#1}% + \end{sidewaysfigure} + }% +} + +\newcommand*{\degrees}[1]{\ensuremath{#1^{\circ}}} + +\newcommand*{\idxcrossref}[2]{\see{#1}{#2}} + +% display and index a counter: +\newcommand{\icounter}[1]{% +\counter{#1}\index{counters!#1@\counter{#1}|hyperpage}} + +% display and index BibTeX: +\newcommand{\iBiBTeX}{\BiBTeX\index{BibTeX@\BiBTeX|hyperpage}} + +% display and index PDFLaTeX: +\newcommand{\iPDFLaTeX}{\PDFLaTeX\index{PDFLaTeX@\PDFLaTeX|hyperpage}} + +% display and index text: +\newcommand{\Index}[1]{#1\index{#1|hyperpage}} + +% index monospaced text: +\newcommand{\indextt}[1]{\index{#1@\texttt{#1}|hyperpage}} + +% display and index monospaced text: +\newcommand{\Indextt}[1]{\texttt{#1}\indextt{#1}} + +% command definition: display and index +\newcommand*{\cmddef}[1]{\cmdname{#1}\indexComdef{#1}} + +% index and display a command name +\newcommand*{\icmdname}[1]{\cmdname{#1}\indexCom{#1}} + +% index an environment definition, but don't display it +\newcommand*{\indexEnvdef}[1]{\index{#1@\envname{#1} environment|indexdef}} + +% index an environment, but don't display it +\newcommand*{\indexEnv}[1]{\index{#1@\envname{#1} +environment|hyperpage}} + +% environment definition: display and index +\newcommand*{\envdef}[1]{\envname{#1}\indexEnvdef{#1}} + +% index and display environment +\newcommand*{\ienvname}[1]{\envname{#1}\index{#1@\envname{#1} environment|hyperpage}} + +\newtoks\argsummarytok + +\newcommand*{\indexglo}[1]{\textbf{\hyperpage{#1}}} + +\DeclareRobustCommand*{\gloindex}[1]{\index{#1|indexglo}} + +\newcommand*{\glsi}[1]{% + \glsdoifexists{#1}{\glshyperlink[\glsentrytext{#1}]{#1}}% +} + +\newcommand*{\glsni}[1]{% + \glsdoifexists{#1}{\glshyperlink[\glsentryuseriv{#1}]{#1}}% +} + +\newcommand*{\glsnl}[1]{% + \glsdoifexists{#1}{\glsentryuseriv{#1}}% +} + +\DeclareRobustCommand*{\indexuservi}[1]{% + \expandafter\index\expandafter{\glsentryuservi{#1}|hyperpage}% +} + +\DeclareRobustCommand*{\indexdefuservi}[1]{% + \expandafter\index\expandafter{\glsentryuservi{#1}|indexdef}% +} + +% \defgcs[extra][label]{name}{arg syntax}{location of definition}{summary}{arg +% summary} +\newcommand{\defgcs}[1][]{% + \def\@gcs@extra{#1}% + \@defgcs +} + +\newcommand{\@defgcs}[6][\gcslabel]{% + \def\gcslabel{#2}% + \argsummarytok{#6}% + \expandafter\newglossaryentry\expandafter + {#1}% + {% + sort={#2}, + name={\cmdname{#2}}, + first={\protect\cmdname{#2}\indexdefuservi{#1}}, + text={\protect\cmdname{#2}\indexuservi{#1}}, + user1={#3}, + user2={#4}, + description={#5}, + user3={\the\argsummarytok}, + user4={\protect\cmdname{#2}}, + user5={\@gcs@extra}, + user6={#2@\protect\cmdname{#2}} + }% +} + +% \defgchar[extra]{label}{char}{arg syntax}{location}{summary}{arg summary} +\newcommand{\defgchar}[7][]{% + \newglossaryentry{#2}% + { + name={\texttt{#3}}, + sort={#3}, + first={\texttt{#3}% + \indexdefuservi{#2}}, + text={\protect\texttt{#3}% + \indexuservi{#2}}, + user1={#4}, + user2={#5}, + user3={#7}, + user4={\texttt{#3}}, + description={#6}, + user5={#1}, + user6={#3@\texttt{#3}} + }% +} + +% \defgchildchar{label}{parent}{char}{summary} +\newcommand{\defgchildchar}[4]{% + \newglossaryentry{#1}% + {% + sort={#3},% + parent={#2}, + description={#4}, + first={\texttt{#3}% + \indexuservi{#1}}, + text={\protect\texttt{#3}% + \indexuservi{#1}}, + user4={\texttt{#3}}, + user6={#3@\texttt{#3}} + }% +} + +% \defgxchildchar{label}{parent}{char}{summary}{extra} +\newcommand{\defgxchildchar}[5]{% + \newglossaryentry{#1}% + {% + sort={#3},% + parent={#2}, + description={#4}, + first={\texttt{#3}% + \indexuservi{#1}% + \protect\index{#5|hyperpage}% + }, + text={\protect\texttt{#3}% + \indexuservi{#1}% + \protect\index{#5|hyperpage}% + }, + user4={\texttt{#3}}, + user6={#3@\texttt{#3}} + }% +} + +% \defgactivechar[sort]{label}{cs}{arg syntax}{location}{summary}{arg summary} +\newcommand{\defgactivechar}[7][]{% + \ifstrempty{#1} + {% + \def\@gcs@sort{#3}% + }% + {% + \def\@gcs@sort{#1}% + }% + \protected@edef\@do@newglossaryentry{% + \newglossaryentry{#2}% + {% + name={\noexpand\texttt{\noexpand\protect\noexpand#3}}, + sort={\@gcs@sort}, + first={\noexpand\texttt{#3}% + \indexdefuservi{#2}}, + text={\noexpand\protect\noexpand\texttt{#3}% + \indexuservi{#2}}, + user1={#4}, + user2={#5}, + user3={#7}, + user4={\noexpand\texttt{#3}}, + description={#6}, + user6={\expandonce\@gcs@sort @\texttt{\protect#3}} + }% + }% + \@do@newglossaryentry +} + +% \defgchildactivechar{label}{parent}{cs}{summary} +\newcommand{\defgchildactivechar}[4]{% + \newglossaryentry{#1}% + {% + sort={#3},% + parent={#2}, + first={\texttt{#3}% + \indexuservi{#1}}, + text={\protect\texttt{#3}% + \indexuservi{#1}}, + user4={\texttt{#3}}, + description={#4}, + user6={#3@\texttt{#3}} + }% +} + +% \defgactivecharcs[sort]{label}{cs}{arg syntax}{location}{summary}{arg summary} +\newcommand{\defgactivecharcs}[7][]{% + \ifstrempty{#1} + {% + \def\@gcs@sort{#3}% + }% + {% + \def\@gcs@sort{#1}% + }% + \protected@edef\@do@newglossaryentry{% + \newglossaryentry{#2}% + {% + name={\noexpand\cmdname{\noexpand\protect\noexpand#3}}, + sort={\backslashsym#1}, + first={\noexpand\cmdname{#3}% + \indexdefuservi{#2}}, + text={\noexpand\protect\noexpand\cmdname{#3}% + \indexuservi{#2}}, + user1={#4}, + user2={#5}, + user3={#7}, + user4={\noexpand\cmdname{#3}}, + description={#6}, + user6={\backslashsym#1@\protect\cmdname{\string#3}} + }% + }% + \@do@newglossaryentry +} + +% \defgidxactivechar[sort]{label}{cs}{arg syntax}{location}{summary}{arg summary} +\newcommand{\defgidxactivechar}[7][]{% + \ifstrempty{#1} + {% + \def\@gcs@sort{#3}% + }% + {% + \def\@gcs@sort{#1}% + }% + \toks@{#6}% + \protected@edef\@do@newglossaryentry{% + \newglossaryentry{#2}% + {% + name={\noexpand\texttt{\noexpand#3}}, + sort={"\expandonce\@gcs@sort}, + first={\noexpand\protect\noexpand\texttt{\noexpand#3}% + \indexdefuservi{#2}}, + text={\noexpand\protect\noexpand\texttt{\noexpand#3}% + \indexuservi{#2}}, + user1={#4}, + user2={#5}, + user3={#7}, + user4={\noexpand\texttt{\noexpand#3}}, + description={\the\toks@}, + user6={"\expandonce\@gcs@sort @\texttt{\string#3}} + }% + }% + \@do@newglossaryentry +} + +% \defgchildidxactivechar{label}{parent}{cs}{summary} +\newcommand{\defgchildidxactivechar}[4]{% + \newglossaryentry{#1}% + {% + sort={"#3}, + parent={#2}, + name={\noexpand\texttt{\noexpand#3}}, + first={\noexpand\texttt{\noexpand#3}% + \indexuservi{#1}}, + text={\protect\texttt{\noexpand#3}% + \indexuservi{#1}}, + user4={\texttt{#3}}, + description={#4}, + user6={"#3@\texttt{\string#3}} + }% +} + +% \defgidxactivecharcs{label}{charcs}{arg syntax}{location}{summary}{arg summary} +\newcommand{\defgidxactivecharcs}[6]{% + \newglossaryentry{#1}% + {% + name={\cmdname{\protect#2}}, + sort={"\backslashsym"#2}, + first={\cmdname{#2}% + \indexdefuservi{#1}}, + text={\protect\cmdname{#2}% + \indexuservi{#1}}, + user1={#3}, + user2={#4}, + user3={#6}, + user4={\cmdname{#2}}, + description={#5}, + user6={"\backslashsym"#2@\protect\cmdname{\string#2}} + }% +} + +% \defgsymcs[label]{sym}{syntax}{location}{summary}{arg summary} +\newcommand{\defgsymcs}[6][\gcslabel]{% + \def\gcslabel{#2}% + \argsummarytok{#6}% + \expandafter\newglossaryentry\expandafter + {#1}% + {% + name={\cmdname{#2}}, + sort={\backslashsym#2}, + first={\protect\cmdname{#2}% + \indexdefuservi{#1}}, + text={\protect\cmdname{#2}% + \indexuservi{#1}}, + user1={#3}, + user2={#4}, + description={#5}, + user3={\the\argsummarytok}, + user4={\protect\cmdname{#2}}, + user5={}, + user6={\backslashsym#2@\protect\cmdname{#2}} + }% +} + +% \defgenv[label]{env name}{arg syntax}{location}{summary}{arg +% summary} +\newcommand{\defgenv}[6][\gcslabel]{% + \def\gcslabel{env-#2}% + \argsummarytok{#6}% + \expandafter\newglossaryentry\expandafter + {#1}% + {% + sort={#2}, + name={\protect\cmdname{begin}\protect\texttt{\protect\marg{#2}}}, + first={\protect\envname{#2}% + \indexdefuservi{#1}}, + text={\protect\envname{#2}% + \indexuservi{#1}}, + user1={#3}, + user2={#4}, + description={#5}, + user3={\the\argsummarytok}, + user4={\protect\envname{#2}}, + user5={}, + user6={#2@\envname{#2} environment} + }% +} + +\newlength\summaryskip +\newlength\summarypostskip +\newlength\summarypredescskip +\newlength\summarypostnameskip + +\setlength{\summaryskip}{2ex plus .5ex minus .5ex} +\setlength{\summarypostskip}{.5ex plus .1ex minus .1ex} +\setlength{\summarypredescskip}{1ex plus .5ex minus .5ex} +\setlength{\summarypostnameskip}{1ex plus .25ex minus .25ex} + +\newglossarystyle{summary}% Summary glossary style +{% + \setglossarystyle{inline}% + \renewcommand{\glossaryheader}{\raggedright\enablefoothooks + \ifnum\novicemedia=\NOVICEbook\relax + \setleftfootmark{\dosummarytopmark}% + \setrightfootmark{\dosummarybottommark}% + \fi + }% + \renewcommand{\glsgroupheading}[1]{% + \gls@inlinesep\def\gls@inlinesep{}% + \noindent\makebox[\linewidth][c]% + {% + \ifnum\novicemedia=\NOVICEbook + \textbf{\glsgetgrouptitle{##1}}% + \else + \protected@write\@auxout{}{\string\gls@header{##1}}% + \hypertarget{gls:##1}{\textbf{\glsgetgrouptitle{##1}}}% + \fi + }% + \\*[\summarypostskip]% + }% + \renewcommand{\glsinlinenameformat}[2]{% + \def\glsentrylabel{##1}% + \penalty\@lowpenalty\par\noindent + \glstarget{##1}{##2\glsentryuseri{##1}}% + \gloindex{\glsentryuservi{##1}}% + \dosummarymark{\glsuseriv{##1}}% + \ifcsempty{glo@##1@userii}% + {% + \\*[\summarypredescskip]% + }% + {% + \\*[\summarypostnameskip]% + \textbf{Defined in: }\glsentryuserii{##1}.% + \par + \vskip\summarypredescskip + }% + }% + \renewcommand*{\glsinlinesubnameformat}[2]{\glstarget{##1}{\strut}}% + \renewcommand{\glsinlinedescformat}[3]{##1\space[\S##3]\glsentryuserv{\glsentrylabel}}% + \renewcommand{\glsinlineseparator}{\par\vskip\summaryskip\noindent}% + \renewcommand{\glsinlinesubseparator}{;\space}% + \renewcommand{\glsinlinesubdescformat}[3]{##1\space[\S##3]}% + \renewcommand{\glsinlineparentchildseparator}{}% + \renewcommand{\glsinlinepostchild}{.}% + \renewcommand{\glspostinline}{% +% \gappto\rightfootmark{\disablefoothooks}% +% \gappto\leftfootmark{\disablefoothooks}% + \protected@write\@auxout{}{\string\@flow@endsummary{\thepage}}% + }% +} + +\newcommand*{\nxipagestyle}[1]{\protect\ipagestyle{#1}} + +\newcommand*{\nxisty}[1]{\protect\isty{#1}} +\newcommand*{\nxicls}[1]{\protect\icls{#1}} +\newcommand*{\nxiappname}[1]{\protect\iappname{#1}} + +\newcommand*{\nxglsi}{\protect\glsi} +\newcommand*{\nxglsni}{\protect\glsni} + +\newcommand*{\nxglslink}[2]{\protect\glslink{#1}{#2}} + +\newcommand*{\nxGls}{\protect\Gls} +\newcommand*{\nxgls}{\protect\gls} + +\newcommand*{\nxicounter}{\protect\icounter} + +\newcommand{\dohtmlcolorbox}[2][]{#2} + +\newcommand*{\ocaron}{\v{o}} +\newcommand*{\ocedilla}{\c{o}} +\newcommand*{\obarunder}{\b{o}} +\newcommand*{\odotunder}{\d{o}} +\newcommand*{\omacron}{\={o}} +\newcommand*{\odoubleacute}{\H{o}} +\newcommand*{\odotover}{\.{o}} +\newcommand*{\otilde}{\~{o}} +\newcommand*{\ocircum}{\^{o}} +\newcommand*{\obreve}{\u{o}} +\DeclareRobustCommand*{\oumlaut}{\"{o}} +\newcommand*{\uring}{\r{u}} +\newcommand*{\rbarunder}{\b{r}} +\newcommand*{\xytie}{\t{xy}} +\newcommand*{\dotlessj}{\j} + +\newcommand{\indexEPS}{% + \index{Encapsulated PostScript (EPS) file|hyperpage}% + \index{file formats!eps@\texttt{.eps}|hyperpage}% +} + +\newcommand{\indexDVI}{% + \index{Device Independent (DVI) file|hyperpage}% + \index{file formats!dvi@\texttt{.dvi}|hyperpage}% +} + +\newcommand{\indexPDF}{% + \index{Portable Document Format (PDF) file|hyperpage}% + \index{file formats!pdf@\texttt{.pdf}|hyperpage}% +} + +\newcommand{\indexTOC}{% + \index{table of contents file (.toc)@table of contents file (\texttt{.toc})|hyperpage}% + \index{file formats!toc@\texttt{.toc}|hyperpage}% +} + +\newcommand{\indexLOF}{% + \index{list of figures file (.lof)@list of figures file (\texttt{.lof})|hyperpage}% + \index{file formats!lof@\texttt{.lof}|hyperpage}% +} + +\newcommand{\indexLOT}{% + \index{list of tables file (.lot)@list of tables file (\texttt{.lot})|hyperpage}% + \index{file formats!lot@\texttt{.lot}|hyperpage}% +} + +\newcommand{\indexLOG}{% + \index{log file (.log)@log file (\texttt{.log})|hyperpage}% + \index{file formats!log@\texttt{.log}|hyperpage}% +} + +\newcommand{\indexAUX}{% + \index{auxiliary file (.aux)@auxiliary file (\texttt{.aux})|hyperpage}% + \index{file formats!aux@\texttt{.aux}|hyperpage}% +} + +\newcommand{\iauxfile}{auxiliary (\texttt{.aux}) file\indexAUX} + +\newcommand{\indexSYNCTEX}{% + \index{synctex file (.synctex.gz)@synctex file (\texttt{.synctex.gz})|hyperpage}% + \index{file formats!synctex.gz@\texttt{.synctex.gz}|hyperpage}% +} + +\newcommand{\indexCLS}{% + \index{class files (.cls)@class files (\texttt{.cls})|hyperpage}% + \index{file formats!cls@\texttt{.cls}|hyperpage}% +} + +\newcommand{\indexSTY}{% + \index{packages files (.sty)@package files (\texttt{.sty})|hyperpage}% + \index{file formats!sty@\texttt{.sty}|hyperpage}% +} + +\newcommand*{\TO}{\ensuremath{\Rightarrow}} + +\DeclareRobustCommand*{\extraindexaux}{% + \index{file formats!aux@\texttt{.aux}|indexdef}% +} + + +\DeclareRobustCommand*{\extraindexsentencespacing}{% + \index{spacing!French|indexdef}% + \index{spacing!English|indexdef}% + \index{French spacing|idxcrossref{spacing, French}}% + \index{English spacing|idxcrossref{spacing, English}}% + \index{inter-sentence spacing|idxcrossref{spacing, inter-sentence}}% +} + +\DeclareRobustCommand*{\extraindexshortlong}{% + \index{short command|idxcrossref{command, short}}% + \index{long command|idxcrossref{command, long}}% + \index{command!long|indexdef}% +} + +\DeclareRobustCommand*{\extraindexfragile}{% + \index{moving argument|idxcrossref{argument, moving}}% + \index{argument!moving|indexdef}% + \index{fragile command|idxcrossref{command, fragile}}% +} + +\DeclareRobustCommand*{\extraindexoptional}{% + \index{optional argument|idxcrossref{argument, optional}}% +} + +\DeclareRobustCommand*{\extraindexmandatory}{% + \index{mandatory argument|idxcrossref{argument, mandatory}}% +} + +\DeclareRobustCommand*{\extraindexrobust}{% + \index{robust command|idxcrossref{command, robust}}% +} + +\DeclareRobustCommand*{\extraindexarg}{% + \index{parameter|idxcrossref{argument}}% +} + +\DeclareRobustCommand*{\extraindexgroup}{% + \index{scope|idxcrossref{group}}% +} + +\DeclareRobustCommand*{\extraindexterminal}{% + \index{command prompt|idxcrossref{terminal}}% +} + +\newcommand*{\preambleillustration}{% +\begin{ttfamily} +\begin{tabbing} +\glsni{documentclass}\marg{\ldots}\=\\ +\>\rmfamily $\longleftarrow$ This bit in here is the preamble.\\ +\glsni{begin}\marg{document} +\end{tabbing} +\end{ttfamily} +} + +\newcommand{\dobibexamplenumbered}{% +\noindent\textbf{\Large Bibliography}\relax % simulate thebibliography +\begin{fwlist}{[3]} +\fwitem{[1]} ``\LaTeX: a document preparation +system'', Leslie Lamport, 2nd edition (updated for +\LaTeXe), Addison-Wesley (1994). + +\fwitem{[2]} ``A Guide to \LaTeX: document +preparation for beginners and advanced users'', +Helmut Kopka and Patrick W. Daly, Addison-Wesley (1995). + +\fwitem{[3]} ``The \LaTeX\ Companion'', +Michel Goossens, Frank Mittelbach and +Alexander Samarin, Addison-Wesley, (1994). +\end{fwlist} +} + +\newcommand{\dobibexamplelabelled}{% +\par\noindent +{\Large\bfseries \bibname}% +\begin{fwlist}{[Goossens 1994]} +\fwitem{[Lamport 1994]} ``\LaTeX\ : a document preparation +system'', Leslie Lamport, 2nd edition (updated for +\LaTeXe), Addison-Wesley (1994). + +\fwitem{[Kopka 1995]} ``A Guide to \LaTeX: document +preparation for beginners and advanced users'', +Helmut Kopka and Patrick W. Daly, Addison-Wesley (1995). + +\fwitem{[Goossens 1994]} ``The \LaTeX\ Companion'', +Michel Goossens, Frank Mittelbach and +Alexander Samarin, Addison-Wesley, (1994). +\end{fwlist} +} + +\newcommand{\dodescriptionexample}{% +\begin{description} +\item[Animal] Living being + +\item[Vegetable] Plant + +\item[Mineral] Natural inorganic substance +\end{description} +} + +\newcommand{\dodescriptionkomaexample}{% +\addtokomafont{descriptionlabel}{\normalfont\scshape} +\begin{description} +\item[Animal] Living being + +\item[Vegetable] Plant + +\item[Mineral] Natural inorganic substance +\end{description} +} + +\newcommand{\doexerciseexample}{% +\begin{result} +\setlength{\parindent}{1.5em}% +\par\textbf{Exercise} +\begin{itshape}\par\vspace{\baselineskip} +This is a sample. +\end{itshape} +\end{result}} + +\newcommand*{\historyitem}[1]{\section*{#1}} + +\ifnum\novicemedia=\NOVICEbook + \newcommand*{\backcoverheading}{% + \newpage\thispagestyle{empty}% + \section*{Back Cover Text}% + } +\else + \newcommand*{\backcoverheading}{\chapter*{Back Cover Text}} +\fi + +\endinput diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/acrobat.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/acrobat.png Binary files differnew file mode 100644 index 00000000000..502b8b340ac --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/acrobat.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/backtic.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/backtic.png Binary files differnew file mode 100644 index 00000000000..1d4588728fb --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/backtic.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/circle.pdf b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/circle.pdf new file mode 100644 index 00000000000..8d839ee6497 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/circle.pdf @@ -0,0 +1,58 @@ +%PDF-1.3 +%Çì¢ +6 0 obj +<</Length 7 0 R/Filter /FlateDecode>> +stream +xœÝ’Q +Â0†ßsŠ<Æ¥ëšå>;<@q›° Îûƒu,(»€”ôOÒ~%?´ Æâ½#<àÐxìžpJéÄ+iiM:‚e¦Cî,WcrÝû·\|1Çt… +ªƒÌƒL„2PåMGðZ‘zE!vŒ.©†\³ò¼ö\K(ÑÐÜ0ÖÓv²ÍÚû+³5‘¡ß^"´»·ÍñÏÝöpNÿé;2z endstream +endobj +7 0 obj +175 +endobj +8 0 obj +<</R4 +4 0 R>> +endobj +5 0 obj +<</Type/Page/MediaBox [0 0 75 75] +/Rotate 0/Parent 3 0 R +/Resources<</ProcSet[/PDF] +/ExtGState 8 0 R +>> +/Contents 6 0 R +>> +endobj +3 0 obj +<< /Type /Pages /Kids [ +5 0 R +] /Count 1 +>> +endobj +1 0 obj +<</Type /Catalog /Pages 3 0 R +>> +endobj +4 0 obj +<</Type/ExtGState/Name/R4/TR/Identity/OPM 1/SM 0.02>> +endobj +2 0 obj +<</Producer (GNU Ghostscript 6.51) +>>endobj +xref +0 9 +0000000000 65535 f +0000000505 00000 n +0000000622 00000 n +0000000446 00000 n +0000000553 00000 n +0000000308 00000 n +0000000015 00000 n +0000000260 00000 n +0000000279 00000 n +trailer +<< /Size 9 /Root 1 0 R /Info 2 0 R +>> +startxref +674 +%%EOF diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom.png Binary files differnew file mode 100644 index 00000000000..5e880cffaac --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom1.png Binary files differnew file mode 100644 index 00000000000..5268c72a318 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom2.png Binary files differnew file mode 100644 index 00000000000..9b256ba1a70 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom3.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom3.png Binary files differnew file mode 100644 index 00000000000..aa8a45152bd --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom3.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom4.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom4.png Binary files differnew file mode 100644 index 00000000000..4c3e7849883 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom4.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom5.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom5.png Binary files differnew file mode 100644 index 00000000000..c8eac6422b6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom5.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom6.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom6.png Binary files differnew file mode 100644 index 00000000000..128700318c5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom6.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom7.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom7.png Binary files differnew file mode 100644 index 00000000000..ad1f8c0b25b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/cmdprom7.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dinglist.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dinglist.png Binary files differnew file mode 100644 index 00000000000..492741906d3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dinglist.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer1.png Binary files differnew file mode 100644 index 00000000000..41f4f5c21a3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer2.png Binary files differnew file mode 100644 index 00000000000..f9e83de400d --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer3.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer3.png Binary files differnew file mode 100644 index 00000000000..8573b6346be --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer3.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer4.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer4.png Binary files differnew file mode 100644 index 00000000000..ca10536cffd --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/dirviewer4.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/draftimage.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/draftimage.png Binary files differnew file mode 100644 index 00000000000..79715ee0e1d --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/draftimage.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/entersymbol.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/entersymbol.tex new file mode 100644 index 00000000000..65b8afaa8f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/entersymbol.tex @@ -0,0 +1,13 @@ +\begin{pgfpicture}{0bp}{0bp}{17.273bp}{7.051bp} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{\pgfarrowtriangle{4bp}}} +\pgfpathmoveto{\pgfpoint{16.773bp}{6.551bp}} +\pgfpathlineto{\pgfpoint{16.773bp}{3.008bp}} +\pgfpathlineto{\pgfpoint{2.6bp}{3.008bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\end{pgfpicture} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/errormessage.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/errormessage.png Binary files differnew file mode 100644 index 00000000000..022e635a0c9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/errormessage.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/exsamp.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/exsamp.png Binary files differnew file mode 100644 index 00000000000..d9ee70b0c77 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/exsamp.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph.png Binary files differnew file mode 100644 index 00000000000..352fa2e2463 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph2.png Binary files differnew file mode 100644 index 00000000000..78281e7857a --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/incgraph2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/letterbox.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/letterbox.tex new file mode 100644 index 00000000000..99aec18d7eb --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/letterbox.tex @@ -0,0 +1,170 @@ +\begin{pgfpicture}{0bp}{0bp}{341.494bp}{162.55bp} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfsetdash{{5.0bp}{5.0bp}}{0.0bp} +\pgfpathmoveto{\pgfpoint{96.08bp}{88.611bp}} +\pgfpathlineto{\pgfpoint{340.994bp}{88.611bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{163.104bp}{103.492bp}} +\pgfpathlineto{\pgfpoint{176.514bp}{137.467bp}} +\pgfpathcurveto{\pgfpoint{178.224bp}{141.787bp}}{\pgfpoint{179.214bp}{145.837bp}}{\pgfpoint{179.214bp}{148.402bp}} +\pgfpathcurveto{\pgfpoint{179.214bp}{152.452bp}}{\pgfpoint{177.054bp}{154.027bp}}{\pgfpoint{169.449bp}{155.467bp}} +\pgfpathlineto{\pgfpoint{169.449bp}{159.787bp}} +\pgfpathlineto{\pgfpoint{201.129bp}{159.787bp}} +\pgfpathlineto{\pgfpoint{201.129bp}{155.332bp}} +\pgfpathcurveto{\pgfpoint{193.344bp}{153.442bp}}{\pgfpoint{189.879bp}{150.292bp}}{\pgfpoint{186.414bp}{142.237bp}} +\pgfpathlineto{\pgfpoint{161.529bp}{83.737bp}} +\pgfpathcurveto{\pgfpoint{156.759bp}{72.217bp}}{\pgfpoint{153.744bp}{67.177bp}}{\pgfpoint{149.289bp}{62.587bp}} +\pgfpathcurveto{\pgfpoint{144.519bp}{57.682bp}}{\pgfpoint{139.344bp}{55.252bp}}{\pgfpoint{133.584bp}{55.252bp}} +\pgfpathcurveto{\pgfpoint{125.799bp}{55.252bp}}{\pgfpoint{120.039bp}{59.437bp}}{\pgfpoint{120.039bp}{65.017bp}} +\pgfpathcurveto{\pgfpoint{120.039bp}{68.797bp}}{\pgfpoint{123.504bp}{72.082bp}}{\pgfpoint{127.689bp}{72.082bp}} +\pgfpathcurveto{\pgfpoint{130.569bp}{72.082bp}}{\pgfpoint{132.009bp}{71.227bp}}{\pgfpoint{135.609bp}{67.357bp}} +\pgfpathcurveto{\pgfpoint{137.454bp}{65.467bp}}{\pgfpoint{138.894bp}{64.612bp}}{\pgfpoint{140.334bp}{64.612bp}} +\pgfpathcurveto{\pgfpoint{144.249bp}{64.612bp}}{\pgfpoint{149.289bp}{69.922bp}}{\pgfpoint{152.439bp}{77.707bp}} +\pgfpathlineto{\pgfpoint{156.039bp}{86.077bp}} +\pgfpathlineto{\pgfpoint{130.254bp}{146.242bp}} +\pgfpathcurveto{\pgfpoint{127.554bp}{152.857bp}}{\pgfpoint{125.799bp}{154.297bp}}{\pgfpoint{118.734bp}{155.332bp}} +\pgfpathlineto{\pgfpoint{118.734bp}{159.787bp}} +\pgfpathlineto{\pgfpoint{152.304bp}{159.787bp}} +\pgfpathlineto{\pgfpoint{152.304bp}{155.467bp}} +\pgfpathcurveto{\pgfpoint{146.679bp}{154.747bp}}{\pgfpoint{144.519bp}{153.172bp}}{\pgfpoint{144.519bp}{150.157bp}} +\pgfpathcurveto{\pgfpoint{144.519bp}{149.122bp}}{\pgfpoint{144.654bp}{148.267bp}}{\pgfpoint{145.104bp}{147.277bp}} +\color[rgb]{0,0,0}\pgfseteorule\pgfusepath{fill} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{285.881bp}{131.101bp}} +\pgfpathlineto{\pgfpoint{285.881bp}{142.621bp}} +\pgfpathcurveto{\pgfpoint{285.881bp}{150.541bp}}{\pgfpoint{279.401bp}{155.581bp}}{\pgfpoint{269.186bp}{155.581bp}} +\pgfpathcurveto{\pgfpoint{261.131bp}{155.581bp}}{\pgfpoint{254.651bp}{152.251bp}}{\pgfpoint{254.651bp}{148.066bp}} +\pgfpathlineto{\pgfpoint{254.786bp}{144.061bp}} +\pgfpathcurveto{\pgfpoint{254.786bp}{140.011bp}}{\pgfpoint{251.501bp}{136.726bp}}{\pgfpoint{247.451bp}{136.726bp}} +\pgfpathcurveto{\pgfpoint{243.716bp}{136.726bp}}{\pgfpoint{240.521bp}{139.606bp}}{\pgfpoint{240.521bp}{143.026bp}} +\pgfpathcurveto{\pgfpoint{240.521bp}{148.066bp}}{\pgfpoint{245.426bp}{154.141bp}}{\pgfpoint{252.221bp}{157.156bp}} +\pgfpathcurveto{\pgfpoint{257.981bp}{159.586bp}}{\pgfpoint{265.721bp}{161.341bp}}{\pgfpoint{271.931bp}{161.341bp}} +\pgfpathcurveto{\pgfpoint{278.546bp}{161.341bp}}{\pgfpoint{286.061bp}{159.451bp}}{\pgfpoint{291.371bp}{156.436bp}} +\pgfpathcurveto{\pgfpoint{297.266bp}{153.106bp}}{\pgfpoint{299.561bp}{148.651bp}}{\pgfpoint{299.561bp}{140.011bp}} +\pgfpathlineto{\pgfpoint{299.561bp}{109.501bp}} +\pgfpathcurveto{\pgfpoint{299.561bp}{103.291bp}}{\pgfpoint{299.876bp}{101.446bp}}{\pgfpoint{300.866bp}{99.421bp}} +\pgfpathcurveto{\pgfpoint{302.036bp}{96.946bp}}{\pgfpoint{304.601bp}{95.371bp}}{\pgfpoint{307.661bp}{95.371bp}} +\pgfpathcurveto{\pgfpoint{310.091bp}{95.371bp}}{\pgfpoint{311.666bp}{96.091bp}}{\pgfpoint{314.141bp}{98.251bp}} +\pgfpathlineto{\pgfpoint{316.841bp}{94.516bp}} +\pgfpathcurveto{\pgfpoint{312.836bp}{90.646bp}}{\pgfpoint{308.066bp}{88.891bp}}{\pgfpoint{302.036bp}{88.891bp}} +\pgfpathcurveto{\pgfpoint{293.531bp}{88.891bp}}{\pgfpoint{288.626bp}{92.221bp}}{\pgfpoint{285.881bp}{100.006bp}} +\pgfpathcurveto{\pgfpoint{276.251bp}{91.906bp}}{\pgfpoint{269.186bp}{88.891bp}}{\pgfpoint{259.556bp}{88.891bp}} +\pgfpathcurveto{\pgfpoint{246.731bp}{88.891bp}}{\pgfpoint{237.371bp}{96.406bp}}{\pgfpoint{237.371bp}{106.756bp}} +\pgfpathcurveto{\pgfpoint{237.371bp}{116.386bp}}{\pgfpoint{245.561bp}{123.451bp}}{\pgfpoint{261.581bp}{127.501bp}} +\pgfpathcurveto{\pgfpoint{267.881bp}{129.076bp}}{\pgfpoint{268.601bp}{129.211bp}}{\pgfpoint{285.881bp}{131.101bp}} +\pgfpathmoveto{\pgfpoint{285.881bp}{106.486bp}} +\pgfpathlineto{\pgfpoint{285.881bp}{126.061bp}} +\pgfpathcurveto{\pgfpoint{264.146bp}{124.171bp}}{\pgfpoint{252.041bp}{117.826bp}}{\pgfpoint{252.041bp}{108.196bp}} +\pgfpathcurveto{\pgfpoint{252.041bp}{101.266bp}}{\pgfpoint{257.666bp}{95.821bp}}{\pgfpoint{264.596bp}{95.821bp}} +\pgfpathcurveto{\pgfpoint{271.796bp}{95.821bp}}{\pgfpoint{277.826bp}{98.836bp}}{\pgfpoint{285.881bp}{106.486bp}} +\color[rgb]{0,0,0}\pgfseteorule\pgfusepath{fill} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{119.228bp}{160.172bp}} +\pgfpathlineto{\pgfpoint{119.228bp}{54.234bp}} +\pgfpathlineto{\pgfpoint{202.464bp}{54.234bp}} +\pgfpathlineto{\pgfpoint{202.464bp}{160.172bp}} +\pgfpathlineto{\pgfpoint{119.228bp}{160.172bp}} +\pgfclosepath +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{237.008bp}{162.05bp}} +\pgfpathlineto{\pgfpoint{237.008bp}{88.349bp}} +\pgfpathlineto{\pgfpoint{317.072bp}{88.349bp}} +\pgfpathlineto{\pgfpoint{317.072bp}{162.05bp}} +\pgfpathlineto{\pgfpoint{237.008bp}{162.05bp}} +\pgfclosepath +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{\pgfarrowsingle}}\pgfsetendarrow{{\pgfarrowsingle}} +\pgfpathmoveto{\pgfpoint{74.411bp}{159.216bp}} +\pgfpathlineto{\pgfpoint{74.411bp}{88.611bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{\pgfarrowsingle}}\pgfsetendarrow{{\pgfarrowsingle}} +\pgfpathmoveto{\pgfpoint{74.411bp}{88.611bp}} +\pgfpathlineto{\pgfpoint{74.411bp}{55.968bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{2}{-0}{0}{2}{\pgfpoint{-0.375bp}{111.572bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}height}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{2}{-0}{0}{2}{\pgfpoint{-0.175bp}{60.879bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}depth}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{2}{-0}{0}{2}{\pgfpoint{129.963bp}{0.625bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}width}} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{\pgfarrowsingle}}\pgfsetendarrow{{\pgfarrowsingle}} +\pgfpathmoveto{\pgfpoint{119.809bp}{27.622bp}} +\pgfpathlineto{\pgfpoint{201.278bp}{27.622bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{2}{-0}{0}{2}{\pgfpoint{247.878bp}{-0.25bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}width}} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{\pgfarrowsingle}}\pgfsetendarrow{{\pgfarrowsingle}} +\pgfpathmoveto{\pgfpoint{239.7bp}{26.747bp}} +\pgfpathlineto{\pgfpoint{314.991bp}{26.747bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\end{pgfpicture} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/maths.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/maths.png Binary files differnew file mode 100644 index 00000000000..a630825f36c --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/maths.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/miktex1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/miktex1.png Binary files differnew file mode 100644 index 00000000000..152e864bbc8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/miktex1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-1.png Binary files differnew file mode 100644 index 00000000000..49b19eb2ae7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-2.png Binary files differnew file mode 100644 index 00000000000..429bddf758e --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/newdoc-2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad1.png Binary files differnew file mode 100644 index 00000000000..e9595050e41 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad2.png Binary files differnew file mode 100644 index 00000000000..836bb82b619 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/notepad2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rectangle.pdf b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rectangle.pdf Binary files differnew file mode 100644 index 00000000000..ac58edb74f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rectangle.pdf diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/reflbox.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/reflbox.png Binary files differnew file mode 100644 index 00000000000..3ed90dea801 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/reflbox.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/resizbox.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/resizbox.png Binary files differnew file mode 100644 index 00000000000..7825129ae93 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/resizbox.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rotbox.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rotbox.png Binary files differnew file mode 100644 index 00000000000..90355ea3b2a --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/rotbox.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/scalbox.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/scalbox.png Binary files differnew file mode 100644 index 00000000000..bddd9dae82b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/scalbox.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/shapes.pdf b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/shapes.pdf Binary files differnew file mode 100644 index 00000000000..423637db0a7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/shapes.pdf diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/tds.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/tds.tex new file mode 100644 index 00000000000..a98aad68770 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/tds.tex @@ -0,0 +1,124 @@ +\begin{pgfpicture}{0bp}{0bp}{129.708bp}{92.568bp} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{-0.422bp}{36.243bp}} +\pgfputat{\pgfpoint{29.156bp}{3.852bp}}{% +\pgftext[right,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}texmf}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{56.271bp}{70.841bp}} +\pgfputat{\pgfpoint{0bp}{3.789bp}}{% +\pgftext[left,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}bibtex}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{55.599bp}{28.116bp}} +\pgfputat{\pgfpoint{0bp}{3.789bp}}{% +\pgftext[left,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}doc}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{93.644bp}{28.116bp}} +\pgfputat{\pgfpoint{0bp}{3.789bp}}{% +\pgftext[left,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}latex}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{93.644bp}{-0.125bp}} +\pgfputat{\pgfpoint{0bp}{3.789bp}}{% +\pgftext[left,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}latex}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{55.724bp}{-0.125bp}} +\pgfputat{\pgfpoint{0bp}{3.188bp}}{% +\pgftext[left,center]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}tex}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{114.068bp}{84.615bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}bib}} +\end{pgfscope} +\begin{pgfscope} +\pgftransformcm{1}{-0}{0}{1}{\pgfpoint{114.068bp}{56.454bp}} +\pgfputat{\pgfpoint{0bp}{0bp}}{% +\pgftext[left,base]{\rmfamily \mdseries \upshape \normalsize +\color[rgb]{0,0,0}bst}} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{31.269bp}{39.001bp}} +\pgfpathlineto{\pgfpoint{38.355bp}{39.001bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{52.528bp}{3.568bp}} +\pgfpathlineto{\pgfpoint{38.355bp}{3.568bp}} +\pgfpathlineto{\pgfpoint{38.355bp}{74.435bp}} +\pgfpathlineto{\pgfpoint{52.528bp}{74.435bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{38.355bp}{31.915bp}} +\pgfpathlineto{\pgfpoint{52.528bp}{31.915bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{109.221bp}{88.608bp}} +\pgfpathlineto{\pgfpoint{95.048bp}{88.608bp}} +\pgfpathlineto{\pgfpoint{95.048bp}{60.261bp}} +\pgfpathlineto{\pgfpoint{109.221bp}{60.261bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{87.962bp}{74.435bp}} +\pgfpathlineto{\pgfpoint{95.048bp}{74.435bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{73.788bp}{31.915bp}} +\pgfpathlineto{\pgfpoint{87.962bp}{31.915bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfsetstartarrow{{}}\pgfsetendarrow{{}} +\pgfpathmoveto{\pgfpoint{73.788bp}{3.568bp}} +\pgfpathlineto{\pgfpoint{87.962bp}{3.568bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\end{pgfpicture} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal-texdoc.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal-texdoc.png Binary files differnew file mode 100644 index 00000000000..293e0761ff4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal-texdoc.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal.png Binary files differnew file mode 100644 index 00000000000..198bbeae706 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal1.png Binary files differnew file mode 100644 index 00000000000..b4bb682f84b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal10.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal10.png Binary files differnew file mode 100644 index 00000000000..2da44b17a4d --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal10.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal11.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal11.png Binary files differnew file mode 100644 index 00000000000..75335d1a96f --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal11.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal2.png Binary files differnew file mode 100644 index 00000000000..519b4e51583 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal3.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal3.png Binary files differnew file mode 100644 index 00000000000..b09a37fbcc7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal3.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal4.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal4.png Binary files differnew file mode 100644 index 00000000000..00f3f485336 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal4.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal5.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal5.png Binary files differnew file mode 100644 index 00000000000..7fc4194b015 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal5.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal6.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal6.png Binary files differnew file mode 100644 index 00000000000..a9d807a94d3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal6.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal7.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal7.png Binary files differnew file mode 100644 index 00000000000..f11f93f6675 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal7.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal8.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal8.png Binary files differnew file mode 100644 index 00000000000..f1729cb8652 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal8.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal9.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal9.png Binary files differnew file mode 100644 index 00000000000..76d3aa79b34 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/terminal9.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-latexmk.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-latexmk.png Binary files differnew file mode 100644 index 00000000000..8325d351c0e --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-latexmk.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-preferences.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-preferences.png Binary files differnew file mode 100644 index 00000000000..ab4ed7bc4e3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-preferences.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig1.png Binary files differnew file mode 100644 index 00000000000..cd0f073ebba --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig2.png Binary files differnew file mode 100644 index 00000000000..92435ede768 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig3.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig3.png Binary files differnew file mode 100644 index 00000000000..d49e9ad540b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig3.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig4.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig4.png Binary files differnew file mode 100644 index 00000000000..4b1715c60b7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks-toolconfig4.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks1.png Binary files differnew file mode 100644 index 00000000000..80e3903fe95 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks2.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks2.png Binary files differnew file mode 100644 index 00000000000..9201293ff43 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks2.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks3.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks3.png Binary files differnew file mode 100644 index 00000000000..1d7f8107d5b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks3.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks4.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks4.png Binary files differnew file mode 100644 index 00000000000..bcaa5e63488 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks4.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5-annote.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5-annote.tex new file mode 100644 index 00000000000..5b2cb4155e7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5-annote.tex @@ -0,0 +1,124 @@ +\begin{pgfpicture}{0bp}{0bp}{397.030728bp}{428.611259bp} +\begin{pgfscope} +\pgftransformcm{0.48}{-0.0}{0.0}{0.48}{\pgfpoint{95.590728bp}{428.611259bp}} +\pgflowlevelsynccm\pgfputat{\pgfpoint{0pt}{0pt}}{\pgftext[top,left]{\includegraphics[width=628.0bp,height=828.0bp]{pictures/texworks5}}} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{67.836299bp}{370.226417bp}} +\pgfpathlineto{\pgfpoint{106.339252bp}{394.599448bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +% marker type 7 +{\begin{pgfscope} +\color[rgb]{0.0,0.0,0.0}\pgfpathqmoveto{108.029128bp}{395.669174bp} +\pgfpathqlineto{103.409057bp}{388.010521bp} +\pgfpathqlineto{103.804427bp}{392.994865bp} +\pgfpathqlineto{99.130172bp}{394.770042bp} +\pgfclosepath +\pgfusepathqfill +\end{pgfscope}} +\begin{pgfscope} +\pgftransformcm{1.0}{-0.0}{0.0}{1.0}{\pgfpoint{62.18613bp}{365.372901bp}} +\pgftext[center,top]{\rmfamily\mdseries\upshape\fontsize{12pt}{12pt}\selectfont +\color[rgb]{0.0,0.0,0.0}Abort} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{54.842204bp}{151.926712bp}} +\pgfpathlineto{\pgfpoint{97.087775bp}{113.423759bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +% marker type 7 +{\begin{pgfscope} +\color[rgb]{0.0,0.0,0.0}\pgfpathqmoveto{98.565948bp}{112.07653bp} +\pgfpathqlineto{89.958816bp}{114.509056bp} +\pgfpathqlineto{94.870513bp}{115.444603bp} +\pgfpathqlineto{95.347686bp}{120.421776bp} +\pgfclosepath +\pgfusepathqfill +\end{pgfscope}} +\begin{pgfscope} +\pgftransformcm{1.0}{-0.0}{0.0}{1.0}{\pgfpoint{46.326591bp}{158.184094bp}} +\pgftext[center,base]{\rmfamily\mdseries\upshape\fontsize{12pt}{12pt}\selectfont +\color[rgb]{0.0,0.0,0.0}Error Message} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{293.174889bp}{106.325822bp}} +\pgfpathcurveto{\pgfpoint{293.174889bp}{100.124864bp}}{\pgfpoint{244.838536bp}{98.092072bp}}{\pgfpoint{186.136006bp}{98.092072bp}} +\pgfpathcurveto{\pgfpoint{127.43346bp}{98.092072bp}}{\pgfpoint{80.59417bp}{100.124864bp}}{\pgfpoint{80.59417bp}{106.325822bp}} +\pgfpathcurveto{\pgfpoint{80.59417bp}{112.526811bp}}{\pgfpoint{128.181984bp}{114.559572bp}}{\pgfpoint{186.884529bp}{114.559572bp}} +\pgfpathcurveto{\pgfpoint{245.587059bp}{114.559572bp}}{\pgfpoint{293.174889bp}{112.526811bp}}{\pgfpoint{293.174889bp}{106.325822bp}} +\pgfclosepath +\color[rgb]{1.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{48.105492bp}{60.60683bp}} +\pgfpathlineto{\pgfpoint{92.596634bp}{82.734291bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +% marker type 7 +{\begin{pgfscope} +\color[rgb]{0.0,0.0,0.0}\pgfpathqmoveto{94.387389bp}{83.624901bp} +\pgfpathqlineto{89.005614bp}{76.480919bp} +\pgfpathqlineto{89.910506bp}{81.398369bp} +\pgfpathqlineto{85.44313bp}{83.643943bp} +\pgfclosepath +\pgfusepathqfill +\end{pgfscope}} +\begin{pgfscope} +\pgftransformcm{1.0}{-0.0}{0.0}{1.0}{\pgfpoint{48.940581bp}{56.501838bp}} +\pgftext[center,top]{\rmfamily\mdseries\upshape\fontsize{12pt}{12pt}\selectfont +\color[rgb]{0.0,0.0,0.0}Line Number} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{116.523304bp}{91.355363bp}} +\pgfpathcurveto{\pgfpoint{116.523304bp}{86.394578bp}}{\pgfpoint{110.491046bp}{82.373063bp}}{\pgfpoint{103.049884bp}{82.373063bp}} +\pgfpathcurveto{\pgfpoint{95.608707bp}{82.373063bp}}{\pgfpoint{89.57645bp}{86.394578bp}}{\pgfpoint{89.57645bp}{91.355363bp}} +\pgfpathcurveto{\pgfpoint{89.57645bp}{96.316118bp}}{\pgfpoint{95.608707bp}{100.337633bp}}{\pgfpoint{103.049884bp}{100.337633bp}} +\pgfpathcurveto{\pgfpoint{110.491046bp}{100.337633bp}}{\pgfpoint{116.523304bp}{96.316118bp}}{\pgfpoint{116.523304bp}{91.355363bp}} +\pgfclosepath +\color[rgb]{1.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +\begin{pgfscope} +\pgfsetlinewidth{1.0bp} +\pgfsetrectcap +\pgfsetmiterjoin \pgfsetmiterlimit{10.0} +\pgfpathmoveto{\pgfpoint{148.735905bp}{13.870117bp}} +\pgfpathlineto{\pgfpoint{106.490334bp}{52.37307bp}} +\color[rgb]{0.0,0.0,0.0} +\pgfusepath{stroke} +\end{pgfscope} +% marker type 7 +{\begin{pgfscope} +\color[rgb]{0.0,0.0,0.0}\pgfpathqmoveto{105.012161bp}{53.720298bp} +\pgfpathqlineto{113.619292bp}{51.287773bp} +\pgfpathqlineto{108.707595bp}{50.352226bp} +\pgfpathqlineto{108.230422bp}{45.375053bp} +\pgfclosepath +\pgfusepathqfill +\end{pgfscope}} +\begin{pgfscope} +\pgftransformcm{1.0}{-0.0}{0.0}{1.0}{\pgfpoint{213.832152bp}{11.309725bp}} +\pgftext[right,top]{\rmfamily\mdseries\upshape\fontsize{12pt}{12pt}\selectfont +\color[rgb]{0.0,0.0,0.0}Input Line} +\end{pgfscope} +\end{pgfpicture} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5.png Binary files differnew file mode 100644 index 00000000000..78ddb664bea --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks5.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks6.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks6.png Binary files differnew file mode 100644 index 00000000000..e9557706b35 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks6.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks7.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks7.png Binary files differnew file mode 100644 index 00000000000..840c2759f90 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks7.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks8.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks8.png Binary files differnew file mode 100644 index 00000000000..78f4689d701 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks8.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks9.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks9.png Binary files differnew file mode 100644 index 00000000000..9a816e4ecad --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/texworks9.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/yap1.png b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/yap1.png Binary files differnew file mode 100644 index 00000000000..821a3c9f972 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/pictures/yap1.png diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/argument.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/argument.tex new file mode 100644 index 00000000000..16690f2c547 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/argument.tex @@ -0,0 +1,5 @@ +Some \glspl{command} take one or more \glspl*{argument}. This +provides a way to give \LaTeX\ additional information so that it is +able to carry out the command. There are two types of arguments: +\glslink{mandatory}{mandatory} and \glslink{optional}{optional}. + diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/auxiliary.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/auxiliary.tex new file mode 100644 index 00000000000..2f8b6335781 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/auxiliary.tex @@ -0,0 +1,53 @@ +When \LaTeX\ creates your \gls{output}, it not only creates a PDF +file but also creates other associated files. The most common of these are +the log file\indexLOG, which has the extension \texttt{.log}, and +the \gls*{auxiliary}, which has the extension \texttt{.aux}. + +The log file contains a transcript of the most recent \LaTeX\ run. +It lists all the files that have been loaded, including the \glsterm{cls} +and any \htmlref{packages}{sec:packages} that your document has used. +There should also be the class or package version number and date, +although this is dependent on the class or package author. If you +ever want \htmlref{to ask for help}{ch:help}, you need to say what +version you are using. + +For example, this book uses the \icls{scrbook} +class, so the log file includes the lines: +\begin{flushleft}\ttfamily +\noindent +(\slash usr\slash local\slash texlive\slash 2010\slash texmf-dist\slash tex\slash latex\slash koma-script\slash scrbook.cls\par +\noindent +Document Class:\ scrbook 2010\slash 06\slash 17 v3.06 KOMA-Script document class (book)\par +\end{flushleft} +(This is actually now out-of-date as the latest version at the time +of writing this is version~3.11a dated 2012/07/05.) + +Error messages, warnings and general information messages are also +written to the log file as well as the document statistics. You can +delete this log file if you like. It will be created again the next +time you run \LaTeX. + +The auxiliary file contains all the information needed for +cross-referencing (covered in \sectionref{sec:crossref}). This is +needed to ensure all your cross-references are up-to-date. You can +delete this file, but you will need at least two \LaTeX\ runs to +ensure your cross-references are correct the next time you create +your \gls{output}. + +\htmlref{TeXWorks}{sec:texworks} also creates a file with the extension +\texttt{.synctex.gz}\indexSYNCTEX. This file allows you to jump to +and from the \gls{source} and the appropriate part of the +\gls{output}. If you delete this file, you will have to run \LaTeX\ +again before you can use this function. + +Other files that may be created include the table of contents file +(\texttt{.toc})\indexTOC, the list of figures file +(\texttt{.lof})\indexLOF\ and the list of tables file (\texttt{.lot})\indexLOT. +Some \glsunset{cls}\glspl{cls}\glsreset{cls} or \htmlref{packages}{sec:packages} create +additional files. If your operating system +hides file extensions, you might want to switch off this behaviour, +if possible, to make it easier to distinguish between all the +various files. + +TeXWorks has a menu item \menu{File}\menuto\menu{Remove AUX Files} +that will remove the auxiliary files. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/cls.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/cls.tex new file mode 100644 index 00000000000..53d0bae7187 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/cls.tex @@ -0,0 +1,11 @@ +The \gls*{cls} (\texttt{.cls}) defines the page layout, heading +styles and various \glspl{command} and \glspl{environment} needed for a +particular type of document. The class file is specified using the +command +\begin{definition} +\glsentrytext{documentclass}\oarg{\meta{options}}\marg{\meta{class-name}} +\end{definition}% +where \meta{class-name} is the name of the +file without the \texttt{.cls} extension. All \LaTeX\ documents +must start with this command. This book uses the +\icls{scrbook} class. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/command.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/command.tex new file mode 100644 index 00000000000..14533118720 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/command.tex @@ -0,0 +1,144 @@ +A \gls*{command} is used to tell \LaTeX\ to do a particular thing +at that point in the document. These are the basic forms a command +can take: + +\begin{enumerate} +\item \label{itm:controlword}\textbf{A Control Word.}\index{command!control word|hyperpage} + +This is a backslash \gls{backslashchar} followed by letters (A,\ldots,Z,a,\ldots,z). \faq{Commands gobble following space}{xspace}There can be no +non-alphabetical characters in the command, apart from the initial +backslash, and the name is always \textbf{case-sensitive} so, for example, \glsni{gamma} +and \glsni{Gamma} have different meanings. One command +that often trips up new users is \gls{LaTeX}, which prints the +LaTeX logo: \makeimg{LaTeX logo}{\LaTeX}. This command has three +captial letters and two lower case letters. If you get the case +of any of the letters incorrect, you will get an \dq{undefined +control sequence} error. + +\strut\warning There must be no space between the backslash and the +start of the command name. Some command names are made up of two +or more names joined together, such as \glsni{tableofcontents}. +\emph{Make sure you don't insert any spaces in the control word.} This will +either lead to an error or an unexpected result. +For example, +\begin{alltt}\correct +\cmdname{appendixname} +\end{alltt} +displays \dq{\appendixname} but +\begin{alltt}\wrong +\cmdname{appendix name} +\end{alltt} +switches to the appendices and then prints the word \dq{name}. + +Most \LaTeX\ commands have fairly self-explanatory names. +(For example, \booklinebreak\glsni{chapter} starts a new chapter and +\glsni{rightarrow} prints an arrow pointing to the right.) +However, in most cases, you need to use U.S. spelling +(for example, \glsni{color} rather than \cmdname{colour}). + +This is the most common form of command. Any spaces immediately +following a command of this type are ignored, so for example +\begin{codeS} +\gls{TeX} nician +\end{codeS}% + will produce +\begin{resultS}[TeXnician (where the TeX logo is written with a dropped E)] +\TeX nician +\end{resultS}% + whereas +\begin{codeS} +\glsni{TeX}\marg{} nician +\end{codeS}% + will produce +\begin{resultS}[TeX nician (where the TeX logo is written with a dropped E)] +\TeX{} nician +\end{resultS}% +\bookpagebreak + But the following will cause an \dq{undefined control sequence} + error: +\begin{alltt}\wrong +\cmdname{TeXnician} +\end{alltt} + +There is one command that you must use in every document you create, +and that is the \glsi{documentclass} command. This command +must be placed at the very start of your document, and indicates what +type of document you are creating. This command is described in more detail +\latex{in }\chapterref[later]{ch:simpledoc}. + +\item \label{itm:starredcommand}\textbf{A Starred Command}\index{command!starred|hyperpage} + +Some commands have variants that are indicated by an asterisk at the +end of the name. For example, \verb|\chapter| makes a numbered +chapter whereas \verb|\chapter*| is makes an unnumbered chapter. +A \keyword{starred command} is the version of the command with the +asterisk. (On a UK keyboard the asterisk character is usually +located on the same key as the digit~\texttt{8}.) + +This may seem like a different form to a control word, described +above. After all, I've just said that a control word can only +contain alphabetical characters. However a starred command is actually a control +word (such as \glsi{chapter}) followed by an asterisk. The +control word checks to see if the next character is +an asterisk. If it is, it performs one action, otherwise it performs +another action. + +This type should therefore just come under the previous category, +but as you will often hear of \dq{starred commands} it seemed better +to have a separate category. + +\item \label{itm:controlsymbol}\textbf{A Control Symbol.}\index{command!control +symbol|hyperpage} + +This is a backslash followed by a single non-alphabetical character. +For example \glsi{percent} will print a percent symbol. +Spaces are +not ignored after this type of command, for example +\begin{codeS} +17.5\glsi{percent} VAT +\end{codeS}% +will produce +\begin{resultS}[vat.html] +17.5\% VAT +\end{resultS} + +It's also possible to have starred forms of control symbols. For +example \glsi{newline.dbbackslashchar} forces a line break. If it's +not followed by an asterisk a page break is allowed at that line +break, but if it is followed by an asterisk \verb|\\*| no page break is allowed +at that line break. (If a page break is needed, it will be made at +the end of the previous line instead.) + +\item \label{itm:charactersequence}\textbf{Character Sequence.}\index{command!character +sequence|hyperpage} + +Some special sequences of characters combine to form an instruction. For example \texttt{ffi} +is the command to produce the \makeimg{ffi}{ffi} ligature, and the sequence +of symbols \iexclamdowncmd\ is the command to produce the upside +down exclamation mark !` + +\item \textbf{An Internal Command.}\index{command!internal|hyperpage} + +This is like the first type, a control word, but the +\texttt{@}\index{"@ in a command name@\texttt{"@} (in a command name)|hyperpage} +character appears in the command name (for example +\cmdname{c@section}) \emph{however} internal commands should only be +used in \htmlref{class files}{sec:cls} or +\htmlref{packages}{sec:packages}. The @ symbol takes on a special +meaning when a file is included using \glsi{documentclass} (a +class file) or \glsi{usepackage} (a package). + +For example, in a class file or package \cmdname{c@section} is an +internal representation of the section +\htmlref{counter}{ch:counters}, whereas in a \texttt{.tex} file +\cmdname{c@section} is interpreted as the command \cmdname{c} (the +cedilla \htmlref{accent command}{obj:accents}) that takes the +character @ as its argument, followed by \texttt{section}, which +produces the rather odd looking +\makeimg{@ with a cedilla section}{\c{@}section}\faq{\textbackslash @ and @ in macro +names}{atsigns}. + +Don't be tempted to use internal commands until you have first +grasped the basics. You have been warned! + +\end{enumerate} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/declaration.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/declaration.tex new file mode 100644 index 00000000000..beea9b3a2fe --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/declaration.tex @@ -0,0 +1,84 @@ +The term \gls*{declaration} is used to refer to a \gls{command} that +affects the document from that point onwards. The declaration itself +does not produce any text and, in most cases, its effect can be +localised by placing the declaration within a \gls{group}. For +example, \glsi{bfseries} is a declaration that switches the +current font weight to bold, so the following code +\begin{code} +\begin{alltt} +Here is some normal text. +\glsni{bfseries} Here is some bold text. +\end{alltt} +\end{code}% +will appear in the typeset document looking like: +\begin{resultS}[declaration.html] +Here is some normal text. \bfseries Here is some bold text. +\end{resultS} + +Some declarations don't immediately have a visible effect. For +example, the declarations +\begin{definition} +\gls{raggedright} +\gls{raggedleft} +\gls{centering} +\end{definition} +only set the paragraph justification to ragged-right, +ragged-left or centred, respectively, if the +declaration is still in effect at the end of the paragraph. +That is, if it is still in effect at the next \glsni{par} or blank line. + +\xminisec{Example:} +\begin{code} +This is an example paragraph illustrating the paragraph justification declarations. The default justification is fully justified. +\glsni{raggedright} The paragraph justification can be switched to +ragged-right or \glsni{raggedleft} ragged-left. +\glsni{par} +\end{code} +\begin{result}[raggedleft.html] +This is an example paragraph illustrating the paragraph justification declarations. The default justification is fully justified. +\raggedright The paragraph justification can be switched to +ragged-right or \raggedleft ragged-left. +\par +\end{result} +Above, the justification at the paragraph break is ragged-left, so +that's the justification used for the entire paragraph. +Compare with: +\begin{code} +\marg{This is an example paragraph illustrating the paragraph justification declarations. The default justification is fully +justified. +\glsni{raggedright} The paragraph justification can be switched to +ragged-right or \glsni{raggedleft} ragged-left.} +\glsni{par} +\end{code} +\begin{result}[fullyjustified.html] +\setlength{\parindent}{1.5em}% For the benefit of LaTeX2HTML +{This is an example paragraph illustrating the paragraph justification declarations. The default justification is fully justified. +\raggedright The paragraph justification can be switched to +ragged-right or \raggedleft ragged-left.}\relax +\par +\end{result} +Above, the justification at the paragraph break is fully-justified, +since both the declarations \glsni{raggedright} and +\glsni{raggedleft} are cancelled when their local scope (signified +by the curly braces) ends. +This type of mistake most often occurs when people try to centre +text doing something like: +\begin{alltt} +\marg{\glsni{centering} Some text that is supposed to +be centred. +} +\wrong +Next paragraph. +\end{alltt} +The paragraph break (blank line) must go before the closing brace. +\begin{alltt} +\marg{\glsni{centering} Some text that is supposed to +be centred. +\correct +} +Next paragraph. +\end{alltt} + +\warning While we're on the subject of centred text, don't be +tempted to use \cmdname{centerline}. It's obsolete~\cite{l2tabu}. + diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/dvi.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/dvi.tex new file mode 100644 index 00000000000..34cfb3a3d43 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/dvi.tex @@ -0,0 +1,18 @@ +\glsterm{tex} (and subsequently \LaTeX) originally created \glspl*{dvi} +instead of PDF files.\footnote{There was no PDF +back then.} However, although there are free DVI viewers, not many +people have them installed, so it's really only \TeX\ users who +can read them. Also, you can't embed image files in a DVI file or +have fancy effects, such as rotation. Instead, people can use +\TeX\slash \LaTeX\ to create +a DVI file and then use an application to convert the DVI file to +PostScript. + +These days PDF is the preferred platform-independent format, and +with the advent of PDF\TeX, modern \TeX\slash \LaTeX\ users can +directly create PDF documents rather than going through the DVI +route. Some people still prefer to create DVI files as an +intermediate step, particularly if they want to embed PostScript +instructions (as is done by the \isty{pstricks} package). For +simplicity, this book assumes that you have a modern \TeX\ +distribution and are using PDF\LaTeX\ rather than \LaTeX\TO DVI. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/environment.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/environment.tex new file mode 100644 index 00000000000..d4b8f0aa3a6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/environment.tex @@ -0,0 +1,51 @@ +An \gls*{environment} is a block of code contained within the +\glspl{command} +\begin{definition} +\gls{begin}\marg{\meta{env-name}} +\end{definition}% +and +\begin{definition} +\gls{end}\marg{\meta{env-name}} +\end{definition}% +where \meta{env-name} is the +name of the environment. The block of code is then formatted in a +method specific to that environment. For example, the +\gls{env-bfseries}\footnote{Note there is no backslash in +the +environment name.}\ environment will typeset the contents of the +environment in a bold font. The following code: +\begin{codeS} +\glsni{begin}\marg{bfseries}Here is some bold text.\glsni{end}\marg{bfseries} +\end{codeS}% +will appear in the typeset document looking like: +\begin{resultS}[Here is some bold text. (The entire sentence is in a +bold font.)] +\begin{bfseries}Here is some bold text.\end{bfseries} +\end{resultS} + +Some environments also supply \glspl{command} that may only be used +within that environment. + +\xminisec{Example:} +The \glsni{env-itemize} environment provides a command called +\glsni{item} so that you can specify individual items within +an unordered list: +\begin{code} +\begin{alltt} +Shopping List: +\glsni{begin}\marg{itemize} + \glsni{item} Cabbages + \glsni{item} Bananas + \glsni{item} Apples +\glsni{end}\marg{itemize} +\end{alltt} +\end{code}% +The above will produce the following output: +\begin{result}[shoppinglist.html] +Shopping List: +\begin{itemize} +\item Cabbages +\item Bananas +\item Apples +\end{itemize} +\end{result} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/fragile.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/fragile.tex new file mode 100644 index 00000000000..115f9561576 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/fragile.tex @@ -0,0 +1,26 @@ +Certain types of \glspl{command}, called \glspl*{fragile}, can +seriously mess things up when they are used in what is termed a +\emph{moving argument}. These types of +\gls{argument} +are generally those whose contents are copied to another part of the +document. For example, section headings appear at the start of a +section, but they can also appear in the table of contents. The +\glsi{footnote} command is a fragile command, so +\begin{alltt}\wrong +\glsni{section}\marg{A heading\glsni{footnote}\marg{with a footnote}} +\end{alltt} +will cause an error\faq{An extra `\rightbracesym'??}{extrabrace}. + +If there is no other command to use in its place, you should +use \gls{protect} immediately before the +fragile command: +\begin{codeS} +\begin{alltt} +\glsni{section}\marg{A heading\glsni{protect}\glsni{footnote}\marg{with a footnote}} +\end{alltt} +\end{codeS}% +\faq{Footnotes in LaTeX section headings}{ftnsect}This, however, is +a contrived example, because it isn't a good idea to have a footnote +in a +section heading, as it will also end up in the table of contents, +and possibly in page headings. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/group.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/group.tex new file mode 100644 index 00000000000..2604ce6db39 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/group.tex @@ -0,0 +1,32 @@ + A segment of code may be \glsd[hyper=false]{group} by placing it + within \gls{leftbracechar} and \gls{rightbracechar} (curly braces). + Most \glspl{command} that occur within a group will be + local to that group. For example, \glsi{bfseries} changes + the font weight to bold, so the following segment of code: +\begin{code} +Here is some text. \marg{This text \glsi{bfseries} is in a +group.} Here is some more text. +\end{code}% +will appear in the typeset document looking like: +\begin{resultS}[grouping.html] +Here is some text. {This text \bfseries is in a group.} +Here is some more text. +\end{resultS} + +As can be seen, the font change only stays in effect until it +reaches the end of the group (signified by the closing curly brace +\glsni{rightbracechar}.) For a command to be in the same +\keywordfmt{scope} as another command, both commands must be within the same group. +For example, in the following, \glsi{bfseries} and +\glsi{itshape} are in the same scope: +\begin{codeS} +\marg{\glsi{bfseries} Some bold \glsi{itshape} +and italic text} +\end{codeS} +But below, they are in different scopes: +\begin{codeS} +\marg{\glsni{bfseries} Some bold text} +\marg{\glsni{itshape} and some italic text} +\end{codeS} + +\Glsplural{environment} form an implicit scope. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/hyphenation.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/hyphenation.tex new file mode 100644 index 00000000000..1bf2a2649e8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/hyphenation.tex @@ -0,0 +1,34 @@ +Words sometimes require \gls*{hyphenation} to help justify paragraphs +and prevent overly large areas of white space or protrusions into +the right margin. Some word processors by default don't hyphenate +words in fully-justified paragraphs, which has led some people to +believe that hyphenation is bad. Just because word processors do +something a certain way, doesn't mean that it's the correct way. +\TeX\ has an excellent hyphenation algorithm, but the default +hyphenation pattern is designed for English. If you are writing in +another language, use the \isty{babel} package to switch the +hyphenation pattern (see \sectionref{sec:babel}). + +Despite using an excellent algorithm, \TeX\ occasionally gets the +hyphenation wrong, particularly where the hyphenation is context +sensitive. There are two ways of setting the hyphenation for a given +word. + +\begin{enumerate} +\item For all occurrences of the word, use +\begin{definition} +\gls{cshyphenation}\marg{\meta{hyphenated word}} +\end{definition} +inserting a hyphen \Indextt{-} at all possible hyphenation +points. For example: +\begin{codeS} +\glsni{cshyphenation}\marg{gal-axy} +\end{codeS} + +\item For a particular instance of a word, use \gls{hyphen} at the +hyphenation point within the word. For example: +\begin{code} +There once was a little alien called Uiop who lived in the faraway gal\glsni{hyphen}axy of +Zxcv. +\end{code} +\end{enumerate} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/intersentencespacing.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/intersentencespacing.tex new file mode 100644 index 00000000000..a91f4f9a96e --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/intersentencespacing.tex @@ -0,0 +1,124 @@ +\Gls*{intersentencespacing} refers to the default type of space +to be inserted between adjacent sentences within a paragraph. There is +disagreement over what size this space should be. French spacing +uses the same space as used between words. English spacing uses an +\Index{en-space} (half an \htmlref{em}{tab:units}\doifbook + {\csname footnote\endcsname{see \sectionref{sec:length}}}-space). With proportional +fonts\latex{ (such as this one)}, the en-space is slightly larger than a +single space. The difference is shown here: +\begin{code} +\begin{alltt} +X X + +X\gls{enspace} X +\end{alltt} +\end{code} +\begin{result} +X X +\glspar +X\enspace X +\end{result} +(Note that with fully-justified paragraphs, in both cases the spaces +may be stretched to ensure the sides of the paragraph are flushed.) + +\TeX\ (and \LaTeX) defaults to English spacing, but you can switch +to French spacing using the declaration: +\begin{definition} +\gls{frenchspacing} +\end{definition} +and switch back again using +\begin{definition} +\gls{nonfrenchspacing} +\end{definition} + +There was no en-space on a typewriter, so typists started using two +spaces in an attempt to emulate that slightly larger than one space +look. This habit has spread to word-processor users as well, and now +many people incorrectly assume English spacing means adding two +spaces after a full stop, which is too wide and looks ugly, but this +error shouldn't be used as a criticism against English spacing. + +There has been a gradual trend towards French spacing over the last +century, and some publishers insist on it. I~think this may in part +be due to a backlash against the ugliness of two spaces in +typewritten and word-processed documents. In fact the Oxford Style +Manual~\cite{oxford} simply states, \dq{In text, only use a single +space after all sentence punctuation.} + +Personally, I~prefer English spacing, particularly in reference +books. I~have many reference books on my shelf, but I~haven't read +any of them from cover-to-cover. I~flick to a particular section and +skim through the paragraphs until I~reach the desired bit of +information. Sometimes I've already looked something up, so I~have a vague +idea as to where to find the information. The extra space between +sentences makes it easier to locate a particular sentence. + +This isn't so much of an issue with books designed to be read from +beginning to end, such as a novel. However, I~have read one such +book that used a font where the commas had tiny tails and most of +the sentences contained multiple proper nouns, which made it very +difficult to read as it wasn't clear where the sentences ended. Is +that a full stop followed by a new sentence that happens to start +with a proper noun, or is it a comma whose tiny tail is blurred by +my short-sighted eyes followed by a clause that happens to start +with a proper noun? A~well-written, well-presented document should +not interrupt the reader, forcing them to continually go back to +re-parse a sentence. + +However, if you are writing a document, whether prose or technical, +with the intention of having it published you must check with the +publisher's guidelines to see if they insist on a particular style. +\xminisec{Notes:} +An end of sentence punctuation mark can be one of: a full stop +(\gls{sentence.periodchar}), exclamation mark +(\gls{sentence.exclamchar}) or question mark (\gls{questionchar}). + +\begin{enumerate} +\item If an end of sentence punctuation mark follows a lower case +character, \TeX\ assumes the punctuation mark indicates the end of +the sentence. For example, as in: +\begin{codeS} +Did you see that? I certainly did. +\end{codeS} + +\item Where this isn't the case, use \gls{spacesym} (backslash +followed by a space). +\begin{code} +This can happen when a sentence contains +a lower case abbreviation, e.g.\glsni{spacesym}like this +one. +\end{code} + +\item If an end of sentence punctuation mark follows an upper case +character, \TeX\ assumes the sentence hasn't ended at that point. +For example, as in: +\begin{codeS} +The G.P. said it was only hypochondria. +\end{codeS} + +\item Where the sentence actually ends with an upper case letter, +add \gls{at} after the letter and before the punctuation mark. +\begin{code} +Yesterday, I saw my G.P\glsni{at}. Tomorrow I'm going to see the +specialist. +\end{code} + +\end{enumerate} + +\xminisec{Note on Typewriter Fonts} + +Note that \gls{nonfrenchspacing} in a monospaced font will insert +two spaces between sentences, emulating a typewritten document. +\begin{code} +\begin{alltt} +\glsni{ttfamily} +\glsni{nonfrenchspacing} x. x. + +\glsni{frenchspacing} x. x. +\end{alltt} +\end{code} +\begin{result}\ttfamily +\nonfrenchspacing x. x. + +\frenchspacing x. x. +\end{result} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/introduction.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/introduction.tex new file mode 100644 index 00000000000..b1077d07b41 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/introduction.tex @@ -0,0 +1,129 @@ +\label{ch:def}% + +As mentioned in \chapterref[the introduction]{ch:intro}, \LaTeX\ is a +language, so you can't simply start typing and expect to see your +document appear before your very eyes\faq{Why is TeX not a WYSIWYG system?}{notWYSIWYG}. You need to know a few things +before you can get started, so it's best to define a few terms first. +Don't worry if there seems a lot to take in, there will be some +practical examples later, which should hopefully make things a little +clearer. + +\begin{latexonly} +Throughout this book, \glstext{source} is +illustrated in a typewriter font with the word +\inputlabelformat{Input} placed in the margin, and the corresponding +output (how it will appear in the PDF document) is typeset with the word \outputlabelformat{Output} in the +margin. + +\xminisec{Example:} +A single line of code is displayed like this: +\end{latexonly} +\html{Throughout this document, \glstext{source} is +illustrated in the form:} +\begin{codeS} +This is an \glsni{textbf}\marg{example}. +\end{codeS}% +The corresponding +\glslink{output}{output}\html{ (how it will appear in the PDF document)\footnote{This HTML version of the book uses bitmaps to illustrate the output, which doesn't look as good as the actual PDF version.}}\ is illustrated like this: +\begin{resultS}[exampleoutput.html] +This is an \textbf{example}. +\end{resultS}% +\begin{latexonly}% +Segments of code that are longer than one line are bounded above and below, illustrated as follows: +\begin{code} +\begin{alltt} +Line one\glsni{par} +Line two\glsni{par} +Line three. +\end{alltt} +\end{code}% +with corresponding output: +\begin{result} +Line one\par +Line two\par +Line three. +\end{result}% +\end{latexonly}% +Take care not to confuse a backslash~\glsni{backslashchar} +with a forward slash~\gls{text.slash} as they have different meanings. +\doifnotbook +{% + (Commands typeset in blue, such as \glsni{par}, indicate a hyperlink to + the command definition in the +\latexhtml{\htmlref{summary}{ch:glossary}}{\htmladdnormallink{summary}{summary.html}}.) +} + +\Glstext{command} definitions are shown in a typewriter font in the form: +\begin{definition} +\glsni{documentclass}\oarg{\meta{options}}\marg{\meta{class file}} +\end{definition}% +In this case the command being defined is called +\cmdname{documentclass} and text typed \meta{like this} (such as +\meta{options} and \meta{class file}) indicates the type of thing you +need to substitute. (Don't type the angle brackets!) For example, if you want the \icls{scrartcl} +\glstext{cls} you would substitute \meta{class file} with +\texttt{scrartcl} and if you want the \clsopt{letterpaper} option you +would substitute \meta{options} with \texttt{letterpaper}, like this: +\begin{codeS} +\glsnl{documentclass}\oarg*{letterpaper}\marg*{scrartcl} +\end{codeS} +But more on that later. + +\refstepcounter{object}\label{obj:visiblespace}% +Sometimes it can be easy to miss a space character when you're +reading this kind of \latexhtml{book}{document}. When it's important +to indicate a space, the visible space symbol~\gls{visiblespace} is used. For +example: +\begin{codeS} +A\glsni{visiblespace}sentence\glsni{visiblespace}consisting\glsni{visiblespace}of\glsni{visiblespace}six\glsni{visiblespace}words. +\end{codeS} +When you type up the code, replace any occurrence of +\glsni{visiblespace} with a space. + +\refstepcounter{object}\label{obj:comment} +One other thing to mention is the comment character~\gls{percentchar} +(the percent symbol). Anything from the percent symbol up to, and +including, the end of line character is ignored by \LaTeX. Thus +\begin{code} +A simple \glsni{percentchar} next comes a command to make some bold text\newline +\glsni{textbf}\marg{example} +\end{code}% +will produce the output +\begin{resultS}[commentexample.html] +A simple % next comes a command to make some bold text +\textbf{example} +\end{resultS}% +\refstepcounter{object}\label{obj:suppresseol}% +The percent symbol is often used to suppress unwanted space +resulting from line breaks\footnote{\LaTeX\ treats the end-of-line +character as a space.}\ in the \glstext{source}. +For example, the following code +\begin{code} +Foo\glsni{percentchar}\newline +Bar +\end{code}% +will produce the output: +\begin{resultS}[FooBar (single word)] +Foo% +Bar +\end{resultS}% +as opposed to +\begin{code} +Foo\newline +Bar +\end{code}% +which will produce the output: +\begin{resultS}[Foo Bar (two words)] +Foo\ Bar\relax% LaTeX2HTML is getting confused! +\end{resultS}% +On the other hand, spaces at the start of a line of input are +ignored, so +\begin{code} +Foo\glsni{percentchar}\newline +\strut~~Bar +\end{code} +still produces: +\begin{resultS}[FooBar] +Foo% + Bar +\end{resultS} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/length.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/length.tex new file mode 100644 index 00000000000..38471d48825 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/length.tex @@ -0,0 +1,104 @@ +A \gls{length} register stores dimensions (such as 1in, 5cm, +8.25mm). Like \glslink{command}{control words}, length registers +start with a backslash and only contain alphabetical characters in +their name. These registers are used to determine page layouts etc. +For example, the paragraph indentation is given by the length +register \gls{parindent}. Acceptable units of measurement are listed +in \tableref{tab:units}. The two relative units \dq{em} and \dq{ex} are +dependent on the current font. (The em-value used to be the +width of an \dq{M} and the ex-value was the height of the letter +\dq{x}, but these days the values are more +arbitrary~\protect\cite{texbook}.) Use \texttt{em} for widths and +\texttt{ex} for heights if you want to use relative values. + +\begin{table}[htbp] +\caption{Units of Measurement} +\label{tab:units} +\centering +\begin{tabular}{ll} +\iunit{pt}{\protect\TeX\ point} & \TeX\ point: 72.27pt = 1in\\ +\iunit{in}{inch} & inch: 1in = 25.4mm\\ +\iunit{mm}{millimetre} & millimetre: 1mm=2.845pt\\ +\iunit{cm}{centimetre} & centimetre: 1cm = 10mm\\ +\iunit{ex}{relative unit} & the \dq{x-height} of the current font\\ +\iunit{em}{relative unit} & the width of a \dq{quad} in the current font\\ +\iunit{sp}{scaled point} & scaled point: 1sp = 65536pt\\ +\iunit{bp}{big point} & big point (or \Index{PostScript} point): 72bp = 1in\\ +\iunit{dd}{did\^ot point} & did\^ot point: 1dd=0.376mm\\ +\iunit{pc}{pica} & pica: 1pc=12pt\\ +\iunit{cc}{cicero} & cicero: 1cc=12dd\\ +\iunit{mu}{math unit} & math unit: 18mu = 1em +\end{tabular} +\par +\end{table} + +To change a length you can use the command: +\begin{definition} +\gls{setlength}\marg{\meta{cmd}}\marg{\meta{length}} +\end{definition}% +where \meta{cmd} is the register (for example, \glsni{parindent}) +and \meta{length} is the new length. Alternatively, you can add a +value to a length using: +\begin{definition} +\gls{addtolength}\marg{\meta{cmd}}\marg{\meta{length increment}} +\end{definition} +The value of a length register can be displayed in your document using +\begin{definition} +\gls{the}\meta{register} +\end{definition} + +A \keyword{rubber length} is a length that has a certain amount of +elasticity. This enables you to specify your desired length but +allows \LaTeX\ to stretch or contract the space to get the body of +text as flushed with the margins as possible. + +\faq{Zero paragraph indent}{parskip}For example, the paragraph gap \gls{parskip} is usually set to +\texttt{0pt plus 1pt}. This means that the preferred gap is +0pt but \LaTeX\ can stretch it up to 1pt to help prevent the +page from having a ragged bottom. For example: +\begin{code} +\begin{alltt} +\glsni{setlength}\marg{\glsni{parindent}}\marg{0pt} +\glsni{setlength}\marg{\glsni{parskip}}\marg{10pt plus 1pt minus 1pt} + +This is the first paragraph. + +This is the second paragraph. +The paragraph indentation is \glsni{the}\glsni{parindent}. +\end{alltt} +\end{code}% +This now produces: +\begin{result} +\setlength{\parindent}{0pt} +\setlength{\parskip}{10pt plus 1pt minus 1pt} + +This is the first paragraph. + +This is the second paragraph. +The paragraph indentation is \the\parindent. +\end{result}% +In this example, the preferred paragraph gap is 10pt but +it will allow for a deviation of up to plus or minus 1pt. + +\warning Note that it's generally best not to change \glsni{parskip} +explicitly as it can cause unexpected complications. If you use one +of the \koma\ classes, such as \icls{scrreprt}, you can use the +\scrclsopt{parskip} class option that can take the following values: +\texttt{parskip=full} (a full line height) \texttt{parskip=half} +(half a line height).\footnote{There are also variants that have +\texttt{+}, \texttt{-} or \texttt{*} as a suffix. See the +\koma\ documentation for further details.} + +\xminisec{Example:} +\begin{codeS} +\glsni{documentclass}\oarg{parskip=full}\marg{scrbook} +\end{codeS} + +If you want to change any of the page layout lengths (such as +\gls{textwidth}), the easiest way to do it is to use the +\isty{geometry} \htmlref{package}{sec:packages}. This package should have been installed +when you installed your \TeX\ distribution. For example: suppose you want the total text +area to be 6.5in wide and 8.75in high with a left margin of 0.4in, then you would do: +\begin{codeS} +\glsni{usepackage}\oarg{body=\marg{6.5in,8.75in}\comma left=0.4in}\marg{geometry} +\end{codeS} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/mandatory.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/mandatory.tex new file mode 100644 index 00000000000..0630fadd030 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/mandatory.tex @@ -0,0 +1,83 @@ +\Glspl*{mandatory} are arguments that \emph{have} to be +specified. +\glspar +\xminisec{Examples:} +\begin{enumerate} +\item If you want a footnote, you need to use the +\glsi{footnote} command, which has a mandatory argument that +specifies the contents of the footnote. Like this: +\begin{codeS} +Here is a footnote.\glsni{footnote}\marg{This is the +footnote +text.} +\end{codeS} +\begin{latexonly} +\begin{resultS} +Here is a footnote.\footnotemark +\end{resultS} +\footnotetext{This is the footnote text.}% +\doifnotbook{(By default you +won't get a hyperlink. This book uses the \sty{hyperref} package, +which generates the hyperlinks.)} +\end{latexonly} + +\item If you want to start a new chapter, you need to use the +\glsi{chapter} command, but you also need to tell \LaTeX\ +the +title of this new chapter. So the \glsi{chapter} command +takes +one mandatory argument that specifies the title. + +For example, the following code: +\begin{codeS} +\glsni{chapter}\marg{Some Definitions} +\end{codeS}% +was used to generate the heading for +\latexhtml{the current chapter (at the top of +page~\pageref{ch:def})}{\chapterref[the definitions chapter]{ch:def} +of this document}. +\item The command \glsi{textbf} typesets its argument in a +bold +font (as opposed to the +\glsterm{declaration} +\glsi{bfseries} which switches to a bold font.) + +For example, the following code: +\begin{codeS} +\glsni{textbf}\marg{Some bold text.} +\end{codeS}% +produces the output +\begin{resultS}[Some bold text. (All the text is in bold.)] +\textbf{Some bold text.} +\end{resultS} +\end{enumerate} + +\xminisec{Notes:} +\begin{enumerate} +\item\label{itm:argnogrp} \LaTeX\ takes the first non-space object +following the command name as the argument, which is why in the +above +examples the arguments have to be \glsd{group}. + +Suppose the last example above didn't have a group, so instead the +code was: +\begin{codeS} +\glsni{textbf} Some bold text. +\end{codeS}% +then only the \dq{S} would be the argument because it's the first +object +following the command, in which case the output would look like: +\begin{resultS}[Some bold text. (Only the letter S is bold.)] +\textbf Some bold text. +\end{resultS} + +\item If you want the argument to be blank, use empty braces: +\gls{leftbracechar}\gls{rightbracechar}. For example, suppose you +want to have a +chapter without a title\protect\footnote{The numbers for chapters, sections +etc are automatically inserted by \LaTeX, so this example would +produce a numbered chapter without a title.}\ you would need to do: +\begin{codeS} +\glsnl{chapter}\marg{} +\end{codeS} +\end{enumerate} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/optional.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/optional.tex new file mode 100644 index 00000000000..2cbb56233d4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/optional.tex @@ -0,0 +1,75 @@ +Some \glspl{command} may have one or more \glspl*{optional}. Unlike +\glspl{mandatory}, optional arguments must always be enclosed in +square brackets \gls{opt.opensq}~\gls{opt.closesq}. +\xminisec{Example:} +The command \gls{newline.dbbackslashchar} ends a line. +So the following segment of code: +\begin{codeS} +Line one\glsni{newline.dbbackslashchar}Line two. +\end{codeS}% +will produce the following output: +\begin{result}[Line one <newline> Line two]\setlength{\parindent}{1.5em}% +Line one\\Line two. +\end{result}% +However the \glsni{newline.dbbackslashchar} command also +has an optional +argument that allows you to specify how big the gap between the two +lines should be. So the following segment of code: +\begin{codeS} +Line one\glsni{newline.dbbackslashchar}\oarg{1cm}Line two. +\end{codeS}% +will produce the following output: +\begin{result}[Line one <1cm vertical gap> Line two]\setlength{\parindent}{1.5em}% +Line one\\[1cm]Line two. +\end{result} +Incidentally, note the +difference between the previous example, and the following example: +\begin{codeS} +Line one\glsni{newline.dbbackslashchar}\marg{[1cm]} Line two. +\end{codeS}\screenpagebreak +\begin{result}[newlineargs.html]\setlength{\parindent}{1.5em}% +Line one\\{[1cm]} Line two. +\end{result}% +\faq{Start of line goes awry}{newlineargs}In this example the \texttt{[1cm]} has been placed inside a group, so +it is no longer considered to be an optional argument, and since the +command \glsni{newline.dbbackslashchar} does not take a +mandatory argument, +the \texttt{[1cm]} is simply interpreted as ordinary text. + +\xminisec{Example:} +The command \glsi{framebox} (which will be covered later in +\sectionref{sec:fbox}) takes a +\gls{mandatory} and two optional arguments. +\glsni{framebox} puts a frame around the contents of its +mandatory argument: +\begin{codeS} +\glsni{framebox}\marg{Some Text} +\end{codeS}% +\begin{resultS}[Image of the words 'Some Text' inside a rectangular +box where there is a narrow gap between the edge of the text and the +frame] +\framebox{Some Text} +\end{resultS} +The first optional argument can be used to make the box a specified +width: +\begin{codeS} +\glsni{framebox}\oarg{4cm}\marg{Some Text} +\end{codeS}% +\begin{resultS}[Image of the words 'Some Text' centred inside a +rectangular box of width 4cm (plus a narrow gap)] +\framebox[4cm]{Some Text} +\end{resultS} +The second optional argument specifies the +justification of the text (\underline{l}eft, \underline{r}ight or +\underline{c}entred) within the box: +\begin{codeS} +\glsni{framebox}\oarg{4cm}\oarg{r}\marg{Some Text} +\end{codeS}% +\begin{resultS}[Image of the words 'Some Text' right justified inside a +rectangular box of width 4cm (plus a narrow gap)] +\framebox[4cm][r]{Some Text} +\end{resultS} +\glspar +In general, if a command has both optional and mandatory arguments, +the optional arguments are usually specified first (although there +are a few exceptions). diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/output.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/output.tex new file mode 100644 index 00000000000..6b7149fe72b --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/output.tex @@ -0,0 +1,14 @@ + The \LaTeX\ application reads in your \glsterm{source} + and creates the typeset document, the + \gls*{output}. This book assumes that you will be using the + version of \LaTeX\ that produces PDF files (PDF\LaTeX). If you are + using TeXWorks (see \chapterref{ch:tex2pdf}), you need to select the + \mbox{\dq{PDFLaTeX}} item from the drop-down list. If you are using + TeXnicCenter, select the \mbox{\dq{LaTeX\TO PDF}} build + profile. If you are + using WinEdt, when you want to build your document click on the + button marked \dq{PDFLaTeX} rather than the one marked \dq{LaTeX}. + If you are using a terminal or command prompt, use the command + \texttt{pdflatex} rather than \texttt{latex}. (TeXnicCenter, WinEdt + and using the terminal or command prompt approach are described in + the \suppmaterial[.)]{supplemental material} diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/perl.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/perl.tex new file mode 100644 index 00000000000..73837d06157 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/perl.tex @@ -0,0 +1,20 @@ +\glsterm{tex}-distributions such as \itexdistro{TeX~Live} and \itexdistro{MiKTeX} also +include some helper applications that you may find useful. For example, +\iappname{texdoc} (\sectionref{sec:texdoc}) helps you access +installed documentation and \iappname{makeindex} helps generate an +index for your document. Some of the helper applications are +written in a scripting language called \gls*{perl}, and you must +have the \iappname{perl} application installed to be able to use +them. Unix-like operating systems should already have it installed. +Windows users can choose between several Perl distributions. The +most popular seem to be \iperldistro{Strawberry Perl}{http://strawberryperl.com/} and +\iperldistro[.]{Active Perl}{http://www.activestate.com/activeperl} Perl scripts that come +with \glsterm{tex} include: \iappname{epstopdf} (converts Encapsulated +PostScript (EPS)\indexEPS\ files to PDF), \iappname{pdfcrop} (crops +a PDF file), \iappname{xindy} (a more flexible indexing application +than \iappname{makeindex}), \iappname{texcount} (counts the number +of words in a \LaTeX\ document) and \iappname{latexmk} (runs \LaTeX\ +and any associated applications, such as \iappname{bibtex}, the +required number of times to ensure the document is fully +up-to-date). + diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/preamble.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/preamble.tex new file mode 100644 index 00000000000..262f13a1126 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/preamble.tex @@ -0,0 +1,11 @@ +The \gls*{preamble} is the part of the \gls{source} that comes +after the \screenlinebreak\reportlinebreak\glsi{documentclass} +\gls{command} and before +\glsni{begin}\marg{\texttt{document}} (the start of the +\glsi{env-document} \gls{environment}). Only +a few +special commands may be placed in the preamble (such as \glsni{title}), and there are a few +special commands that may only go in the preamble (such as \glsi{usepackage}). +Nothing that generates text (for example, \glsi{maketitle}) may go in the preamble. + +\preambleillustration diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/robust.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/robust.tex new file mode 100644 index 00000000000..3f73e1a0661 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/robust.tex @@ -0,0 +1 @@ +A \gls*{robust} is a \gls{command} that is not a \glsni{fragile}. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/short.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/short.tex new file mode 100644 index 00000000000..7ab189d4595 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/short.tex @@ -0,0 +1,10 @@ +A \gls*{short} is a \gls{command} whose \gls{argument} may not +contain a paragraph break (either as a blank line or using +\glsi{par}.) Conversely, a \keywordfmt{long command} is a command whose +\gls{argument} may contain a paragraph break. + +Using short commands helps to test for forgotten braces, so it is +recommended that when you \htmlref{define a new +command}{ch:newcom}\latex{ (see \chapterref{ch:newcom})} you should +always make the command a short command, unless there is a chance +that the argument may need to contain a paragraph break. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/source.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/source.tex new file mode 100644 index 00000000000..50a3f0a6af4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/source.tex @@ -0,0 +1,6 @@ + The \gls*{source} consists of all the text and \LaTeX\ + \glslink{command}{commands} that make up an entire document. + The source code is typed in using a text + editor\faq{TeX-friendly editors and shells}{editors}, and saved with + the file extension \texttt{.tex}. The source code may be contained + in just one file, or it might be split across several files.% diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/terminal.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/terminal.tex new file mode 100644 index 00000000000..f6303062ea2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/terminal.tex @@ -0,0 +1,59 @@ +Sometimes you may find that you need to use a command-line +application. This is an application that doesn't have a graphical +user interface. This isn't specific to \glsterm{tex}, but the \TeX\ +distribution comes with a number of them. In fact, front-ends (such +as TeXWorks) run some of these applications for you when click on +the typeset or build button. + +Most operating systems provide a \gls*{terminal} or command prompt where +you can type the command-line application name and any associated +information. For example, \xfigureref{fig:terminal} shows a terminal +running under Fedora on Linux. + +\begin{description} +\item[Windows] To open the MSDOS Prompt, go to the Start menu, then +\dq{All Programs}, then \dq{Accessories} and click on \dq{MSDOS +Prompt}. + +\item[Mac OSX] To open the Mac Terminal, go to your +\dq{Applications} folder, open \dq{Utilities} and double click on \dq{Terminal}. + +\item[Unix etc] The Terminal is usually located either in the \dq{Applications} +menu or in the \dq{System Tools} subdirectory of the +\dq{Applications} menu. +\end{description} + +\begin{figure}[htbp] +\figconts + {pictures/terminal} + {% + \caption{A Terminal} + } + {fig:terminal} +\end{figure} + +\xminisec{Example:} + +One such command-line application you are likely to need is +\iappname{texdoc}. This is mentioned in more detail in +\sectionref{sec:texdoc}, but to use \iappname{texdoc} you need to +open the terminal or command prompt as described above and type +\texttt{texdoc} followed by a package or class name, for example: +\begin{verbatim} +texdoc scrbook +\end{verbatim} +(see \figureref{fig:terminal-texdoc}) +then press the Enter or Return \enter\ key. + +\begin{figure}[htbp] +\figconts + {pictures/terminal-texdoc} + {% + \caption{Running texdoc From a Terminal} + } + {fig:terminal-texdoc} +\end{figure} + +Other \glsterm{tex}-related command-line applications include +\iappname{pdflatex}, \iappname{bibtex}, \iappname{makeindex}, +\iappname{xindy} and \iappname{kpsewhich}. diff --git a/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/tex.tex b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/tex.tex new file mode 100644 index 00000000000..29c6fbe47db --- /dev/null +++ b/Master/texmf-dist/doc/latex/dickimaw/src/novices/term-defs/tex.tex @@ -0,0 +1,16 @@ +\gls*{tex}\faq{What is TeX?}{whatTeX}\ is the typesetting language +written by +\htmladdnormallink{Donald~Knuth}{http://www-cs-faculty.stanford.edu/~knuth/}. +He wrote a format of \TeX\ called Plain \TeX, but many people find +Plain \TeX\faq{Should I use Plain TeX or LaTeX?}{plainvltx}\ +complicated, so Leslie~Lamport wrote a format of \TeX\ called +\LaTeX\ to make it a bit easier to use\faq{How does LaTeX relate to +Plain TeX?}{LaTeXandPlain}. You can think of \LaTeX\ as a +go-between converting your instructions into \TeX. This +\latexhtml{book}{document} mostly uses the term \LaTeX, even if the +matter is more general to \TeX, to avoid complicating matters. Some +error messages you may see will be \LaTeX\ messages, some will be +\TeX\ messages. \LaTeX\ error messages tend to be a bit easier to +understand than \TeX\ messages. There are other formats of \TeX, +such as ConTeXt\faq{What is ConTeXt?}{context}, but this book +does not cover them. |