I want to put some code from a .sty in the main .tex file, but I don't know how to do this. I have copy-pasted the code from the .sty file into the preamble of my .tex file, but I get errors, while everything was fine when I just used the .sty file.
Here's the relevant part of my .tex:
Code: Select all
%\usepackage{natbibspacing}
\newdimen\bibspacing
\setlength\bibspacing\z@
\renewenvironment{thebibliography}[1]{%
\bibfont\bibsection\parindent \z@\list
{\@biblabel{\arabic{NAT@ctr}}}{\@bibsetup{#1}%
\setcounter{NAT@ctr}{0}}%
\ifNAT@openbib
\renewcommand\newblock{\par}
\else
\renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
\fi
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax
\let\citeN\cite \let\shortcite\cite
\let\citeasnoun\cite
\itemsep\bibspacing %
\parsep\z@skip %
}{\def\@noitemerr{%
\PackageWarning{natbib}
{Empty `thebibliography' environment}}%
\endlist\vskip-\lastskip}
Code: Select all
[LaTeX] myfile-0.6.2.tex => myfile-0.6.2.dvi (latex)
[LaTeX] finished with exit status 1
myfile-0.6.2.tex:11:Undefined control sequence. \setlength\bibspacing\z
myfile-0.6.2.tex:11:Missing number, treated as zero. \setlength\bibspacing\z
myfile-0.6.2.tex:11:Illegal unit of measure (pt inserted). \setlength\bibspacing\z
myfile-0.6.2.tex:11:Missing \begin{document}. \setlength\bibspacing\z@
myfile-0.6.2.tex:293:Undefined control sequence. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Missing number, treated as zero. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Illegal unit of measure (pt inserted). \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Undefined control sequence. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Extra \else. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Extra \fi. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Undefined control sequence. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Missing number, treated as zero. \begin{thebibliography}{28}
myfile-0.6.2.tex:293:Illegal unit of measure (pt inserted). \begin{thebibliography}{28}
myfile-0.6.2.tex:299:Something's wrong--perhaps a missing \item. ...Jan, Piet, and Klaas}]{Henk2007}
myfile-0.6.2.tex:299:Something's wrong--perhaps a missing \item. ...Jan, Piet, and Klaas}]{Henk2007}
myfile-0.6.2.tex:299:Something's wrong--perhaps a missing \item. ...Jan, Piet, and Klaas}]{Henk2007}
I would use just .sty file instead of putting the code in my .tex, but the submission system of the journal I am going to submit my paper to (Ecology) only allows one LaTeX file to be uploaded.
Help would be much appreciated!