Check out my first novel, midnight's simulacra!

LaTeX: Difference between revisions

From dankwiki
(add chktexrc note courtesy of ivan andrus)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Spacing==
* The default margins are generally 1.5" or more, more suitable for books than other documents. For 1" margins, add <tt>\usepackage{fullpage}</tt>.
* Double-spacing can be achieved (in the main body) via <tt>\usepackage{doublespace}</tt>
** Return to single-spacing via <tt>\begin{singlespace}</tt> and <tt>\end{singlespace}</tt> blocks.
==Punctuation==
==Punctuation==
===Quotation Marks===
===Quotation Marks===
Line 28: Line 24:
* <tt>enumerate</tt> will give numbers instead of bullets
* <tt>enumerate</tt> will give numbers instead of bullets
* <tt>description</tt> generates labeled items. Provide each label in square brackets: <tt>\item[label]</tt>
* <tt>description</tt> generates labeled items. Provide each label in square brackets: <tt>\item[label]</tt>
==Appearance==
===Fonts===
* Bold: <tt>\textbf{boldfaced text}</tt>
* Italics: <tt>\textit{italicized text}</tt> (it is advised to end most italicized sequences with "\/")
* Monospace: <tt>\texttt{typewriter-stylized text}</tt>
===Spacing===
* The default margins are generally 1.5" or more, more suitable for books than other documents. For 1" margins, add <tt>\usepackage{fullpage}</tt>.
* Double-spacing can be achieved (in the main body) via <tt>\usepackage{doublespace}</tt>
** Return to single-spacing via <tt>\begin{singlespace}</tt> and <tt>\end{singlespace}</tt> blocks.
* <tt>\vfill</tt>, <tt>\vspace{amount}</tt> and <tt>\pagebreak</tt>
==Special Forms==
To include monospaced documents (code, emails, etc) use <tt>\VerbatimInput</tt> on a filename argument. This requires the <tt>moreverb</tt> package.
* Important attributes include ''fontsize'', ''frame'', ''framerule'', ''label'', and ''numbers''


==[[Unicode]]==
==[[Unicode]]==
Basic LaTeX doesn't support UTF-8 beyond expanding macros based on lexical sequences. If this is intended, use the <tt>utf8</tt> parameter to the <tt>inputenc</tt> package. [http://scripts.sil.org/xetex XeTeX] aims to be a fully Unicode-aware TeX engine.
Basic LaTeX doesn't support UTF-8 beyond expanding macros based on lexical sequences. If this is intended, use the <tt>utf8</tt> parameter to the <tt>inputenc</tt> package. [http://scripts.sil.org/xetex XeTeX] aims to be a fully Unicode-aware TeX engine.
==BibTeX==
* Style [http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html examples]
* Protect anything like capitalization, accented characters etc with curly braces
* A good list of [http://www.math.uiuc.edu/~hildebr/tex/bibliographies.html BibTeX tips]
* My [[BibTeX|BibTeX repository]]
==Checkers==
==Checkers==
Of these, ChkTeX seems more fully-featured than lacheck. Neither is actively maintained.
* [http://baruch.ev-en.org/proj/chktex/ ChkTeX]
** Watch out for some idiosyncrasies of ChkTeX. In particular, its error #38 is a false positive using the standard rules of American English.
** Rule emission can be controlled with command-line options or <tt>~/.chktexrc</tt>
*** I use <tt>-n 38</tt>
*** This has the (more descriptive) .chktexrc equivalent <code>QuoteStyle = Traditional</code> (default: Logical)
* [http://www.ctan.org/tex-archive/help/Catalogue/entries/lacheck.html lacheck]
* [http://www.ctan.org/tex-archive/help/Catalogue/entries/lacheck.html lacheck]
* [http://baruch.ev-en.org/proj/chktex/ ChkTeX]


==See Also==
==See Also==

Revision as of 22:18, 11 June 2012

Punctuation

Quotation Marks

Use `` for the left mark, and two apostrophes for the right.

Hyphens/Dashes

  • Hyphens separate the parts of a compound word. Use a single '-', without spaces.
  • Endashes separate the bounds of a range, usually numerics. Use two '-' characters, without spaces.
  • Emdashes separate distinct thoughts. Use three '-' characters, without spaces.
  • Minus signs are a mathematical entity. Use a single '-' in math mode.

Periods

To get correct spacing:

  • Use ".\ " if the period does not end the sentence.
  • Use "\@. " if the period ends the sentence, and follows a capital letter.

Ellipses

Use \ldots (or \cdots for line-centered dots).

  • Don't use three periods (bad spacing) or the Unicode character '…' (HORIZONTAL ELLIPSIS, U+2026).
  • What about \dots? fixme

Tildes

Generally, \textasciitilde{} is the way to go. In math mode, use \sim.

  • When typesetting a url, the url and hyperref packages handle tildes properly.

Backslashes

Use \textbackslash{} to render a backslash in text.

Lists

Enclose bulleted lists within a \begin{itemize} and \end{itemize} block. Each element is preceded by \item.

  • enumerate will give numbers instead of bullets
  • description generates labeled items. Provide each label in square brackets: \item[label]

Appearance

Fonts

  • Bold: \textbf{boldfaced text}
  • Italics: \textit{italicized text} (it is advised to end most italicized sequences with "\/")
  • Monospace: \texttt{typewriter-stylized text}

Spacing

  • The default margins are generally 1.5" or more, more suitable for books than other documents. For 1" margins, add \usepackage{fullpage}.
  • Double-spacing can be achieved (in the main body) via \usepackage{doublespace}
    • Return to single-spacing via \begin{singlespace} and \end{singlespace} blocks.
  • \vfill, \vspace{amount} and \pagebreak

Special Forms

To include monospaced documents (code, emails, etc) use \VerbatimInput on a filename argument. This requires the moreverb package.

  • Important attributes include fontsize, frame, framerule, label, and numbers

Unicode

Basic LaTeX doesn't support UTF-8 beyond expanding macros based on lexical sequences. If this is intended, use the utf8 parameter to the inputenc package. XeTeX aims to be a fully Unicode-aware TeX engine.

BibTeX

Checkers

Of these, ChkTeX seems more fully-featured than lacheck. Neither is actively maintained.

  • ChkTeX
    • Watch out for some idiosyncrasies of ChkTeX. In particular, its error #38 is a false positive using the standard rules of American English.
    • Rule emission can be controlled with command-line options or ~/.chktexrc
      • I use -n 38
      • This has the (more descriptive) .chktexrc equivalent QuoteStyle = Traditional (default: Logical)
  • lacheck

See Also