2

I'm trying to delimit an equation with parentheses and it has fractions inside it, so I can't just increase the parentheses' size, because they wouldn't be correctly alligned. What I'm trying to do is the following:

MDC(m,n)=mindiv(m,n)$\times$ MDC $\left($ $\dfrac{m}{mindiv(m,n)}$,$\dfrac{n}{mindiv(m,n)}$ $\right)$

It compiles correctly until I attempt to add the parentheses like that. I've tried all possible ways to add the math mode delimiters, but all it does is give me a series of errors. How do I delimit bigger equations like this in math mode? I found out that the following works:

$\left( \right)$

However, if I attempt to wrap the equation like that (with the delimiters at the beginning and at the end only), I still get a series of errors.

  • 1
    ...then you haven't "tried all possible ways"... – Werner Apr 8 '15 at 21:20
  • Yeah, indeed I hadn't. I have just had an insight which actually worked. – Vinicius Sesti Apr 8 '15 at 21:21
  • Welcome to TeX.SX! Why are you jumping out of mathmode continously? – user31729 Apr 8 '15 at 21:21
  • Thank you! I had initially thought I needed to delimit math mode whenever I wanted to add a math symbol, only now I found out I would jump in and out of math mode doing that. A single pair of delimiters wrapping the entire piece of code is enough, apparently. – Vinicius Sesti Apr 8 '15 at 21:24
3

You're doing it wrong...

You should switch to math-mode and stay there in order to set math content:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\mindiv}{mindiv}
\DeclareMathOperator{\MDC}{MDC}
\begin{document}
\[
  \MDC(m,n) = \mindiv(m,n) \times \MDC \biggl( \dfrac{m}{\mindiv(m,n)}, \dfrac{n}{\mindiv(m,n)} \biggr)
\]
\end{document}

I've declared some operators since it seemed to suit your needs. Also, you can use \left(...\right), but I've decided (for spacing consistency) to use \big-like delimiters.

|improve this answer|||||
2

Jumping out of mathmode using $...$ is not a pretty good way. Use a common $...$ pair or \[...\] or a math environment as equation or align.

The function names should be wrapped into a \DeclareMathOperator statement to provide upright typesetting and better spacing, however, admitted, I had done this only for \mindiv so far. I leave it to the OP as an exercise for the \MDC operator ;-)

\documentclass{article}

\usepackage{mathtools}

\DeclareMathOperator{\mindiv}{mindiv}

\begin{document}


$MDC(m,n)=\mindiv(m,n) \times MDC \left(\dfrac{m}{\mindiv(m,n)},\dfrac{n}{\mindiv(m,n)}\right)$

\begin{align}
MDC(m,n) &=\mindiv(m,n) \times MDC \left(\dfrac{m}{\mindiv(m,n)},\dfrac{n}{\mindiv(m,n)}\right)
\end{align}

\end{document}

enter image description here

|improve this answer|||||
  • MDC is wrong: if you want italics it should be \mathit{MDC}. – egreg Apr 8 '15 at 21:29
  • @egreg: See the 'explanation' in the post ;-) – user31729 Apr 8 '15 at 21:29

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.