[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [eLyXer-users] brackets with \left.

From: Jens Nöckel
Subject: Re: [eLyXer-users] brackets with \left.
Date: Sun, 13 Dec 2009 22:54:29 -0800

Hi Alex,
OK - I've checked out the current version and will look at it some more.
In the meantime, here is what the \left. is supposed to be for:

It allows all brackets to be written in pairs of opening and closing type, thus defining an enclosed content. When matching pairs of brackets are used on a single line, there is no problem defining the enclosed content, but there are situations where you want to define an enclosed content while only having a bracket at one end of it. Then you use an invisible bracket, represented by \right. or \left. An important case where this is needed is when the enclosed content spans several lines of (say) an eqnarray. The opening bracket - e.g. \left{ - is on one line, and the closing \right} on another. LaTeX won't be happy unless there is a \right. at the end of the first line and a \left. at the beginning of the last. The reason for using \left{ in the first place (instead of a plain brace "{" ) is to get a bracket whose vertical height is automatically scaled to match the content (possibly modified by an additional phantom height). See section 18.1.4 (Multiline Brackets) in the LyX Help doc Math.lyx.

The current version of elyxer doesn't seem to have any vertical size adjustment of brackets to match, say, enclosed fractions in vertical height. So the \left. and \right. constructs really serve no purpose here, and one could simply throw them away for now.


On Dec 13, 2009, at 2:46 PM, Alex Fernandez wrote:

Hi Jens,

On Sun, Dec 13, 2009 at 9:13 PM, Jens Nöckel <address@hidden> wrote:
The reason I'm writing is that elyxer gives wrong HTML output for brackets
such as
\left. something \right)
where I use the \left. to balance the right bracket with an invisible
delimiter. In the HTML output the left delimiter appears as a dot because the \left tab is recognized as a "onefunction" and immediately translated by
inserting the symbol that follows.

That is just a result of my ignorance of how \left and \right work;
without knowing any better I just did the minimal work that produced
acceptable results for the LyX Math manual.

What are they supposed to do? Why is the dot invisible in \left.? Why
the need to balance a \right with a \left?

I've looked a little at the code and see a Bracket class, but if I
understand correctly it seems to be used only by the pair [ and ], and it also doesn't leave a trace in the HTML output (i.e., there is no surrounding <span> in the formula corresponding to the extent of the bracketed content). But I'm still trying to learn the logic of the code, so correct me if I'm wrong... Ultimately I think the \left and \right tokens should count as bracket delimiters, and some way of handling the invisible bracket for
\left. or \right. is needed.

Actually, the Bracket class is just for {} brackets; there is a
SquareBracket to read [] brackets. Right now none of them have
anything to do with reading \left and \right commands. A different
solution should perhaps be found.

Right now I can fix this by post-processing the HTML do remove the
<span class="symbol">.</span>
But I'm thinking that the Bracket class is probably the place where this
could be fixed.

Maybe not the Bracket class, but a command is surely the way to go.
Just be sure to download the source code (not the coalesced
everything-in-one-big-file elyxer.py) if you want to actually follow
the code, it is nicely organized in packages:
and then run eLyXer directly from the source code: instead of
 $ elyxer.py input.lyx output.html
run it as
 $ src/principal.py input.lyx output.html
I have added an explanation to the developer guide.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]