Debian Codegraph @

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

raw
1 \documentclass[a4paper,12pt]{article}
2 \usepackage[margin=2.5cm]{geometry}
3 \usepackage{lmodern}
4 \usepackage[T1]{fontenc}
5 \usepackage{smartnotes}
6
7 \begin{document}
8
9 \title{Package example use for \texttt{smartnotes}}
10 \date{}
11 \maketitle
12
13 \bigskip
14 {\Large \textbf{Automatic placement}}
15 \vspace{0.8cm}
16
17 This sentence places a note automatically\note{This note is placed automatically according to where it appears in the text area.}
18 while the text continues normally.
19
20 \bigskip\bigskip
21
22 Automatic placement also works across the line, as you will see just about now: here is a note in the left half\note{Auto Left}
23 \hfill and here is one in the right\note{Auto Right}.
24 half
25 \bigskip
26 \vspace{1cm}
27
28 {\Large \textbf{Forced placement}}
29 \vspace{0.8cm}
30
31 The package also allows explicit control. \newline \noindent
32 This note\note[right]{This note is forced to the right margin, regardless of where it appears in the line.} is forced to the right even though it is attached near the beginning of the sentence.
33
34 \vspace{1.5cm}
35
36 Likewise, this note is forced to the left while the sentence finishes at the far\note[left]{Forced left} right.\hfill
37
38 \bigskip
39 \vspace{1cm}
40
41 {\Large \textbf{Changing the box shape}}
42 \vspace{0.8cm}
43
44 The default shape is rounded\note{Rounded boxes are the package default.}, but a local option can switch\note[rectangle]{This note uses the rectangular box shape instead of the default rounded shape.} to a rectangular note when sharper corners are preferred.
45
46 \bigskip
47 \vspace{1cm}
48
49 \newpage
50 {\Large \textbf{Changing colours locally}}
51 \vspace{0.8cm}
52
53 A note can also be used to mark different kinds of remarks. For example, this one might indicate a correction\note[backgroundcolor=red!15,linecolor=red]{Please recheck this argument before the final version.}
54 while this one could be a general reminder\note[backgroundcolor=green!20,linecolor=green!50!black]{Add the missing reference once the bibliography is finalized.}.
55
56 \bigskip
57 \vspace{1cm}
58
59 {\Large \textbf{Switching off the fancy line}}
60 \vspace{0.8cm}
61
62 The package normally uses the fancy connector line\note{This note uses the default fancy connector.},
63 but it can also be disabled for a simpler visual style\note[nofancyline]{This note is shown without the fancy connector line.} when a cleaner margin is preferred.
64
65 \bigskip
66 \vspace{1cm}
67
68 {\Large \textbf{Stacking behaviour}}
69 \vspace{0.8cm}
70
71 When several notes are attached close to one another on the same side of the page, the package stacks them vertically instead of letting them overlap. This is useful when reviewing a dense paragraph with several short remarks in quick succession.
72
73 First one appears here\note{First note.} and
74 the second\note{Second note that got stacked} note can be added nearby as well without the margin notes colliding.
75
76 \vspace{1cm}
77
78 The spacing between stacked notes can be adjusted globally with the \verb|stacksep| option in \verb|\notesetup|.
79
80 \bigskip
81 \vspace{1cm}
82
83 {\Large \textbf{Global setup}}
84 \vspace{0.8cm}
85
86 Global settings can be changed in the preamble using \verb|\notesetup|. For example, one might use:
87
88 \begin{verbatim}
89 \notesetup{
90 width=2.4cm,
91 sep=10pt,
92 backgroundcolor=yellow!20,
93 linecolor=black,
94 rectangle,
95 font={\small\ttfamily\bfseries}
96 fancyline
97 }
98 \end{verbatim}
99
100 This makes it easy to adapt the general appearance of the notes for a particular document while still allowing local overrides where needed.
101
102
103
104 \end{document}