Am 12.09.2011 11:46, schrieb Jean-Marc Lasgouttes:

It allows free spacing, so that you can insert multiple spaces and LaTeX
will respect them. It moreover allows to format your text in the way you
like - like in our case typewriter.

I cannot parse what you mean. You are certainly not indicating that any LaTeX 
list, like itemize or
enumerate environment, are designed with free spacing in mind, are you?

You misunderstood me. The LaTeX list allows to use multiple spaces. The other lists are indeed derived from the basic LaTeX list but forbid this.

I had a lengthy discussion about this topic with the LaTeX gurus and our
lyxcode definition is correct. The only bug is that we are using in any
case protected spaces instead of normal ones.

So to use latex 2.09 terminology as I understand it (I have only Lamport first 
edition at hand :),
the advice is to use interword space (\ ) instead of unbreakable space (~).

Yes and that is also what they told me and this indeed fixes the problem. So the solution is really that simple!

I am not against this, but this will be a change for existing documents. Some 
people are actually
happy that the lines do not break and go through the right margin...

But this doesn't make sense: You can't print it and also not publish this. So I doubt that people do this purposely.

So I do not think we can do the
change just like that. What I would propose is to keep LyX-Code as an obsolete 
solution and support
instead some more standard stuff like verbatim and alltt.

\def\obeyspaces{\catcode`\ \active}
{\obeyspaces\global\let =\space}

In a nutshell, it makes normal spaces act like protected spaces. Does
that ring a bell?

That is the opposite to what we want. We need normal spaces that don't
act as protected spaces.

You know that you can just read the code instead of just complaining. THe 
effect \obeyspace is that
the LaTeX code

\begin{lyxcode}
aa bb bb
\end{lyxcode}
would act just as your proposed
\begin{lyxcode}
aa\ \ bb\ \ bb
\end{lyxcode}
whereas current LyX code outputs
\begin{lyxcode}
aa~~bb~~bb
\end{lyxcode}

Are you telling me that you cannot see that it just makes more sense?

Heiko Oberdiek told me that this would have drawbacks as this change take place globally. (I didn't understand the TeX-internal details.) Moreover it doesn't work for multiple spaces, see the attached file.
It also doesn't solve the bug, because it is:

- when the user presses SPACE we insert a ~

As long as we don't change this, we can redefine whatever we want.

So why should we take risks and add some more definitions when there is a clean solution that was recommended by LaTeX experts?

Actually I would propose freespacing to take several values:

0: no free spacing
1: output space as "~"
2: output space as "\ "
3: output space as " "

I propose to use our default spacing mechanism:

- if the user enters a SPACE, he gets a '\ '
- the the user inserts a protected space (Ctrl+SPACE) he gets a '~'

As you can see, all we have to do is to transform in free spacing mode in inserted space to '\ '. All other space types can also in free spacing mode used as usual, even \negmedspace, \qquad etc.

And additionally replace lyxcode with something standard.

But lyxcode code _is_ standard. It correctly uses TeX's list environment in exactly or the purpose why it is defined in TeX. The LaTeX gurus had a look at our code and said it is correct. We cannot use something else and this would also don't make sense. Naturally spoken, we need a bus, not a car and not a lorry and we already have this bus. We only need to change to change the arrangement of its seats.

regards Uwe

Attachment: obeyspace-test.lyx
Description: application/lyx

Reply via email to