我注意到命令行pybtex-format
工具为 HTML 生成了一个公平的输出:
$ pybtex-format myinput.bib myoutput.html
所以我去了源代码,pybtex/database/format/__main__.py
发现了一个非常简单的解决方案,对我来说就像一个魅力:
from pybtex.database.format import format_database
format_database('myinput.bib', 'myoutput.html', 'bibtex', 'html')
这是我的输入和输出文件:
@inproceedings{Batista18b,
author = {Cassio Batista and Ana Larissa Dias and Nelson {Sampaio Neto}},
title = {Baseline Acoustic Models for Brazilian Portuguese Using Kaldi Tools},
year = {2018},
booktitle= {Proc. IberSPEECH 2018},
pages = {77--81},
doi = {10.21437/IberSPEECH.2018-17},
url = {http://dx.doi.org/10.21437/IberSPEECH.2018-17}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head><meta name="generator" content="Pybtex">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bibliography</title>
</head>
<body>
<dl>
<dt>1</dt>
<dd>Cassio Batista, Ana Larissa Dias, and Nelson <span class="bibtex-protected">Sampaio Neto</span>.
Baseline acoustic models for brazilian portuguese using kaldi tools.
In <em>Proc. IberSPEECH 2018</em>, 77–81. 2018.
URL: <a href="http://dx.doi.org/10.21437/IberSPEECH.2018-17">http://dx.doi.org/10.21437/IberSPEECH.2018-17</a>, <a href="https://doi.org/10.21437/IberSPEECH.2018-17">doi:10.21437/IberSPEECH.2018-17</a>.</dd>
</dl></body></html>