Thanks, that sounds like one option. Currently I'm experimenting with the "include child document", setting type to "include" and inserting a plain text file as the document. I can then write some text to the file just before generation. This seems to work.
Ramon Casha On 6 November 2014 14:17, Rainer M Krug <rai...@krugs.de> wrote: > Ramon Casha <rca...@gmail.com> writes: > > > I have a LyX document from which I want to generate a number of output > > documents from the command line. The output documents vary in small > > details, like a product name or a recipient name. > > > > Is it possible to define a macro or change its value from the command > line? > > I could then use the macro from within the document to insert its > > definition. I'm already using branch enabling/disabling to show or hide > > sections of text, but in some cases I need to insert some text that can > > have an arbitrary value at runtime. > > .lyx files are text files (unless they are compressed, which they > normaly aren't). SO you could put inn your LyX document > ###THIS_NEEDS_TO_BE_REPLACED### and then use any scripting language to > replace ###THIS_NEEDS_TO_BE_REPLACED### with "This is my text" and then > compile the lyx document. If you want to be on the safe side, you could > copy the .lyx file, do the replacements, compile the final document and > finally delete the copy of the original lyx file. > > Cheers, > > Rainer > > > > > Ramon Casha > > -- > Rainer M. Krug > email: Rainer<at>krugs<dot>de > PGP: 0x0F52F982 >