
Eu tenho duas caixas minipage
lado a lado com alturas diferentes dentro \fbox
e elas estão centralizadas uma na outra
\documentclass{article}
\usepackage{fancybox}
\begin{document}
\noindent
\makebox[\textwidth]{%
\parbox{1.2\textwidth}{%
\setlength{\fboxsep}{10pt}%
\fbox{%
\begin{minipage}[c]{.53\textwidth}
text\\[8pt]
text\\[8pt]
text
\end{minipage}}%
\hfill
\fbox{%
\begin{minipage}[c]{.53\textwidth}
text \hrulefill\\
text \hrulefill\\
text \hrulefill
\end{minipage}}}}
\end{document}
mas eles não ficam centralizados se eu usar minipage
dentro de um\shadowbox
\documentclass{article}
\usepackage{fancybox}
\begin{document}
\noindent
\makebox[\textwidth]{%
\parbox{1.2\textwidth}{%
\setlength{\fboxsep}{10pt}%
\shadowbox{%
\begin{minipage}[c]{.53\textwidth}
text\\[8pt]
text\\[8pt]
text
\end{minipage}}%
\hfill
\shadowbox{%
\begin{minipage}[c]{.53\textwidth}
text \hrulefill\\
text \hrulefill\\
text \hrulefill
\end{minipage}}}}
\end{document}
Como posso centralizar as minipáginas dentro \shadowbox
?
Responder1
Você pode centralizar novamente a caixa usando \raisebox
. Também reduzi um pouco a largura para deixar espaço para a sombra, pois tex estava alertando sobre a caixa cheia demais
\documentclass{article}
\usepackage{fancybox}
\begin{document}
\noindent
\makebox[\textwidth]{%
\parbox{1.2\textwidth}{%
\setlength{\fboxsep}{10pt}%
\fbox{%
\begin{minipage}[c]{.53\textwidth}
text\\[8pt]
text\\[8pt]
text
\end{minipage}}%
\hfill
\fbox{%
\begin{minipage}[c]{.53\textwidth}
text \hrulefill\\
text \hrulefill\\
text \hrulefill
\end{minipage}}}}
\bigskip
\noindent
\makebox[\textwidth]{%
\parbox{1.2\textwidth}{%
\setlength{\fboxsep}{10pt}%
\raisebox{-.5\totalheight}{\shadowbox{%
\begin{minipage}[c]{.52\textwidth}
text\\[8pt]
text\\[8pt]
text
\end{minipage}}}%
\hfill
\raisebox{-.5\totalheight}{\shadowbox{%
\begin{minipage}[c]{.52\textwidth}
text \hrulefill\\
text \hrulefill\\
text \hrulefill
\end{minipage}}}}}
\end{document}
Responder2
Você também pode usar oadjustbox
pacote para obter facilmente qualquer alinhamento vertical desejado:
O código:
\documentclass{article}
\usepackage{fancybox}
\usepackage{adjustbox}
\begin{document}
\noindent
\makebox[\textwidth]{%
\parbox{1.2\textwidth}{%
\setlength{\fboxsep}{10pt}%
\adjustbox{valign=c}{\shadowbox{%
\begin{minipage}[c]{.52\textwidth}
text\\[8pt]
text\\[8pt]
text
\end{minipage}}}%
\hfill
\adjustbox{valign=c}{\shadowbox{%
\begin{minipage}[c]{.52\textwidth}
text \hrulefill\\
text \hrulefill\\
text \hrulefill
\end{minipage}}}}}
\end{document}