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 creating a document that shows a template of a documentation standard. I'd like to put in some miscellaneous notes for the template placeholders. Something like

[date1]   [COMMENT: Please use only dates obtained from
[date2]   the Center for Dates.]

Since the date list will have lots of white space to its right, I'd like the comment to appear there. It's closer to home and conserves space. The closest I found to what I want is \marginpar{} but it doesn't quite do the trick.

How can I do this in LaTeX?

share|improve this question
@skytrader Suppose we have a comment for date2 and date3 would you please modify your example to show, how you propose to have it typeset (assume they all have two lines of contents). If you have an example scan from the standard, it will even be better to include a small image. – Yiannis Lazarides Dec 9 '11 at 4:33
@skytrader Anyway, just added an answer, as I had some time in my hands! – Yiannis Lazarides Dec 9 '11 at 5:19
up vote 9 down vote accepted

The difficulty with this layout, is that the dates are printed using a different grid from those of the comments, i.e., it makes a tabular environment an unsuitable way to typeset such a layout. In a way, the comments are typeset as "sideways-footnotes"!

enter image description here

To make it convenient for the author to enter the lines, we provide a user command as:

\adddate{date..}{Please ....}

We create a list to hold all the data. We then iterate through the list and typeset using two minipages. Adding a bit more salt and pepper and some LaTeX kernel black magic commands we get the minimal below:

       \else \g@addto@macro{\listone}{,#1}
   \expandafter\def\csname#1\endcsname{\footnotesize #2}

% add some data 
\adddate{date1}{1 Please use only dates obtained from the Center for Dates.}
\adddate{date2}{2 Please use original dates.}
\adddate{date3}{3 Please use original dates.}
% print the data
% define a macro for this for convenience
% if you want
    \next \par
    \@nameuse\next \par

You can add an additional macro to hold the code for the loops, if you are going to use such code extensively.

share|improve this answer
Wow! That's really some time you've got. I don't really have anything specific in mind about the layout---I planned to clip my words should they overflow. But that's really some effort. Thank you very much! (--,) – skytreader Dec 9 '11 at 5:25
@Yiannis -- this would look even nicer if the comments were set ragged right instead of justified. the uneven spacing makes this material hard to read, and i don't think the extra attention is "justified". (sorry about that.) – barbara beeton Dec 9 '11 at 14:14
@barbarabeeton -- thanks for the comment; no amount of cosmetic surgery can turn this ugly duckling into a typographical beauty. This sort of example though is good from a programming point of view, as it demonstrates, iteration and the use of lists using (La)TeX. – Yiannis Lazarides Dec 9 '11 at 14:43
@Yiannis -- ugly duckling, true! and i agree it's a useful demonstration of techniques. but i still feel that the ugliness and difficulty of reading the result attract more and longer attention than warranted for the object. a subjective view. – barbara beeton Dec 9 '11 at 15:56

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.