[Tex/LaTex] bibtex – how to check .bst for errors

bibtex

I'm trying to create a bibliography with bibtex. It took me quite a long time to find good styling file for bibtex which suits my needs. The deal is, that it hadn't ONLINE reference function, so I used another .bst file. After I copied this fc. it was calling another, so I copied it as well – this exact problem was gone. I'm using XeLatex.
BUT NOW IT SAYS:

! 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.

AND WHAT I HAVE ADDED:

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
}

THIS IS WHAT BIB ENTRY SHOULD LOOK LIKE FOR .BST I COPIED FROM:

@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"
}

I AM WELL AWARE THAT THERE IS SOME PROBLEM WITH MY MODIFIED BST FILE, SO I WOULD LIKE TO ASK… IS THERE A WAY TO CHECK IT FOR ERRORS (from what I understood 'latex makebst' isn't the one)? I will gladly provide more info, or files.

EDIT:

MY ENTRY:

@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}
}

As you can see I tried to replace "" with {}, but to no avail… so I suppose that they have the same meaning for compiler.

BBL ENTRY:

\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}

Best Answer

The error is unrelated to bibtex (other than it was bibtex that generated the bad latex) In

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

The % is TeX's comment character so latex just sees

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

so the \texttt and the math $ are never closed and you get the errors that you quoted.

the $ were never doing anything useful, so they could just be deleted, but rather than \texttt you need a command that deals with special characters in URL such as %, ~ and #. Obvious choice is \url from the url (or hyperref) package that will make those characters safe and also allow line breaking at good places like /.

So something like

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

and

\usepackage{url}

in your document (or package).

Related Question