Things I do in LaTeX which may need justifying to co-authors

Quick things:

All one file

Lots of people feel more organized if they have an outer paper.tex which \includes intro.tex, litreview.tex etc. I used to do that too. Now I find that one large file is better. Here's why

  1. You obviously have your document in some version control system. If you move a block of text from one file to another, none of the VCSs know how to deal with that in the presence of conflicts. In LaTeX it's very common to have to move a block of text, because one needs to move figures. Of course you don't do that till the very end, right? Yes, that's exactly when you don't want a mass of conflicts, and yet it's exactly the point when everyone is frantically trying to fix their section.
  2. If you want to globally search and replace it's much easier to do so in a single file. Yes, of course you should have had the notation right before you started. But you didn't.
  3. If you really think compilation is too slow without \includeonly, try texify –quiet first.
  4. Now, of course it's not a good idea to copy/paste large figures into the main file, but one small tweak makes it much easier to find figure labels etc. Put the graphical content into figs/mybigfig.tex, but put caption and label in the main file:
    \caption{lots of lovely plots, all lovingly tikzed (pron TIK-zeed)}

Inline macro definitions

Lots of people feel more organized if they have all their macro definitions at the top of the file (or in macros.tex). I agree, for generic macros. However, for symbols, I prefer to define them at the point in the text when they are first introduced. This means that you get an error if you try to refer to \params before they're defined. Example:

In this section we blather on for a while about what we're going to do, and 
then in paragraph two, we'll actually tell you.  If I accidentally try to talk 
about $\img$ here, I'll get an error.

We consider an image $\img$ as a list of samples $\{\samp_i\}_{i=1}^\nsamp$.

Misc stuff to paste in the top

%!TEX root = ../paper.tex
% -*- compile-command: "texify --pdf -V --quiet main.tex" -*-

% Silence includegraphics

% Learn about xspace
\newcommand{\etal}{\emph{et al.}\xspace}

And see

Author notes as marginpars

% Twocolumn marginpar, e.g. for CVPR/ICCV
\marginpar[~\hspace{-12mm}\parbox{16mm}{\tiny \textcolor{blue}{#1:#2}}]%
{~\hspace{-4mm}~\parbox[t]{20mm}{\tiny \textcolor{blue}{#1: #2}}}}
\def\awf#1{\textcolor{red}{\!\scriptsize $^\bullet\!$}%
{\rotatebox{90}{\parbox{5cm}{\textcolor{red}{\scriptsize $\bullet$ #1}}}}}%

Shrink-to-fit parbox, aligning on top of first line

% Shrink-to-fit parbox, aliging on top of first line
\begin{minipage}[t]{\textwidth}% Top-hanging minipage, will align on
			       % bottom of first line
\begin{tabbing} % tabbing so that minipage shrinks to fit
\\[-\baselineskip] % Make first line zero-height
#1 % Include user's text

Picture with label in circle

\node (pic) {#1};
\path[fill=white,draw=gray,thick] (pic.south west) +(3ex,3ex) circle (2ex)
   node {#2};

Two pictures with same height, forcing total width

% \awfTwoPicsSameHeight{WIDTH}{PIC1}{PIC2}
% Make two pictures of different aspect ratio sit neatly in a box of width WIDTH
\setlength{\awfpicH}{0.25\linewidth} % an initial guess...
latex.txt · Last modified: 2024/05/02 11:45 by awf
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0