On 12/10/11 17:07, Richard Heck wrote:
On 10/12/2011 09:33 AM, Torquil Macdonald Sørensen wrote:
On 12/10/11 15:19, Richard Heck wrote:
On 10/12/2011 08:39 AM, Torquil Macdonald Sørensen wrote:
Hi!
Is it possible to have two branches of the same lyx document, with different
document classes?
I don't think so. Document class is a global setting.
This would be useful in the following scenario (which I'm in right now): I
have a paper that is to be submitted both to the arxiv.org preprint server and
to 'journal x'. Thus I want one version with the 'article' document class, and
one with a particular document class requested by journal x.
Can't you just switch between these classes as need be?
I will have to change the document class as well as change between branches,
since there are some other differences, pertaining toe
title/author/address/etc code that need to be different as well between the
two versions. I though I could hit two birds with one stone if the
documentclass could also be affected by the branching :-)
Ahh, I see. I'll think about this for the future. I've had other ideas about
automated branch selection.
But I guess it is not possible. I can put a lyx-comment within each of the
branched content sections, reminding me which documentclass to select for each
of them. Not as elegant, though.
This could be done with some LaTeX code, too. I assume there is some variable
that you could test for, doing something like:
\ifx\definedonlyinspecialclass\undefined
% content of branch
\fi
I.e., wrap the branch in ERT with such code.
Interesting. If I understand you correctly, this suggestion involves not using
any lyx branches, but instead using tex-programming to compile differently
depending on the chosen document class. In that case the latex output would
always be the same (apart from documentclass). But I think that when I submit an
article (i..e latex code) I don't want that code in include any code that was
really meant for other recipients.
That's why the lyx-branching is so cool. I hadn't used it before now, but I will
from now on.
Best regards
Torquil Sørensen