如何在文件中重新定義段落樣式(然後傳回預設值)?

如何在文件中重新定義段落樣式(然後傳回預設值)?

我更喜歡手動建立我的參考書目,因為我對格式很挑剔,並且我需要每個參考書目條目都有一個懸掛縮排和一個空白行。我用這段程式碼做得很好:

\documentclass[12pt]{memoir}
\begin{document}
\par \noindent \hangindent=0.9cm Leyser, Karl J. \textit{Medieval Germany and Its Neighbours, 900--1250}. London, England: The Hambledon Press, 1982.\\
\par \noindent \hangindent=0.9cm Marongiu, Antonio. ``A Model State in the Middle Ages: The Norman and Swabian Kingdom of Sicily.'' \textit{Comparative Studies in Society and History} 6, iii (1964): 307--320.\\
\end{document}

等等,但我確信有一種方法可以透過在章節開頭重新定義段落樣式來一次保存所有這些格式。

我嘗試了 titlesec 包,但我擔心雖然我過去用它來格式化我的章節標題,但我不知道足夠的知識來讓它在這種情況下工作。

如果有人能指出我正確的方向,或告訴我如何在參考書目末尾切換回預設段落樣式,我將非常感激...

先感謝您!

答案1

只需使用內建機制,即list

\documentclass[12pt]{memoir}

\usepackage{lipsum}

\newenvironment{mybib}
 {\section*{\bibname}
  \list{}{%
    \topsep=0pt
    \partopsep=0pt
    \parsep=0pt
    \leftmargin=0.9cm
    \itemindent=-\leftmargin
    \itemsep=\baselineskip}}
 {\endlist}

\begin{document}

\lipsum[2]

\begin{mybib}

\item Leyser, Karl J. \textit{Medieval Germany and Its Neighbours, 900--1250}. 
London, England: The Hambledon Press, 1982.

\item Marongiu, Antonio. ``A Model State in the Middle Ages: The Norman and 
Swabian Kingdom of Sicily.'' \textit{Comparative Studies in Society and History} 
6, iii (1964): 307--320.

\end{mybib}

\end{document}

在此輸入影像描述

答案2

natbib是一個強大的替代方案:

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage[authoryear]{natbib}
\setlength{\bibsep}{1\baselineskip}
\setlength{\bibhang}{0.9cm}

\begin{document}
\lipsum[2]

\begin{thebibliography}{}
\bibitem[Leyser(1982)]{ley82} Leyser, Karl J. \textit{Medieval Germany
    and Its Neighbours, 900--1250}.  London, England: The Hambledon
  Press, 1982.
\bibitem[Marongiu(1964)]{mar64} Marongiu, Antonio. ``A Model State in
  the Middle Ages: The Norman and Swabian Kingdom of Sicily.''
  \textit{Comparative Studies in Society and History} 6, iii (1964):
  307--320.
\end{thebibliography}
\end{document}

在此輸入影像描述

答案3

使用\everypar{}\parskip


微量元素


\documentclass[12pt]{memoir}
\usepackage{kantlipsum}
\begin{document}
\kant[2]
\section*{References}
{\parindent0pt
\parskip\baselineskip
\everypar{\hangindent.9cm}

Leyser, Karl J. \textit{Medieval Germany and Its Neighbours, 900--1250}.
London, England: The Hambledon Press, 1982.

Marongiu, Antonio. ``A Model State in the Middle Ages: The Norman 
and Swabian Kingdom of Sicily.'' \textit{Comparative Studies in 
Society and History} 6, iii (1964): 307--320.

}    
\end{document}

相關內容