Summarizing a text book is easy in LaTeX, but sometimes I want to learn the summarized text. Reading the summary over and over again is not very efficient, so I came up with the typical solution, where you can hide the main part of the summary and can check your knowledge by asking yourself questions based on keywords in the margin. Here is an example, where I started summarizing the R package data.table:
Now I use hide the main text and can ask myself the questions:
- Express the data.table in SQL-form?
- How to create a data.table?
Add the following to your latex file (note that I load also the packages lstlisting and some other packages not mentioned here):
1 2 3 4 5 6 7 8 9 |
\setlength{\parindent}{0pt} \setlength{\parskip}{\baselineskip}% \usepackage{geometry} \usepackage{marginnote} \usepackage{color} \newgeometry{top=1.5cm, bottom=1.5cm, outer=5cm, inner=2cm, heightrounded, marginparwidth=4cm, marginparsep=0.1cm} \renewcommand*{\marginfont}{\color{red}\sffamily} \makeatother |
Some remarks:
- I changed the vertical distance of the paragraphs, so it automatically skips a line (if you summarize with lots of text this is probably not a good thing, but if you summarize R commands like in the example, you don’t want to have to add linebreaks after every paragraph.
- I removed the indent for new paragraphs for the same reason.
- I added the package color so I can show the margin notes in the color red (using the renewcommand for the marginfont.
In the text you can now add a margin note by adding:
1 |
\marginnote{your text for the margin} |