0

I am using overleaf. I have this block of code written for a 2 column document that needs to be transferred to a single column document.

\begin{figure}
\centering
\begin{minipage}{0.2\textwidth}
\def\xspace{0}
\centering
\hspace{-6mm}
\begin{tikzpicture}
    \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth,trim={0 0 0 0},clip]{Chapters/ICRA2022/figures/table_items.png}};
    \begin{scope}[x={(image.south east)},y={(image.north west)}]
          \foreach \i/\j in {{(0.2,0.6)/(0.2,1.1)},{(0.3,0.75)/(0.3,1.1)},{(0.39,1)/(0.39,1.1)},{(0.62,0.7)/(0.62,1.1)}} \draw [-stealth, red, thick] \i -- \j;
          \node[scale=0.45] at (0.42,1.15) {$\{O^{(1)},O^{(2)},O^{(3)}, \ ... \ , O^{(7)}\}$};
          \node[scale=0.45] at (0.42,1.25) {$O^{(n)}$ for Pick Action};
    \end{scope}
\end{tikzpicture}\\
\hspace{-9mm}
\subfloat[]{\begin{tikzpicture}
    \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth,trim={0 0 0 0},clip]{Chapters/ICRA2022/figures/table_grid.png}};
    \begin{scope}[x={(image.south east)},y={(image.north west)}]
          \foreach \i/\j in {{(0.015,0.68)/(0.015,1.1)},{(0.15,0.7)/(0.15,1.1)},{(0.285,0.72)/(0.285,1.1)},{(0.42,0.74)/(0.42,1.1)},{(0.557,0.77)/(0.557,1.1)}} \draw [-stealth, red, thick] \i -- \j;
          \node[scale=0.45] at (0.33+\xspace,1.15) {$\{O^{(1)},\ O^{(2)},\ O^{(3)},\ O^{(4)}, \ O^{(5)}, \ ... \}$};
          \node[scale=0.45] at (0.35+\xspace,1.25) {$O^{(n)}$ for Place Action};
    \end{scope}
\end{tikzpicture}}
\end{minipage}\hfill
\begin{minipage}{0.28\textwidth}
\centering
\hspace{-10mm}
\subfloat[]{\includegraphics[width=1.1\textwidth,trim={1cm 0.32cm 0 0.25cm},clip]{Chapters/ICRA2022/figures/architecturenewest.pdf}}
\end{minipage}\caption{(a) $O^{(n)}$ for pick and place actions (b) Our gaze network. The gaze attention block attends to fixations relative to each object while the object attention block attends to objects that are most likely being fixated on.}\label{fig:architecture}
\end{figure}

This is how it originally looks like in the 2 column document.

enter image description here

This is how it looks like in the single column document with too much space in between.

enter image description here

How do I scale the contents within the block of code? Varying the size of the minipage does not work as it will result in the figures looking like this where the text is no longer aligned to the arrows. I do not want to update the positioning manually as I have over 50+ of such figures.

enter image description here

I am looking for a function such as \scale_everything

\begin{figure}
\centering

% % % % % % % % % % % % % % % % % % % % EXAMPLE USAGE OF SCALE EVERYTHING % % % % % % % % % % % % % % % % % % % %

\scale_everything{0.5\textwidth}{

\begin{minipage}{0.2\textwidth} \def\xspace{0} \centering \hspace{-6mm} \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth,trim={0 0 0 0},clip]{Chapters/ICRA2022/figures/table_items.png}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] \foreach \i/\j in {{(0.2,0.6)/(0.2,1.1)},{(0.3,0.75)/(0.3,1.1)},{(0.39,1)/(0.39,1.1)},{(0.62,0.7)/(0.62,1.1)}} \draw [-stealth, red, thick] \i -- \j; \node[scale=0.45] at (0.42,1.15) {${O^{(1)},O^{(2)},O^{(3)}, \ ... \ , O^{(7)}}$}; \node[scale=0.45] at (0.42,1.25) {$O^{(n)}$ for Pick Action}; \end{scope} \end{tikzpicture}\ \hspace{-9mm} \subfloat[]{\begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth,trim={0 0 0 0},clip]{Chapters/ICRA2022/figures/table_grid.png}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] \foreach \i/\j in {{(0.015,0.68)/(0.015,1.1)},{(0.15,0.7)/(0.15,1.1)},{(0.285,0.72)/(0.285,1.1)},{(0.42,0.74)/(0.42,1.1)},{(0.557,0.77)/(0.557,1.1)}} \draw [-stealth, red, thick] \i -- \j; \node[scale=0.45] at (0.33+\xspace,1.15) {${O^{(1)},\ O^{(2)},\ O^{(3)},\ O^{(4)}, \ O^{(5)}, \ ... }$}; \node[scale=0.45] at (0.35+\xspace,1.25) {$O^{(n)}$ for Place Action}; \end{scope} \end{tikzpicture}} \end{minipage}}\hfill

\scale_everything{0.4\textwidth}{

\begin{minipage}{0.28\textwidth} \centering \hspace{-10mm} \subfloat[]{\includegraphics[width=1.1\textwidth,trim={1cm 0.32cm 0 0.25cm},clip]{Chapters/ICRA2022/figures/architecturenewest.pdf}} \end{minipage}}\caption{(a) $O^{(n)}$ for pick and place actions (b) Our gaze network. The gaze attention block attends to fixations relative to each object while the object attention block attends to objects that are most likely being fixated on.}\label{fig:architecture} \end{figure}

Here is a MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{subfig}
\usepackage{graphicx}

\usepackage{tikz} \begin{document}

\begin{figure} \centering \subfloat[][a]{ \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.3\textwidth,trim={0 0 0 0},clip]{example-image-a}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] \foreach \i/\j in {{(0.2,0.6)/(0.2,1.1)},{(0.3,0.75)/(0.3,1.1)},{(0.39,1)/(0.39,1.1)},{(0.62,0.7)/(0.62,1.1)}} \draw [-stealth, red, thick] \i -- \j; \node[scale=0.45] at (0.42,1.15) {${O^{(1)},O^{(2)},O^{(3)}, \ ... \ , O^{(7)}}$}; \node[scale=0.45] at (0.42,1.25) {$O^{(n)}$ for Pick Action}; \end{scope} \end{tikzpicture}}
\subfloat[][a]{ \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.3\textwidth,trim={0 0 0 0},clip]{example-image-a}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] \foreach \i/\j in {{(0.2,0.6)/(0.2,1.1)},{(0.3,0.75)/(0.3,1.1)},{(0.39,1)/(0.39,1.1)},{(0.62,0.7)/(0.62,1.1)}} \draw [-stealth, red, thick] \i -- \j; \node[scale=0.45] at (0.42,1.15) {${O^{(1)},O^{(2)},O^{(3)}, \ ... \ , O^{(7)}}$}; \node[scale=0.45] at (0.42,1.25) {$O^{(n)}$ for Pick Action}; \end{scope} \end{tikzpicture}} \label{steady_state} \end{figure}

\end{document}

Kong
  • 2,313

1 Answers1

1

This is probably a bad option, but you can add [scale=2, transform shape] to the tikzpicture. This will "scale everything" as you suggest, but the scaled text will look out of place in your document. On the other hand, it looks like the subfloat (a) is already scaled down (including text) compared to subfloat (b), so maybe this does what you want.

enter image description here

Sandy G
  • 42,558