1

How can I control the action of my box, keeping my fixed text in the center? The code created is as follows:

\documentclass[11pt, a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[brazil]{babel}
\usepackage{graphicx}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage{amstext}
\usepackage{amsmath}
\usepackage{booktabs,array,tabularx}
\usepackage{subfig}
\usepackage{siunitx, makecell}
\usepackage{mathtools,float}
\begin{document}
\fbox{\begin{minipage}[H]{10cm}
$$\text{F.transfer\^{e}ncia}_b(\omega)=\frac{1}{\sqrt{1+(\frac{\omega}{\omega_c})^2}}e^{-j\arctan(\frac{\omega}{\omega_c})}$$
\end{minipage}}
\end{document}

When I try to change the size of the box, the text moves to the left and I do not want it.

6
  • What is your end-goal here? An equation that is boxed? Something like this?
    – Werner
    Commented Oct 8, 2016 at 19:51
  • It's not clear what the problem is. You get the formula centered in a box 10cm wide.
    – egreg
    Commented Oct 8, 2016 at 19:51
  • @Werner Yes I want something like your box, but in my code, when I modify the size of the box (modify 10 cm), the text goes to the left and I want the text centering. I need a small box in the center with the text in the center. Commented Oct 8, 2016 at 20:05
  • @egreg In my code, when I modify the size of the box (modify 10 cm), the text goes to the left and I want the text centering. I need a small box in the center with the text in the center. Commented Oct 8, 2016 at 20:06
  • @CarmenGonzález I think that Heiko found the right answer for your needs. Please, read Why is \[ … \] preferable to $$? and recall that there is no H option to minipage.
    – egreg
    Commented Oct 8, 2016 at 20:19

1 Answer 1

3

Example for a "small" box in the center with centered contents:

\documentclass[11pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\[
  \boxed{
    \text{F.transfer\^{e}ncia}_b(\omega)=
    \frac{1}{\sqrt{1+(\frac{\omega}{\omega_c})^2}}
    e^{-j\arctan(\frac{\omega}{\omega_c})}}
\]
\end{document}

Result

Alternative: \begin{center}\boxed{...}\end{center}.

You must log in to answer this question.

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