如何删除参考书目环境中的左缩进,以便章节标题“文章”和参考书目项目与文档中的所有其他章节和段落对齐?
\documentclass{book}
\makeatletter
\def\@bibitem#1{\item[]%
\if@filesw\immediate\write\@auxout{\string \bibcite {#1}{\the\value{\@listctr }}}\fi\ignorespaces}
\makeatletter
\begin{document}
\chapter{Chapter 1}
\section{Hello world}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nec tincidunt diam, eu porta nibh.
\begin{thebibliography}{99}
\section*{Articles}
\bibitem{} Kahneman, Daniel, Jack Knetsch, and Richard Thaler, `Anomalies: The endowment effect, loss aversion, and status quo bias’ (1991) 5(1) \textit{Journal of Economic Perspectives} 193.
\end{thebibliography}
\end{document}
答案1
请注意,此方法存在一些限制。\section*
不应放在 内thebibliography
,这不适用于细分书目。例如,如果您想添加缩进,请使用
\patchcmd{\thebibliography}{\leftmargin\labelwidth}{\leftmargin1cm\itemindent-1cm}{}{}
章节标题也将缩进,并且需要进一步调整。我邀请您考虑使用 编写参考书目的可能性biblatex
。无论如何,这是您问题的 MWE:
\documentclass{book}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\thebibliography}{\leftmargin\labelwidth}{\leftmargin0pt}{}{}
\patchcmd{\thebibliography}{\labelsep}{0pt}{}{}
\patchcmd{\@bibitem}{\item}{\item[]}{}{}
\makeatletter
\begin{document}
\chapter{Chapter 1}
\section{Hello world}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nec tincidunt diam, eu porta nibh.
\begin{thebibliography}{99}
\section*{Articles}
\bibitem{} Kahneman, Daniel, Jack Knetsch, and Richard Thaler, `Anomalies: The endowment effect, loss aversion, and status quo bias’ (1991) 5(1) \textit{Journal of Economic Perspectives} 193.
\end{thebibliography}
\end{document}