I am working on a list of courses that I have taken. The following code:

Math 100--Trivialities \hfill Professor Jane Doe
Grade: A


enter image description here

Notice that there is an extra line space between the professor's name and grade. Is it possible to remove that space so that the Grade appears on the next line as if it were typed in a paragraph? In my mind, I'm thinking of it looking something like:

Math 100-Trivialities        Professor Jane Doe
                                       Grade: A

Here are two options for achieving your requested output:

enter image description here

\noindent Math 100--Trivialities \hfill Professor Jane Doe \par
\hfill Grade: A


\noindent Math 100--Trivialities \hfill
  Professor Jane Doe \\
  Grade: A

\noindent ensures that the left entry is flush with the left margin.

The first inserts a paragraph break and then flushes Grade: A to the right using \hfill. The second uses the fact that a tabular is traditionally [c]enter-aligned and overriding that with [t]op. Using a column specification of r@{} adds the contents right-aligned with no column separation on the right.

If you're using a document style that has a non-zero \parskip, you can revert this in the first approach, if needed. My MWE provides no \parskip.

Another, perhaps "overkill-ish" way of obtaining the output would be to use flushright and setting the first entries (on the same line) in a box of width \linewidth:

\makebox[\linewidth]{Math 100--Trivialities \hfill Professor Jane Doe}
Grade: A
  • What about a tabular*? – egreg Nov 20 '12 at 20:35

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.