Marcelo Acuña wrote:

No, I have about 1000 of this ---comment---, and I
need a global setting.
I think it is not possible to redefine --- without
changing the font metrics.
Instead, you will have to define your own emdash
character that does not allow a linebreak. Something like


\newcommand\myem{\textormath{\leavevmode\hbox{---}}{---}}
Then you could do

\newcommand\mycomment[1]{\myem#1\myem}

and wrap all you comments in \mycomment{this is a
comment}

If you do not need, say, underline, in your
document, you could furthermore redefine underline as
\renewcommand\underbar{\mycomment}

and just underline all you comments in LyX.

Or do it with colors as described here:

http://www.troubleshooters.com/linux/lyx/index.htm#BuiltinCharacterStyles
However, if this is really such a common task in
Spanish documents, posting a question to the Spanish TeX newsgroup (es.comp.lenguajes.tex) might help further.

HTH,
Jürgen

Thanks Jürgen, I posted the problem to
es.comp.lenguajes.tex and I get a solution
but this work in Kile and not work in Lyx.
Is not global but simple.
A person in that list say that
after put \usepackage[spanish]{babel}
in preamble I must put a tilde (~) prev to em dash ~---like this---
In lyx this not work. Tilde is print without
any change but, before I re-quest to this
person I check it with Kile and this work very
well, tilde is not print and hyphenation is
made correctly.
How I can get it in Lyx?
You can get this in lyx by writing your em-dashes
as ERT.  I.e. write the ~--- in ERT, and leave
the rest of the text normal.
I seem to remember you had lots of these?
You can fix them all this way:
Lyx can't do this with search and replace, but
a text editor capable of replacing several lines can
do it by working on the .lyx file. 0. Backup the .lyx file, in case the process goes wrong.
1. Look at the lyx file, check what an ERT containing
   ~--- looks like.  My example is for lyx 1.4
2. Use a powerful text editor on the .lyx file, tell
    it to replace every occurence of --- with:
\begin_inset ERT
status collapsed

\begin_layout Standard
~---
\end_layout

\end_inset


I.e. aaa---bbb
should become

aaa
\begin_inset ERT
status collapsed

\begin_layout Standard
~---
\end_layout

\end_inset

bbb

Then all your em-dashes are hyphenation-free.
Open the latered file with lyx and verify that it is
ok, then view->dvi

To save work when writing:
Create one ~--- ERT, mark it and copy.
Whenever you need this construct, use paste.

Finally, setting up "babel" right should be as simple
as setting the document language to spanish.

Helge Hafting


Reply via email to