3

I write a document with LyX, to which I add PSTricks pictures in ERT sections.

I defined a \newcommand in a certain ERT section, and it was available during this ERT section, but not available in the next ERT section.

I don't want to define this command in the preamble, because it is specific to a chapter.

How can I define a \newcommand that will be available in all ERT sections of a given chapter?

5

After the chapter title hit Ctrl-L for ERT and then insert

\begingroup
\newcommand...

and then leave the ERT mode. Before the next chapter (the end of the current one) insert also with ERT

\endgroup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.