[texhax] Latex examdesign class: bug with \ref'ing a labeledequation

Mauricio Calvao orca at if.ufrj.br
Sat May 1 23:46:48 CEST 2010


Hi Phil,

Thanks for your prompt reply!

Please see below a minimal example of a .tex file in which this happens. 
I attach two files: (1) the .pdf output after running Latex (of course) 
several times; (2) my modified and otherwise working examdesign.cls; I 
suspect my examdesign.cls file might perhpas be outdated, despite my 
having downloaded it from CTAN recently... Could you provide me yours as 
well? Unfortunately I no longer use MikTex, which is one of the very few 
things I miss a lot from Windows, particularly because of its updating 
the packages on the fly...

Thanks again for any further help!!


###################################################

\documentclass[10pt,brazil]{examdesign}

\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{babel}

\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\usepackage{graphicx}

\setlength{\topmargin}{-.5cm} \setlength{\oddsidemargin}{-.7cm}
\setlength{\evensidemargin}{-.7cm} \setlength{\textwidth}{17.2cm}
\setlength{\textheight}{23cm}

%\usepackage{bm}
\NoRearrange
%\ShortKey
%\BoldfaceCorrectMultipleChoiceAnswer

\setrandomseed{1}
\NumberOfVersions{1}
%\NoKey
%\OneKey
\class{Universidade Federal do Rio de Janeiro\\
Instituto de F\'\i sica\\F\'\i sica III --
2010/1}
\examname{Prova Final (P1) -- 13/05/2010}

\SectionPrefix{Se\c c\~ao \arabic{sectionindex}. \space}
\SectionFont{\bf}
\ContinuousNumbering
\DefineAnswerWrapper{{\bf Resolu\c c\~ao:\ \\} }{$\blacksquare$}

\begin{document}

\begin{shortanswer}[title={Se\c c\~ao 2. Quest\~oes 
discursivas},rearrange=no,suppressprefix=yes,resetcounter=yes]

\begin{question}
Considere uma densidade linear de carga, num arco de c\'\i rculo de raio 
$R$, dada por
\[
  \boxed{
\lambda(\theta)=A\cos\theta\,,\qquad 0\le\theta\le\pi\,,
}
\]
calcule a carga total.


\ \\
\begin{answer}

Um elemento infinitesimal de arco do c\'\i rculo possui carga
\begin{align*}
   dq &= \lambda d\ell\,, \\
      &= A\cos\theta\, Rd\theta\,.
\end{align*}
Logo
\begin{equation}
  \boxed{
    Q= 0
}
\label{carga}
\end{equation}

A express\~ao \ref{carga} era de se esperar, simplesmente por uma 
quest\~ao de simetria.


\end{answer}

\end{question}

\end{shortanswer}


\end{document}


###################################################


Philip G. Ratcliffe wrote:
>> I have been using Jason Alexander's examdesign Latex class 
>> for quite a 
>> while now; it is excellent and essentially does all I'd like to build 
> 
> Me too and I fully agree.
> 
>> [snip]
>> However, I need to refer to a labeled equation: I used
>>
>> \begin{equation}
>> F = ma
>> \label{Newton}
>> \end{equation}
>> ...
>> Equation \ref{Newton} is Newton's second law.
>>
>> When I compile the .tex file (through Kile under Debian Linux 
>> lenny), I get the following error:
>> Reference `1 at Newton` on page 4 undefined on input line 384.
>> [snip]
> 
> Hmm, I've just tried your snippet on my (fully up-to-date MiKTeX) system
> inside a "shortanswer" environment and .. it works!
> 
> Of course, you did run LaTeX twice, didn't you?
> 
> So, as the saying goes, can we have a full minimal example please?
> 
> Ciao,  Phil


-- 
#######################################
Prof. Mauricio Ortiz Calvao
Federal University of Rio de Janeiro
Institute of Physics, P O Box 68528
CEP 21941-972 Rio de Janeiro, RJ
Brazil

Email: orca at if.ufrj.br
Phone: (55)(21)25627483
Homepage: http://www.if.ufrj.br/~orca
#######################################
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1.pdf
Type: application/pdf
Size: 23808 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20100501/d4a74fec/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: examdesign.cls
Type: text/x-tex
Size: 48346 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20100501/d4a74fec/attachment-0001.bin>


More information about the texhax mailing list