On 2012-01-01, Bogdan wrote:
> 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. There are several use cases. I remember a similar request some time (maybe years) ago. A "hook" for pre-documentclass code could also solve some of the "how do I configure auto-loaded packages" problems. I could imagine a layout keyword like PrePreamble % this should appear before the \documentclass call in the latex source EndPrePreamble This could then be used by layouts like "IEEEtranA4" as well as in idividual documents via the local layout feature. >> But what exactly do you want? Can you send me a _small_ LyX file with a >> short explanation? > Being able to input code before the \documentclass call is actually not > uncommon. ... > 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 :) In this case, a _small_ LaTeX file might be a better example. Maybe you can provide some small LaTeX use cases to convince the developers that this is a case common enought to support it without ugly workarounds? > 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. In LyX, conditional text is usually done with branches (define with Document>Settings>Branches, use with Insert>Branch). Günter
