我用indentfirst
它来缩进段落的第一行。但是我在末尾有一个参考书目,我希望每个段落都有悬挂缩进。例如:
\usepackage{indentfirst}
\usepackage{hanging}
\begin{document}
Some paragraphs here with regular indentation.
But then suddenly:
\magicCommandToStopIndentationGoesHere
\magicCommandToStartHangingIndentationGoesHere
And here is my bibliography, with hanging indentation
\end{document}
我该怎么做?我无法修改参考书目中的任何乳胶,也无法包装它,因为它是用 pandoc-citeproc 生成的,所以我希望有像这样的神奇命令。
这是一个最小的工作示例:
\documentclass[]{article}
\usepackage{indentfirst}
\date{}
\begin{document}
%%% This should all have first-line indentation
Hello,
Here is a citation: (Smith 2015, 25).
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
\section*{Works Cited}\label{works-cited}
%%% I can't change anything from here on, since it's automatically generated
%%% This needs to have hanging indentation
Smith, John. 2015. \emph{A Book}. But Imagine if this Publisher had a
really really long name or something that was overflowing; it needed to
be indented hanging-wise Book Press.
\end{document}
答案1
您可以使用\everypar
来设置参考书目的布局:
使用段落设置定义一个新的宏:
\newcommand{\hangworkscited}{%
\parindent 0em\parskip 1ex
\everypar={\hangindent 1.3em}}
然后在你的之后调用它参考文献节标题。
平均能量损失
\documentclass[]{article}
\usepackage{indentfirst}
\date{}
\newcommand{\hangworkscited}{%
\parindent 0em\parskip 1ex
\everypar={\hangindent 1.3em}}
\begin{document}
%%% This should all have first-line indentation
Hello,
Here is a citation: (Smith 2015, 25).
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
\section*{Works Cited}\label{works-cited}
\hangworkscited
%%% I can't change anything from here on, since it's automatically generated
%%% This needs to have hanging indentation
Smith, John. 2015. \emph{A Book}. But Imagine if this Publisher had a
really really long name or something that was overflowing; it needed to
be indented hanging-wise Book Press.
Smith, John. 2015. \emph{A Book}. But Imagine if this Publisher had a
really really long name or something that was overflowing; it needed to
be indented hanging-wise Book Press.
Smith, John. 2015. \emph{A Book}. But Imagine if this Publisher had a
really really long name or something that was overflowing; it needed to
be indented hanging-wise Book Press.
\end{document}