[texhax] Left aligning the maths environment

Uwe Lück uwe.lueck at web.de
Thu Jul 27 00:39:16 CEST 2006


Hi Jim,

just advertising for a package I happen to maintain
(rather loosing than earning money with that):

At 22:50 26.07.06, James Smith wrote:

>I'm writing some code listings and have used the verbatim environment
>for the pseudo-code listings which works fine. I now have to re-write
>the listings ``mathematically'' with more abstract syntax and
>mathematical equations (assertions, actually) to the right of each line
>of code.
>
>I'm using the \array environment and it looks great but I have two
>issues:
>
>1) The first column contains line numbers and I'd like to make it a
>fixed width. I'm not bothered about the width of the remaining columns
>since the code and assertions that they contain is so variable. I just
>need to fix the first column
>
>2) I'd like to move the whole lot hard over to the left, at the moment
>it floats in the middle. Is this possible without losing the use of the
>\array environment, which is ideal.

what about giving up array and use lineno.sty (alternatively:
numline.sty) instead (CTAN: macros/latex/contrib/lineno)?
Together with the Standard flushleft environment?
In this way, you could get automatic line numbers
in the left-hand margin and do in the rest whatever you want.

However, as often, in writing I am thinking more deeply:
What is the problem with the array environment?
What about \begin{flushleft}\begin{array}{rl} ?

longtable or supertab my be preferable to array since
a listing doesn't fit on a single page.

[I waited a while with posting; it still may be appropriate.]

HTH -- Uwe.



More information about the texhax mailing list