目的:将每页的文字列与图片列分开

目的:将每页的文字列与图片列分开

我不知道以前是否有人问过这个问题。但到目前为止,我的搜索没有找到任何结果。

在某些书中,图形被放置在页面的外侧,如下图所示。

在此处输入图片描述

这在 TeX/LaTeX 中可以实现吗?那就是如何设置页面,以便所有文本都出现在“文本列”中,而图形出现在每个页面的“图形列”中?

答案1

tufte-latex您可以为此使用该包,它提供了一个marginfigure环境:

\documentclass{tufte-handout}

\usepackage{graphicx}

\begin{document}
\section{Rubber Ducks}

\begin{marginfigure}[7.5ex]
\includegraphics[width=\linewidth]{rubber_duck}
\caption{A classic rubber duck}
\end{marginfigure}

A rubber duck is a toy shaped like a stylised yellow-billed duck, and it is generally yellow with a flat base. It may be made of rubber or rubber-like material such as vinyl plastic. The yellow rubber duck has achieved an iconic status in Western pop culture and is often symbolically linked to bathing. Various novelty variations of the toy are produced.

Its history is linked to the emergence of rubber manufacturing in the late 19th century. The earliest rubber ducks were made from harder rubber.

Jim Henson popularized rubber ducks in 1970, performing the songs "Rubber Duckie" and "DUCKIE" as Ernie, a popular Muppet from Sesame Street. Ernie frequently spoke to his duck and carried it with him in other segments of the show. On a special occasion, Little Richard performed the song.

\begin{marginfigure}[7.5ex]
\includegraphics[width=\linewidth]{novelty_ducks}
\caption{Non-standard rubber ducks}
\end{marginfigure}

Besides the ubiquitous yellow rubber duck with which most people are familiar, there have been numerous novelty variations on the basic theme, including character ducks representing professions, politicians, or licensed individual celebrities. There are also ducks that glow in the dark, change colour, have interior LED illumination, or include a wind-up engine that enables them to "swim". In 2001, The Sun, a British tabloid newspaper reported that Queen Elizabeth II has a rubber duck in her bathroom that wears an inflatable crown. The duck was spotted by a workman who was repainting her bathroom. The story prompted sales of rubber ducks in the United Kingdom to increase by 80\% for a short period.

Rubber ducks are collected by a small number of enthusiasts. The 2007 Guinness World Record for World's Largest Rubber Duck Collection stood at 2,583 different rubber ducks, and was awarded to Charlotte Lee.


\end{document}

(文字及图片来自维基百科

答案2

我想添加另一个答案,以防您(或任何其他人)希望图形从页面顶部开始并向下移动,而不是将它们与出现边注的文本对齐。

\documentclass{book}

\usepackage{lipsum}
\usepackage[demo]{graphicx}
\usepackage{flowfram}

\newflowframe{0.65\textwidth}{\textheight}{0pt}{0pt}[main]
\newdynamicframe{0.3\textwidth}{\textheight}{0.7\textwidth}{0pt}[sidepanel]

% For two-sided documents, swap locations on odd pages

\setflowframe*{main}{evenx=0.35\textwidth}
\setdynamicframe*{sidepanel}{clear,evenx=0pt}

\newcommand{\sidefigure}[1]{%
  \appenddynamiccontents*{sidepanel}{%
   \begin{staticfigure}
    \centering
    #1%
   \end{staticfigure}
   \vspace{\baselineskip}%
  }%
}

\begin{document}

\lipsum[1]

\sidefigure{%
  \includegraphics[width=\linewidth]{test-image}
  \caption{Sample Figure}
  \label{fig:sample1}
}

\lipsum[2]

\sidefigure{%
  \includegraphics[width=\linewidth]{test-image}
  \caption{Another Sample Figure}
  \label{fig:sample2}
}

\lipsum[3-5]

\sidefigure{%
  \includegraphics[width=\linewidth]{test-image}
  \caption{A Third Sample Figure}
  \label{fig:sample3}
}


\end{document}

相关内容