I tend to use LyX for composing scientific papers, but a journal wants me to have changed text marked in specific ways that don't happen to be the way that LyX translates tracked changes into PS/PDF.

Is there a way to modify not just the color but also the underlining of changed text when it's converted to PS or PDF? I suppose I'd have to do something with the \lyxadded and/or \lyxdeleted commands?

LyX seems to always generate commands that look like \lyxadded{My Name,,,}{2011 blah blah date}{my text}, so if there's a good way to intercept this and add my own formatting to the {my text} part, that would probably work if there's no more elegant way.


As long as you don't want to get fancy with detecting whether changed text should be viewed on the output or not, it's actually quite simple. LyX writes the \lyxadded command into its own preamble in the generated .tex file:


and this preamble occurs before the one it gives to you under Document / Settings ... / LaTeX Preamble. So all you have to do is redefine the command:


Since LyX already uses the ulem package for striking out changes, \uline is available without any additional usepackageing.

If you go this route, you're probably best off leaving the "show changes" on every time you export, and just renew the \lyxadded and \lyxdeleted commands as appropriate when you don't want to see them.

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.