Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.]
[date3]

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
add comment

1 Answer

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:

\documentclass{article}
\makeatletter
\def\listone{}
\def\adddate#1#2{
   \ifx\@empty\listone
       \g@addto@macro{\listone}{#1}
       \else \g@addto@macro{\listone}{,#1}
   \fi
   \expandafter\def\csname#1\endcsname{\footnotesize #2}
}

\parindent0pt
\begin{document}
% 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
\begin{minipage}[t]{2.5cm}
\@for\next:=\listone\do{%
    \next \par
}
\end{minipage}
\begin{minipage}[t]{3cm}
\@for\next:=\listone\do{%
    \@nameuse\next \par
}
\end{minipage}
\end{document}

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
add comment

Your Answer

 
discard

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.