如何修改 biblatex abnt 样式

如何修改 biblatex abnt 样式

我正在尝试编辑 abnt 样式,以便打印参考

  1. 丢失 URL 周围的“<”和“>”
  2. Sl: sn 斜体
  3. 我如何将引用 (Instruments, 2019) 更改为 (National Instuments, 2019),就像 bibtex 与 red hat 的结合一样。
  4. 当有两篇文章属于同一作者时,它会打印每个引用的作者姓名(现在第二个引用用 _______ 代替作者姓名)我创建了一个简化的 tex 文件,这样我就可以摆弄代码来找到解决方案,但我无法找到我正在处理的 tex 和 bib 文件。感谢您的帮助。

 \documentclass{article}
 \usepackage[T1]{fontenc}       
 \usepackage[utf8]{inputenc}        
 \usepackage[brazil]{babel}     
 \usepackage{csquotes}

 \usepackage[style=abnt,backend=biber,citecounter=true,backrefstyle=three]{biblatex}
 \DefineBibliographyStrings{brazil}{%
 }

 \bibliography{ref}
 \begin{document}

 \section{Introduction}
 \cite{website:ArduinoLabview}
 \cite{website:OPENSOURCESW}
 \cite{website:OPENSOURCEHW}
 \printbibliography

 \end{document}

和 bib 文件

@misc{website:ArduinoLabview,
      author = "National Instruments",
      title = "Arduino™ Compatible Compiler for LabVIEW by Aledyne-TSXperts",
      year = "2019",
      url = "https://www.tsxperts.com/arduino-compatible-compiler-for-labview/",
      urldate     = {2019-06-07}
}

@misc{website:OPENSOURCEHW,
      author = "Red Hat, Inc.",
      title = "What is open hardware?",
      %year = "2012",
      url = "https://opensource.com/resources/what-open-hardware",
      urldate = {2019-06-07}
}

@misc{website:OPENSOURCESW,
      author = "Red Hat, Inc.",
      title = "What is open source?",
      %year = "2012",
      url = "https://opensource.com/resources/what-open-source",
      urldate = {2019-06-07}
}

答案1

  1. 应该解决

    \DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace\url{#1}}
    

    中的原始定义abnt.bbx\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace<\url{#1}>}%。 也可以看看艾伦·芒恩评论

  2. 您可以使用以下方式将斜体直接添加到相关的 bibstring 中

    \DefineBibliographyStrings{brazil}{%
      sineloco     = {\mkbibemph{s\adddot l\adddot}},
      sinenomine   = {\mkbibemph{s\adddot n\adddot}},
    }
    

    \bibstring{sineloco}或者您可以对和的每次调用添加强调\bibstring{sinenomine}。由于有多个这样的调用,因此\mkbibemph直接添加到 bibstring 的方法更快。我不太确定我是否认为\mkbibemph直接添加到 bibstring 是概念上最好的解决方案,但是...

  3. 所谓的公司作者应该用一对额外的花括号括起来,以避免被解析并拆分为家人和名字,如人名。参见在书目条目的“作者”字段中使用“公司作者”(完整拼写出姓名)。 你需要

    author = "{National Instruments}",
    

    author = "{Red Hat, Inc.}",
    

    如果你只想在后者的引文中看到“Red Hat”,你可以添加

    shortauthor = {{Red Hat}},
    

    这也提到了艾伦·芒恩 在评论中

  4. 尝试选项repeatfields=true,。例如参见https://github.com/abntex/biblatex-abnt/issues/43。标准样式和一些贡献的样式具有类似的功能,可以使用名为 的选项打开或关闭dashed。例如,请参阅在参考书目中两次获得全名

把所有这些放在一起,我们得到

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{csquotes}

\usepackage[style=abnt, backend=biber, 
  repeatfields=true,
  citecounter=true, backrefstyle=three]{biblatex}

\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace\url{#1}}

\DefineBibliographyStrings{brazil}{%
  sineloco     = {\mkbibemph{s\adddot l\adddot}},
  sinenomine   = {\mkbibemph{s\adddot n\adddot}},
}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{website:ArduinoLabview,
  author  = {{National Instruments}},
  title   = {Arduino™ Compatible Compiler for LabVIEW by Aledyne-TSXperts},
  year    = {2019},
  url     = {https://www.tsxperts.com/arduino-compatible-compiler-for-labview/},
  urldate = {2019-06-07},
}
@misc{website:OPENSOURCEHW,
  author      = {{Red Hat, Inc.}},
  shortauthor = {{Red Hat}},
  title       = {What is open hardware?},
  url         = {https://opensource.com/resources/what-open-hardware},
  urldate     = {2019-06-07}
}
@misc{website:OPENSOURCESW,
  author      = {{Red Hat, Inc.}},
  shortauthor = {{Red Hat}},
  title       = {What is open source?},
  url         = {https://opensource.com/resources/what-open-source},
  urldate     = {2019-06-07}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{website:ArduinoLabview}
\cite{website:OPENSOURCESW}
\cite{website:OPENSOURCEHW}
\printbibliography
\end{document}

ABNT 修改了参考书目,URL 周围没有尖括号,并使用斜体表示“sl”和“sn”,并且作者姓名重复。

相关内容