[Tex/LaTex] Problem with sorting literature order by entry type (misc, book,…) in BiBTeX

bibliographiesbibtexsorting

EDIT: I edited a "main" file and I added a .bib file.

I have problem with BibTeX – concretely with sorting literature order by entry type. The .cls file is HERE and .bst file is HERE.

Error:

! LaTeX Error: Command \bibhang already defined.
Or name \end... illegal, see p.192 of the manual.

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

l.402 \newlength{\bibhang}

?

Document:

\documentclass[thesis=B,czech]{FITthesis}[2012/06/26]

\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage{dirtree}
\usepackage[square,sort,comma,numbers]{natbib}
\usepackage[defernumbers=true]{biblatex}


\department{text}
\title{text}
\authorGN{text}
\authorFN{text}
\authorWithDegrees{text}
\supervisor{text}
\acknowledgements{text}
\abstractCS{text}
\abstractEN{text}
\placeForDeclarationOfAuthenticity{text}
\declarationOfAuthenticityOption{1}
\keywordsCS{text}
\keywordsEN{text}

\begin{document}

\begin{introduction}
    %
\end{introduction}

\chapter First

    \cite{alfa}
    \cite{beta}
    \cite{gama}
    \cite{delta}

\begin{conclusion}
    %
\end{conclusion}

\bibliographystyle{csn690}
\bibliography{mybibliographyfile}

\appendix

\end{document}

.bib file:

@BOOK{gama,
 author = {Gama},
 title = {1.},
 subtitle = {Gama},
 address = {Gama},
 publisher = {Gama},
 year = {Gama},
}

@MISC{delta,
  Author = {2.},
  Institution = {Delta},
  note = {Delta},
  Year = {2000},
  Title = {Delta}
}

@MASTERTHESIS{beta,
  author = {Beta},
  title = {3.},
  year = {2000},
  school = {Beta},
  type = {Beta},
  url = {http://www.beta.com},
}

@MANUAL{alfa,
    title = "4.",
    url = "http://www.alfa.com",
}

Thank you!

Best Answer

To solve the error with macro \bibhang comment the call of biblatex (both natbib and biblatex defines a macro \bibhang):

\usepackage[square,sort,comma,numbers]{natbib}
%\usepackage[defernumbers=true]{biblatex}

To use package biblatex you have to change some lines in your MWE:

  • change \bibliography{mybibliographyfile} to \printbibliography
  • add after calling package biblatex the macro \addbibresource{mybibliographyfile.bib}
  • comment %\usepackage[square,sort,comma,numbers]{natbib}
  • To use BibTeX with biblatex add the biblatex option ,backend=bibtex
  • Do not use bibliographystyle csn690 with BibLaTeX.

Because you don't specified which error you have with the sorting I can't help you there. I suugest you can ask a follow up question for this.

So this should compile:

\documentclass[thesis=B,czech]{FITthesis}[2012/06/26]

\usepackage[utf8]{inputenc}

\usepackage{graphicx}
%\usepackage{dirtree}
%\usepackage[square,sort,comma,numbers]{natbib}
\usepackage[%
  defernumbers=true
 ,natbib
 ,backend=bibtex
]{biblatex}
\addbibresource{mybibliographyfile.bib}

\department{text}
\title{text}
\authorGN{text}
\authorFN{text}
\authorWithDegrees{text}
\supervisor{text}
\acknowledgements{text}
\abstractCS{text}
\abstractEN{text}
\placeForDeclarationOfAuthenticity{text}
\declarationOfAuthenticityOption{1}
\keywordsCS{text}
\keywordsEN{text}

\begin{document}

\begin{introduction}
    %
\end{introduction}

\chapter First

    \cite{alfa}
    \cite{beta}
    \cite{gama}
    \cite{delta}

\begin{conclusion}
    %
\end{conclusion}

%\bibliographystyle{csn690}
\printbibliography

\appendix

\end{document}
Related Question