Meijian An's Latex Tips

 

  1. Replace all 'and' by '&' (or 'e' in portuguese) in references/cites.
  2. Set space of the document.
  3. Float/fix the figure or the table.
  4. Correct the compile warning: overfull \hbox (or bad box).
  5. Quotation marks in Latex, which is not the simple (").
  6. Change word cases (upper/lower).
  7. \footnote used in the title of Chapter.
  8. TEX FAQ. Frequently asked questions about TeX and LaTeX.
 

Tips

  1. Replace all 'and' by '&' (or 'e' in portuguese) in references/cites.
    Change all " and " in {style}.bst into " \& ". e.g. in latex document:

          \usepackage[colon, authoryear]{natbib}
          ...
          \bibliographystyle{plainnat}

    The style file is */texmf/bibtex/bst/natbib/plainnat.bst. then change all "and" in plainnat.bst into " \& ".

  2. Set space of the document.
    Method 1:

          \usepackage{setspace}
          \doublespacing
          %\onehalfspacing
          %\singlespacing

    Method 2:

          \linespread{1.6} %double space
          %\linespread{1.2} %single and half space
          %\linespread{1} %single space

  3. Float/fix the figure or the table.
    Method 1: Select some or all of [!htb]. e.g.:

          \begin{figure}[!htb]
          ...
          \end{figure}

    Method 2: use \tt to fix the figure/table in this page. for example:

          \begin{figure}\tt
          ...
          \end{figure}

    All detail configurations about figure can be found from the book, "Using Import graphics in LATEX2e".

  4. Correct the compile warning: overfull \hbox (or bad box).
    Whenever you see a \hbox message, you can either:
    • rewrite the lines shown in the warning message so that the message disappears.
    • insert \- (hyphenation) into a place of the word where causes overfull.
  5. Quotation marks in Latex, which is not the simple (").
    Do not use the ASCII quotation mark character " for quotes. Use `` for opening quotations and '' for closing them. These are pairs of left single-quote and right single-quote characters.

  6. Change word cases (upper/lower).
    To upper case (capitalize):

          \MakeUppercase{...} % or use \uppercase{...}

    To lower case:

          \MakeLowercase{...} %% \lowercase{...}

  7. \footnote used in the title of Chapter.
    \protect can be used to have \footnote to be used in the title.

          \chapter{... \protect \footnote[1]{... notes ...}}