[Tex/LaTex] Unknown package calc error in bibliography

bibliographieserrorslists

I am using a style file prescribed by Riton Press to write an article. They have a bibliography format (described in their style file as):

\renewenvironment{thebibliography}[1]
        {\frenchspacing
         \small\rm\baselineskip=11pt
         \begin{list}{\arabic{enumi}.}
        {\usecounter{enumi}\setlength{\parsep}{0pt}     
%          \setlength{\leftmargin 12.7pt}{\rightmargin 0pt}%FOR 1--9 ITEMS
         \setlength{\leftmargin 17pt}{\rightmargin 0pt}  %FOR 10--99 ITEMS
%         \setlength{\leftmargin 22pt}{\rightmargin 0pt}   %FOR 100+ABOVE ITEMS
         \setlength{\itemsep}{0pt} \settowidth
          {\labelwidth}{#1.}\sloppy}}{\end{list}}

However, this keeps giving the following error while compiling the tex file:

! Package calc Error: `0' invalid at this point.

See the calc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.1 \begin{thebibliography}{10}

? 
! Missing number, treated as zero.
<to be read again> 
                   \protect 
l.1 \begin{thebibliography}{10}

? 
! Illegal unit of measure (pt inserted).
<to be read again> 
                   \protect 
l.1 \begin{thebibliography}{10}

? 

! LaTeX Error: \begin{list} on input line 1 ended by \end{thebibliography}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.136 \end{thebibliography}

? 
) [32

]

But if I ignore these errors, all the references are displayed. It displays the text "pt!" in the references page.

here

Kindly help me know how I can avoid the errors from the bibliography part.

Best Answer

 \setlength{\leftmargin 17pt}{\rightmargin 0pt}

(tries to) set a length register called \leftmargin17pt to the value \rightmargin0pt

By an accident of the original definition of \setlength this does not generate an error and sets \leftmargin to 17pt and \rightmargin to 0pt by luck.

If you load calc your luck changes.