| 1 |
# zebra |
| 2 |
|
| 3 |
A writing revision toolkit for LaTeX. The current release focuses on inline |
| 4 |
note-taking, providing macros (`\todo`, `\comment`, `\fixed`, `\note`, |
| 5 |
`\placeholder`) for collaborative writing. Notes are colour-coded, numbered, |
| 6 |
and marked in the margin. A summary table and note list are appended at the |
| 7 |
end of the document. If `hyperref` is loaded, note-list page references link |
| 8 |
back to the notes. The `final` option suppresses all notes for clean output. |
| 9 |
|
| 10 |
> **Migration:** This package was previously distributed as `zebra-goodies`. |
| 11 |
> The old name still works but prints a deprecation warning. |
| 12 |
|
| 13 |
## Options |
| 14 |
|
| 15 |
- `draft` / `final`: show or suppress notes. Default: `draft`. |
| 16 |
```latex |
| 17 |
\usepackage[final]{zebra} |
| 18 |
``` |
| 19 |
- `sort`: order of the detailed note list. `none` (default, document order) or `type` (grouped by note type). |
| 20 |
```latex |
| 21 |
\usepackage[sort=type]{zebra} |
| 22 |
``` |
| 23 |
- `unnumbered`: turns off note numbering. Inline markers become `[todo: ...]` (no number), the margin symbol carries no number, the end-of-document detailed note list is omitted (the summary table remains), and `\zebraref` falls back to `\ref`. Useful as a workaround if numbered notes interact badly with a particular class; the summary table count is then an upper-bound estimate. Default: disabled. |
| 24 |
```latex |
| 25 |
\usepackage[unnumbered]{zebra} |
| 26 |
``` |
| 27 |
|
| 28 |
Load `hyperref` explicitly if you want clickable note-list page references: |
| 29 |
|
| 30 |
```latex |
| 31 |
\usepackage{zebra} |
| 32 |
\usepackage{hyperref} |
| 33 |
``` |
| 34 |
|
| 35 |
## Take Notes |
| 36 |
|
| 37 |
```latex |
| 38 |
\todo[<who>]{bla bla} |
| 39 |
\fixed[<who>]{bla bla} |
| 40 |
\comment[<who>]{bla bla} |
| 41 |
\note[<who>]{bla bla} |
| 42 |
\placeholder[<who>]{bla bla} |
| 43 |
``` |
| 44 |
|
| 45 |
If a short name clashes with another package, use the prefixed form: |
| 46 |
|
| 47 |
```latex |
| 48 |
\zebratodo[<who>]{bla bla} |
| 49 |
\zebrafixed[<who>]{bla bla} |
| 50 |
\zebracomment[<who>]{bla bla} |
| 51 |
\zebranote[<who>]{bla bla} |
| 52 |
\zebraplaceholder[<who>]{bla bla} |
| 53 |
``` |
| 54 |
|
| 55 |
## Refer to Notes |
| 56 |
|
| 57 |
Labels may be placed inside note bodies with the usual `\label` command. |
| 58 |
Standard `\ref` returns the note number, while `\zebraref` prints the note |
| 59 |
type together with the number. |
| 60 |
|
| 61 |
```latex |
| 62 |
\todo{\label{zebra:intro}revise the introduction} |
| 63 |
|
| 64 |
See Todo~\ref{zebra:intro} on p.~\pageref{zebra:intro}. |
| 65 |
See \zebraref{zebra:intro} for the full reference. |
| 66 |
``` |
| 67 |
|
| 68 |
Labels inside notes are unavailable in `final` mode because the notes |
| 69 |
themselves are suppressed. |
| 70 |
|
| 71 |
Notes can appear inside moving arguments such as `\section` and `\caption`. |
| 72 |
To ensure stable numbering, add a `\label` inside the note — the note is |
| 73 |
then counted once regardless of how many times the heading appears (TOC, |
| 74 |
running headers, etc.). Notes without a `\label` in moving arguments are |
| 75 |
still safe but may receive a separate number in each context. |
| 76 |
|
| 77 |
## Define New Notes |
| 78 |
|
| 79 |
```latex |
| 80 |
\colorlet{mycyan}{cyan} |
| 81 |
\zebranewnote{question}{mycyan} % uses default symbol |
| 82 |
\zebranewnote{question}{mycyan}[$\diamond$] % custom symbol for this type |
| 83 |
|
| 84 |
\question[who]{what's this?} |
| 85 |
``` |
| 86 |
|
| 87 |
## Customise Existing Types |
| 88 |
|
| 89 |
Use `\zebrasetup` to change the colour or symbol of any note type after loading. Accepted keys: |
| 90 |
|
| 91 |
- `color/<type>=<colour>` — override the colour of a note type. |
| 92 |
- `symbol/<type>=<symbol>` — override the margin symbol of a note type. |
| 93 |
|
| 94 |
```latex |
| 95 |
\zebrasetup{color/todo=red} % red todos |
| 96 |
\zebrasetup{symbol/fixed=$\surd$} % tick mark for fixed notes |
| 97 |
\zebrasetup{color/todo=red, symbol/fixed=$\surd$} % combine several keys |
| 98 |
``` |
| 99 |
|
| 100 |
## Limitations |
| 101 |
|
| 102 |
- Use `\label` for notes in `\section`, `\caption`, and similar moving arguments; unlabelled notes there may be counted again in contents lists or running heads. |
| 103 |
- A labelled note and an unlabelled note with the same type, author, and body may be treated as the same replay. Add a label, vary the text, or avoid identical note bodies. |
| 104 |
- Identical unlabelled notes on the same source line, such as `\todo{x}\todo{x}`, collapse to one note. |
| 105 |
- In `final` mode, labels inside notes are unavailable. In `unnumbered` mode, the detailed list is omitted and summary counts are only an upper-bound estimate. |
| 106 |
- `\zebranewnote` expects command-name-safe note names and colours already known to `xcolor`; invalid values are left to TeX or `xcolor` errors. |
| 107 |
|
| 108 |
## Author |
| 109 |
|
| 110 |
Ruini Xue <[email protected]> |
| 111 |
|
| 112 |
## License |
| 113 |
|
| 114 |
Copyright (C) 2016-2026, Ruini Xue |
| 115 |
|
| 116 |
This work may be distributed and/or modified under the conditions of |
| 117 |
the LaTeX Project Public License (LPPL), version 1.3c. The latest |
| 118 |
version of this license is at: |
| 119 |
|
| 120 |
http://www.latex-project.org/lppl.txt |
| 121 |
|
| 122 |
This work is "maintained" (as per LPPL maintenance status) by Ruini Xue. |