Skip to content
Snippets Groups Projects
Commit a5ca429f authored by Daria Bogatova's avatar Daria Bogatova
Browse files

Upgrade report template.

Add draft mode (pdf -> png).
Add fast mode.
Update README.
Remove unnecessary packages and files.
Add graphics.
parent 06baf85d
Branches
No related tags found
No related merge requests found
Pipeline #14433 passed
document/dist/* document/dist/*
!document/dist/.gitkeep !document/dist/.gitkeep
*-pdf-converted-to*
chktex* chktex*
# Report title # LaTeX document
The up-to-date version of the paper is built in CI and resides as artifact. The up-to-date version of the paper is built in CI and resides as artifact.
...@@ -8,7 +8,14 @@ The up-to-date version of the paper is built in CI and resides as artifact. ...@@ -8,7 +8,14 @@ The up-to-date version of the paper is built in CI and resides as artifact.
```bash ```bash
bash ./document/build.sh # to compile bash ./document/build.sh # to compile
bash ./document/build.sh -f # to compile in fast mode
bash ./document/build.sh -d # to compile in draft mode
open ./document/dist/*.pdf # to open open ./document/dist/*.pdf # to open
``` ```
*Fast mode* does not remove auxiliary files, so the subsequent recompilations are much faster.
*Draft mode* converts all PDF graphics into low-res PNG (output file is `report-draft.pdf`).
Draft mode requires `imagemagick` to be installed (`brew install` or `apt-get install`).
If using with Overleaf, it suggested to run `git config core.fileMode false`. If using with Overleaf, it suggested to run `git config core.fileMode false`.
\section{Acknowledgments}
Acknowledgments go here
Exmaple entry Exmaple entry
https://eprint.iacr.org/2015/1125.pdf https://eprint.iacr.org/2015/1125.pdf
@inproceedings{practical-ore, @inproceedings{practical-ore,
author="Chenette, Nathan and Lewi, Kevin and Weis, Stephen A. and Wu, David J.", author = {Chenette, Nathan and Lewi, Kevin and Weis, Stephen A. and Wu, David J.},
title="Practical Order-Revealing Encryption with Limited Leakage", title = {Practical Order-Revealing Encryption with Limited Leakage},
booktitle="Fast Software Encryption", booktitle = {Fast Software Encryption},
year="2016", year = {2016},
publisher="Springer Berlin Heidelberg", publisher = {Springer Berlin Heidelberg},
pages="474--493" pages = {474--493}
} }
...@@ -9,17 +9,21 @@ CWD=$(pwd) ...@@ -9,17 +9,21 @@ CWD=$(pwd)
INTERACTION=nonstopmode INTERACTION=nonstopmode
OUTDIR=dist OUTDIR=dist
JOBNAME=report JOBNAME=report
PREVIEW="" DRAFT=""
OPEN=false FAST=false
SYNCTEX=1 SYNCTEX=1
usage() { echo "Usage: $0 [-o]" 1>&2; exit 1; } usage() { echo "Usage: $0 [-f -d]" 1>&2; exit 1; }
while getopts "o" o; do while getopts "df" o
do
case "${o}" in case "${o}" in
o) f)
PREVIEW="\def\preview{true}" FAST=true
OPEN=true ;;
d)
DRAFT="\def\draft{true}"
JOBNAME="$JOBNAME-draft"
;; ;;
*) *)
usage usage
...@@ -28,27 +32,32 @@ while getopts "o" o; do ...@@ -28,27 +32,32 @@ while getopts "o" o; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
rm -rf ${OUTDIR}/* if [ $FAST == false ]
mkdir -p ${OUTDIR} then
mkdir -p ${OUTDIR}/tmp
cp ${OUTDIR}/*.pdf ${OUTDIR}/tmp || true
rm -f ${OUTDIR}/*.*
cp ${OUTDIR}/tmp/*.pdf ${OUTDIR} || true
rm -rf ${OUTDIR}/tmp
mkdir -p ${OUTDIR}/figures
fi
if [ -n "$CI_BUILD_REF" ]; if [ -n "$CI_BUILD_REF" ];
then then
printf "\providecommand{\\\version}{%s}" $(echo $CI_BUILD_REF | cut -c1-8) > version.tex printf "\providecommand{\\\version}{%s}" $(echo $CI_BUILD_REF | cut -c1-8) > version.tex
fi fi
latexmk -cd -dvi- -f -pdf -ps- -time \ latexmk -cd -dvi- -f -pdf -ps- -time -shell-escape \
-jobname=$JOBNAME \ -jobname=${JOBNAME} \
-outdir=$OUTDIR \ -outdir=${OUTDIR} \
--synctex=${SYNCTEX} \ --synctex=${SYNCTEX} \
--interaction=${INTERACTION} \ --interaction=${INTERACTION} \
-pdflatex='pdflatex %O "\def\dummy{} '${PREVIEW}' \input %S "' \ -pdflatex='pdflatex %O "\def\dummy{} '${REVIEW}' '${DRAFT}' \input %S "' \
main main
if [ $FAST == false ]
then
rm -f ${OUTDIR}/*.{aux,log,out,xwm,toc,lof,lot,bib,bbl,bcf,blg,xml,fls,fdb_latexmk} rm -f ${OUTDIR}/*.{aux,log,out,xwm,toc,lof,lot,bib,bbl,bcf,blg,xml,fls,fdb_latexmk}
fi
echo "Done." echo "Done."
if [ "$OPEN" == true ]
then
open ${OUTDIR}/${JOBNAME}.pdf
fi
\begin{figure}[hb]
\centering
\includegraphics[width=0.33\textwidth]{goethe}
\caption[Short caption]{
Long caption.
Multiline.
}\label{figure:goethe}
\end{figure}
This diff is collapsed.
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
\input{sections/introduction} \input{sections/introduction}
\input{acknowledgement}
\printbibliography% \printbibliography%
\end{document} \end{document}
...@@ -3,15 +3,12 @@ ...@@ -3,15 +3,12 @@
\usepackage[a4paper, margin=1in]{geometry} \usepackage[a4paper, margin=1in]{geometry}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{amsmath} % allow \text{} in math mode \usepackage{amsmath}
\usepackage{amsfonts} \usepackage{amsfonts}
\usepackage{bm}
\usepackage{listings}
\usepackage{subcaption} \usepackage{subcaption}
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{balance} \usepackage{balance}
\usepackage{mathtools} \usepackage{mathtools}
\usepackage{breqn}
\usepackage{nicefrac} \usepackage{nicefrac}
\usepackage{booktabs} \usepackage{booktabs}
\usepackage{multirow} \usepackage{multirow}
...@@ -22,11 +19,9 @@ ...@@ -22,11 +19,9 @@
urlcolor = JungleGreen, urlcolor = JungleGreen,
citecolor = magenta citecolor = magenta
]{hyperref} ]{hyperref}
\usepackage{cleveref} % must be loaded after hyperref
\usepackage{color} \usepackage{color}
\usepackage{marginnote}
\setlength{\marginparwidth}{1.5cm}
\renewcommand*{\marginfont}{\color{red}\tiny}
\let\proof\relax \let\proof\relax
\let\endproof\relax \let\endproof\relax
...@@ -35,11 +30,10 @@ ...@@ -35,11 +30,10 @@
\let\endproof\relax \let\endproof\relax
\usepackage{caption} \usepackage{caption}
\usepackage[all]{nowidow} \usepackage[all]{nowidow}
\usepackage{hyphenat} \usepackage{hyphenat}
\usepackage{enumitem} \usepackage{enumitem}
\usepackage{comment} \usepackage{siunitx}
\usepackage[ \usepackage[
backend=biber, backend=biber,
...@@ -61,88 +55,9 @@ ...@@ -61,88 +55,9 @@
\graphicspath{{./graphics/}} \graphicspath{{./graphics/}}
% https://tex.stackexchange.com/a/226857/97712 \ifdefined\draft%
\makeatletter % https://www.overleaf.com/learn/latex/Inserting_Images#Generating_high-res_and_low-res_images
\let\oldmarginnote\marginnote% \usepackage{epstopdf}
\renewcommand*{\marginnote}[1]{% \epstopdfDeclareGraphicsRule{.pdf}{png}{.png}{convert #1 \OutputFile}
\begingroup% \DeclareGraphicsExtensions{.png,.pdf}
\ifodd\value{page}
\if@firstcolumn\reversemarginpar\fi
\else
\if@firstcolumn\else\reversemarginpar\fi
\fi
\oldmarginnote{#1}%
\endgroup%
}
\makeatother
\newcommand{\BigO}[1]{\mathcal{O}\left(#1\right)}
\newcommand{\BigOmega}[1]{\Omega\left(#1\right)}
% custom theorems if needed
\newtheoremstyle{mytheor}
{1ex}{1ex}{\normalfont}{0pt}{\scshape}{.}{1ex}
{{\thmname{#1 }}{\thmnumber{#2}}{\thmnote{ (#3)}}}
\theoremstyle{mytheor}
\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{rem}[thm]{Remark}
\newtheorem{remark}[thm]{Remark}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{definition}[thm]{Definition}
\newtheorem{claim}[thm]{Claim}
\newtheorem{note}[thm]{Note}
\newtheorem{assume}[thm]{Assumption}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\lstset{
mathescape=true,
tabsize=2,
morekeywords={return,then,if,else,foreach,endforeach}
}
\ifdefined\preview%
\excludecomment{release}
\else
\newenvironment{release}{}{}
\fi \fi
% \captionsetup[table]{skip=10pt}
% \captionsetup[figure]{skip=10pt}
% \setlength{\parindent}{0pt}
% \setlength{\parskip}{3pt}
% \newenvironment{myitemize}
% { \begin{itemize}
% \setlength{\itemsep}{0pt}
% \setlength{\parskip}{0pt}
% \setlength{\parsep}{0pt} }
% { \end{itemize} }
% \newenvironment{myitemizenoindent}
% { \begin{itemize}[leftmargin=*]
% \setlength{\itemsep}{0pt}
% \setlength{\parskip}{0pt}
% \setlength{\parsep}{0pt} }
% { \end{itemize} }
% \newenvironment{myenumerate}
% { \begin{enumerate}
% \setlength{\itemsep}{0pt}
% \setlength{\parskip}{0pt}
% \setlength{\parsep}{0pt} }
% { \end{enumerate} }
% \newenvironment{mydescription}
% { \begin{description}
% \setlength{\itemsep}{0pt}
% \setlength{\parskip}{0pt}
% \setlength{\parsep}{0pt} }
% { \end{description} }
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
Intro goes here. Intro goes here.
And one reference~\cite{practical-ore}. And one reference~\cite{practical-ore}.
\begin{release} \input{figures/fig-goethe}
This is printed only in release mode.
\end{release} Reference to \cref{figure:goethe}.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment