fillin exercise in PDF: bug with underlining?

4 views
Skip to first unread message

Sean Fitzpatrick

unread,
May 29, 2026, 12:22:59 PM (2 days ago) May 29
to prete...@googlegroups.com

I am noticing that in PDF output, exercises with fillin sometimes get an answer blank that is underlined, and sometimes the underline is not there.

I am not sure why, since the .tex source is the same in each case, but not the PDF output.

Examples:

Here is an exercise in .ptx source:

      <exercise label="TaC-antiderivatives-4">

          <statement>
            <p>
              Fill in the blanks:
              <q>Inverse operations do the <fillin answer="opposite" width="20"/>
              things in the <fillin answer="opposite" width="20"/> order.</q>
            </p>
          </statement>
          <evaluation>
            <evaluate>
              <test correct="yes">
                <strcmp case="insensitive">opposite|reverse</strcmp>
              </test>
            </evaluate>
            <evaluate>
              <test correct="yes">
                <strcmp case="insensitive">opposite|reverse</strcmp>
              </test>
            </evaluate>
          </evaluation>
      </exercise>

It produces the following .tex:

\begin{divisionexercise}{4}{}{}{TaC-antiderivatives-4}%
Fill in the blanks: \textquotedblleft{}Inverse operations do the \fillintext{20} things in the \fillintext{20} order.\textquotedblright{}%
\end{divisionexercise}%

And in PDF, it appears thus:


In this case, we get underlines. But here is another example. The .ptx source is

        <exercise label="TaC-lHospitals-rule-5">
            <statement>
              <p>
                Fill in the blanks: The Quotient Rule is applied to
                <m>\ds \frac{f(x)}{g(x)}</m> when taking <fillin width="20" answer="derivatives"/>;
                l'Hospital's Rule is applied when taking certain <fillin width="20" answer="limits"/>.
              </p>
            </statement>
            <evaluation>
              <evaluate>
                <test correct="yes">
                  <strcmp case="insensitive">a derivative|derivatives?</strcmp>
                </test>
                <test>
                  <strcmp use-answer="yes" strip="no" />
                  <feedback>
                    <p>
                      Your answer includes the correct word but has extra text.
                    </p>
                  </feedback>
                </test>
              </evaluate>
              <evaluate>
                <test correct="yes">
                  <strcmp case="insensitive">limits?</strcmp>
                </test>
                <test>
                  <strcmp use-answer="yes" strip="no" />
                  <feedback>
                    <p>
                      Your answer includes the correct word but has extra text.
                    </p>
                  </feedback>
                </test>
              </evaluate>
            </evaluation>
      </exercise>


The .tex produced is:

\begin{divisionexercise}{5}{}{}{TaC-lHospitals-rule-5}%
Fill in the blanks: The Quotient Rule is applied to \(\ds \frac{f(x)}{g(x)}\) when taking \fillintext{20}; l'Hospital's Rule is applied when taking certain \fillintext{20}.%
\end{divisionexercise}%

This seems like the same result! But in PDF, there is no underline:


Seems like a TeX (XeLaTeX) bug? Or something else? I don't see any difference in .ptx or .tex source that explains why one gets underlined and the other does not.

Sean Fitzpatrick

unread,
May 29, 2026, 12:49:24 PM (2 days ago) May 29
to prete...@googlegroups.com

Sorry, I think it is a false alarm.

All the blanks get underlined, but which underlines show up depends on the zoom level.

What is weird is that I have one exercise set where there are two questions on the same page, using fillin blanks of the same length. The underlining shows up for one but not the other. But if I zoom in, both are there.

Oscar Levin

unread,
May 29, 2026, 12:54:59 PM (2 days ago) May 29
to prete...@googlegroups.com
I wonder if it has to do with the display math on that line.  I've seen weirdness with line rendering with some pdf viewers in other contexts too.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/47ed8114-71de-4bb2-b309-4b2343eb656e%40gmail.com.
uUXGYV2cxCl5eH75.png
rkmgYcBtbRWX0Hc0.png

Sean Fitzpatrick

unread,
May 29, 2026, 12:58:29 PM (2 days ago) May 29
to prete...@googlegroups.com

My only remaining concern comes from my experience with the Ricoh printer in our department.

Last term I had weekly quizzes with an \hrule near the top. Sometimes it printed, sometimes it didn't.

PDF is not as immutable as we were led to believe!

Reply all
Reply to author
Forward
0 new messages