I'm new to LaTeX and I'm trying to write a line, then a new blank line just underneath it. Here is my code so far:

\begin{center} \underline{\smash{This} \\ A} \end{center}
\begin{center} is some \\ - \end{center}
\begin{center} \underline{\smash{random}} \\ B} \end{center}
\begin{center} text. \\ - \end{center}

So what I'm really trying to do is to write some text on the first line, and on the next line I'm trying to leave it blank (except the ones that are underlined and has letters A and B underneath, kinda like what you see in SAT writing portion.

enter image description here

I'm trying to do this because I need to vertically align the entire sentence, I just need to find a way to get rid of those hyphens or dashes and just make them blank (except letters A and B underneath)!! What can I do?!

  • 1
    You can replace the hyphens by "backslash space", no? "\ ". This will appear as a blank. – Daniel Moskovich Oct 7 '13 at 4:25

Here's one way to do what you want using a package designed for linguistic examples. It has the limitation that the letters underneath are left aligned with the words, not centred; this is a function of how the package is designed and not easily changeable.

The \gll macro takes two lines each terminated with \\. Each word in line one will be aligned with each word in line two. {} can be used to skip words (or group words).

\usepackage{cgloss4e} % documentation is found in the `gb4e` package

{\gll \uline{This} is some \uline{random} text.\\
 A {} {} B {}\\}

output of code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.