(SDU Logo) Institut for Matematik og Datalogi
Syddansk Universitet Institut for Matematik og Datalogi

DM534 - Introduction to Computer Science 2012

Latex Stuff

Forced Line Breaks and Paragraphs

Inserting \\ or \newline will force a line break. This is used a lot in many environments, but should almost never be used in normal text. Inserting an empty line in the source code will start a new paragraph. The paragraph style is as default a newline and the first line indented. This can be changed globally if some other style is needed.

The command \paragraph{...} is a kind of "sub-sub-sub sectino", NOT a textual paragraph.

Forced Page Breaks

Inserting \newpage will force a page break, which may be desired after the table of contents or similar replaces. However, it is rarly needed otherwise and will create a lot of half-empty pages. I.e., do not use it as default before every \section, unless there is a very good reason for it.

For small documents, consider not using a whole page as title page. The same with the table of contents; if it is small, it may be better to put more on the same page, or even completely leave it out.

Math

If something is math-like, it should be written in math mode. That includes variables and negative numbers (e.g., -42 is wrong, $-42$ is correct). If the math is part of text, math mode is initiated and ended with $. If the math is not part of text, it called "display math". Many environments exist for display math, but the align-environment can be used in most cases. E.g., \begin{align*}[some math]\end{align*} for creating display math without equation numbers. Use align instead of align* to show equation numbers.

The align environment can vertically align multiple lines by inserting & in every line. Multiple & can be inserted to create more columns. The justufication of the columns alternate, starting with right justification.

If text must be embedded in math mode, then the command \text{...} can be used. Remember that spaces in math mode are managed by Latex (and forced space should very rarely be used), so space in the start and end of the embedded text may be needed.

Appendix

When the appendix should start, insert \appendix. This will reset the section/chapter counter and use A, B, C, .. as section/chapter number. Do NOT just make a \section{Appendix}. For extra stuff, see the appendix package.

Page Numbering/Style

Usually page numbering starts with roman numbers and changes to arabic numbers after the TOC (and it resets). Similarly, the page style sometimes change.

TOOD: write how to do it properly

Source Code

Almost always, do NOT include source code as pictures.

Use the listings package, maybe with a custom defined language if it does not know it already.

Dashes and Quotation Marks

click (using just ' and " is not correct)

Abbreviations and Spaces

If a . (dot) is not the end of a sentence, the following space must be escaped. Otherwise the space is an end-of-sentence space, which might be larger than a normal inter-word space.

Some spaces should be non-breaking, i.e. a line break should not occur at the space. E.g., the space in "page \ref{" or "Figure \ref{". Use ~ to make a non-breaking space: "page~\ref{".