We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

99

You can use multline or split provided by amsmath package. Use multline to split equations without alignment (first line left, last line right) Use split to split equations with alignment Here are examples: The corresponding source code is as follows: (i).Use equation: \begin{equation} 1+2+3+4+8x+7=1+2+3+4+4x+35 \\ \Rightarrow x=7 \end{equation} (ii)....


29

You can use a vertical alignment to get the measuring done and then re-flow them in a horizontal layout: \documentclass{article} \usepackage[leqno]{amsmath} \renewcommand\theequation{\alph{equation}} \newenvironment{brqalign}{% % START CODE %%%%%%%%%%%% % Do everything an a box, as you can not remove % things from the main vertical list. \setbox0\vbox\...


29

As noted in comments the amsmath and breqn documentation have several good examples, also the mathtools package has extended versions of several of the amsmath alignments. But the usual style here is to answer inline rather than refer to manuals, so this is a document giving the basic usage of the environments you mention. \documentclass{article} \...


22

Let's see how commath should define its macros. \documentclass{article} \usepackage[margin=1cm]{geometry} \usepackage{amsmath} %%% Here start the definitions \newcommand{\dif}{\mathop{}\!\mathrm{d}} \newcommand{\Dif}{\mathop{}\!\mathrm{D}} \makeatletter \newcommand{\spx}[1]{% \if\relax\detokenize{#1}\relax \expandafter\@gobble \else \...


18

The error is due to breqn, of course. Only one definition for an active character can be valid at a given time. Since you have a math comma in the section title, this goes in the header and, with that long verbatim, it gets typeset when verbatim is active, which gives a different meaning to the active comma. Here's a minimal example showing the issue. \...


16

To understand what is happening here, I cleaned the code a bit and used colored rules than fboxes. I have also used a loop to typeset the various boxes. This way it was easier to modify the widths and see what is happening at the transition points. Firstly, we view a typeset box that has an adequate width to handle the equations. We see that it correctly ...


14

The main problem is the breqn math comma being written to the mark used in headings while verbatim is active. which gives a classic fragile command in moving argument cryptic error. \hbox hides this (a better fix allowing the comma to be used normally may be posted later) The fact that luatex segfaults after the runaway argument is a separate lower level ...


12

An alternative answer, which allows you to use \label as normal: The problem is caused by the fact that cleveref relies on redefining \refstepcounter, while breqn doesn't actually use this to advance the equation counter. Fortunately the cleveref code for dealing with footnotes, which don't use \refstepcounter either, provides a basis for dealing with ...


12

“Missing termination in the redefinition of \mathchoice made by mathstyle.sty (loaded by breqn): \documentclass[11pt]{report} \usepackage{amsmath,mathtools} \usepackage{breqn} \makeatletter \def\mathchoice{% \relax\ifcase\numexpr\mathstyle\relax % <----- trailing \relax added \expandafter\@firstoffour % Display \or \expandafter\@firstoffour %...


11

You can tell auctex about additional math environments using LaTeX-add-environments. For example, I sometimes use math environments named thm, prop, lem, cor, defn, not, rem, ex, notation, and equation*, and I tell auctex about them with the following lines in my .xemacs/init.el file: (add-hook 'LaTeX-mode-hook 'add-my-latex-environments) (defun add-my-...


11

The breqn package changes the definition of \sum (and of almost all other commands for math mode). The definition it uses is (using the output of \show) > \sum=\protected\long macro: ->\@sym \sum \math_sym_COs:Nn \mg@cop {50}. The macro \@sym is the same as \@gobble, at least between \[ and \], so the first two tokens disappear. Now TeX finds \...


10

The breqn package plays around with category codes of the subscript and superscript characters, but it only sets them at the \begin{document}. What we need is to set them earlier, before \usepackage{tensor}. For instance, the following appears to work. \documentclass{article} \usepackage{breqn} \catcode`_=12 \catcode`^=12 \usepackage{tensor} \begin{document}...


10

Yes, for a reason I don't understand yet the combination of float and breqn package is incompatible to the (sub)caption package: \listfiles \documentclass[a4paper]{article} \usepackage{breqn} \usepackage{float} \usepackage{caption} \begin{document} A \end{document} will issue the warning Package caption Warning: \caption will not be redefined since it's ...


10

This is a known issue which has been fixed in the CTAN release and thus will propagate to MiKTeX and TeX Live as they update. Essentially, in making some other admin changes a mistake was made in the list of files to send to CTAN: this can happen and tends to be picked up quickly. If you absolutely cannot wait until the update is available in your TeX system ...


9

The way breqn works is rather complex, and so I'm not surprised that it fails in the case you give. I'd suggest sticking rigidly to the formally-allowed syntax for superscripts: \documentclass{article} \usepackage{breqn} \newcommand{\hc}{^{\dagger}} \begin{document} \begin{dmath} A\hc \end{dmath} \end{document} As Bruno observes, this is to do with ...


9

If you need to break up the conditions of the minimization problem across two or more lines, the following will work: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \min_{\substack{A,B\\ 0\le A\le T \\ D+X+W-S\ge 0}} \Bigl(I+X+W-E-\bigl(X+k(A-B)\bigr)\Bigr) \end{equation*} \end{document} If you want the ...


9

breqn won't break after commas and ordinary atoms, so your formula has no feasible break point. You have to help breqn telling it that, in this case, breaking at commas is allowed. \documentclass{article} \textwidth=.7\textwidth % just to show the result \newcommand{\breakingcomma}{% \begingroup\lccode`~=`, \lowercase{\endgroup\expandafter\def\...


9

It's breqn. Making your example a bit more minimal \documentclass [a4paper,12pt,DIV=10,BCOR=0.5cm]{scrreprt} \usepackage{cite} \usepackage[pdftex]{graphicx} \usepackage{breqn} \linespread{1} \includeonly{part\string_1} \begin{document} \pagenumbering{Roman} \pagestyle{headings} \include{part\string_1} \include{part\string_2} \end{document} If ...


8

The breqn package has undergone a thorough revision from the version in TeX Live 2009 to the one in TeX Live 2010 (which is identical to the version in TeX Live 2011). The error is triggered by the fact that flexisym.sty changes the category code of ^ too early, so that a syntax such as \catcode`\^^@ which is needed by listings is not legal any more: for it ...


8

In my opinion the most important point is that the structure of the equations should be transparent to the reader. Automatic breaking of the equations usually fails dismally on this, despite noble efforts; making all lines the same length is far far worse. I'll concentrate on your first example. As a mathematician, I would seriously consider changing ...


8

I believe that breqn makes more problems that it solves. By default, every relation symbol in dmath marks a line break point for alignment. Those you don't want should be hidden. Choose one of the methods below. \documentclass{article} \usepackage{amsmath} \usepackage{breqn} \begin{document} \begin{dmath} x \in A - B \leftrightarrow x \in A \text{ and }...


7

You can force a line break with \\ I think breqn by default gives the same breaking penalty to all binary relations, with no user-level customisation of that. On the other hand I think that it is safe to do this \let\oldcdot\cdot \usepackage{breqn} \let\cdot\oldcdot which restores \cdot to its normal non-breqn definition so breaking won't occur at the ...


7

\{ has additional code so that it works in text mode as well as math and that upsets breqn in the form used here. These infix primitives are rightly deprecated with amsmath, but if you must you may:-) \documentclass{article} \let\oldlbrace\lbrace \let\oldrbrace\rbrace \def\brace{\atopwithdelims\oldlbrace\oldrbrace} \usepackage{breqn} \begin{document} \...


7

I believe that breqn is not perfect and if you want to achieve absolute beautiful mathematics, then you (a human being) should decide where an equation should and where it should not break. I think, you would get a nice message from them on the lines of "could you please re-format each and every formula in your paper before publication?" The only one I am ...


7

\documentclass{article} \usepackage{amsmath} \let\xxmathchoice\mathchoice \usepackage{breqn} \let\yymathchoice\mathchoice \usepackage[version=3]{mhchem} \begin{document} \let\mathchoice\xxmathchoice \ce{H2SO4} ... \let\mathchoice\yymathchoice \begin{dmath}... \end{document}


7

Perhaps for some small package this could be possible, but the general answer is no. In particular, breqn and its companion package flexisym do very extensive changes to the normal setup of math formulas which are, in some cases, global; therefore, even if it were possible to load them in a group, the changes would be performed also at the outer level. The ...


7

To put stuff above an \overbrace simply use the construction \overbrace{-bottom-}^{-top-}, which works fine with breqn. Your construction \overset{-top-}{\overbrace{-bottom-}} is an abuse of \overset, which as far as I can tell is meant for stacking single symbols or relations. Here you pile a whole formula atop another. One way around the error which ...


7

The trick of \mleft of package mleftright is that it starts with an empty \mathopen{} and puts the whole expression inside a \mathclose{...} including the original delimiters with \left and \right. Thus the surrounding math sees a correctly delimited expression and \left and \right do not set their additional spacing inside \mathclose. As the original \left ...


Only top voted, non community-wiki answers of a minimum length are eligible