我正在尝试编辑 abnt 样式,以便打印参考
- 丢失 URL 周围的“<”和“>”
- Sl: sn 斜体
- 我如何将引用 (Instruments, 2019) 更改为 (National Instuments, 2019),就像 bibtex 与 red hat 的结合一样。
- 当有两篇文章属于同一作者时,它会打印每个引用的作者姓名(现在第二个引用用 _______ 代替作者姓名)我创建了一个简化的 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
应该解决
\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace\url{#1}}
中的原始定义
abnt.bbx
是\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\addspace<\url{#1}>}%
。 也可以看看艾伦·芒恩的评论您可以使用以下方式将斜体直接添加到相关的 bibstring 中
\DefineBibliographyStrings{brazil}{% sineloco = {\mkbibemph{s\adddot l\adddot}}, sinenomine = {\mkbibemph{s\adddot n\adddot}}, }
\bibstring{sineloco}
或者您可以对和的每次调用添加强调\bibstring{sinenomine}
。由于有多个这样的调用,因此\mkbibemph
直接添加到 bibstring 的方法更快。我不太确定我是否认为\mkbibemph
直接添加到 bibstring 是概念上最好的解决方案,但是...所谓的公司作者应该用一对额外的花括号括起来,以避免被解析并拆分为家人和名字,如人名。参见在书目条目的“作者”字段中使用“公司作者”(完整拼写出姓名)。 你需要
author = "{National Instruments}",
和
author = "{Red Hat, Inc.}",
如果你只想在后者的引文中看到“Red Hat”,你可以添加
shortauthor = {{Red Hat}},
尝试选项
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}