4

I'd like to disable enumeration for my document. I'm using amsmath and breqn. I tried using \mathtoolsset{showonlyrefs=true}, but it doesn't work.

\documentclass[a4paper,landscape]{article}
\usepackage{amsmath}
\usepackage{breqn}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true}
\begin{document}
\begin{dmath}
Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)
 \end{dmath}
 \begin{dmath}
Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)
 \end{dmath}
 \end{document}

I could use dmath*, but this is inconvenient, since I'm writing a formula sheet.

4

You could redefine the dmath environment to be the dmath* environment, using

\renewenvironment{dmath}{\begin{dmath*}}{\end{dmath*}}

Here's a complete MWE that demonstrates the idea:

% arara: pdflatex
\documentclass[a4paper,landscape]{article}
\usepackage{amsmath}
\usepackage{breqn}

\renewenvironment{dmath}{\begin{dmath*}}{\end{dmath*}}

\begin{document}
\begin{dmath}
Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)
 \end{dmath}
 \begin{dmath}
Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)
 \end{dmath}
 \end{document}
  • Great! This works for my purpose. Do you know if there is a way to make it work as it's done in mathtools: enumerate only those equations that are referenced? – m33lky Jan 29 '14 at 17:20
  • @m33lky glad it works :) I don't know how to emulate the mathtools method; some study of mathtools.sty might help- I imagine it checks information from the .aux file, but beyond that I'm not sure – cmhughes Jan 29 '14 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.