Ben Chuanlong Du's Blog

It is never too late to learn.

General Tips for LaTeX

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Online Compiler/Editor

wikibooks has a comprehensive tutorial about LaTeX.

List Structures on WikiBooks

TeXample.net has lots of useful example resources for TeX users.

  1. LaTeX does not recognize ~ as one's home directory.

  2. Sometimes these old temporary files generated by LaTeX during compiling can lead LaTeX to failure. So if you don't think there's anything wrong in your LATeX code (especially when the code works well before but it doesn't work now), you might want to delete all these temporary files and then compile LaTeX again. If you're working on a big LaTeX project and there're many subfolders which containing temporary file to be deleted, it's very annoying to deleted them manually. A good is to deleted them recursively using command prompt (in windows) or terminal (in linux).

  3. When you define you new commands in LaTeX, you'd better put them after command \begin{document}, especially when you import these commands from a existing file, otherwise, LaTeX might fail to find these user-defined commands.

  4. Usually we don't have to put a string into a quotation mark in LaTeX, however, we have do this if the string contains space(s).

  5. Command \include{} cannot be nested, and the file being imported cannot contain command \setcounter.

  6. You must use \printanswers to show contents in solution environment if you use the document class exam. Note this offers a neat way for controlling the solutions.

  7. If you use the hyperref, then you'd better not use the option dvipdfm. Without the option dvipdfm, both the commands latex and pdflatex work well; with the option dvipdfm, only the latex wroks.

  8. If you want to compile different LaTeX code according to different compiler used, you can use ifpdf. In your LaTeX code, you can use the following syntax to achieve the purpose

    \ifpdf
    %latex code to be compiled using pdflatex
    \else
    %latex code to be compiled using latex
    \fi
    
  9. Most LaTeX IDEs support user-defined templates, so you can create your own LaTeX templates for different purposes.

  10. Sometimes you might want to use a picture or some data table in a PDF document, but you do not have the source picture nor the source LaTeX code. What you can do is to take a snap shot of the part on the PDF using Adobe Reader, copy and paste the snap shot into Word, change the word file into PDF using Save as ... function in Word, and then include the PDF pages into the your LaTeX source file. Some PDF viewer softwares (e.g., evince) might also allows you to extract the picture directly.

  11. When you use environment align, you do not have to use & to align equations manually though can do that. If you don't align equations manually, they will be aligned automatically.

Bibliography Management

Integration with Other Tools

References

http://www.tug.org/books/

Comments