Learning LaTeX can be a daunting task, especially when you're teaching yourself and stuck consulting stack exchange for hours on end. To spare others some of those early growing pains, I've created a quick start guide, as well as a template. The template includes the main pieces that I have used time and time again in drafting papers and reports.
3. Figures: You will undoubtedly need to add images/plots/figures to your document and this is pretty straight forward. Similarly to the table example, you first generate the figure environment (\begin{figure} \end{figure}) which will label your figure and give it a caption (if you choose). Inside of this environment, you include an image using \includegraphics[<specify scale, height or width of the image here>]{<specify the path to the file relative to the location of your .tex file>} 4. Equations: For me, writing equations is the biggest selling point for LaTeX. Once you get used to coding up equations, this method is so much quicker than any other equation editor and looks orders of magnitude nicer too. The two main equation environments that I use are the 'equation' environment (\begin{equation} \end{equation}) and the align environment (\begin{align} \end{align}). The main difference between these two is that the align environment allows you to (as the name suggests) align lines of equations, using the '&' key. This is handy for making your equations look cleaner and more organized, or to display an equation that is too long for a single line. Both these environments will by default number your equations. If you do not want a number, you can either include \nonumber at the end of the equation, or, you can use the equation* or align* environments. You can also enter into 'math' mode inline in your document using $ <put your equation code here> $. Using $$ $$ will cause a line break and display like \begin{equation*} \end{equation*}. To serve as a launching off point, here is a template with all the main building blocks that I tend to use regularly. I hope you find it to be helpful!
When starting out with LaTeX, you'll undoubtedly ask yourself, 'But isn't [insert text editor you usually use] so much quicker/easier/etc.?' Maybe it is right now, but with practice, typesetting with LaTeX is quicker and looks more polished (especially when creating documents with lots of equations). In fact, once you get the hang of coding in LaTeX, you'll realize how time-consuming the equation editor in ppt and word really was and how much more streamlined having control over all aspects of the typesetting is.
0 Comments
Leave a Reply. |