TransWikia.com

ref command not working in the argument of redefined section/subsection command (UAI template)

TeX - LaTeX Asked by user3775947 on February 20, 2021

So I used this template from this UAI conference https://auai.org/uai2021/submission_instructions.php
I found that the section{ref{some_label}} or subsection{ref{some_label}} are only compiled to be ??.
The section and subsection commands are redefined in the template class file.
So I guess it has to do with the titlesec package or titleformat command. There seems also a deeper conflict between MakeUppercase command and hyperref package.
Can anyone help take a look at the template?

One Answer

The class has broken section somehow. You should report it to the maintainers.

However a simple workaround seems to be to move label

documentclass{uai2021}

begin{document}

section{zzz}label{abc}
aaa see Section~ref{abc}
end{document}

with label after the argument produces

enter image description here

with it in the argument

documentclass{uai2021}

begin{document}

section{zzzlabel{abc}}
aaa see Section~ref{abc}
end{document}

Gives the error

! Undefined control sequence.
label #1->@bsphack begingroup def label@name 
                                                  {#1}label@hook protected...
l.5 section{zzzlabel{abc}}
                            
? 

The issue can be simplified down to files just in standard distributions

documentclass{article}

usepackage{titlesec}
titleformat*{section}{MakeUppercase}

begin{document}

section{zzzlabel{abc}}
aaa see Section~ref{abc}
end{document}

gives the error

! Missing control sequence inserted.
<inserted text> 
                inaccessible 
l.8 section{zzzlabel{abc}}
                            
? 

Answered by David Carlisle on February 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP