Darren Freeman wrote:
On Wed, 2007-07-25 at 13:46 +0200, Helge Hafting wrote:
Sure. Which is why you shouldn't use a standard environment.
Put the ERT directly into the environment where you need it.
I don't want it in one of the other environments, it is in place of one.
[...]
I don't want my TeX inside an \author{} or \title{} or similar. It is in
lieu of the \author{} because I want it to look like:
\author[a1]{Name1}, \author[a2]{Name2}, ...
\address[a1]{Add1}
\address[a2]{Add2}
Now the problem is if I put an ERT in a Standard environment, LyX will
finish off the frontmatter section, my ERT is after that, and then the
following frontmatter which is supported by the LyX class will
erroneously be outside frontmatter too. And none of that will appear.
Now I understand. I have tested a different solution. It is
a hack, but it seems to work well:
Create a single paragraph of type "author". It should contain
nothing but an ERT box.
Inside this ERT box, type something like this:
}\author[a1]{name1}\author[a2]{name2}{
Yes, the braces are crazy here. But remember that LyX will
wrap all this inside "\author{...}", and so the resulting
tex code exported by LyX will be:
\author{}\author[a1]{name1}\author[a2]{name2}{}
The final "{}" won't be a problem. I don't know if the LyX-generated
empty "\author{}" in front will be - it didn't cause trouble in my
simple test.
If there is trouble, consider abusing one of the other
frontpage paragraph types instead. Ideally, you'll
use a frontpage paragraph type that don't need the initial "[a1]" stuff.
Then you fill it with whatever is supposed to go there,
followed by the ERT "}\author[a1]{name1}\address[a1]{address1}{".
Helge Hafting