0

Long story short: Changed laptop and previous working documents don't compile anymore. Problem show up with comamand \uline from \usepackage[normalem]{ulem} with argument \hspace{3cm}.

\documentclass[letterpaper,12pt,addpoints]{exam}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{graphicx}
\usepackage[left=0.7in,right=0.8in,top=0.8in,bottom=2in]{geometry} %add  argument to geometry package to see frames [.., showframe..]
\usepackage[normalem]{ulem}
\usepackage{etoolbox}
\usepackage{amssymb}
\usepackage{mathabx}
\usepackage{stmaryrd}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage[font=itshape]{quoting}
\usepackage{listings}

\begin{document}

\uline{all \hfill fine } %works \uline{not \hfill fine \hspace{3cm}} %does not work

\end{document}

This was working and producing such result:

this is working in a different machine

Now I am working on a different laptop and got these errors:

 !! Extra }, or forgotten \endgroup.\UL@stop ...alty \ifnum \lastkern =\thr@@ \egroup\egroup \ifdim \wd \UL@box... \uline{not \hfill fine \hspace{3cm}}
! Extra }, or forgotten \endgroup.\UL@stop ...num \lastkern =\thr@@ \egroup \egroup\ifdim \wd \UL@box =\z@ \e... \uline{not \hfill fine \hspace{3cm}}
! Missing } inserted.<inserted text>} \uline{not \hfill fine \hspace{3cm}}
! Missing } inserted.<inserted text>} \uline{not \hfill fine \hspace{3cm}}

Miktex is updated, tried with Texstudio and Texmaker, different compilers, I know it should not make difference, but every time blocks here. Sounds something is missing in this laptop. Any idea?

Big thanks.

  • If I ignore the errors and open produced pdf, will find the expected results. It makes me even more confused about the errors. – user30586 Oct 28 '20 at 23:21
  • 1
    The \hspace command has been changed. It now supports calc-syntax (if the package calc is used you can do e.g. additions), but this make it fragile for ulem. Put the space in box: \mbox{\hspace{3cm}}. – Ulrike Fischer Oct 28 '20 at 23:22
  • Perfect, it's compiling without erros once again. Thank you so much. How can I mark your comment as solution? – user30586 Oct 31 '20 at 17:52
  • Time and time again I see people doing this for completion lines. It would be much easier to fill the line with \rule[<height>]{<width>}{<thickness>} or Name:~\makebox[2in]{\hrulefill}. –  Nov 03 '20 at 22:47

0 Answers0