如何在整本书中将图片(带标题)放在左边,将文字放在右边

如何在整本书中将图片(带标题)放在左边,将文字放在右边

我正在尝试在左侧设置图像(带居中标题)并在右侧设置相应的文本(两端对齐和顶部对齐)。我尝试过 longtable、table、minipages 和 wrapfig,但一旦完成第二个实例,一切都会变得一团糟,第三个实例会变得更糟。这是一种传记词典,大约有 100 页长。我刚刚开始使用 LaTeX,所以也许我忽略了一些显而易见的东西。我的问题是:这是否可行以及如何实现?

答案1

你是指这样的吗?

\documentclass{article}

\usepackage{caption}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{lipsum}

\newcommand\figwithtext[3]% #1 = image #2=caption #3=text
  {
    \par\noindent
    \begin{minipage}[t]{0.48\textwidth}
      \includegraphics[valign=t,width=\linewidth]{#1}
      \captionof{figure}{#2}
    \end{minipage}\hfill
    \begin{minipage}[t]{0.48\textwidth}
      \vspace{0pt}
      #3
    \end{minipage}
    \par\smallskip
}
\begin{document}

\lipsum[1]
\figwithtext{example-image}{First caption}{
As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena should only be used as a canon for our understanding.}

\figwithtext{example-image-a}{Second caption}{The paralogisms of practical reason are what first give rise to the architectonic of practical reason. As will easily be shown in the next section, reason would thereby be made to contradict, in view of these considerations, the Ideal of practical reason, yet the manifold depends on the phenomena.}
\lipsum[4]
\end{document}

在此处输入图片描述

相关内容