## LaTeX forum ⇒ LyX ⇒ Problems Using Hyperref Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
crgonzalez4611
Posts: 7
Joined: Mon Mar 24, 2014 3:48 am

### Problems Using Hyperref

Hello,

I am working on my thesis using LyX. I am running into trouble with the hyperref support. Without it, the thesis outputs just fine but when I turn hyperref on in Document > Settings > PDF Properties it does not work. It gives me the following error:

Undefined Control Sequence. \begin{acknowledgments} The control sequence at the end of the top lineof your error message was never \def'ed. If you havemisspelled it (e.g., \hobx'), type I' and the correctspelling (e.g., I\hbox'). Otherwise just continue,and I'll forget about whatever was undefined.

And identical errors for the following (instead of \begin{acknowledgments}: \listoftables, \listoffigures, \begin{abstract}`.

I have no idea what is going on. I am no expert in LaTeX or LyX but I know you would want the files to help me so they are attached. Useful information follows below the signature line.

Carlos

Machine:
Windows 7 Enterprise (64-bit)

Software:
LyX 2.1.0
MiKTeX 2.9

Document:
No content (paragraphs, figures, tables, bibliography entries) included.

Document Class:
Another student gave me customized .cls and .layout files (based on report class) for the requirements of my school. Both files are in the attachment. I am currently running them as a local layout (i.e. the class is not installed in MiKTeX or LyX system folders).

Bibliography:
.bib file made using Jabref 2.10. I am using jfm.bst as my style. I have it installed in the MiKTeX system folder but I have also included it in the attachment.
Attachments
Thesis Files.zip
Last edited by cgnieder on Tue Jun 17, 2014 12:09 pm, edited 1 time in total.

Tags:

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am
Your cls file is not a local layout. Layout files talk to LyX about what to put on the screen as you're typing. It doesn't know what to do with the cls code when you put it there. Either paste the contents of the cls file into the Preamble or put the file in the same folder as your document and call it from the Preamble.

crgonzalez4611
Posts: 7
Joined: Mon Mar 24, 2014 3:48 am
Poor choice of words on my part. I meant I have both .cls and .layout files on the same folder as the thesis .lyx files. What I did was that I went to Document > Settings > Document Class and selected the .layout file using the "Local Layout" button. Like I said, the document output just fine without the hyperref. Just as I turned the hyperref on, it did not work.

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am
Ok, I understand now. Well your layout file looks fine. You call natbib three times and nomencl twice in your preamble, but that won't cause what's happening. Those error messages aren't very helpful. I'd blame the cls file because there's not a whole lot else in these minimal examples, but a cursory glance at it didn't spot anything that stood out (other than my personal pet peeve of not changing the first line of frankensteined code to the name of the new cls file). It is totally possible that if someone who knows writing cls files better than me takes a look, they might find something. However...

crgonzalez4611
Posts: 7
Joined: Mon Mar 24, 2014 3:48 am
Thanks for your trying. I know it was a lot of files so thanks for taking a look. If I can't find a solution for this, I might have to learn LaTeX and work in TeXworks instead, like you suggested.

Since I posted the topic, I tried exporting a blank file (no preamble, no math packages, no modules, only natbib citation style selected) with the class and it worked just fine... as long as hyperref is off.

I also tried using the thesis files and commenting out the preamble one line at a time. Still no luck with getting hyperref to work or finding any conflicts with the packages I am using.

I now think (especially after your response) it is something in the .cls and/or .layout file(s). Like I said, I got the class files from another student so I have not touched them. It is very possible that whoever coded the class files made a mistake.

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am
I don't know what I had going last night but I couldn't recreate it this morning which is probably just as well because I went back and fixed the errors in the cls instead and now it seems to be working correctly within LyX. The problem was with the MakeUppercase in just the sections throwing up error messages so I hard-coded the titles in all caps instead which is bad form but at least it does compile. Cls file attached. Just swap it for the one you have in your document folder and continue using LyX as usual.
Attachments
lsuetd2.cls

crgonzalez4611
Posts: 7
Joined: Mon Mar 24, 2014 3:48 am
Thanks so much for your help. It worked. Just needed to add a few phantom sections in the front matter and in the back matter.

I could not have submitted my thesis as it was before. I am required to submit a PDF file with bookmarks and cross references and now I have everything I need to start writing. Thanks.