3

In the figure form, how to adjust the whole size of "text" and "math" format "as a combined figure" at once?

If this is a usual pdf figure, we can do \includegraphics[width=4.4in], such as below, the size is tuned by [width=4.4in]

\begin{figure}[htbp]
  \centering
  \includegraphics[width=4.4in]{.pdf}
  \caption{}\label{}
\end{figure}

Can we adjust the whole overall size of the figure (including the "text" and "math" format) at once by the similar function, like "size"?

I hope to have a 3-times-larger figure overall.

enter image description here

\documentclass{article}
\usepackage{mathtools,amssymb}
\begin{document}

\begin{figure}[!h]
\begin{center}
\begin{gather*}
\overbrace{\underbrace{A \times B}_E\times
           \underbrace{C\times {D}}_{EFG}}^{\text{ABCDEFG}} \\[-\normalbaselineskip]
\underbrace{\kern5em}_{\text{family}}
\end{gather*}
\end{center}
\caption{}
\end{figure}
\end{document}
wonderich
  • 2,387

2 Answers2

3
\documentclass[fleqn]{article}
\usepackage{mathtools,amssymb,varwidth}
\usepackage{showframe}
\begin{document}

\begin{figure}[!htb]
\resizebox{\linewidth}{!}{%
  \begin{varwidth}{\linewidth}
  \mathindent=0pt
  \begin{gather*}
    \overbrace{\underbrace{A \times B}_E\times
               \underbrace{C\times {D}}_{EFG}}^{\text{ABCDEFG}}\\[-\normalbaselineskip]
    \underbrace{\hphantom{A\times B\times C\times D}}_{\text{family}}
    \end{gather*}
  \end{varwidth}}
  \caption{foo}
\end{figure}
\end{document}

enter image description here

Instead of \resizebox you can also use \scalebox:

[...]
\begin{figure}[!htb]
\centering
\scalebox{3}{%
  \begin{varwidth}{\linewidth}
[...]
  • Thanks, may I make sure the complete code for your "\scalebox"? – wonderich Dec 28 '18 at 20:52
  • yes. By the way: If you do not need the environment gather* then it can be done in an easier way: \scalebox{3}{$\displaystyle\overbrace{\underbrace{A \times B}_E\times ...$} –  Dec 28 '18 at 20:56
  • actually you taught me to use "gather*" - -what was that purpose in a previous post you answer? Thanks!!! – wonderich Dec 28 '18 at 21:00
  • It depends on what you want: Only one time an equation as big as possible or an equation as part of a document with other equations? In the first case it doesn't matter what you use ... –  Dec 28 '18 at 21:06
  • Thanks -- but what is the preamble needed for \scalebox{...}?

    This looks not compilable simply from "\usepackage{mathtools,amssymb,varwidth} \usepackage{showframe}"

    – wonderich Dec 28 '18 at 21:09
  • 1
    Package graphicx is needed, but it is loaded already by mathtools. At least in my TeX distribution. –  Dec 28 '18 at 21:13
  • Thanks +1, I accept your answer, but -- my real question is the following: https://tex.stackexchange.com/q/467729/41144 --- I dont find it fully resolved. – wonderich Dec 28 '18 at 21:49
  • May I also know what is the use of " \mathindent=0pt" this causes some problem in my compilation in tex.stackexchange.com/q/467729/41144 – wonderich Dec 28 '18 at 23:40
  • Amsmath is a bit tricky if you want to resize a formula. With fleqn it puts the equation left aligned but with an indentation of mathindent from the left margin. This is the reason why it must be set to 0 pt –  Dec 29 '18 at 07:53
3

If you want to resize content using a specific width/height, then you can use \resizebox{<width>}{<height>} (using ! to maintain the aspect ratio if you only specify one or the other). If you want to scale content using a number, you can use \scalebox{<num>}:

enter image description here

\documentclass{article}

\usepackage{graphicx,amsmath}

\begin{document}

\begin{figure}
  \centering
  \scalebox{3}{$\displaystyle % If needed...
    \underbrace{
      \overbrace{
        \underbrace{
          A \times B
        }_E \times \underbrace{
          C \times D
        }_{EFG}
      }^{\text{ABCDEFG}}
    }_{\text{family}}
  $}
  \caption{A caption}
\end{figure}

\end{document}

I've nested the family \underbrace as part of the bigger expression, so there's no need to manually place it based on the location. Also note the use of \centering rather than the center environment, and there's no need for using gather.

Werner
  • 603,163
  • +1 Thanks, I like your answer, -- my real question is the following: https://tex.stackexchange.com/q/467729/41144 I dont find it fully resolved. – wonderich Dec 28 '18 at 21:50