Read the catch below, before adopting this solution.
With the help of comments from John Kormylo and Philip S. Hirschhorn, I was able to piece together a "hacky" solution.
The \pointformat
command expects a single line as input. So, we can trick it into printing multiple lines using the `\parbox' command. It can be called in several ways. We specifically use the following format
\parbox[position][height]{width}{contents}
to write a custom command named \obe{}{}{}
:
\newcommand{\obe}[3]{
\parbox[t][0pt]{0.8cm}{
#1\\
(CO#2)\\
(PO#3)
}
}
It takes 3 arguments: the point value, the CO value, and the PO value, respectively. It can be called from the square brackets (where the points are given) of \question
, \part
, or \subpart
. For example,
\question[\obe{5}{1}{2}] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
will display something like this:

Other parameters for the \parbox
command are as follows:
t
- is used to set the alignment. The top of the box will be aligned with the top of the question. Alternatives: b
and c
.
0pt
- the height of the box. Ignoring this one will give the box a height, which can result in adding space between the lines of the same question.
0.8cm
- the width of the box. It can vary based on the size of the points margin that you use.
However, there's a catch. Whenever the question fits one or two lines, we will have to add spacing between questions manually. If we do not do that, for example:
\question[\obe{5}{1}{2}] The quick brown fox jumps over the lazy dog.
\question[\obe{2}{2}{4}] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
\question[\obe{4}{3}{2}] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
this will result in:

To avoid that, we can use \vspace{2\baselineskip}
for single-line questions, and \vspace{\baselineskip}
for multi-line questions. To make things easier, I have defined another custom command:
\newcommand{\qspace}[1]{
\vspace{#1\baselineskip}
}
that can be used by writing:
\question[\obe{5}{1}{2}] The quick brown fox jumps over the lazy dog.
\qspace{2}
\question[\obe{2}{2}{4}] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
\qspace{1}
\question[\obe{4}{3}{2}] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
which generates:

\parbox
to create a custom command to add the three lines. It works in most cases. However, if I have a question with multiple lines, it latches on to the first line and adds spacing in between the lines of the same question. The new line (if needed) should be added after each question. And for "tabular count", I am not sure I understand what that is. Can you elaborate?\begin{tabular}[t]{r}...\end{tabular}
. instead of\parbox
. You can control whether the points expand upward or downward using [b] or [t]. You can also use\smash
or\raisebox
to hide the extra lines.\parbox
combined with\smash
seems to have done the trick. I will test it out to see if I can find any other problems and if it works, post the solution soon.