Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
latex [2016/01/20 11:37] awflatex [2024/02/01 16:37] (current) – [Misc stuff to paste in the top] awf
Line 1: Line 1:
 ====== Things I do in LaTeX which may need justifying to co-authors ====== ====== Things I do in LaTeX which may need justifying to co-authors ======
 +
 +
 +Quick things: 
 +  * In a hand-marked-up PDF, a tilde at the end of a line indicates a "tie", to keep characters bound to the word that precedes them, see https://tex.stackexchange.com/questions/9633/why-should-i-put-a-before-ref-or-cite
 +  * It is useful for version control to issue a soft newline after each full stop. 
 +  * Avoid elegant variation https://www.bartleby.com/116/302.html
  
 ====== All one file ====== ====== All one file ======
Line 8: Line 14:
   - 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.   - 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.
   - If you really think compilation is too slow without ''\includeonly'', try ''texify --quiet'' first.   - If you really think compilation is too slow without ''\includeonly'', try ''texify --quiet'' first.
 +  - 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:  <code>
 +\begin{figure}
 +\input{figs/mybigfig.tex}
 +\caption{lots of lovely plots, all lovingly tikzed (pron TIK-zeed)}
 +\label{fig:tikz-virtuosity}
 +\end{figure}</code>
  
 ====== Inline macro definitions ====== ====== Inline macro definitions ======
Line 26: Line 38:
  
 ====== Misc stuff to paste in the top ====== ====== Misc stuff to paste in the top ======
 +
 <code> <code>
 +%!TEX root = ../paper.tex
 +% -*- compile-command: "texify --pdf -V --quiet main.tex" -*-
 +
 % Silence includegraphics % Silence includegraphics
 \setkeys{Gin}{quiet=true} \setkeys{Gin}{quiet=true}
Line 34: Line 50:
  
 </code> </code>
 +
 +And see http://www-rohan.sdsu.edu/~aty/bibliog/latex/floats.html
 +
 +<code>
 +% Twocolumn marginpar, e.g. for CVPR/ICCV
 +\newcommand\authornote[2]{\textcolor{blue}{\hspace{-1pt}\rule{2pt}{2ex}\hspace{-1pt}}%
 +\marginpar[~\hspace{-12mm}\parbox{16mm}{\tiny \textcolor{blue}{#1:#2}}]%
 +{~\hspace{-4mm}~\parbox[t]{20mm}{\tiny \textcolor{blue}{#1: #2}}}}
 +</code>
 +
 +<code>
 +\def\awf#1{\textcolor{red}{\!\scriptsize $^\bullet\!$}%
 +\marginpar{\hspace{-4mm}\parbox[b]{1cm}%
 +{\rotatebox{90}{\parbox{5cm}{\textcolor{red}{\scriptsize $\bullet$ #1}}}}}%
 +}
 +</code>
 +
 +<code>
 +% Shrink-to-fit parbox, aliging on top of first line
 +\newcommand{\hangbox}[1]{
 +\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
 +\end{tabbing}
 +\end{minipage}
 +}
 +</code>
 +
 +====== Picture with label in circle ======
 +<code tex>
 +\usepackage{tikz}
 +\def\labelledpic#1#2{
 +\begin{tikzpicture}
 +\node (pic) {#1};
 +\path[fill=white,draw=gray,thick] (pic.south west) +(3ex,3ex) circle (2ex)
 +   node {#2};
 +\end{tikzpicture}
 +}
 +\labelledpic{\includegraphics[width=0.3\textwidth]{hohum}}{A}
 +</code>
 +
 +====== Two pictures with same height, forcing total width ======
 +<code TeX>
 +% \awfTwoPicsSameHeight{WIDTH}{PIC1}{PIC2}
 +% Make two pictures of different aspect ratio sit neatly in a box of width WIDTH
 +\newlength{\awfpicH}
 +\def\awfTwoPicsSameHeight#1#2#3{
 +\setlength{\awfpicH}{0.25\linewidth} % an initial guess...
 +\def\pair##1{\includegraphics[height=##1]{#2}~\includegraphics[height=##1]{#3}}
 +\setlength{\awfpicH}{\awfpicH*\ratio{\linewidth}{\widthof{\pair{\awfpicH}}}}
 +\pair\awfpicH
 +}
 +</code>
 +
latex.1453289824.txt.gz · Last modified: 2016/01/20 11:37 by awf
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0