bibtex - 如何检查 .bst 中的错误

bibtex - 如何检查 .bst 中的错误

我正在尝试使用 bibtex 创建参考书目。我花了很长时间才找到适合我需要的 bibtex 样式文件。问题是,它没有在线参考功能,所以我使用了另一个 .bst 文件。在我复制这个 fc 之后,它调用了另一个,所以我也复制了它 - 这个确切的问题消失了。我正在使用 XeLatex。但现在它说:

! File ended while scanning use of \texttt .
<inserted text>
\par
l.159 \bibliography{literatura}
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
! Missing $ inserted.
<inserted text>
$
l.160
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.160
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Extra }, or forgotten \endgroup.
\par ...m \@noitemerr {\@@par }\fi \else {\@@par }
\fi
l.160
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
[30
] [31
]
! LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.171 \end{document}
Your command was ignored.

我还添加了以下内容:

FUNCTION {format.url}
{ url empty$
{ "" }
{ new.block "Dostupn{\'{e}}~z: $\texttt{<{" url * "}>}$" * }
if$
}

FUNCTION {online} %  CHANGE mudrd8mz 2005-10-12 addign new item type
{ output.bibitem
format.authors output
new.block
format.btitle " [online]" * output
new.sentence
publisher missing$
'skip$
{ publisher output }
if$
year missing$
'skip$
{ format.date "year" output.check }
if$
new.sentence
cited missing$
'skip$
{ "[cit.~" cited * "]" * output }
if$
new.sentence
note output
new.sentence
format.url output
fin.entry
}

这是我复制自 .BST 的 BIB 条目的样子:

@ONLINE{eurydiceictedu2000,
author = "Eurydice",
title = "Information and communication technology in the education systems in
Europe: National education policies, Curricula, Teacher training",
cited = "8.\,6.\,2004",
year = "2004",
url = "http://www.eurydice.org/Doc_intermediaires/others/en/ict.html"
}

我很清楚我修改的 BST 文件存在一些问题,所以我想问一下... 有没有办法检查其中的错误(据我所知,“latex makebst”不是那个)?我很乐意提供更多信息或文件。

编辑:

我的参赛作品:

@ONLINE{houser,
author = {Pavel Houser},
title = {Collegium pro arte antiqua},
cited = {30.\,6.\,2014},
year = {2014},
url = {http://www.collegium.cz/waldorf/hudba/kurzy/rytmicke%20texty.pdf}
}

正如你所见,我试图替换“”{},但无济于事...所以我认为它们对于编译器具有相同的含义。

BBL 入口:

\begin{thebibliography}{1}

\bibitem{houser}
{\sc Houser, P.}
\newblock {\em Collegium pro arte antiqua} [online]. 2014.
[cit.~30.\,6.\,2014].
\newblock Dostupn{\'{e}}~z:
$\texttt{<{http://www.collegium.cz/waldorf/hudba/kurzy/rytmicke%20texty.pdf}>}$.

\end{thebibliography}

答案1

该错误与 bibtex 无关(除了 bibtex 生成了坏的 latex)

$\texttt{<{http://www.collegium.cz/waldorf/hudba/kurzy/rytmicke%20texty.pdf}>}$.

%是 TeX 的注释字符,因此 latex 只会看到

$\texttt{<{http://www.collegium.cz/waldorf/hudba/kurzy/rytmicke

因此\texttt和数学$永远不会关闭,因此您会得到所引用的错误。

它们$从来没做过任何有用的事情,所以它们可以被删除,但\texttt你不需要一个处理 URL 中特殊字符(如%~和)的命令#。显然,选择\url来自url(或hyperref)包,它将使这些字符安全,并允许在 等好的地方换行/

所以就像

{ new.block "Dostupn{\'{e}}~z: \url{" url * "}" * }

\usepackage{url}

在您的文档(或包)中。

相关内容