| 1 |
\documentclass{article} |
| 2 |
\usepackage{snaptodo} |
| 3 |
\usepackage[colorlinks, allcolors=red!50!black]{hyperref} |
| 4 |
\def\email#1{\href{mailto:#1}{\ttfamily #1}} |
| 5 |
\def\snaptodocommand{{\ttfamily\color{red!50!black}\string\snaptodo}} |
| 6 |
|
| 7 |
\begin{document} |
| 8 |
|
| 9 |
\title |
| 10 |
{Snaptodo---A todo that snaps to the closer side\thanks |
| 11 |
{Repository \url{https://github.com/Symbol1/snaptodo}.} } |
| 12 |
|
| 13 |
\author |
| 14 |
{Hsin-Po Wang\thanks |
| 15 |
{Email \email{[email protected]}. |
| 16 |
Website \url{https://www.symbol.codes}.}} |
| 17 |
|
| 18 |
\date{March 16, 2024} |
| 19 |
|
| 20 |
\maketitle |
| 21 |
|
| 22 |
\begin{abstract} |
| 23 |
Snaptodo package is an alternative to todonote package, |
| 24 |
from which it differs in the following ways: |
| 25 |
(A) Depending on where you call \snaptodocommand, |
| 26 |
the note is put on the left or right margin, |
| 27 |
whichever is closer. |
| 28 |
(B) The notes bump each other down so they never overlap; |
| 29 |
the lines never overlap either; |
| 30 |
(C) Minimalistic, aesthetic, and customizable style. |
| 31 |
|
| 32 |
\end{abstract} |
| 33 |
|
| 34 |
\section{Installation} |
| 35 |
|
| 36 |
Copy and paste |
| 37 |
{\ttfamily\verb|snaptodo.sty|} |
| 38 |
to your working directory. |
| 39 |
|
| 40 |
\section{Minimal Working Example} |
| 41 |
|
| 42 |
\begin{verbatim} |
| 43 |
\documentclass{article} |
| 44 |
\usepackage{snaptodo} |
| 45 |
\begin{document} |
| 46 |
Your done |
| 47 |
\snaptodo{Your todo} |
| 48 |
\end{document} |
| 49 |
\end{verbatim} |
| 50 |
|
| 51 |
\section{Showcase of Examples} |
| 52 |
|
| 53 |
Using snaptodo is as simple as calling \snaptodocommand% |
| 54 |
\snaptodo{Calling \snaptodocommand!} |
| 55 |
and compile twice.% |
| 56 |
\snaptodo{Compile twice!} |
| 57 |
If the calling point% |
| 58 |
\snaptodo{Calling point!} |
| 59 |
is on the left of a page,% |
| 60 |
\snaptodo{Left of a page!} |
| 61 |
the todo note---after compiling twice of |
| 62 |
course---will appear on the left margin.% |
| 63 |
\snaptodo{On the left margin!} |
| 64 |
And vice versa.% |
| 65 |
\snaptodo{Vice versa!} |
| 66 |
|
| 67 |
\section{Customization} |
| 68 |
|
| 69 |
I defined |
| 70 |
{\ttfamily\verb|\snaptodoset|} |
| 71 |
that works like |
| 72 |
{\ttfamily\verb|\tikzset|} and |
| 73 |
{\ttfamily\verb|\pgfplotsset|}. |
| 74 |
While you can access dedicated options by |
| 75 |
{\ttfamily\verb|\snaptodoset{<some_option>}|}, |
| 76 |
you can also access the exact same options by |
| 77 |
{\ttfamily\verb|\pgfkeys{/snaptodo/<some_option>}|}. |
| 78 |
For local changes, you can put them here |
| 79 |
{\ttfamily\verb|\snaptodo[<some_option>]{}|}. |
| 80 |
|
| 81 |
\subsection{Color} |
| 82 |
|
| 83 |
The color of the broken line is |
| 84 |
{\ttfamily\verb|snaptodo@chain|}. |
| 85 |
The default color for that is |
| 86 |
{\ttfamily\verb|yellow!50!black|}. |
| 87 |
Saying |
| 88 |
{\ttfamily\verb|\colorlet{snaptodo@chain}{green!50!white}|} |
| 89 |
lets you to change this color globally. On the other hand, |
| 90 |
to change this color locally, you can do |
| 91 |
{\ttfamily\verb|\snaptodo[call chain/.style=green!50!white]{}|}.% |
| 92 |
\snaptodo[call chain/.style=green!50!white]{New broken line color} |
| 93 |
|
| 94 |
The color of the note text is |
| 95 |
{\ttfamily\verb|snaptodo@block|}. |
| 96 |
The default color for that is |
| 97 |
{\ttfamily\verb|red!50!black|}. |
| 98 |
Saying |
| 99 |
{\ttfamily\verb|\colorlet{snaptodo@block}{blue!50!white}|} |
| 100 |
lets you change this color. On the other hand, |
| 101 |
for locally changing this color, you can do |
| 102 |
{\ttfamily\verb|\snaptodo[margin block/.style=blue!50!white]{}|}.% |
| 103 |
\snaptodo[margin block/.style=blue!50!white]{New note text color} |
| 104 |
|
| 105 |
\subsection{Line style} |
| 106 |
|
| 107 |
In order to use a thicker or thinner broken line, |
| 108 |
recall the standard Ti\emph kZ option |
| 109 |
{\ttfamily\verb|[thick]|}, |
| 110 |
{\ttfamily\verb|[ultra thin]|}, |
| 111 |
or |
| 112 |
{\ttfamily\verb|[line width=???]|}. |
| 113 |
In our case, simply put that option in this style |
| 114 |
\snaptodo[call chain/.style={line width=2pt}]{Thicker broken line}% |
| 115 |
{\ttfamily\verb|\snaptodo[call chain/.style={line width=???}]{}|}. |
| 116 |
|
| 117 |
In order to use a special dash pattern, |
| 118 |
recall the standard Ti\emph kZ option |
| 119 |
{\ttfamily\verb|[dotted]|}, |
| 120 |
{\ttfamily\verb|[dashed]|}, |
| 121 |
or |
| 122 |
{\ttfamily\verb|[dash pattern=???]|}. |
| 123 |
In our case, simply put that option in this style |
| 124 |
\snaptodo[call chain/.style={dashed}]{Dashed broken line}% |
| 125 |
{\ttfamily\verb|\snaptodo[call chain/.style={dash pattern=???}]{}|}. |
| 126 |
|
| 127 |
\subsection{Sep and width} |
| 128 |
|
| 129 |
The gap between two note blocks is stored in |
| 130 |
{\ttfamily\verb|/snaptodo/block sep|}. |
| 131 |
The default length is |
| 132 |
{\ttfamily\verb|\baselineskip|}. |
| 133 |
Use |
| 134 |
{\ttfamily\verb|\snaptodoset{block sep=0pt}|} |
| 135 |
for global setting and use |
| 136 |
{\ttfamily\verb|\snaptodo[block sep=0pt]{note}|}% |
| 137 |
\snaptodo[block sep=0pt]{2 blocks close...} |
| 138 |
\snaptodo[block sep=0pt]{...to each other} |
| 139 |
for local setting this. |
| 140 |
|
| 141 |
The gap between two horizontal lines is stored in |
| 142 |
{\ttfamily\verb|/snaptodo/chain sep|}. |
| 143 |
The default length is |
| 144 |
{\ttfamily\verb|0.5ex|}. |
| 145 |
To change, use |
| 146 |
{\ttfamily\verb|\snaptodoset{chain sep=0pt}|} |
| 147 |
for global setting and |
| 148 |
{\ttfamily\verb|\snaptodo[chain sep=0pt]{note}|}% |
| 149 |
\snaptodo[chain sep=0pt]{2 chains close...} |
| 150 |
\snaptodo[chain sep=0pt]{...to each other} |
| 151 |
for local setting. |
| 152 |
|
| 153 |
The width of the note block is |
| 154 |
{\ttfamily\verb|\marginparwidth|}. |
| 155 |
The width where the broken line has slope is |
| 156 |
{\ttfamily\verb|\marginparsep|}. |
| 157 |
These are the built-in dimensions. |
| 158 |
(So modify them with care!) |
| 159 |
|
| 160 |
\subsection{Bias} |
| 161 |
|
| 162 |
The tipping point between snapping to the left versus |
| 163 |
to the right is the center of the page, by default. |
| 164 |
You can change this by |
| 165 |
{\ttfamily\verb|/snaptodo/chain bias=-99in|}.% |
| 166 |
\snaptodo[chain bias=-99in]{Forced to the left} |
| 167 |
That way, all todo notes are forcedly |
| 168 |
snapped to the left hand side. Or, by |
| 169 |
\snaptodo[chain bias=99in]{Forced to the right}% |
| 170 |
{\ttfamily\verb|/snaptodo/call bias=99in|}, |
| 171 |
all todo notes are forcedly snapped to the right hand side. |
| 172 |
|
| 173 |
\subsection{Rise} |
| 174 |
|
| 175 |
If your document is really busy, e.g., like |
| 176 |
{\ttfamily\verb|stress_testing.tex|}, |
| 177 |
try setting a positive |
| 178 |
{\ttfamily\verb|/snaptodo/block rise|},% |
| 179 |
\snaptodo[block rise=2em]{Rising} |
| 180 |
\snaptodo[block rise=2em]{to leave} |
| 181 |
\snaptodo[block rise=2em]{room.} |
| 182 |
e.g., |
| 183 |
{\ttfamily\verb|\snaptodo[block rise=2em]{}|}. |
| 184 |
That way, a note will rise by that amount |
| 185 |
to leave more rooms for later notes. |
| 186 |
(But if there will be overlay, |
| 187 |
the notes automatically bump down.) |
| 188 |
|
| 189 |
|
| 190 |
\subsection{Alignment} |
| 191 |
|
| 192 |
By |
| 193 |
{\ttfamily\verb|/snaptodo/margin block/.style={align=???}|} |
| 194 |
you can control the alignment of note text. |
| 195 |
The default setting is |
| 196 |
{\ttfamily\verb|align=flush \std@leftright|}, |
| 197 |
which flushes the text toward the page edges. |
| 198 |
If |
| 199 |
{\ttfamily\verb|align=flush \std@rightleft|} |
| 200 |
is what you do,% |
| 201 |
\makeatletter |
| 202 |
\snaptodo[margin block/.style={align=flush \std@rightleft}] |
| 203 |
{flush toward text body} |
| 204 |
the text will be flushed toward the main text body.% |
| 205 |
\snaptodo[margin block/.style={align=flush \std@rightleft}] |
| 206 |
{flush toward text body} |
| 207 |
Don't forget that you need |
| 208 |
\makeatother |
| 209 |
{\ttfamily\verb|\makeatletter|} |
| 210 |
and |
| 211 |
{\ttfamily\verb|\makeatother|} |
| 212 |
to handel control sequences with the at character. |
| 213 |
|
| 214 |
\subsection{Font} |
| 215 |
|
| 216 |
With |
| 217 |
\snaptodo[margin block/.style={font=\tiny}]{tiny} |
| 218 |
\snaptodo[margin block/.style={font=\scriptsize}]{scriptsize} |
| 219 |
\snaptodo[margin block/.style={font=\footnotesize}]{footnotesize} |
| 220 |
\snaptodo[margin block/.style={font=\small}]{small} |
| 221 |
\snaptodo[margin block/.style={font=\normalsize}]{normalsize} |
| 222 |
\snaptodo[margin block/.style={font=\large}]{large} |
| 223 |
\snaptodo[margin block/.style={font=\Large}]{Large} |
| 224 |
\snaptodo[margin block/.style={font=\LARGE}]{LARGE} |
| 225 |
\snaptodo[margin block/.style={font=\huge}]{huge} |
| 226 |
\snaptodo[margin block/.style={font=\Huge}]{Huge} |
| 227 |
{\ttfamily\verb|/snpatodo/margin block/.style={font=...}|}, |
| 228 |
you can change font size. |
| 229 |
This style also allows you to change font family. |
| 230 |
\snaptodo[margin block/.style={font=\itshape}]{itshape} |
| 231 |
\snaptodo[margin block/.style={font=\scshape}]{scshape} |
| 232 |
\snaptodo[margin block/.style={font=\slshape}]{slshape} |
| 233 |
\snaptodo[margin block/.style={font=\sffamily}]{sffamily} |
| 234 |
\snaptodo[margin block/.style={font=\ttfamily}]{ttfamily} |
| 235 |
\snaptodo[margin block/.style={font=\bfseries}]{bfseries} |
| 236 |
|
| 237 |
\end{document} |