I am using the natbib
package and a custom .bst
file. I am not very familiar with LaTeX unfortunately. The document is able to compile and produce a PDF, but I dont know what the error means. I am using MiKTeX and TeXstudio. This is my .bib
entry:
@book{fysikbog,
title = {Physics for Scientists and Engineers, 7th edition},
author = {John W. Jewett and Raymond A. Serway},
year = {2008},
number = {ISBN: 0-495-11240-2},
series = {Paperback},
publisher = {Thomson Learning}
}
This is my .bst
file:
https://gist.github.com/rmagni/86813d2eb62ccf6d36e497ac21d425e2
MWE:
\documentclass[a4paper,11pt,fleqn,dvipsnames,twoside,openright]{memoir}
\usepackage[english]{varioref}
\usepackage{natbib}
\bibpunct[,]{[}{]}{;}{a}{,}{,}
\bibliographystyle{Harvard}
\begin{document}
This is a citation. \citep{fysikbog}.
\begingroup
\raggedright
\bibliography{litteratur}
\endgroup
\end{document}
Thrown Error:
1 is an integer literal, not a string, for entry fysikbog
while executing---line 1485 of file Harvard.bst
(There was 1 error message)
Not sure what the relevant part of this is, but this is the part around line 1485 which the error message mentions:
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
}
EXECUTE {end.bib}
Hopefully someone knows what this error means, thanks!
Best Answer
The
.bst
file has a faulty function definition (ll. 464-472)The
month empty$
is hanging around there for no reason and causes a 1 to appear on the stack that is then not expected by the rest of the file and causes problems.I assume the intended definition is closer to
Furthermore or all calls to
format.year
should be made asformat.year output
and notformat.year output.check
.output.check
expects another argument that is not present in the incorrect calls. Simply replace all occurrences offormat.year output.check
withformat.year output
.I have uploaded a corrected version,
harvard-fixed.bst
, that should work to https://gist.github.com/moewew/170dd99835c17667456738937a5d59d6. You can see the necessary changes in the revision history.