2

I need to have a list on which each entry has a number; an underscore line that is only long enough to accommodate a person's initials; and these are both followed by text.

The text needs to have varying lengths, of course, because each line has different text; yet the initials underscore lines need to be the same length. However, it seems impossible to force the initials lines to remain the same size. I would prefer them to be before the text, but I've placed them after the text, because the only fix that seems to have SORT of worked yet has been to do rightskip so as to constrain the right-hand margin; however, this (and every other solution that's come close to working) necessitates tweaking the \hspace manually, line by line, so as to inch it a bit further here and a bit nearer there. The initials lines never end up precisely the same size, and the manual tweaking is obviously too laborious to scale.

None of the \linewidth or \textwidth or similar solutions I've found on stackexchange are working for this; they all return error messages when I attempt to implement them. Thanks for any help you can offer.

I'm not using the numbered list feature, if that matters. My code so far is:

%[cls file, etc.]
\usepackage{fancyhdr}
\usepackage{longtable}
\usepackage{colortbl}
\usepackage{enumitem}
\usepackage{mathabx}
\usepackage{tabularx}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

[...]

\vspace{.15cm}  
\rightskip=3cm  
\hspace{.25in} 1. Text of a certain length \hspace{.15in} \hrulefill  \\

\vspace{.15cm}   
\rightskip=3cm   
\hspace{.25in} 2. Shorter text  \hspace{1.25in} \hrulefill \\

\vspace{.15cm}  
\rightskip=3cm  
\hspace{.25in} 3.  Long long long long long long long text \hspace{.8in} \hrulefill  \\

\end{document}
Mico
  • 506,678
andrew
  • 131
  • 1
    Welcome to TeX.SX. Is there a reason you can't use the \rule command? The format is \rule[raise]{width}{thickness} where raise is a height reference from the baseline and width is the wideness (length in this case). For example, \rule[-2pt]{2em}{1pt} would make a line 2 points below the baseline, the length of 2 "m" characters (approximately) and 1 point thick. Also, I suggest you use the built-in enumerate environment for automatic numbering. – Sandy G Oct 10 '17 at 00:49
  • Thanks, Sandy! Mico knocked it out and solved the problem below before I got to your comment, but I will experiment with yours tomorrow as well. Thanks for weighing in! – andrew Oct 10 '17 at 05:09

1 Answers1

2

Here's a solution that places the initials-here rule before the text. (The horizontal rule is just there to illustrate the width of the textblock.) The solution uses \parboxes for both the initials-here rule and the associated text.

enter image description here

\documentclass{article}
% simplified preamble:
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{lipsum}

\newlength\initialsboxwidth
\setlength\initialsboxwidth{1cm} % set to suit your needs
\newlength\textboxwidth
\setlength\textboxwidth{3.5in}
\newcommand\initialsbox{%
   \parbox{\initialsboxwidth}{\null\hrulefill}}
\newcommand\mynum[2]{
   \par\vspace*{.15in}
   \noindent\hspace{0.25in}%
   #1.\quad\initialsbox\quad%
   \parbox[t]{\textboxwidth}{\raggedright #2}\par}

\begin{document}
\hrule % just to indicate width of textblock

\mynum{1}{Text of a certain length}
\mynum{3}{Shorter text} 
\mynum{9}{Long long long long long long long long long long long long long long long text} 

\end{document}
Mico
  • 506,678
  • Thanks, Mico! Looks like I'm too much of a newbie to add a thumbs up that registers, but consider your answer recommended. You rock hard. Have a great week, and thanks again. – andrew Oct 10 '17 at 05:02