我怎样才能用 \cite 抑制一定范围的引用?

我怎样才能用 \cite 抑制一定范围的引用?

我搜索了已经存在的问题,但找不到我想要的东西(因为它总是与我想要实现的目标相反或不是同一个问题),所以我决定问这个问题:

如何在文档中使用 citestyle=numeric-comp 暂时禁用 biblatex 的参考范围选项?

我的 MWE:

\documentclass{article}

\usepackage[
backend = biber,
bibencoding = utf8,
sorting = none,
citestyle = numeric-comp
]{biblatex}


\addbibresource{Quellen/Literaturdatenbank.bib}


\begin{document}

    Citing in the text \textbf{should} use compression/range: \cite{doubleshift-rano,diss-huang,getriebebuch2016,dedizierteHybrid2019} (correct) \\
    
    Within a specific part of the document (in a table) I want to use \textbf{no} range of references and I want to see every number of the used references: \cite{doubleshift-rano,diss-huang,getriebebuch2016,dedizierteHybrid2019} (incorrect) \\
    
    Above it should look like: [1,2,3,4]
    
    \clearpage
    
    \printbibliography[
    heading = bibintoc,
    title = Literaturverzeichnis,
    ]

\end{document}

结果如下:

在此处输入图片描述

但在第二段中我想停用“numeric-comp” 的范围功能暂时地.这可能吗?

我的references.bib是:

@article{
    doubleshift-rano,
    author   = {Vanja Ranogajec and Jo\v{s}ko Deur and Vladimir Ivanović and H. Eric Tseng},
    title    = {Multi-objective parameter optimization of control profiles for automatic transmission double-transition shifts},
    journal  = {Control Engineering Practice},
    volume   = {93},
    year     = {2019}
}

@book{
    diss-huang,
    author    = {Hua Huang},
    title     = {Model-based calibration of automated transmissions},
    publisher = {Universitätsverlag der TU Berlin},
    year      = {2016}
}

@book{
    getriebebuch2016,
    author    = {Robert Fischer and Ferit Kü\c{c}ükay and Gunter Jürgens and Burkhard Pollak},
    title     = {Das Getriebebuch - 2., überarbeitete Auflage},
    publisher = {Springer Vieweg},
    year      = {2016}
}

@inbook{dedizierteHybrid2019,
    author    = {Andreas Kinigadner and Christian Lauinger and Laurent Bayoux},
    title     = {Dedizierte Hybridgetriebe},
    booktitle = {Elektrifizierung des Antriebsstrangs - Grundlagen - vom Mikro-Hybrid zum vollelektrischen Antrieb},
    year      = {2019},
    publisher = {Springer Vieweg},
    pages     = {171-182}
}

提前谢谢您!

问候,托马斯

答案1

您可以根据数字样式定义另一个引用命令。我在逗号后留了空格,numeric-comp 中也有。

不要\\在段落末尾使用。

\documentclass{article}

\usepackage[
backend = biber,
bibencoding = utf8,
sorting = none,
citestyle = numeric-comp
]{biblatex}


\addbibresource{biblatex-examples.bib}

\newbibmacro*{citeext}{%
  \printtext[bibhyperref]{%
    \printfield{labelprefix}%
    \printfield{labelnumber}%
    \ifbool{bbx:subentry}
      {\printfield{entrysetcount}}
      {}}}


\DeclareCiteCommand{\citeext}[\mkbibbrackets]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{citeext}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\begin{document}

    Citing in the text \textbf{should} use compression/range: \cite{doody,herrmann,angenendt,baez/article} (correct),
    \cite{doody,herrmann,baez/article}

    Within a specific part of the document (in a table) I want to use \textbf{no} range of references and I want to see every number of the used references: \citeext{herrmann,angenendt,baez/article,doody} (incorrect) 

    Above it should look like: [1,2,3,4]

  \printbibliography

\end{document}

在此处输入图片描述

相关内容