Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

1 Answer

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
}
share|improve this answer
    
Thanks a lot, works great :) –  Eric Jan 25 '13 at 5:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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