Debian Codegraph @

texmf-dist/doc/latex/smartnotes/smartnotes-doc.tex

raw
1 \documentclass[a4paper,11pt]{article}
2 \usepackage[T1]{fontenc}
3 \usepackage[utf8]{inputenc}
4 \usepackage[a4paper,margin=2.5cm]{geometry}
5 \usepackage{microtype}
6 \usepackage{xcolor}
7 \usepackage{hyperref}
8 \usepackage{enumitem}
9 \usepackage{listings}
10 \usepackage{smartnotes}
11
12 \hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue}
13 \lstset{
14 basicstyle=\ttfamily\small,
15 columns=fullflexible,
16 keepspaces=true,
17 frame=single,
18 breaklines=true
19 }
20
21
22
23 \title{smartnotes \\ \small A package for dynamic side notes}
24 \author{Author: \textit{Abhishek Ranna}}
25 \date{Version 0.1 \texttt{2026/04/05}}
26
27 \begin{document}
28 \maketitle
29
30 \section{Overview}
31
32 \texttt{smartnotes} provides margin notes that automatically choose the left or right margin based on the note position, so connector lines remain short and direct. Its main focus is clear visual anchoring of notes using short connector arrows. It also supports forced side placement, basic overlap avoidance and two box styles.\footnote{This package exists because I was supposed to be writing something important, but a minor formatting frustration turned into an evening of procrastination and, eventually, a package.}
33 It is intended for drafting—hence the convenient global disable option—and for adding notes to yourself or collaborators while preparing a document.
34 \par
35
36
37 \section{Loading the package}
38
39 \begin{lstlisting}
40 \usepackage{smartnotes}
41 \end{lstlisting}
42
43 To disable all notes without having to remove them:
44
45 \begin{lstlisting}
46 \usepackage[disable]{smartnotes}
47 \end{lstlisting}
48
49 \section{Default settings}
50
51 The default values \footnote{These defaults do not have any specific logic; they are simply the ones I was trying to achieve on the evening this package was written.} used by \texttt{smartnotes} are listed in Table~\ref{tab:smartnotes-defaults}.
52
53 \begin{table}[h]
54 \centering
55 \begin{tabular}{ll}
56 \hline
57 \textbf{Option} & \textbf{Default value} \\
58 \hline
59 \texttt{width} & \texttt{2.2cm} \\
60 \texttt{sep} & \texttt{8pt} \\
61 \texttt{pagepad} & \texttt{6pt} \\
62 \texttt{stacksep} & \texttt{6pt} \\
63 \texttt{cornerradius} & \texttt{4pt} \\
64 \texttt{backgroundcolor} & \texttt{cyan!20} \\
65 \texttt{bordercolor} & \texttt{black} \\
66 \texttt{textcolor} & \texttt{black} \\
67 \texttt{linecolor} & \texttt{blue} \\
68 \texttt{font} & \verb|\footnotesize\sffamily| \\
69 \texttt{shape} & \texttt{rounded} \\
70 \texttt{side} & \texttt{auto} \\
71 \texttt{fancyline} & enabled \\
72 \hline
73 \end{tabular}
74 \caption{Default settings of the \texttt{smartnotes} package.}
75 \label{tab:smartnotes-defaults}
76 \end{table}
77
78 In words, the defaults correspond to a rounded note box of width \texttt{2.2\,cm}, separated
79 from the text area by \texttt{8\,pt}, with a page-edge padding of \texttt{6\,pt} and a
80 vertical stacking separation of \texttt{6\,pt}. The default corner radius is
81 \texttt{4\,pt}. The note box uses a \texttt{cyan!20} background with a black border and
82 black text, while connector lines are drawn in blue. The default font is
83 \verb|\footnotesize\sffamily|. Notes are placed automatically on the left or right margin
84 according to their position in the text area, and fancy connector lines are enabled by default.
85
86 \section{Global setup}
87
88 Use \verb|\notesetup| in the preamble if you wish to make changes to default style:
89
90 \begin{lstlisting}
91 \notesetup{
92 width=2.2cm,
93 sep=8pt,
94 pagepad=6pt,
95 stacksep=4pt,
96 backgroundcolor=yellow!30,
97 bordercolor=black,
98 textcolor=black,
99 linecolor=black,
100 fancyline,
101 rounded,
102 cornerradius=4pt,
103 font={\linespread{0.7}\selectfont\footnotesize\itshape\sffamily}
104 }
105 \end{lstlisting}
106
107 \section{The \texttt{\textbackslash note} command}
108
109 \begin{lstlisting}
110 \note{Automatic side note}
111 \note[left]{Forced left}
112 \note[right]{Forced right}
113 \note[rectangle]{Sharp corners}
114 \note[rounded,cornerradius=6pt]{Rounded box with modified corener radius}
115 \note[nofancyline]{No connector, can be used as a comment box.}
116 \end{lstlisting}
117
118 \section{Supported options}
119
120 \begin{itemize}[leftmargin=2.2em]
121 \item Dimensions: \verb|width|, \verb|sep|, \verb|pagepad|, \verb|stacksep|, \verb|cornerradius|
122 \item Colors: \verb|backgroundcolor|, \verb|bordercolor|, \verb|textcolor|, \verb|linecolor|, \verb|color|
123 \item Side selection: \verb|auto|, \verb|left|, \verb|right|
124 \item Shape: \verb|rectangle|, \verb|rounded|
125 \item Connector: \verb|fancyline|, \verb|nofancyline|
126 \item Font: \verb|font={...}|
127 \end{itemize}
128
129 \newpage
130 \section{Example}
131
132 %Modify the styling here as shown to change it globally from the default
133
134 % \notesetup{
135 % width=2cm,
136 % sep=8pt,
137 % pagepad=6pt,
138 % stacksep=4pt,
139 % backgroundcolor=cyan!30,
140 % bordercolor=black,
141 % textcolor=black,
142 % linecolor=black,
143 % rounded,
144 % cornerradius=4pt,
145 % font={\linespread{0.7}\selectfont\footnotesize\itshape\sffamily}
146 % }
147 \
148 The line starts here\note{Note goes here} and the connector shows the location for the note.\par
149 \medskip
150 For a note that needs to be on the end of a line it shall go here\note{Note B} and automatically be printed on the nearest margin.\par
151 \medskip
152 A sentence with a note\note{Automatic placement and stacking.} and another\note{Second note on the same line.}.
153
154 \vspace{2cm}
155 If for some reason you want\note[right]{Forced placement} a note on the far side - then you can force it like here.
156
157 \end{document}