3

I want to write this equation: Peso fibra=(1,266x500)/(média 3 pesos)

I used the equation environment. But, the word "média" has an accent. So, I have problems to compile my main file.

How I can resolve this problem?

1
  • Consider putting \usepackage[utf8]{inputenc} in your preamble.
    – Hugh
    May 28, 2014 at 0:19

2 Answers 2

7

I'm not sure I understand what you want but maybe the following is what you are after:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
  \text{Peso fibra}
  = (1{,}266 \times 500)/(\text{m\'edia 3 pesos})
\end{equation}

\end{document}

output

5
  • \text{m\'edia $3$ pesos} is better, IMO.
    – egreg
    May 27, 2014 at 16:22
  • @egreg Good point! I'll change it. May 27, 2014 at 16:23
  • For the denominator, \text{m\'edia 3 pesos} would seem more straightforward.
    – Mico
    May 27, 2014 at 16:25
  • @Mico I think 3 should be in math mode. May 27, 2014 at 16:26
  • 2
    I guess this might matter if the fonts used for math and text mode aren't the same.
    – Mico
    May 27, 2014 at 16:29
2

you can use \'e for the accent. For the text in math mode, use \mbox{} or \text{} from amsmath packages. This is the sample code to generate the equation.

\documentclass{article}

\begin{document}
    \[
        \mbox{Peso fibra} = \frac{(1,266\times500)}{\mbox{m\'edia 3 pesos}}
    \]
\end{document}

enter image description here

all possibility

\documentclass{article}

\usepackage{amsmath}

\usepackage{units}

\begin{document}
    The simple one (without \verb|amsmath| package),
    \begin{align*}
        \mbox{Peso fibra} &=(1,266\times500)/(\mbox{m\'edia 3 pesos})
        \\
        \mbox{Peso fibra} &= \frac{(1,266\times500)}{\mbox{m\'edia 3 pesos}}
        \\
        \mbox{Peso fibra} &= \nicefrac{(1,266\times500)}{(\mbox{m\'edia 3 pesos})}
    \end{align*}

    With \verb|\text{}| from \verb|amsmath|
    \begin{align*}
        \text{Peso fibra} &=(1,266\times500)/(\text{m\'edia 3 pesos})
        \\
        \text{Peso fibra} &= \frac{(1,266\times500)}{\text{m\'edia 3 pesos}}
        \\
        \text{Peso fibra} &= \nicefrac{(1,266\times500)}{(\text{m\'edia 3 pesos})}
    \end{align*}
\end{document}

enter image description here

1
  • 3
    It's better to use the \text macro in this situation as the font size will adjust automatically if the string occurs in the numerator or denominator of a fraction.
    – Mico
    May 27, 2014 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .