我一直无法在自定义环境中使用段落缩进。\setlength
没有按预期设置缩进的长度。每个段落(或在本例中为参考书目条目)应该有 17pt 的悬挂缩进。
因为我所有的引用都是手写的(我没有使用任何 bib 文件),所以我没有使用参考书目环境(但如果您认为有办法使用该环境获得所需的结果,请告诉我!)
梅威瑟:
\documentclass{book}
\newenvironment{mybibliography}{
\setlength{\parskip}{6pt}
\setlength{\parindent}{0pt}
\setlength{\hangindent}{17pt}
}
\begin{document}
\chapter*{Bibliography}
\begin{mybibliography}
Jack Smith, `Hello World: An analysis of the origins of the universe' (2014) 44(3) \textit{Journal of Something} 45.
Jack Smith, `Hello World: An analysis of the origins of the universe' (2014) 44(3) \textit{Journal of Something} 45.
\end{mybibliography}
\end{document}
答案1
\hangindent
每段结束时的值都会被重置。您需要将其恢复。
\documentclass{book}
\newenvironment{mybibliography}
{%
\par
\setlength{\parskip}{6pt}%
\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{17pt}}%
}
{\par}% <-- don't forget
\begin{document}
\chapter*{Bibliography}
\begin{mybibliography}
Jack Smith, `Hello World: An analysis of the origins of the universe'
(2014) 44(3) \textit{Journal of Something} 45.
Jack Smith, `Hello World: An analysis of the origins of the universe'
(2014) 44(3) \textit{Journal of Something} 45.
\end{mybibliography}
\end{document}