On 01-Jan-12 6:07 pm, Uwe Stöhr wrote:
Am 01.01.2012 16:15, schrieb Richard Heck:

On 12/31/2011 05:51 PM, Bogdan wrote:
Is there *any* way to make LyX add latex code before the
\documentclass{} call?

I do not think so.

And I have never seen this and I doubt that this will work because
without loading the document class or any package, you cannot do much.

For the IEEEtran class for instance, the page margins can be set only
by setting some IEEEtran
latex variables before the \documentclass{} call ... the use of
geometry package or the likes is
highly discouraged for IEEEtran.

Can you please point me to the IEEEtran documentation where this is
described? No example nor the documentation of IEEEtran on CTAN
http://ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
describe or use this.

Sure, the official FAQ: http://www.michaelshell.org/tex/ieeetran/

Search for the string "incorrect margins". The PDF doc of the IEEEtran does not list many tricks.

But what exactly do you want? Can you send me a _small_ LyX file with a
short explanation?

I'm occasionally using IEEEtran in A4 paper format for other purposes than submitting academic papers to IEEE journals/conferences. IEEEtran fixes the content size regardless of the paper size, hence the top and bottom paper margins become quite large when using the a4paper class option. I want to use shorter top and bottom margins but the usage of the geometry package is highly discouraged in conjunction with IEEEtran.

Others ran into the same issue:

http://andrejserafim.wordpress.com/2009/04/28/ieeetran-page-margins/

Being able to input code before the \documentclass call is actually not uncommon. In fact, it is mentioned in many latex tutorials/docs indirectly. I'm sure you all know that you can compile a latex file either like:

pdflatex myfile.tex

or

pdflatex "\def\myvar{true}\input{myfile.tex}"

e.g. http://en.wikibooks.org/wiki/LaTeX/Customizing_LaTeX#Command-line_LaTeX

The 2nd command above is equivalent to declaring "\def\myvar{true}" before \documentclass. This way, \myvar may be used internally by the class, allowing fixing such things like the margin issue in IEEEtran.

I hope the above explanations are sufficient but I can still submit a LyX file if you want me. I wouldn't be able to show much in it though since this is what I would like LyX to do: allow me to input code before \documentclass :)

Bogdan.

p.s. I'm also using the 2nd example to compile two versions of the same latex document, one with just maths questions (for students), and the other with questions+answers (for supervisors). Saves time, different issue though.

Reply via email to