LyXStrange error in compiling .pdf

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
User avatar
aiyoung
Posts: 3
Joined: Tue Aug 21, 2012 7:00 pm

Strange error in compiling .pdf

Post by aiyoung »

Hello All,

I am trying to get a .cls that my university provides to place nice with LyX.

I followed the instructions found on this site: http://blog.icall-research.net/2011/01/ ... or-mac-os/ to have the .cls avalible to LyX.

In addition to the above, i added the .clo file so that i could use the preview function in LyX.

I then imported the .tex example template (which compiles into a .pdf just fine in TeXworks) into LyX.

When i click on view in LyX, i receive the following error:
Undefined Control Sequence:

\maketitle

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
By exporting the LyX file back into a .tex file, i found that i would get the same error when i tried previewing the .pdf in TeXworks!

I traced the issue to LyX adding \maketitle in the wrong spot by comparing the .tex file LyX produced with the original .tex template.

When i move \maketitle to match the original .tex template, the file compiles correctly in TeXworks.

I then proceeded to save this new .tex file and then import the file into LyX to see if LyX would now preview the .pdf correctly.

To my dismay, LyX moved the \maketitle to the incorrect spot again!

If any LyX user has run into this issue when adding a .cls file to LyX and has any ideas on how i can get the .pdf preview to work correctly, I'd appreciate any help i can get.

I would much rather work on my thesis in LyX than have to switch to a different LaTeX editor.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

aiyoung
Posts: 3
Joined: Tue Aug 21, 2012 7:00 pm

Strange error in compiling .pdf

Post by aiyoung »

Just a thought i had.

When you create a article_name.layout file to use a .cls in LyX, one typically puts
# Input general definitions
Input stdclass.inc
at the end of the file.

When i googled stdclas.inc, it looks like it defines fonts and whatnot for standard classes like articles etc.

http://web.mit.edu/outland/share/lyx/la ... dclass.inc

is there a different .inc file i should be referencing in the .layout file if the .cls i want to use is for a thesis?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Strange error in compiling .pdf

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Does this help?

Autoadding \maketitle destroys layout of my article

Stefan
LaTeX.org admin
User avatar
aiyoung
Posts: 3
Joined: Tue Aug 21, 2012 7:00 pm

Re: Strange error in compiling .pdf

Post by aiyoung »

Hello Stefan,

The link you sent is similar to the issue that i'm having, however not using the template and starting from scratch didn't solve my issue.

I've emailed the person who keeps the .cls files up to date to see if any LyX user has contacted them with the same problem.
Post Reply