.. latex-example: LaTeX examples =============================================== Example 1 --------------------------------- Our first example is to show a very basic set of LaTeX typesettings on font styles, spacing, comment lines, itemized and enumerated lists, mathematical expressions, and figures. .. literalinclude:: ./examples0/first_latex.tex :language: latex :linenos: Buidling the document will generate a pdf output. The LaTeX file, the baskin logo, and the pdf output can be downloaded here: * :download:`first_latex.tex <./examples0/first_latex.tex>` * :download:`first_latex.pdf <./examples0/first_latex.pdf>` * :download:`baskin-logo-banner.jpg <./examples0/baskin-logo-banner.jpg>` Example 2 --------------------------------- Now let's move on to a more advanced LaTeX documentation. In the second example we see that a style file ``ams200.sty`` is included using a command ``\usepackage{ams200}``. The style file is a collection of various useful things, including definitions of user defined commands, definitions of formatting styles, etc. In this way users can use the customized commands and definitions in the main body of documentations by simply including the style file using ``\usepackage`` command. This becomes very handy when you wish to use your own custom commands and definitions in multiple LaTeX files; otherwise you have to define them at the begining of each LaTeX file. .. literalinclude:: ./examples1/linuxCommands.tex :language: latex :linenos: You will see that the second example produces a list of basic Linux commands (this is something you also need to learn!). You can download the files and build them for youself: * :download:`ams200.sty <./examples1/ams200.sty>` * :download:`linuxCommands.tex <./examples1/linuxCommands.tex>` * :download:`linuxCommands.pdf <./examples1/linuxCommands.pdf>` * :download:`firstLogIn.png <./examples1/firstLogIn.png>` * :download:`baskin-logo-banner.jpg <./examples1/baskin-logo-banner.jpg>` Example 3 --------------------------------- Do you want to do some more carzy things? For those who are crazy enough, there is a way to integrate Python into LaTeX. Watch this video: * `pythontex `_