将“文学”列为一章

将“文学”列为一章

我想将“文学”作为文档索引的一部分。我尝试了这个脚本:

\documentclass[12pt]{article}
\newcommand\ncoverline[1]{\mkern1mu\overline{\mkern-1mu#1\mkern-1mu}\mkern1mu}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel} 

\usepackage{geometry}
\geometry{a4paper,total={160mm,235mm},left=25mm,top=35mm,}

\usepackage{fancyvrb}
\usepackage{fancyhdr, lastpage}
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{\nouppercase\leftmark}
\cfoot{}

\setlength{\headheight}{14.49998pt}
\addtolength{\topmargin}{-2.49998pt}

\usepackage{graphicx} 
\usepackage{subfigure}


\begin{filecontents*}{Bibliografy.bib}
@misc{wikipedia1,
  title = "Scripting language",
  author = "Wikipedia",
  url = "http://en.wikipedia.org/wiki/Scripting_language",
  year = 2014,
}
\end{filecontents*}
\usepackage[numbers]{natbib}

\usepackage{ragged2e}
\usepackage{setspace}
\usepackage{amsmath}


\usepackage{natbib}
\usepackage[noabbrev]{cleveref}

\begin{document}
\include{1-Einleitung_und_Zielsetzung}
\include{2-Grundlagen_und_Stand_der_Forschung}

\newpage
\cite{wikipedia1}
\bibliographystyle{plainnat}
\bibliography{Bibliografy}

\end{document}

但结果中的“Literatur”没有被编号,并且有一个额外的“[1]”,我想要看到的是:“3 Literatur” “[1] ..........”

我将非常感谢您的所有帮助,很抱歉我的问题,但我是 Latex 的新手。

答案1

使用tocbibind带有选项的包numbib将使“参考”成为文章类中的编号部分。

此外,url包(或hyperref)将有助于正确显示url。

A

编译为 pdflatex->bibtex->pdflatex->pdflatex

\documentclass[12pt]{article}
\newcommand\ncoverline[1]{\mkern1mu\overline{\mkern-1mu#1\mkern-1mu}\mkern1mu}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel} 

\usepackage{geometry}
\geometry{a4paper,total={160mm,235mm},left=25mm,top=35mm,}

\usepackage{fancyvrb}
\usepackage{fancyhdr, lastpage}
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{\nouppercase\leftmark}
\cfoot{}

\setlength{\headheight}{14.49998pt}
\addtolength{\topmargin}{-2.49998pt}

\usepackage{graphicx} 
\usepackage{subfigure}

\usepackage{url} % added <<<<<<<<<<<<<<<<<
\usepackage[numbib]{tocbibind} % added <<<<<<<<<<<<<<<<<

\begin{filecontents*}{Bibliografy.bib}
    @misc{wikipedia1,
        title = "Scripting language",
        author = "Wikipedia",
        url = "http://en.wikipedia.org/wiki/Scripting_language",
        year = 2014,
    }
\end{filecontents*}
\usepackage[numbers]{natbib}

\usepackage{ragged2e}
\usepackage{setspace}
\usepackage{amsmath}
    
\usepackage{natbib}
\usepackage[noabbrev]{cleveref}

\begin{document}
    \section{Einleitung und Zielsetzung}
    \section{Grundlagen und Stand der Forschung}
    
    \newpage
    \cite{wikipedia1}
    \bibliographystyle{plainnat}
    \bibliography{Bibliografy}
    
\end{document}

相关内容