A Physics lab report written in LaTeX. Also a good starting point for understanding LaTeX.
- Install a TeX/LaTeX system e.g. MiKTeX
- Install a LaTeX editor e.g. TeXmaker
- Download the ZIP given on this page
- Extract the files in the ZIP to a folder
- Open
SpecificRotation.texusing your LaTeX editor - Compile using PDFLaTeX ('Quick Build' in TeXmaker)
Modify TeX-report as you see fit. The source file (SpecificRotation.tex) is extensively commented and contains many frequently used LaTeX commands. For a rundown of math equations, check out the ShareLaTeX page.
##For GNU/Linux distributions
On GNU/Linux, TeXlive can be used in place of MiKTeX. Replace steps 1 and 2 with the terminal commands
$ apt-get install texlive texmaker
$ dnf install texlive-basic texmaker
The following options are available in dkpinto-report.cls:
Natively, the code supports Linux libertine and Latin modern fonts. These are good choices as they do not interfere with the rendering of math equations. To test out these additional fonts, I would recommend installing the full fonts package in MiKTeX or use the terminal command for TeXlive,
$ apt-get install texlive-fonts-extra
Then enable them in the .cls by removing the '#' before the command.
Linux libertine: \usepackage{libertine} \usepackage[libertine]{newtxmath}
Latin modern: \usepackage{lmodern}
I chose to use the minted package to insert programming code. Installation on Linux requires a bit of work, but it's worth it. If you are on Windows, I would recommend replacing the minted package with the listings package.
-
Make sure you have Python 2.7+ installed
$ python --version -
Install the Python Pygments library
$ apt-get install Pygmentsor$ pip install Pygments -
Install minted from
$ apt-get install texlive-latex-extra -
In TeXmaker, Options -> Configure TeXmaker. Add a -shell-escape in PdfLaTeX by replacing the line with:
pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex -
Call minted in your LaTeX source file. You can call it directly (copy-paste the programming code into the file) or read a programming source file (over 300 languages supported). For more information, check out the ShareLaTeX page.
-
Complile the code with PDFLaTeX
I would recommend a quick glance through the minted documentation. Also note that the -shell-escape option in Step 4 is not entirely safe as it could allow LaTeX to run potentially arbitrary commands on your system, however, it is necessary as minted makes calls to Pygments (an external Python library). Please disable it when not using minted. The original PDFLaTeX is: pdflatex -synctex=1 -interaction=nonstopmode %.tex