LyXIEEETran layout broken in 1.6.7?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
d60pmp
Posts: 17
Joined: Wed Mar 09, 2011 1:54 pm

IEEETran layout broken in 1.6.7?

Post by d60pmp »

Hi all, struggling to run the IEEETran example.
MWE:
  • Install Latex IEEETran class
  • [code]sudo apt-get install texlive-publishers[/code]
  • Confirm installation
  • [code]find /usr/share/ | grep -i ieeetran.cls[/code] Returns [quote] /usr/share/texmf-texlive/tex/latex/IEEEtran/IEEEtran.cls /usr/share/texmf-texlive/tex/latex/base/IEEEtran.cls [/quote]
  • Reconfigure LYX
  • New from template -> IEEETran.lyx
  • Run
  • Returns long list of errors including: [quote]LaTeX Error: Command \proof already defined LaTeX Error: Environment \IEEEkeywords undefined[/quote]
With a truly minimal document of class article[IEEETran] it generates output fine, but as soon as one tries to do anything tricky, like including keywords, it complains:
LaTeX Error: Environment \IEEEkeywords undefined
Can anyone replicate this in 1.6.7?
Is this something that has never worked, or is it broken in this version?

Thanks for your help guys!
Last edited by d60pmp on Sun Mar 13, 2011 1:34 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

d60pmp
Posts: 17
Joined: Wed Mar 09, 2011 1:54 pm

Re: IEEETran layout broken in 1.6.7?

Post by d60pmp »

As far as I can tell this is broken, at least on my installation, but I've found a way of working around it using ERT to define commands like \begin{keywords} instead of the unrecognised \begin{IEEEkeywords} that Lyx inserts.

I'm marking the topic as resolved.

Edit: I've unmarked the topic as resolved since I'm not the only one having problems.
Last edited by d60pmp on Sat Apr 02, 2011 10:18 am, edited 2 times in total.
jmmcg
Posts: 1
Joined: Fri Apr 01, 2011 7:24 pm

Re: IEEETran layout broken in 1.6.7?

Post by jmmcg »

I've tried and tried, but for the life of me can't figure out how to get the IEEETran layout to work in Lyx v1.6.7 nor 1.6.9 on Ubuntu 10.10.

I don't know LaTeX (which is why I use Lyx...) so my understanding of how to use the ERT & \begin{...}, \end{...} commands is limited.

I've tried placing them all around the proof & theorem sections. Turning the styles on & off to see if that might work, also I tried using the comments in:

ftp://ftp.mccme.ru/pub/tex/cd/macros/la ... _notes.txt

Without success. I guess I need someone to state the obvious to me! So hopefully someone can tell me the exact settings & placement of ERT to fix this! Thanks a lot!
d60pmp
Posts: 17
Joined: Wed Mar 09, 2011 1:54 pm

IEEETran layout broken in 1.6.7?

Post by d60pmp »

First of all, is it just the theorems you're having trouble with?
i.e. If you create an IEEEtran document with just some text in does it compile?

Once you have a minimum working document then you can add bits that might be problematic until it won't work any more, then post the errors here and we might be able to be more helpful.

In my installation things are fine until I try and include Theorems, Corollaries etc. I can however include proofs using

Code: Select all

\begin{proof} ... \end{proof}
Hope that helps!
d60pmp
Posts: 17
Joined: Wed Mar 09, 2011 1:54 pm

IEEETran layout broken in 1.6.7?

Post by d60pmp »

Rightyho, cracked it. At least on my machine.

The problem is that there's a conflict between the IEEEtran document class and amsthm package - they both define \proof.

This is made difficult to fix by the fact (correct me if I'm wrong on this) that LyX doesn't let the user mess with the stuff it does at the very beginning of the latex it produces - the so called preamble goes after this.

When you select, for example, the theorem environment in LyX it goes ahead and sticks \usepackage{amsthm} in the preamble where it conflicts with the IEEE \proof, throwing an error.

The workaround is to do everything manually, so LyX doesn't get it's grubby hands on the pre-preamble. So, in the preamble use:

Code: Select all

\let\IEEEproof\proof
\let\IEEEendproof\endproof
\let\proof\@undefined
\let\endproof\@undefined

\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\theoremstyle{plain}
\newtheorem{cor}[thm]{Corollary}
\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}
\theoremstyle{plain}
\newtheorem{prop}[thm]{Proposition}
\theoremstyle{plain}
\newtheorem{conjecture}[thm]{Conjecture}
\theoremstyle{plain}
\newtheorem{fact}[thm]{Fact}
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\theoremstyle{definition}
\newtheorem{example}[thm]{Example}
\theoremstyle{definition}
\newtheorem{problem}[thm]{Problem}
\theoremstyle{definition}
\newtheorem{xca}[thm]{Exercise}
\theoremstyle{remark}
\newtheorem{rema}[thm]{Remark}
\theoremstyle{remark}
\newtheorem{claim}[thm]{Claim}
When you need to put a theorem in use

Code: Select all

ERT[\begin{thm}]
Your theorem here...
ERT[\end{thm}]
For other environments replace {thm} with the code in curly braces in the preamble, {rema} for a remark, {defn} for a definition.

Hope that helps. I think in actual fact both of our problems might be being caused by an outdated IEEEtran.cls... Something for me to look into when I have more time perhaps.
Post Reply