3

This follows from a previous post In the figure form, how to adjust the whole size of "text" and "math" format at once?,

In the figure form, how to adjust the whole size of "text" and "math" format "as a combined figure" at once, from the \twocolumngrid to \onecolumngrid? (say in the revtex)

My trouble is that in the "twocolumn" format of revtex4-1, if I use the following method @Herbert,

\documentclass[aps,prl,twocolumn,superscriptaddress,floatfix,letterpaper,nofootinbib]{revtex4-1}
\usepackage{mathtools,amssymb,varwidth}
\usepackage{showframe}


\begin{document}


\onecolumngrid
\begin{widetext}

\begin{figure}[!h]
\centering
\begin{center}
\resizebox{\linewidth}{!}{%
  \begin{varwidth}{\linewidth}
\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}}
 \end{center}
  \caption{}
\end{figure}
\end{widetext}
\twocolumngrid

\end{document}

I got:

enter image description here

This is not what I wanted. I want to have the figure stand in the middle, with adjustable size (likely 2/3 or 3/4 of the document width).

However, the "\begin{gather*} \end{gather*}" seems to make the trouble.

If I remove "\begin{gather*} ... \end{gather*}" to simply use "$...$", I got a compilation problem and a troublesome output, where the "braces" are making troubles in the wrong position:

enter image description here

PS. My last figure is what I am hoping to get (with tunable size, like 2/3 or 3/4 of the whole document width). But it shall also be scale-invariant as the same smaller one as the one in my first figure. The code should be also compilable.

Edit 1: This seems to cause the trouble \\[-\normalbaselineskip], which outputs "LaTeX Error: There's no line here to end."

My following attempt can not be compiled fully:

\documentclass[aps,prl,twocolumn,superscriptaddress,floatfix,letterpaper,nofootinbib]{revtex4-1}
\usepackage{mathtools,amssymb,varwidth}
\usepackage{showframe}


\begin{document}


\onecolumngrid
\begin{widetext}

\begin{figure}[!h]
\centering
\begin{center}
\resizebox{\linewidth}{!}{%
  \begin{varwidth}{\linewidth}
$
\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{varwidth}}
 \end{center}
  \caption{}
\end{figure}
\end{widetext}
\twocolumngrid

\end{document}
  • 1
    Can you make a mock-up of what you're after? All you talk about are problems without a clear instruction of the expected output. Also, there is no \onecolumngrid or \twocolumngrid. – Werner Dec 28 '18 at 22:05
  • Thank you Werner, what I am after is similar to the "last figure." (But I did not get a error-free compilation for that figure. Also the figure is not scale invariant from the original smaller one) – wonderich Dec 28 '18 at 22:07
  • 1
    There "are" \onecolumngrid and \twocolumngrid in my template – wonderich Dec 28 '18 at 22:08
  • @Werner, I am still in trouble to make it work --- any enlightenment will count as an answer to me. – wonderich Dec 28 '18 at 22:50
  • It seems that my compilation error "LaTeX Error: There's no line here to end." is due to something from here "\resizebox{\linewidth}{!} \begin{varwidth}{\linewidth}" – wonderich Dec 28 '18 at 23:41
2

Since displayed math uses the entire width of the column, varwidth won't help. Instead you need to measure the width seperately and use a normal minipage.

Note the the actual width of the underbrace is slightly larger than its measured width. One gets the same result using \sbox0{$\displaystyle A\times B\times C\times D$}%.

\documentclass[aps,prl,twocolumn,superscriptaddress,floatfix,letterpaper,nofootinbib]{revtex4-1}
\usepackage{mathtools,amssymb,varwidth}
\usepackage{showframe}


\begin{document}


\onecolumngrid
\begin{widetext}

\begin{figure}[htp]% I have yet to find a case where ! makes any difference whatsoever
\centering
\sbox0{$\displaystyle \underbrace{\hphantom{A\times B\times C\times D}}_\text{family}$}% measure width
\resizebox{\linewidth}{!}{\begin{minipage}{\wd0}
  \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{minipage}}
  \caption{}
\end{figure}
\end{widetext}
\twocolumngrid

\end{document}

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.