7

I use fleqn as a document class, but now I solve problem, how to align few equations to the center and few to the right.

I've tried \setlength{\mathindent}{1cm} but after that is the problem that I can't use previously used fleqn aligning.

Could you help me with any solution?

Thank you very much in advance!

lockstep
  • 250,273
astrak
  • 297

2 Answers2

10

I don't think this is a good option since it makes your document inconsistent; that being said, you coud give a try to the nccmath package; declaring the fleqn package option you will have flushed left equations, and using the ceqn environment you can center some chosen equation(s):

\documentclass{article}
\usepackage[fleqn]{nccmath}

\begin{document}

\begin{align}
a &= b \\
&= c \\
&= d.
\end{align}

\begin{ceqn}
\begin{align}
a &= b \\
&= c \\
&= d.
\end{align}
\end{ceqn}

\end{document}
David Carlisle
  • 757,742
Gonzalo Medina
  • 505,128
1

If you only require to locally disable the effect of the fleqn option (when using amsmath), you can just manually set the respective boolean to false:

{
    % Use grouping to keep effect local
    \makeatletter
    \setbool{@fleqn}{false}
    \makeatother
\begin{equation}
    A = B
\end{equation}

}

Source

Raven
  • 3,023