2

I have defined a new command below, but when ever I pass an equation into, it will not work.

\newcommand{\defn}[1]{
{\textbf{Definition}}\\  
\parbox{5.2in}{\begin{flushright} \fbox{#1}\end{flushright} } }

This is what it allows me to do:

\defn{If $f$ is integrable over the interval $[a,b]$, we define $\int_{b}^{a} f(x)\ dx$ }

However, this is what I want to do:

\defn{If $f$ is integrable over the interval $[a,b]$, we define 
$$\int_{b}^{a} f(x)\ dx$$ }

Or alternatively,

 \defn{If $f$ is integrable over the interval $[a,b]$, we define 
  \begin{equation*}
    \int_{b}^{a} f(x)\ dx
  \end{equation}}

I would greatly appreciate any help. Thank you.

  • Please read Why is \[\] preferable to $$? – Werner Jan 25 '13 at 5:52
  • 1
    Why don't you just use the more standard solution using environment and theorem-like constructions, the amsthm package allows you to create theorem-like structures that are unnumbered. Then you also get the bonus of automatically added separation space above and below the construction – daleif Jan 25 '13 at 9:17
4

Try:

\documentclass{article}
\newcommand{\defn}[1]{%
\textbf{Definition:}\par  
\minipage{5.2cm}
#1
\endminipage
}

\begin{document}
 \defn{If $f$ is integrable over the interval $[a,b]$, we define 
  \begin{equation}
    \int_{b}^{a} f(x)\ dx
  \end{equation}
}

\end{document}

You might also consider the following alternate definition, where you can set the size as we:

\newcommand{\defn}[2]{%
\textbf{Definition:}\par  
\hsize#1
#2
}

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.