
Tenho um acréscimo a esta pergunta:Duas figuras lado a lado.
Suponha que temos duas imagens, tornando-as de altura irregular. Estou procurando uma maneira denãouse subfig
e alinhe duas figuras lado a lado, mantendo as legendas alinhadas verticalmente.
Eu criei o seguinte exemplo:
\documentclass{article}
\title{Two Figures Side by Side}
\author{Little Bobby Tables}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand{\exedout}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\newcommand{\exedouttwo}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\begin{document}
\maketitle
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.
\lipsum
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering\exedout
\caption{first figure but with more comments than the second picture to see what the different is.}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\centering\exedouttwo
\caption{second figure}
\end{minipage}
\end{figure}
\lipsum
\end{document}
Dá o seguinte resultado:
Mas eu preciso disso:
Responder1
Use o [t]
argumento opcional de minipage
para alinhar ambos com a linha de base superior (ou seja, a linha de base/linha inferior da imagem). Também adicionei %
s às suas macros para evitar que espaços extras sejam inseridos pelas quebras de linha do código-fonte.
\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand{\exedout}{%
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}%
}
\newcommand{\exedouttwo}{%
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}%
}
\begin{document}
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.
\lipsum
\begin{figure}
\centering
\begin{minipage}[t]{0.45\textwidth}
\centering\exedout
\caption{first figure but with more comments than the second picture to see what the different is.}
\end{minipage}
\begin{minipage}[t]{0.45\textwidth}
\centering\exedouttwo
\caption{second figure}
\end{minipage}
\end{figure}
\lipsum
\end{document}
Responder2
Está usandofloatrow
uma opção?
Observe que no exemplo a seguir tornei as duas figuras mais estreitas alterando \exedout
e \exedouttwo
, como ffigbox
não parece mudar \textwidth
, minipage
portanto as duas figuras seriam muito largas.
\documentclass{article}
\title{Two Figures Side by Side}
\author{Little Bobby Tables}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{floatrow}
\newcommand{\exedout}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.4\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\newcommand{\exedouttwo}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.4\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\begin{document}
\maketitle
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.
\lipsum
\begin{figure}
\begin{floatrow}
\ffigbox{\caption{first figure but with more comments than the second picture to see what the different is.}}{\exedout}
\ffigbox{\caption{second figure}}{\exedouttwo}
\end{floatrow}
\end{figure}
\lipsum
\end{document}