这是马可波罗所著的《百万富翁》的意大利文版。我在此版本中找到了主要抄本(正文)、“最优”抄本,以及来自其他文献资料的其他抄本(评论 1和评论 2) 为所选抄本添加了原文中所缺失的其他细节。
我想使用与以下代码类似的方法在 LaTeX 中复制类似的模式:
% Main Text
Non hanno ferro per fare aguti;
% Comment 1
\begin{UnknownEnvironment}
\textit{Cas.} [ma fano cavechie de legno e con quele conficano le soe nave;]
\end{UnknownEnvironment}
% Please note that at this point, the main text continues
% below right the word “aguti”
ed è grande pericolo a navicare \dots Egli è vero che vi viene un vento$^2$ talvolta la sate,
% Comment 2
\begin{UnknownEnvironment}
\textit{Pad.} [de verso uno destro de sabione ch'é atorno de quel punto]
\end{UnknownEnvironment}
% Even in this case, the main text continues below right “aguti”
di verso lo sabbion, con tanto caldo che \dots
更清楚地说,我希望所有注释和所有主要文本都保留在页面的主要部分,并且注释都是可重入的,并且都允许主要文本从中断的同一点继续。
有没有一个包既可以在环境中进行缩进注释,又可以在这样的注释之后,主文本继续在下一个单词的右下方?提前谢谢!
答案1
如果您想要对齐文本,可以使用 zref-savepos 包来存储注释前文本结束的位置。请注意,它需要进行一些编译,直到所有引用都得到解析:
\documentclass{article}
\usepackage[italian]{babel}
\usepackage{zref-savepos}
\usepackage{changepage}
\newcounter{mycomment}
\newenvironment{UnknownEnvironment}
{\unskip\stepcounter{mycomment}\zsavepos{endpar\the\value{mycomment}}%
\par\bigskip%
\bfseries%
\begin{adjustwidth}{3cm}{0cm}}
{\end{adjustwidth}
\par\bigskip
\noindent\hspace*{\dimexpr\zposx{endpar\the\value{mycomment}}sp-\oddsidemargin-1in}\ignorespaces}
\begin{document}
Main Text
Non hanno ferro per fare aguti;
% Comment 1
\begin{UnknownEnvironment}
\textit{Cas.} [ma fano cavechie de legno e con quele conficano le soe nave;]
\end{UnknownEnvironment}
ed è grande pericolo a navicare \dots Egli è vero che vi viene un vento$^2$ talvolta la sate,
% Comment 2
\begin{UnknownEnvironment}
\textit{Pad.} [de verso uno destro de sabione ch'é atorno de quel punto]
\end{UnknownEnvironment}
% Even in this case, the main text continues below right �aguti�
di verso lo sabbion, con tanto caldo che \dots
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet ante a turpis pulvinar, quis pharetra lorem finibus. Sed iaculis ritus sed molestie elementum. Duis porta maximus velit quis imperdiet. Sed nec lacis vitae nisl rutrum accumsan. Nam molestie purus hendrerit ex tempus volutpat. Donec luctus,
\begin{UnknownEnvironment}
Some example text
\end{UnknownEnvironment}
nulla nec molestie eleifend, lectus sapien rhoncus nisl, id maximus diam ex sed metus. Present volutpat eu mi in vehicula. In lobortis vitae magna at finibus. Phasellus tempor urna eros, consequat blandit sem rhoncus a. Aliquam erat volutpat. Aliquam venenatis maximus felis, vel feugiat mauris tincidunt mattis. Maecenas accumsan metus nec tortor tempor maximus.%
\end{document}
答案2
这是使用 -package 的解决方案linegoal
。它有一个很大的缺陷,即它只适用于\raggedright
-text。不过,我相信有一个聪明的解决方案可以解决这个问题。
所创建环境的缩进是通过changepage
-package 和adjustwidth
-environment 创建的。当然还有其他选择。
输出
代码
\documentclass{article}
\usepackage{linegoal}
\usepackage{changepage}
\newlength{\previousLine}
\newenvironment{UnknownEnvironment}
{%
\setlength{\previousLine}{\linewidth}%
\addtolength{\previousLine}{-\linegoal}
\par\bigskip%
\bfseries%
\begin{adjustwidth}{3cm}{0cm}%
}
{%
\end{adjustwidth}
\par\bigskip%
\hspace*{\previousLine}%
}
\raggedright
\begin{document}
Main Text
Non hanno ferro per fare aguti;
% Comment 1
\begin{UnknownEnvironment}
\textit{Cas.} [ma fano cavechie de legno e con quele conficano le soe nave;]
\end{UnknownEnvironment}%
% Please note that at this point, the main text continues
% below right the word �aguti�
ed è grande pericolo a navicare \dots Egli è vero che vi viene un vento$^2$ talvolta la sate,
% Comment 2
\begin{UnknownEnvironment}
\textit{Pad.} [de verso uno destro de sabione ch'é atorno de quel punto]
\end{UnknownEnvironment}%
% Even in this case, the main text continues below right �aguti�
di verso lo sabbion, con tanto caldo che \dots
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet ante a turpis pulvinar, quis pharetra lorem finibus. Sed iaculis ritus sed molestie elementum. Duis porta maximus velit quis imperdiet. Sed nec lacis vitae nisl rutrum accumsan. Nam molestie purus hendrerit ex tempus volutpat. Donec luctus,
\begin{UnknownEnvironment}
Some example text
\end{UnknownEnvironment}%
nulla nec molestie eleifend, lectus sapien rhoncus nisl, id maximus diam ex sed metus. Present volutpat eu mi in vehicula. In lobortis vitae magna at finibus. Phasellus tempor urna eros, consequat blandit sem rhoncus a. Aliquam erat volutpat. Aliquam venenatis maximus felis, vel feugiat mauris tincidunt mattis. Maecenas accumsan metus nec tortor tempor maximus.%
\end{document}