Significant .lyx EOL White Space Inquiry
José Abílio Matos
jamatos at lyx.org
Mon Dec 14 18:54:09 UTC 2020
On Monday, December 14, 2020 5:46:52 PM WET Richard Kimberly Heck wrote:
> I think that the real reason that we use this scheme is due to how we
> represent insets in the file format, we always change line.
>
> That is what IMO forbids the equivalence between spaces and newlines in the
> lyx file format.
>
>
> If we find a solution for the previous questions this can be implemented in
> lyx2lyx.
>
> The obvious thing to do would be always to break lines at spaces. But then
> how do we handle the case of languages that don't use spaces to separate
> words?
One simple example to illustrate what I mean, even assuming that the space is
our word separator. What should be the file format of the latex paragraph?
The most famous equation of all times is $E=mc^2.$
How do we represent the space between "is" and the math inset?
Now we do (pardon me the markdown syntax :-) ):
``` lyx
\begin_layout Standard
The most famous equation of all times is
\begin_inset Formula $E=mc^{2}.$
\end_inset
\end_layout
```
What would be the alternative? To have a space before the \begin_layout? That
does not seem right and it would complicate our parsing a lot.
The option I am thinking, although a bit ugly, would be:
``` lyx
\begin_layout Standard
The most famous equation of all times is
\space
\begin_inset Formula $E=mc^{2}.$
\end_inset
\end_layout
```
That would mean that we have a special syntax for a line with a single space.
--
José Abílio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20201214/36f9d743/attachment.html>
More information about the lyx-devel
mailing list