BibLaTeX:在 bibenvironment 中使用枚举时的间距

BibLaTeX:在 bibenvironment 中使用枚举时的间距

除了正常的biblenvironmentBibLaTeX我还创建了第二个 ,它使用\enumerate而不是\list。对于这两个列表,我想使用不同的\bibitemsep。但是,更改相应的长度只会影响正常的 bibenvironment。我该如何解决这个问题?

梅威瑟:

\documentclass{article}

\usepackage[backend=biber,style=authoryear]{biblatex}

\setlength{\bibitemsep}{0em} 

\defbibenvironment{enum}
  {\enumerate
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endenumerate}
  {\item}  

\begin{filecontents}{bibo.bib}
@article{greenwade93,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}

@article{bluewade93,
    author  = "George D. Bluewade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}
\end{filecontents}
\addbibresource{bibo.bib}

\begin{document}

 \nocite{*}

 \printbibliography[title={List With Correct Spacing}]

 \printbibliography[env=enum,title={Enumerate Without Correct Spacing}]

\end{document}

答案1

使用列表时,我发现加载 通常会更好。它具有与您的关注点相关的enumitem选项noitemsep和。nosep

\documentclass{article}

\usepackage[backend=biber,style=authoryear]{biblatex}

%\setlength{\bibitemsep}{0em}

\usepackage{enumitem}
%\setlist{noitemsep}% probably better to use here

\defbibenvironment{enum}
  {\enumerate[noitemsep] % not exactly recommended...
     {}%
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endenumerate}
  {\item}

\usepackage{filecontents}
\begin{filecontents}{bibo.bib}
@article{greenwade93,
    author  = {George D. Greenwade},
    title   = {The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})},
    year    = {1993},
    journal = {TUGBoat},
    volume  = {14},
    number  = {3},
    pages   = {342--351},
    addendum = {PS: \the\parsep; PTS: \the\partopsep; TS: \the\topsep;
      BIS: \the\bibitemsep; II: \the\itemindent; IS: \the\itemsep;
      BIS: \the\bibitemsep; BPS: \the \bibparsep;},
}

@article{bluewade93,
    author  = {George D. Bluewade},
    title   = {The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})},
    year    = {1993},
    journal = {TUGBoat},
    volume  = {14},
    number  = {3},
    pages   = {342--351}
}
\end{filecontents}
\addbibresource{bibo.bib}

\begin{document}

\nocite{*}

\printbibliography[title={List With Correct Spacing}]

\printbibliography[env=enum,title={Enumerate Without Correct Spacing}]

\end{document}

相关内容