3

Here's what I currently have :

enter image description here

Code is :

\begin{center}
\makebox[0.7\linewidth]{\Large{Name :} \hrulefill \ }\makebox[0.25\linewidth]{\Large{Class :} \hrulefill}
\end{center}

What I'm trying to get it to look like :

enter image description here

Basically, I need a way of lowering the horizontal lines relative to the text. Thank you.

2 Answers2

3

You can use \rule[<raise>]{<width>}{<height>} to put a rule of width <width> and height <height>. <raise> - the optional argument - can be used to move the rule up or down (negative <raise>):

enter image description here

\documentclass{article}

\begin{document}

Name: \rule{15em}{.4pt}\ Class: \rule{5em}{.4pt}

Name: \rule[-.2\baselineskip]{15em}{.4pt}\ Class: \rule[-.2\baselineskip]{5em}{.4pt}

\end{document}

Perhaps, if you wish to have the rule fill the entire line, you can use a number of \hrulefills and actually raise the Name: and Class::

\bigskip

\raisebox{.2\baselineskip}{Name:} \hrulefill\hrulefill\hrulefill\ 
\raisebox{.2\baselineskip}{Class:} \hrulefill
Werner
  • 603,163
1

One out of many many possible ways to do that.

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{center}
\makebox[0.7\linewidth]{\Large{Name :} \hrulefill \ }\makebox[0.25\linewidth]{\Large{Class :} \hrulefill}
\end{center}
\begin{tabularx}{\linewidth}{lXlp{0.1\linewidth}}
~{\Large Name :} & & {\Large Class :} & \\[0.1cm] %<- adjust this vertical distance to fit your needs
\cline{2-2} \cline{4-4}
\end{tabularx}
\end{document}

enter image description here