LyXHow to use a custom LaTeX class in LyX?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
c1b3rz
Posts: 6
Joined: Fri Sep 28, 2012 8:01 pm

How to use a custom LaTeX class in LyX?

Post by c1b3rz »

Hello.
I'm writing my thesis, and my university offers a LaTeX template for it.
In my first search on how to do it, I've came across this website: http://www.briandalessandro.com/blog/ho ... ss-in-lyx/. I've tried doing what it says (and indeed I can choose the new document class inside LyX) but I get the following error:

Code: Select all

l.8 \usepackage {amsthm}
The package inputenc has already been loaded with options:
[ansinew]
There has now been an attempt to load it with options
[latin9]
Adding the global options:
ansinew,latin9
to your \documentclass declaration may fix this.
So I tryied looking at the .cls and the .style file I had created, and the only reference to the package I found was at the .cls file, which was:

Code: Select all

\RequirePackage{amsmath, amssymb, amsfonts, amsthm}
and nothing else.

First of all, is this way of adding a new class to LyX fully functional? Or is there a safer, more consistent, way of doing so?
If this way works, what and where should I look to try to fix this error?

FYI, I'm using LyX 2.0.4 and MikTex 2.9.
The template can be found here: http://www.bu.ufsc.br/design/template.zip

Thanks in advance for any tip or guidance.
Last edited by cgnieder on Fri Sep 28, 2012 9:27 pm, edited 1 time in total.

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

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to use a custom LaTeX class in LyX?

Post by cgnieder »

I tried to test this but I failed since I haven't the abnt bundle installed. However, the problem is that the the custom package »BUUFSCThesis.sty« from your university does something it shouldn't do: it loads »inputenc« as follows:

Code: Select all

\usepackage[ansinew]{inputenc}
A class or package should never do that as it cannot know which input encoding users will need or want to use. My guess is that LyX also loads inputenc at some point which then causes trouble. You could try the following: comment the offending line (35) in the sty file like this:

Code: Select all

% \usepackage[ansinew]{inputenc}
Regards
site moderator & package author
Post Reply