- TeX Engine Settings
- Aesthetics
- Meta
- Math
- Glossaries
- Bibliography
- Tables
- SI-units
- Clever reference
- Figures
- Preparing for submission
Settings in VSCode with increased memory size (pgfplots) and shell escape:
{
"name": "lualatexmk",
"command": "latexmk",
"args": [
"-shell-escape", // <---- added this line
"--extra-mem-bot=10000000", // <---- added this line
"--extra-mem-top=10000000", // <---- added this line
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
}
\usepackage{tikz}
\usepgfplotslibrary{external}
\definecolor{mycolor}{RGB}{112,45,128}
\newcommand{\roundlabel}[1]{\tikzexternaldisable \tikz[baseline=(char.base)]{
\node[rectangle, rounded corners=0.65mm,inner sep=0.65mm,fill=mycolor, draw=mycolor, text=white, font=\itshape](char) {#1};}\tikzexternalenable}
Example usgae: \roundlabel{Message 5/Conclusion:}
\newcommand{\syntaxHighlight}[1]{\colorbox{black!10}{#1}}
Example usage: \syntaxHighlight{chapters/contributors.tex}
Add in the preamble the following to easily find a weird unicode in Overleaf.
\DeclareUnicodeCharacter{2500}{\color{red} FIX ME!!!!}
\usepackage[dvipsnames]{xcolor} %required package
\newcommand{\update}[1]{{\color{YellowOrange} #1}} %usage \update{this is changed.}
\usepackage[dvipsnames,svgnames, table]{xcolor} % Required to specify custom colors
\usepackage{listofitems}
\usepackage{pgffor}
\makeatletter
% Define your own list of colors
\def\myColorList{LimeGreen,BrickRed,Fuchsia,Bittersweet,YellowOrange, YellowGreen, WildStrawberry}
\readlist\ColorList\myColorList
\newcommand{\defineauthors}[1]{
Personal commands for comments are:
\begin{itemize}
\foreach \x [count=\xi from 1] in {#1} {
\item \textcolor{\ColorList[\xi]}{\textbackslash\unexpanded\expandafter{\x}\{\}}
}
\end{itemize}
\foreach \x [count=\xi from 1] in {#1} {
\expandafter\xdef\csname\x\endcsname####1{\noexpand\textcolor{\ColorList[\xi]}{[\unexpanded\expandafter{\x}: ####1]}}%
}
}
\makeatother
%usage after begin document
\defineauthors{all, gilles, emma, ozlem, lianet, nicola}
Typesetting and defining symbols:
\usepackage{xifthen}
\newcommand{\prob}[1][]{%requires xifthen package%
\ifthenelse{\isempty{#1}}%
{\ensuremath{P}}%
{\ensuremath{P\left\(#1\right\)}}%
}
\newcommand{\vect}[1]{\boldsymbol{\mathrm{#1}}}
\newcommand{\mat}[1]{\boldsymbol{\mathrm{#1}}}
\newcommand{\MSE}{\mathrm{MSE}}
\newcommand{\tr}{\mathrm{tr}}
\newcommand{\moddef}{\mathrm{mod}}
\newcommand{\diag}{\mathrm{diag}}
\newcommand{\vecop}{\text{vec}}
\newcommand{\CP}{L}
\newcommand{\hddots}{\hdots}
\newcommand*{\inC}[1]{\in\mathbb{C}^{#1}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}
\newcommand{\expt}[1]{\mathbb{E} \left\{#1\right\}}
\newcommand{\cn}[2]{\ensuremath{\sim\mathcal{C}\mathcal{N}\left(#1,#2\right)}}
\usepackage[xindy, toc, numberedsection, acronym]{glossaries}
\usepackage{hyperref}
\loadglsentries{abbr.tex}
\makeglossaries
More information: https://www.overleaf.com/learn/latex/Glossaries Base LaTex file is located here.
Scripting files to format the file, remove duplicates, merge different abbr files is located here.
- Clean-up your bib files: https://flamingtempura.github.io/bibtex-tidy/
- I also always enable the "Enclose values in double braces" option to keep the capitalization in titles.
- My default setup
No cite or natbib package is required. For more info check: https://www.overleaf.com/learn/latex/Bibliography_management_with_biblatex
.
Always be aware there is a difference in citation style and bibliography style.
\usepackage[backend=biber,style=ieee]{biblatex}
%\usepackage[backend=biber,language=dutch]{biblatex}
\addbibresource{bib.bib}
\AtBeginBibliography{\footnotesize}
\begin{document}
\printbibliography
\end{document}
- Handy table generator: https://www.tablesgenerator.com/
- I prefer to use the Booktabs table style. An example can be found in the following link: https://nhigham.com/2019/11/19/better-latex-tables-with-booktabs/
%% to hide a column in table
\usepackage{array}
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}
\usepackage[per-mode=symbol]{siunitx} %usage \SI{35}{\meter\squared}
\DeclareSIUnit{\dBm}{dBm} % add SI unit "dBm"
\usepackage[capitalise]{cleveref} %usage \cref{fig:figureReference}
- Standard figure reference gives (\ref) gives: 1
- Cleveref figure references gives (\cref): fig. 1
tikzplotlib
https://automeris.io/WebPlotDigitizer/
%draw arc
\draw (x0, y0) arc
[
start angle=50,
end angle=310,
x radius=0.1cm,
y radius =0.6cm
] ;
%draw line
\draw[] (x1, y1) -- (x2, y2);
%add text
\node[] (x3, y3) {my text};
example:
LaTeX cleaner from Google Research.
Usage:
pip install arxiv_latex_cleaner
arxiv_latex_cleaner ./ --keep_bib --verbose
tar -jcvf arxiv.tar.gz gwffzkzgrjgpqksqdkfgtvzkfnjwghny_arXiv/
- Removes all auxiliary files (
.aux
,.log
,.out
, etc.). - Removes all comments from your code (yes, those are visible on arXiv and you
do not want them to be). These also include
\begin{comment}\end{comment}
,\iffalse\fi
, and\if0\fi
environments. - Optionally removes user-defined commands entered with
commands_to_delete
(such as\todo{}
that you redefine as the empty string at the end). - Optionally allows you to define custom regex replacement rules through a
cleaner_config.yaml
file.
There is a 50MB limit on arXiv submissions, so to make it fit:
- Removes all unused
.tex
files (those that are not in the root and not included in any other.tex
file). - Removes all unused images that take up space (those that are not actually
included in any used
.tex
file). - Optionally resizes all images to
im_size
pixels, to reduce the size of the submission. You can allowlist some images to skip the global size usingimages_allowlist
. - Optionally compresses
.pdf
files using ghostscript (Linux and Mac only). You can allowlist some PDFs to skip the global size usingimages_allowlist
.
- You can check how many times a certain reference is cited in the text. In this example, every reference which is only cited once is colored red.
\usepackage[backend=biber, style=ieee, citestyle=numeric-comp, maxcitenames=1,mincitenames=1, maxbibnames=1, minbibnames=1,isbn=false, doi=false,citecounter=true]{biblatex}
\addbibresource{bib.bib}
\AtBeginBibliography{\footnotesize}
\renewcommand{\finentrypunct}{%
\addperiod\space
\ifnum \value{citecounter} < 2
\color{red}
\else
\color{Green}
\fi
(Cited \arabic{citecounter})%
}
- The number of names shown in the bibliography can be altered by the
maxbibnames=1, minbibnames=1
option. - What if linebreaking of titles in bibliography not working correctly. Possible solutions:
- remove \usepackage{ulem}
- remove \usepackage{cite}
- remove \usepackage{natbib}