I would like to keep a sort of diary in LaTeX, and in this context I have the need for a command like:


such that the following is satisfied:

  • each 'diary entry' corresponds to a chapter of the dairy (assuming that the diary uses the documentclass book) and starts on a new page;
  • the date is listed on the left margin just next to the title as a marginnote;
  • the title starts exactly on the left margin (so it is aligned with the text below).

In this way I could list eventually all the diary entries in a table of contents. Less important but useful to me would be to control the spacing between the entry title and the first sentence of the entry (let's say this vertical distance equals \parskip).

All ideas, questions and suggestions are welcome.

1 Answer 1


Here is an option that uses the article class and setting the title manually. ToC-entries are inserted as \sections, which you can format using tocloft, if needed:

enter image description here


\usepackage[paper=a5paper]{geometry}% Document layout

\newcommand{\entry}[2]{% \entry{<date>}{<title>}
  \addcontentsline{toc}{section}{#2}% Add to ToC
  \makebox[0pt][r]{\smash{\rotatebox[origin=r]{90}{\@datefont\strut #1\hspace*{-.5\baselineskip}}}\hspace{\datedist}}%
  {\@titlefont #2\par}%

% Defaults

% If you want to format the ToC entries...





\entry{July 1st, 2016}{Yesterday}


Customization has been added to change

  • the distance the date is offset into the margin (via \setdatedist{<len>});

  • the date font (via \datefont{<font>});

  • the title font (via \titlefont{<font>}); and

  • the vertical skip below the title entry (via \settitleskip{<len>}).

  • Is there a way to add the date also in the toc (say also in the left margin)?
    – AYK
    Commented Jul 1, 2016 at 1:36
  • @AYK: As a start, use \addcontentsline{toc}{section}{#1: #2} within the \entry command. There doesn't seem like there is enough room to place the date in the margin.
    – Werner
    Commented Jul 1, 2016 at 2:49
  • Actually for my personal use I have a margin length of 5 cm (I have other commands making use of the margin), this is also why I have omitted the rotatebox command.
    – AYK
    Commented Jul 1, 2016 at 11:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .