Add full and conference version switch

This commit is contained in:
François-Xavier Wicht 2026-10-13 14:18:44 +02:00
parent 1c53ae13a4
commit 21a2dcd6e9
Signed by: wichtfx
GPG Key ID: 83B006069E54EC40
6 changed files with 38 additions and 2 deletions

View File

@ -0,0 +1,4 @@
% Proof of Theorem~\ref{thm:example}: in the body in the full version, in the appendix in the conference version (macros/version.tex).
\begin{proof}
Placeholder proof.
\end{proof}

View File

@ -1,2 +1,5 @@
\section{Proofs}\label{app:proofs}
% The complete proofs of the results stated in the body.
% In the conference version, each theorem whose proof the full version has in the body is restated here with its proof. A proof that is in the appendix in both versions goes after them, as it is.
\appendixproof{examplethm}{proof-example}

View File

@ -1,4 +1,4 @@
% Theorem environments. The proof environment is the one amsthm defines.
% Theorem environments. The proof environment is the one amsthm defines; thmtools provides the restatable environment that macros/version.tex uses to restate a theorem in the appendix.
\usepackage{amsthm}
\theoremstyle{plain}
@ -8,3 +8,5 @@
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\usepackage{thmtools}

8
macros/version.tex Normal file
View File

@ -0,0 +1,8 @@
% Full and conference versions. The full version is the text, and \iffull, defined at the top of main.tex, is true in it. Text of the full version only goes in \iffull ... \fi; a passage that hiding cannot handle, such as an abstract that differs as a whole, goes in \full{<full>}{<conference>}.
\newcommand{\full}[2]{\iffull#1\else#2\fi}
% A proof is written once, in its own file appendix/<file>.tex, and its theorem is a restatable environment (thmtools). \proofhere{<file>}, right after the theorem in the body, reads the proof there in the full version and points to the appendix in the conference version. \appendixproof{<restatable name>}{<file>}, in appendix/proofs.tex, restates the theorem and reads the proof there in the conference version, and does nothing in the full version.
\newcommand{\proofhere}[1]{\iffull\input{appendix/#1}\else\noindent The proof is in Appendix~\ref{app:proofs}.\fi}
\newcommand{\appendixproof}[2]{\iffull\else\csname #1\endcsname*\input{appendix/#2}\fi}

View File

@ -1,7 +1,17 @@
% ===== Version switch ========================================================
% The full version is the text. make conf defines \conference before reading this file and builds the conference version; vimtex, make watch and make full build the full version. macros/version.tex defines the commands that hide or swap text in the conference version.
\newif\iffull
\ifdefined\conference \fullfalse \else \fulltrue \fi
% ===== Document class: article by default ===================================
% To switch to a venue class, put its files in venue/ (.latexmkrc adds venue/ to the TeX search path), comment out the article line and uncomment the venue line. A venue class that defines its own theorem environments replaces macros/theorems.tex.
% To switch a version to a venue class, put the class files in venue/ (.latexmkrc adds venue/ to the TeX search path), comment out the article line of that version and uncomment its venue line. A venue class that defines its own theorem environments replaces macros/theorems.tex.
\iffull
\documentclass[11pt]{article}
% \documentclass{llncs}
\else
\documentclass[11pt]{article}
% \documentclass{llncs}
\fi
% ===== End of document class ================================================
\usepackage[T1]{fontenc}
@ -13,10 +23,13 @@
\input{macros/theorems}
\input{macros/algorithms}
\input{macros/notation}
\input{macros/version}
\usepackage[backend=biber,style=numeric-comp]{biblatex}
\addbibresource{bib/dblp.bib}
\addbibresource{bib/refs.bib}
% make conf reads this label to print the page on which the References heading lands.
\defbibheading{bibliography}[\refname]{\section*{#1}\label{references}}
\usepackage{hyperref}
@ -29,6 +42,7 @@
\maketitle
\begin{abstract}
% Sentences of the full version only go in \iffull ... \fi; an abstract that differs as a whole goes in \full{<full abstract>}{<conference abstract>}.
Abstract.
\end{abstract}

View File

@ -1,2 +1,7 @@
\section{Security}\label{sec:security}
% The security theorems, with their proofs here or in the appendix.
\begin{restatable}{theorem}{examplethm}\label{thm:example}
Placeholder theorem.
\end{restatable}
\proofhere{proof-example}