Le 29/08/2011 15:40, Uwe Stöhr a écrit :
In which sense is the LaTeX list environment designed to show
typewriter code?

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? To my knowledge, all the list does here is to help us setting margins and other spacing as we want it to be.

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 (~).

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... 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?

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 " "

And additionally replace lyxcode with something standard.

JMarc

Reply via email to