Bibliography with natbib package

I am trying to write my report and i have this problem with natbib package. I am using overleaf and i am getting the same error:

LaTeX Error: Can be used only in preamble.

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

                                               l.168 bibliography
               {references}

What i am doing wrong? This my code:

documentclass[12pt,letterpaper]{article}
usepackage[utf8]{inputenc}
usepackage[spanish, es-tabla]{babel}
usepackage[version=3]{mhchem}
usepackage[journal=jacs]{chemstyle}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{makeidx}
usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
usepackage[stable]{footmisc}
usepackage[section]{placeins}
%Paquetes necesarios para tablas
usepackage{longtable}
usepackage{array}
usepackage{xtab}
usepackage{multirow}
usepackage{colortab}

%Paquete para el manejo de las unidades
usepackage{siunitx}
sisetup{mode=text, output-decimal-marker = {,}, per-mode = symbol, qualifier-mode = phrase, qualifier-phrase = { de }, list-units = brackets, range-units = brackets, range-phrase = --}
DeclareSIUnit[number-unit-product = ;] atmosphere{atm}
DeclareSIUnit[number-unit-product = ;] pound{lb}
DeclareSIUnit[number-unit-product = ;] inch{"}
DeclareSIUnit[number-unit-product = ;] foot{ft}
DeclareSIUnit[number-unit-product = ;] yard{yd}
DeclareSIUnit[number-unit-product = ;] mile{mi}
DeclareSIUnit[number-unit-product = ;] pint{pt}
DeclareSIUnit[number-unit-product = ;] quart{qt}
DeclareSIUnit[number-unit-product = ;] flounce{fl-oz}
DeclareSIUnit[number-unit-product = ;] ounce{oz}
DeclareSIUnit[number-unit-product = ;] degreeFahrenheit{SIUnitSymbolDegree F}
DeclareSIUnit[number-unit-product = ;] degreeRankine{SIUnitSymbolDegree R}
DeclareSIUnit[number-unit-product = ;] usgallon{galón}
DeclareSIUnit[number-unit-product = ;] uma{uma}
DeclareSIUnit[number-unit-product = ;] ppm{ppm}
DeclareSIUnit[number-unit-product = ;] eqg{eq-g}
DeclareSIUnit[number-unit-product = ;] normal{eqgperliterof{solución}}
DeclareSIUnit[number-unit-product = ;] molal{moleperkilogramof{solvente}}
usepackage{cancel}
%Paquetes necesarios para imágenes, pies de página, etc.
usepackage{graphicx}
usepackage{lmodern}
usepackage{fancyhdr}
usepackage[left=4cm,right=2cm,top=3cm,bottom=3cm]{geometry}
usepackage{xcolor,soul,framed} %,caption
colorlet{shadecolor}{yellow}
%Instrucción para evitar la indentación
%setlengthparindent{0pt}
%Paquete para incluir la bibliografía
usepackage[backend=bibtex,style=chem-acs,biblabel=dot]{biblatex}
addbibresource{references.bib}

%Formato del título de las secciones

usepackage{titlesec}
usepackage{enumitem}
titleformat*{section}{bfserieslarge}
titleformat*{subsection}{bfseriesnormalsize}

%Creación del ambiente anexos
usepackage{float}
floatstyle{plaintop}
newfloat{anexo}{thp}{anx}
floatname{anexo}{Anexo}
restylefloat{anexo}
restylefloat{figure}

%Modificación del formato de los captions
usepackage[margin=10pt,labelfont=bf]{caption}

%Paquete para incluir comentarios
usepackage{todonotes}

%Paquete para incluir hipervínculos
usepackage[colorlinks=true, 
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = black,
            anchorcolor = blue]{hyperref}

definecolor{mygreen}{rgb}{0,0.6,0}
definecolor{mygray}{rgb}{0.5,0.5,0.5}
definecolor{mymauve}{rgb}{0.58,0,0.82}
definecolor{darkWhite}{rgb}{0.94,0.94,0.94}
usepackage{minted}
%%%%%%%%%%%%%%%%%%%%%%
%Inicio del documento%
%%%%%%%%%%%%%%%%%%%%%%
begin{document}
%TXT
bibliography{references}
end{document}

Thank you for your help!


我找到解决方案,语法应该是:

begin{document}
....
printbibliography

end{document}
链接地址: http://www.djcxy.com/p/33466.html

上一篇: 从Rmarkdown产生PDF

下一篇: 参考文献与natbib包