On 2011-10-12, e-letter wrote:
> On 12/10/2011, e-letter <inp...@gmail.com> wrote:
>> On 12/10/2011, Liviu Andronic <landronim...@gmail.com> wrote:
>>> On Wed, Oct 12, 2011 at 10:36 PM, e-letter <inp...@gmail.com> wrote:
>>>> Readers,

>>>> Is it possible to select an acronym e.g. ABC and replace all copies in
>>>> a document with the latex code \textsc{abc}?

>>> It should be possible. Look into advanced search & replace. Otherwise,
>>> use regexp and a text editor.

>> Tried to use advanced find and replace; the result was \textsc{abc} in
>> the pdf document!

>> Then tried to open the lyx file using a text editor and replaced using
>> the editor. The result was that the entire acronym disappeared!

> I have now noticed that not only the acronym disappears but a random
> small quantity of words after the acronym (seems about 3-5 words) also
> disappear! Very bad!

The *.lyx file is not a *.tex file but in LyX's internal, non-documented
format. Editing with a text editor is a powerful means but requires caution.

For a regexp replace like the above:

* Change one occurence "manually" in the LyX GUI and remember its position.

* make a backup

* Open the file in a text editor,

* search the LyX code for the new construct (!! May be several lines
  instead of a single word if there is a format change or ERT box!! -- if
  unsure, make a diff to the *.lyx~ file (assuming one save before and
  one after the intended change).)
  
* search the LyX code for the old construct

* do the regexp replace now you know (or copied) the "from" and "to" strings

* save

* in LyX, do "Revert to saved"

* Check whether it is working before doing more work on the document.
  

Günter

Reply via email to