2014年7月23日 星期三

Small LaTeX Tricks

  1. Use ~ to get a space without line-breaking.
  2. Manually set the number of a figure: Add "\setcounter{figure}{NUMBER}" right before the figure is inserted. This is useful for responses in journal revisions.
  3. Manually set the number of a subfigure: Add "\setcounter{subfigure}{NUMBER}" right before the figure is inserted. This is useful for responses in journal revisions.
  4. Place a figure without numbering: Include the caption package and use its \caption*{TITLE} command to replace \caption{TITLE} to get caption without numbering.
  5. Customize the page margins:  
    1. Set all margins to the same value: \usepackage[margin=1.5cm]{geometry}
    2. Set each margin independently: \usepackage[left=1cm, right=2cm, top=1.5cm, bottom=1.2cm]{geometry}
  6. Intelligent references:
    1. Original syntax: "Figure~\ref{SOME_FIG} shows the result of Table~\ref{SOME_TABLE} in Section~\ref{SOME_SECTION}"; new syntax: "\Cref{SOME_FIG} shows the result of \Cref{SOME_TABLE} in \Cref{SOME_SECTION}"
    2. Preemble command: \usepackage{cleveref}.
    3. Use \Cref for capital reference names (e.g., Figure, Table, Section) and \cref for lower-case ones (e.g., figure, table, section). 
  7. Change the document construct name, from such as "Algorithm" in the caption "Algorithm 3. Some Algorithm" to "Algo": \floatname{algorithm}{Algo}
  8. Use inline LaTeX equations in PowerPoint 2010 with real-time preview:
    1. Install MiKTeX: http://miktex.org
    2. Install powerpointtools: https://code.google.com/p/powerpointtools/ 
    3. If MiKTeX is 64-bit version, copy everything in installdir/bin/x64/ to installdir/bin/
    4. Launch PowerPoint 2010, and initialize the settings of powerpointtools:
      1. LaTeX tab -> Preferences -> General -> Use LaTeX service: MiKTeX Service
      2. LaTeX tab -> Preferences -> MiKTeX Service tab -> fill in installation directory of MiKTeX "C:\Program Files\MiKTeX 2.9"
    5. Done! 
  9. Remove the copyright block is the left bottom corner of the first page of ACM proceedings: Add the following code before \begin{document}:
    1. \makeatletter
      \let\@copyrightspace\relax
      \makeatother 
  10. Add color to LaTeX documents: \usepackage{color}  {\color{red}要改的文字}
  11. Redefine color command for simpler usage (so that outer parenthesis is no longer needed): add \newcommand\blue[1]{{\color{blue}#1}} before ]begin{document} 
  12. Adjust line spread and paragraph separation: Add
    \setlength{\parindent}{4em}
    \setlength{\parskip}{1em}
    \renewcommand{\baselinestretch}{2.0} before \begin{document}

沒有留言:

張貼留言