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.

1 Answers1

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

David Carlisle
  • 757,742
egreg
  • 1,121,712