Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
latex [2017/05/22 11:52] – [Things I do in LaTeX which may need justifying to co-authors] awf | latex [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: if I seem to suggest a tilde at the end of a line, see https:// | ||
+ | Quick things: | ||
+ | * In a hand-marked-up PDF, a tilde at the end of a line indicates a " | ||
+ | * It is useful for version control to issue a soft newline after each full stop. | ||
+ | * Avoid elegant variation https:// | ||
====== All one file ====== | ====== All one file ====== | ||
Line 35: | Line 38: | ||
====== Misc stuff to paste in the top ====== | ====== Misc stuff to paste in the top ====== | ||
+ | |||
< | < | ||
+ | %!TEX root = ../ | ||
% -*- compile-command: | % -*- compile-command: | ||
Line 54: | Line 59: | ||
{~\hspace{-4mm}~\parbox[t]{20mm}{\tiny \textcolor{blue}{# | {~\hspace{-4mm}~\parbox[t]{20mm}{\tiny \textcolor{blue}{# | ||
</ | </ | ||
+ | |||
+ | < | ||
+ | \def\awf# | ||
+ | \marginpar{\hspace{-4mm}\parbox[b]{1cm}% | ||
+ | {\rotatebox{90}{\parbox{5cm}{\textcolor{red}{\scriptsize $\bullet$ #1}}}}}% | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | % 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} | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ====== Picture with label in circle ====== | ||
+ | <code tex> | ||
+ | \usepackage{tikz} | ||
+ | \def\labelledpic# | ||
+ | \begin{tikzpicture} | ||
+ | \node (pic) {#1}; | ||
+ | \path[fill=white, | ||
+ | node {#2}; | ||
+ | \end{tikzpicture} | ||
+ | } | ||
+ | \labelledpic{\includegraphics[width=0.3\textwidth]{hohum}}{A} | ||
+ | </ | ||
+ | |||
+ | ====== 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# | ||
+ | \setlength{\awfpicH}{0.25\linewidth} % an initial guess... | ||
+ | \def\pair## | ||
+ | \setlength{\awfpicH}{\awfpicH*\ratio{\linewidth}{\widthof{\pair{\awfpicH}}}} | ||
+ | \pair\awfpicH | ||
+ | } | ||
+ | </ | ||
+ |