Latex

Admonition Blocks: Making Your Documentation Stand Out

Documentation doesn’t always have to be boring. Admonition blocks draw the reader’s attention to important notes and warnings that may not directly fit as part of the flow of the text. As I often prefer to write long-form reports and documentation in LaTeX, awesomebox and alertmessage are my go-to packages for admonition blocks. Several simple examples may be found below. % !TEX program = xelatex \documentclass{article} % dummy text for examples \usepackage{lipsum} % admonition blocks around text to inform/alert readers \usepackage{awesomebox} % or without using xelatex \usepackage{alertmessage} \begin{document} % awesomebox \tipbox{\lipsum[2]} \notebox{\lipsum[3]} \warningbox{\lipsum[4]} \cautionbox{\lipsum[5]} \importantbox{\lipsum[5]} % alertmessage \alertinfo{\lipsum[2]} \alertsuccess{\lipsum[2]} \alertwarning{\lipsum[2]} \alerterror{\lipsum[2]} \end{document} Tip Box

Using MS Word to Check LaTeX Documents

Microsoft Word has great spelling and grammar checking. Use pandoc to convert the LaTeX document to docx and double check your work. pandoc INPUT.tex -o OUTPUT.docx

Big Parenthesis in a LaTeX Equation

\begin{equation*} \left( \sum_{i=0}^{n}{i} \right) \end{equation*} $$\left( \sum_{i=0}^{n}{i} \right)$$ \left( and \right) automatically expand to fit the material between them

Great Looking LaTeX Tables

No colour No vertical gridlines No fills No borders No bolding Left align text Right align numbers Align titles with data Resize columns to data Use consistent precision \documentclass{article} % \toprule, \midrule, \multicolumn \usepackage{booktabs} % unit formatting \usepackage[per-mode=symbol]{siunitx} \begin{document} \begin{table} % use consistent precision \sisetup{round-mode=places,round-precision=2} % center table in text \centering % make a good descriptive caption \caption{My caption.} % labels must come after captions \label{table:my-table} % resize boxes help fit tables inside 2-column formats % \resizebox{\columnwidth}{!

My Favourite LaTeX Packages

% english hyphenation \usepackage[english]{babel} % for accented characters, load before csquotes \usepackage[utf8]{inputenc} % recommended with babel; \enquote{} \usepackage{csquotes} % for \graphicspath \usepackage{graphicx} \graphicspath{{./fig/}} % \toprule, \midrule, \multicolumn \usepackage{booktabs} % unit formatting \usepackage[per-mode=symbol]{siunitx} % siunitx match IEEE font weight \sisetup{detect-weight=true, detect-family=true} % \FloatBarrier for stopping floats in REFERNCES section \usepackage{placeins} % linked references \usepackage{hyperref} % citations % https://www.sharelatex.com/learn/Bibliography_management_in_LaTeX \usepackage[ style=ieee, doi=false, isbn=false, url=false, ]{biblatex} \addbibresource{kuka-collaborative-poke.bib} % easy referencing, must be loaded last!

Stop LaTeX Floats and Figures from Appearing in References Section

% \FloatBarrier for stopping floats in REFERNCES section \usepackage{placeins} ... ... ... \FloatBarrier \printbibliography \end{document}

Count the Number of Words in a LaTeX Document

detex my-document.tex | wc -w detex: a filter to strip TeX commands from a .tex file wc: word, line, character, and byte count -w: The number of words in each input file is written to the standard output