On 07/24/2010 10:44 AM, Filip Dominec wrote:
Hi, first of all let me thank you for the LyX project. I like how it enables
even people with minimal TeX experience to typeset clean and nice documents.

I have a feature request: please, can you add the automatic replacement function
to the editor? Ideally, each replacement rule should be enabled depending on the
environment and language, but a simple, unconditional replacement would now
suffice, too.

Motivation: In many slavic languages, there are some prepositions that shall be
connected to the following word with an unbreakable space. The localized OO
Writer or MS Word replace the space automatically, whereas when writing the
TeX source, this substitution may be performed by a macro or a third-party
filter before compilation (such as the "vlna" program). I am missing such
replacement in LyX: when a former Word-user begins with LyX, it is hard to learn
pressing ctrl-space when appropriate.

The request for automatic replacement is not unreasonable, though I rather expect that it is a big job and that it will be a long time before it gets done, if ever. But please feel free to file an enhancement request on trac:
    http://www.lyx.org/trac/wiki/BugTrackerHome
That said, automatic replacement looks like overkill for this issue, if not, in fact, the wrong solution. The space does not need to be replaced in the source for precisely the reasons you give, and replacing it there will mean that you have to change it back in certain cases, right? The correct solution therefore seems to be the one you mention: Use some filter to do the replacement for you. Now here's the good news: You can easily arrange to have LyX call a filter like vlna between LaTeX export and compilation. There are several different ways this could be done. Which would be best for your situation isn't obvious to me at this point, in part because that may depend upon which platform your users are on. So, short term, that's what I'd do.

One way: Create a new vlna format and then define a LaTeX-->vlna converter that will run vlna on the LaTeX output. Then create a new format, pdf4, as a PDF output format (say), and set pdflatex as a vlna-->pdf4 converter.

In fact, LyX does all kinds of special things for certain languages. If certain Slavic languages would like vlna or some other filter to be called, then LyX could do that automatically, even detecting whether it is installed, etc. This is not my area of expertise, though, but maybe Uwe would be interested to do it. He does a lot of language stuff. I guess we would want a preference setting to turn this on and off....

Richard

Reply via email to