I am working on a list of courses that I have taken. The following code:
Math 100--Trivialities \hfill Professor Jane Doe
\begin{flushright}
Grade: A
\end{flushright}
produces
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
Best Answer
Here are two options for achieving your requested output:
\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 atabular
is traditionally[c]
enter-aligned and overriding that with[t]
op. Using a column specification ofr@{}
adds the contentsr
ight-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
: