\documentclass[11]{article} \usepackage[utf8]{inputenc} \usepackage{upquote} \title{CSC 400} \author{Michael Scott} \date{March 2021} \newcommand{\Sysname}{Spiffy} \begin{document} \maketitle \section{TeX and LaTeX} TeX is a programming language for writing documents. It was developed by Donald Knuth (ACM Turing Award, 1974). It was originally written in WEB, a literate programming system built on Pascal. Modern versions are in C. TeX computes with macros, with call-by-name parameter semantics. LaTeX is a macro package written on top of TeX. It was originally written by Leslie Lamport (ACM Turing Award, 2013). The two level structure (LaTeX on top of plain TeX) means there are often two or more ways to do something: \begin{itemize} \item \verb|\def v. \[re]newcommand| \item \verb|\vskip v. \vspace| \item \verb|\usepackage v. \RequirePackage| \item \verb|\em or \it v. \emph| \end{itemize} Paremeters to macros are enclosed in curly braces. Multiple parameters require multiple sets of braces. Some macros have one or more optional parameters which, if present, come first and are enclosed in square brackets. \emph{Environments} like \verb|itemize| (used above) are just commands whose last parameter is expected to be long, and is given an explicit end marker. There is a \emph{huge} amount to learn to be a real LaTeX expert. LaTeX itself has thousands of macros. Standard distributions come with hundreds of additional packages that can be included on demand. (My TeX Live installation has over 3000 of them.) Most people start by copying an existing paper and editing it, so they don't have to create a LaTeX doc from scratch. My goal today is simply to alert you to pitfalls that often trip up novice users. \section{Structure and presentation} As in HTML, good writers distinguish between structure and presentation. TeX is pretty unstructured; LaTeX has lots of structure. Macro packages often change the format. So you say \verb|\section{Introduction}| rather than, say, \begin{verbatim} \vskip 3ex {\Large\bf Introduction} \vspace 2ex \end{verbatim} \section{Typography} Kerning is the spacing of adjacent characters. This is usually automatic (and TeX is very good at it), but there are pitfalls. Consider \begin{quote} \verb|{\em if}MMM | \quad {\em if}MMM\\ \verb|\emph{if}MMM| \quad \emph{if}MMM \end{quote} Be aware that letters in math mode are unkerned. Never ever ever use math mode to create italics: $efficiency$ v.\ \emph{efficiency} v.\ $\mathit{efficiency}$. Beware that macros eat following characters. So given \begin{verbatim} \newcommand{\Sysname}{Spiffy} \end{verbatim} we have \begin{quote} \verb|\Sysname is totally awesome.| \Sysname is totally awesome.\\ \verb|\Sysname{} is totally awesome.| \Sysname{} is totally awesome. \end{quote} Most of the time you should let LaTeX space things automatically. If you feel an irresistable urge to tweak things, \raisebox{1.5pt}{\normalsize$\sim$} is a non-breaking space \verb|\,| is a narrow space, \verb|\kern| \emph{len} can be used to get \emph{exactly} the (usually very small) spacing you want. Extra horizontal space can be added with \verb|\hspace|, extra vertical space with \verb|\vspace|. Variants named \verb|\hspace*| and \verb|\vspace*| insert space even when there's nothing on the other side to ``push against.'' Each end of line in your source acts like a space. You can inhibit that by ending the line with a comment (a string starting with \verb|%|). In traditional English text, the space after a sentence is longer than the space between words. So-called ``French spacing'' makes all the spaces the same size. Some conference formats use French spacing. To make English spacing work, LaTeX assumes that a period, question mark, or exclamation point (optionally followed by quote marks or right parens, brackets, or braces) ends a sentence, unless the preceding character is a capital. If this assumption is wrong, you need to fix things. So say \verb|Fig.\ 3| (Fig.\ 3) rather than \verb|Fig. 3| (Fig. 3). Similarly, you need to use \verb|Z\@.| to note that the last letter of the alphabet is Z\@. Otherwise the next space will be too small. (These fixes are harmless with French spacing, so you should use them all the time.) As a general rule of thumb, avoid typesetting lines longer than about 60 characters. Ten-point type on letter-size paper with one-inch margins looks terrible: \bigskip \hspace*{-.75in} \begin{minipage}{6in} \noindent\footnotesize Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{minipage} \bigskip Be aware that double and single quotes are ``aimed'' in English: you need to say \verb|``aimed''| there. Also, a hyphen (run-time) is different from an en-dash (March 18--23), a minus sign ($-3$), or an em-dash---all four have their uses; learn them! An oddity of English is that end-of-sentence punctuation is generally placed \emph{inside} quote marks, rather than outside. In a simlar vein, superscript footnote marks generally come \emph{after} the end-of-sentence punctuation (but square-bracket citations go \emph{inside}). \section{Bibliographies} Use BibTeX to create bibliographies. Start curating your own personal bibliography \emph{now}, and use it for all your papers. You can keep your notes in it, too. \emph{Warning 1}: The ACM Digital Library is a great source of bibliographic entries (already in BibTeX format), but \emph{these entries cannot be used as-is}, because ACM uses some of the fields in ways that are incompatible with standard BibTeX macros. For example, ACM uses the ``address'' field in conferences for the location of the sponsoring organization rather than the location of the conference itself. You can always tell when a paper has snarfed refs straight from the Digital Library, because every ACM conference will appear to have been held in New York City and every IEEE conference will appear to have been held in Washington, DC~\cite{broken, fixed}. As a general rule, you should delete the address field, add a month field, change the Unicode en-dash to a LaTeX \verb|--| in the pages field, change the location field to address, probably cut the publisher, and maybe expand or abbreviate certain words or move the series name into the conference name. \emph{Warning 2}: You also need to put extra braces around any proper names in the title; otherwise BibTeX will uncapitalize them. \bibliographystyle{abbrv} \bibliography{main} \end{document}