- TeX Engine Settings
- Aesthetics
- Meta
- Math
- Glossaries
- Bibliography
- Tables
- SI-units
- Clever reference
- Figures
- Preparing for submission
- Updating manuscript
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": {}
}In LaTeX, when using a two-column format, the last page may sometimes have only one full column, leaving an unbalanced layout. To ensure both columns are evenly distributed, use the balance package. Adding \balance before the last content forces LaTeX to split the text evenly across both columns. This results in a cleaner and more professional layout, avoiding a single long column with excessive white space. If fine-tuning is needed, manual adjustments with \vfill and \newpage can be used. Example:
\usepackage{balance} % Include in the preamble
\balance % Place before the last content\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
https://sronpersonalpages.nl/~pault/#sec:qualitative
https://www.bsaver.io/misc/pretty-figures
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\fienvironments. - 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.yamlfile.
There is a 50MB limit on arXiv submissions, so to make it fit:
- Removes all unused
.texfiles (those that are not in the root and not included in any other.texfile). - Removes all unused images that take up space (those that are not actually
included in any used
.texfile). - Optionally resizes all images to
im_sizepixels, to reduce the size of the submission. You can allowlist some images to skip the global size usingimages_allowlist. - Optionally compresses
.pdffiles using ghostscript (Linux and Mac only). You can allowlist some PDFs to skip the global size usingimages_allowlist.
\setlength{\belowcaptionskip}{-20pt} % in the preamble- 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=1option. - What if linebreaking of titles in bibliography not working correctly. Possible solutions:
- remove \usepackage{ulem}
- remove \usepackage{cite}
- remove \usepackage{natbib}
% Example bib entry
@article{biodegradables,
title = {{Recent Advances in Biodegradable Green Electronic Materials and Sensor Applications}},
author = {Min, JinKi and Jung, Yeongju and Ahn, Jiyong and Lee, Jae Gun and Lee, Jinwoo and Ko, Seung Hwan},
year = 2023,
journal = {Advanced Materials},
volume = 35,
number = 52,
pages = 2211273,
doi = {https://doi.org/10.1002/adma.202211273},
}% Define start and reset color
\makeatletter
\newcommand{\startcolor}{%
\color{RoyalBlue}\global\let\default@color\current@color
}
\newcommand{\resetcolor}{%
\color{black}\global\let\default@color\current@color
}
\makeatother
% Make a highlighted category
\DeclareBibliographyCategory{highlighted}
% Add specific bib entries to category
\addtocategory{highlighted}{biodegradables}
\addtocategory{highlighted}{other_bib_item}
\addtocategory{highlighted}{another_bib_item}
\AtEveryBibitem{%
\ifcategory{highlighted}{\startcolor}{\resetcolor}
}


