2

I'm building a table of integrals, for my own use. I need simple things: equations must be left aligned, sometimes I need alignment on the equal symbol and to save space sometimes I need 2 equations on the same line.

\begin{fleqn}[0pt]
\setlength{\jot}{6pt}
\begin{align*}
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\
    &\int f(x) dx = F(x) + C &&\int f(x) dx = F(x) + C \\
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F_1(x) + C =  \\
    &\qquad\qquad = F_1(x) + C \\
\end{align*}
\end{fleqn}

First I'm not satisfied, I can't set the point of alignment with 2 equations in one line and I can't align the equations on the equal sign. Most environment (tabular, tabbed, split,...) do only one job and when I try to mix them I always get some errors.

Second I would like to create a new environment with

\newenvironment{mathtable}
{ \begin{fleqn}[0pt] \setlength{\jot}{6pt} \begin{align*} }
{ \end{align*} \end{fleqn} }

But it show me an error, it seems I can't use align inside newenvironment. Did a lot of research, used the environ package, used \csname and so on, but I don't know how to build this environment.

6
  • 1
    The amsmath documentation documents that in an environment definition you need to use the \align \endalign forms not \begin{align} \end{align} Commented Sep 19, 2012 at 16:43
  • But then I have a generic error on \begin{fleqn}...
    – ColOfAbRiX
    Commented Sep 20, 2012 at 10:39
  • it's possible that the aligned environment of amsmath might be helpful, since it's meant to be embedded within another environment. Commented Sep 24, 2012 at 14:26
  • There is no fleqn environment.
    – egreg
    Commented Oct 13, 2012 at 15:39
  • 2
    @egreg: There is a fleqn environment with \usepackage{nccmath}.
    – Mafra
    Commented Dec 6, 2012 at 0:00

1 Answer 1

5

You give too little information for giving advice about the first point.

For what concerns the second point, here's how you can define your mathtable environment:

\documentclass{article}
\usepackage{nccmath}
\newenvironment{mathtable}
  {\fleqn[0pt] \setlength{\jot}{6pt} \csname align*\endcsname}
  {\csname endalign*\endcsname\endfleqn}

\begin{document}

\begin{mathtable}
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\
    &\int f(x) dx = F(x) + C &&\int f(x) dx = F(x) + C \\
    &\int f(x) \ldots \mbox{long expression here} \ldots dx = F_1(x) + C =  \\
    &\qquad\qquad = F_1(x) + C
\end{mathtable}

\end{document}

One can't use \begin{foo} and \end{foo} in the definition of a new environment, when foo is the name of an amsmath alignment environment. So one has to use the forms \foo and \endfoo in their places (or \csname foo*\endcsname and \csname endfoo*\endcsname for the *-variants).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .