TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on the formatting of a text book.

The following picture shows the first thing I would like to do.

There are two things to achieve :

  1. I would like to "draw" the date using TikZ so as to have later the possibility to make more evoluated formatting.
  2. Then the "draw" must be put in the left margin.

enter image description here

The LaTeX code would be similar to the following one :

\section{Name of the class}

\subsection{Chapter A : Numeric activities}


\subsubsection{For Tuesday Nov. 29}
share|improve this question
Please don't ask "How do I achieve this layout", but rather a question about a specific feature that you're struggling with, one problem per question. This way other users who have a similar problem can benefit from your question and the solutions to it (No one's gonna ask for the same layout as you). It's no problem to ask several questions, if you've made some attempt yourself first. It's enormously helpful to see what you've tried so far to figure out what doesn't work. Is it putting something in the margin? Is it the table-layout with the colored cells? ... – doncherry Nov 28 '11 at 21:40
You're right. I've edited my question. – projetmbc Nov 28 '11 at 21:59
up vote 8 down vote accepted

Here is a tikz solution using the marginnote package:

enter image description here


    \begin{tikzpicture}[show background rectangle,inner frame sep=0pt,text width=1.5cm,align=center]
        \node [fill=orange] at (0,0)                                (dayofweek)  {#1};
        \node [fill=white ] at ($(dayofweek)  +(0,-\baselineskip)$) (dayofmonth) {#2};
        \node [fill=white ] at ($(dayofmonth) +(0,-\baselineskip)$) (month)      {#3};
        \node [fill=orange] at ($(month)      +(0,-\baselineskip)$) (dayofmonth) {#4};
\reversemarginpar% to put the margin pars on the left
share|improve this answer
Thanks a lot. I'll be able to do better output later... – projetmbc Nov 28 '11 at 22:10
How can I center the text ? – projetmbc Nov 28 '11 at 22:14
Had already updated solution before you asked: use align=center. – Peter Grill Nov 28 '11 at 22:15
Thanks for this anticipated update..:-) – projetmbc Nov 28 '11 at 22:17

You can use a simple tabular environment to format the date, and then frame it using a \fbox; the marginnote command (from the homonymous package) lets you place the date as a marginal note. In the following example I illustrate this approach; the \MyDate command has one mandatory argument (the name of the day); the other three values are typeset automatically (of course, you can make all or some of this elements also customizable as arguments of the command):



    \rowcolor{mycolor} #1 \\
    \large\the\day \\
    \large\shortmonthname. \\
    \rowcolor{mycolor} \the\year




enter image description here

share|improve this answer
Thanks for this light solution. – projetmbc Nov 28 '11 at 22:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.