顶部对齐 lrbox

顶部对齐 lrbox

有没有办法将两个对齐lrbox?我尝试模仿 tufte-latex 的标题。左边是我想要的,右边是我目前得到的结果。

在此处输入图片描述

\documentclass{book}

\usepackage{kantlipsum}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{parskip}

\geometry{
    a4paper,
    left=24.8mm,
    top=27.4mm,
    headsep=2\baselineskip,
    textwidth=107mm,
    marginparsep=8.2mm,
    marginparwidth=49.4mm,
    textheight=49\baselineskip,
    headheight=\baselineskip,
    twoside,
    asymmetric,
    showframe,
}

\usepackage{caption}

\newsavebox{\mycaptionbox}
\newsavebox{\myfigurebox}

\begin{document}

\begin{lrbox}{\myfigurebox}%
    \begin{minipage}{\textwidth}\hbox{}%
        \includegraphics[width=3cm]{example-grid-100x100pt}%
    \end{minipage}%
\end{lrbox}%

\begin{lrbox}{\mycaptionbox}%
    \begin{minipage}{\marginparwidth}\hbox{}%
        \captionof{figure}{\kant[1]}%
    \end{minipage}%
\end{lrbox}%

\begin{minipage}{\linewidth}%
    \hbox{%
        \usebox{\myfigurebox}%
        \hspace{\marginparsep}%
        \smash{\usebox{\mycaptionbox}}%
    }%
\end{minipage}%
    
\end{document}

答案1

Anlrbox始终是单行,因此没有对齐选项,但在其中你想\begin{minipage}[t]将小页面顶部对齐

相关内容