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?


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


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


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.