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!

1

2 Answers 2

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}
7
  • It looks nice. But I have problem with my TeXworks. During the loading process TeXworks write me error message "! LaTeX Error: File `nccmath.sty' not found." So I saved "nccmath.sty" to my style folder but there is still the same problem.
    – astrak
    Commented Dec 18, 2012 at 20:32
  • Maybe will be better to write down my document setting.\documentclass[fleqn,a4paper,11pt]{article} (\manypackages) \usepackage{nccmath} \begin{document}
    – astrak
    Commented Dec 18, 2012 at 20:40
  • @astrak I don't know which LaTeX distribution you are using, but here you find advise on installing packages for TeX Live tex.stackexchange.com/q/73016/3954 and for MikTeX tex.stackexchange.com/q/2063/3954 Commented Dec 18, 2012 at 20:50
  • I found help in user guide of the nccmath package. Thank you very much for help!
    – astrak
    Commented Dec 18, 2012 at 20:58
  • 1
    @PeterGrill The nccmath works for me without any erros, and I usually insert too many formulas. Commented Jul 9, 2020 at 6:02
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

You must log in to answer this question.

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