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 would expect this question to have already been answered, but I could not find an answer on point, so I am looking for thoughts and suggestions. The problem is as follows:

I have a document which I would like to share with a number of individuals for them to write in their comments. I would like to shrink the width of the page or text line, and then add an area on the right. An example would be:

Phasellus tempor! Scelerisque          ________________________
platea mattis sit, lorem sed.          ________________________
Pid, cursus sit platea quis eu,        ________________________
sociis urna turpis adipiscing?         ________________________

In ac, habitasse, vel lundium.         ________________________
Porttitor? Tincidunt sociis, ut        ________________________
dapibus ultricies a. Mid duis cum      ________________________
in pid! Lacus. Parturient cum          ________________________

Elementum tincidunt! Dolor urna,       ________________________
sed eu, nascetur ut! Ultrices auctor,  ________________________
cras pellentesque parturient placerat  ________________________
rhoncus ac turpis hac, placerat vut.   ________________________

My first inclination is to use marginpar, but I wanted to see if there were other, preferable options.

As seen in the example, my preference would be to have comment lines corresponding to paragraphs i.e. where there is no text on the left, there needn't be space for comments on the right.

I would also like to be able to turn off this area for leaving comment at the flip of a switch, so to speak i.e. return the margin widths/etc to normal and not add the lines. I do not expect this would be too difficult.

Incidentally, I am using the todonotes and lineno packages with memoir, so I would like a solution that does not break their functionality.

share|improve this question
    
I am not sure the "comments" tag means in this question what it generally means on this forum. :) –  Brian M. Hunt Mar 15 '12 at 18:14

1 Answer 1

up vote 5 down vote accepted

Since you use lineno package anyways, I made a solution based on this package. You have to have the numbers on and placed on the left to make it work, as in the following example. We introduce a command \PrintCommentLine which prints the line and we add this macro to the macro \makeLineNumberLeft that takes care of line number printing. You can as well easily switch it off.

\documentclass{article}

\usepackage{lineno}
\usepackage[latin]{babel}
\usepackage{lipsum}

% CODE STARTS HERE
\iftrue % change to \iffalse to switch it off
\setlength{\textwidth}{0.5\textwidth}
\def\PrintCommentLine{\kern1.1\textwidth\rule{0.9\textwidth}{1pt}}
\def\makeLineNumberLeft{% 
  \hss\linenumberfont\LineNumber\hskip\linenumbersep%
  \hbox to 0pt{\PrintCommentLine\hss}}
\linenumbers
\leftlinenumbers
\fi
% CODE ENDS HERE

\begin{document}

\noindent
\lipsum

\end{document}
share|improve this answer
1  
This is an excellent solution. –  Yiannis Lazarides Mar 15 '12 at 22:17
    
@YiannisLazarides Thanks. Such solutions are just about recognizing who have done the snippet you need ;) –  tohecz Mar 15 '12 at 22:25
    
Sure and a lot of reading:) –  Yiannis Lazarides Mar 15 '12 at 22:26
    
yes, and a lot of shell commands like locate lineno.sty | xargs gedit ;) –  tohecz Mar 15 '12 at 22:40
    
This is elegant. Thank you. –  Brian M. Hunt Mar 15 '12 at 22:45

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.