
我目前正在嘗試為課程輸入一篇文獻綜述,我必須使用與我的領域相關的引文風格。我希望能夠將我正在談論的引文和來源分析放在其下方,並在論文末尾提供最終參考書目。一切似乎都正常,引文是我想要的格式,但在我的第一頁頂部出現了我所有來源的文字引文清單。
我看過一些關於 的註釋\nocite{*}
,但它似乎沒有對我的文檔進行任何更改。
\documentclass[12pt,letterpaper]{article}
% Set margins to 1.5in
\usepackage[margin=0.75in]{geometry}
% for crimson text
\usepackage{crimson}
\usepackage[T1]{fontenc}
% setup parameter indentation
\setlength{\parindent}{15pt}
\setlength{\parskip}{6pt}
% for 1.15 spacing between text
\renewcommand{\baselinestretch}{1.15}
% For defining spacing between headers
\usepackage{titlesec}
% Level 1
\titleformat{\section}
{\normalfont\fontsize{18}{0}\bfseries}{\thesection}{1em}{}
% Level 2
\titleformat{\subsection}
{\normalfont\fontsize{14}{0}\bfseries}{\thesection}{1em}{}
% Level 3
\titleformat{\subsubsection}
{\normalfont\fontsize{12}{0}\bfseries}{\thesection}{1em}{}
% Level 4
\titleformat{\paragraph}
{\normalfont\fontsize{12}{0}\bfseries\itshape}{\theparagraph}{1em}{}
% Level 5
\titleformat{\subparagraph}
{\normalfont\fontsize{12}{0}\itshape}{\theparagraph}{1em}{}
% Level 6
\makeatletter
\newcounter{subsubparagraph}[subparagraph]
\renewcommand\thesubsubparagraph{%
\thesubparagraph.\@arabic\c@subsubparagraph}
\newcommand\subsubparagraph{%
\@startsection{subsubparagraph} % counter
{6} % level
{\parindent} % indent
{12pt} % beforeskip
{6pt} % afterskip
{\normalfont\fontsize{12}{0}}}
\newcommand\l@subsubparagraph{\@dottedtocline{6}{10em}{5em}}
\newcommand{\subsubparagraphmark}[1]{}
\makeatother
\titlespacing*{\section}{0pt}{12pt}{6pt}
\titlespacing*{\subsection}{0pt}{12pt}{6pt}
\titlespacing*{\subsubsection}{0pt}{12pt}{6pt}
\titlespacing*{\paragraph}{0pt}{12pt}{6pt}
\titlespacing*{\subparagraph}{0pt}{12pt}{6pt}
\titlespacing*{\subsubparagraph}{0pt}{12pt}{6pt}
% Set caption to correct size and location
\usepackage[tableposition=top, figureposition=bottom, font=footnotesize, labelfont=bf]{caption}
% set page number location
\usepackage{fancyhdr}
\fancyhf{} % clear all header and footers
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\rhead{\thepage}
\pagestyle{fancy}
% Overwrite Title
\makeatletter
\renewcommand{\maketitle}{\bgroup
\begin{center}
\textbf{{\fontsize{18pt}{20}\selectfont \@title}}\\
\vspace{10pt}
{\fontsize{12pt}{0}\selectfont \@author}
\end{center}
}
\makeatother
% For full citations inline
\usepackage{bibentry}
\nobibliography*
% For making hanging indents under citations
\usepackage{hanging}
\newcommand\hangbibentry[1]{%
\smallskip\par\hangpara{1em}{1}\bibentry{#1}\smallskip\par %{indent}{afterline}
}
% For indenting the first paragraph of every line
\usepackage{indentfirst}
% For use of astron citation package
\usepackage{natbib}
\begin{document}
\thispagestyle{fancy}
\subsection*{\hangbibentry{Soderblom2010TheStars}}
This source outlines the various methods astrophysicists utilize to estimate the ages of stars.
\bibliographystyle{astron}
\bibliography{mnemonic.bib,bib.bib}
\end{document}
這篇文章的引文是這樣的:
@article{Soderblom2010TheStars,
title = "The Ages of Stars",
year = "2010",
journal = aar,
author = "Soderblom, David R.",
month = "3",
volume = "48",
pages = "581--629",
url = "http://arxiv.org/abs/1003.6074 http://dx.doi.org/10.1146/annurev-astro-081309-130806",
doi = "10.1146/annurev-astro-081309-130806",
}
我有一個警告說:
軟體包 Fancyhdr 警告:\headheight 太小 (12.0pt):使其至少為 14.49998pt。現在我們將文件的其餘部分設定得這麼大。但是,這可能會導致頁面佈局不一致。
還有兩個錯誤說明了這一點:
未定義的控制序列。
編譯器無法理解您使用的命令。檢查命令拼字是否正確。如果該指令是套件的一部分,請確保已使用 \usepackage{...} 將套件包含在序言中。
了解更多
<argument> \protect \astroncite {Soderblom}{2010} l.3 ...te{Soderblom}{2010}]{Soderblom2010TheStars} The control sequence at the end of the top line of your error message was never
\def'ed。如果您拼寫錯誤(例如,
\hobx'), type
I' 和正確的拼寫(例如,`I\hbox')。否則就繼續,我會忘記所有未定義的內容。LaTeX 錯誤:缺少 \begin{document}。
未找到 \begin{document} 指令。確保您已在序言中包含 \begin{document},並且主文檔設定正確。
了解更多 請參閱 LaTeX 手冊或 LaTeX Companion 以取得說明。輸入 H 以獲得立即幫助。
…
l.3 ...te{Soderblom}{2010}]{Soderblom2010TheStars} You're in trouble here. Try typing <return> to proceed. If that doesn't work, type X
退出。
我目前正在使用 Overleaf。
答案1
您收到的第一個錯誤\headheight is too small (12.0pt): Make it at least 14.49998pt.
是因為您建立的標頭 viafancyhdr
大於目前使用的12pt
.所以只需添加
\setlength{\headheight}{15pt}
在你的序言中去掉它。
<argument> \protect \astroncite
您透過使用astron.bst
and得到的第一個錯誤訊息astron.sty
包含以下行:
\def\cite{\@ifstar{\citeyear}{\citefull}}
\def\citefull{\def\astroncite##1##2{##1, ##2}\@internalcite}
\def\citeyear{\def\astroncite##1##2{##2}\@internalcite}
這個文件相當舊,我不知道,但使用例如
\bibliographystyle{plainnat}
讓我使用bibentry
,natbib
如果沒有錯誤,您可以使用以下 MWE 進行測試
\begin{filecontents*}{mybib.bib}
@article{Soderblom2010TheStars,
title = "The Ages of Stars",
year = "2010",
journal = aar,
author = "Soderblom, David R.",
month = "3",
volume = "48",
pages = "581--629",
url = "http://arxiv.org/abs/1003.6074 http://dx.doi.org/10.1146/annurev-astro-081309-130806",
doi = "10.1146/annurev-astro-081309-130806",
}
\end{filecontents*}
\documentclass{article}
\usepackage{bibentry}
\nobibliography*
\usepackage{natbib}
\begin{document}
text
%\bibentry{Soderblom2010TheStars}
\subsection*{\bibentry{Soderblom2010TheStars}}
text
\bibliographystyle{plainnat} % plain astron
\bibliography{mybib}
\end{document}
請參閱我.bib
在參考書目調用中刪除了擴展名。
結果是(沒有做任何破壞網址的事情,請忽略這一點):
對我來說,現在的主要問題是你可以省略使用過時的astron.bst
還是將其用於我不知道的特殊類別中?如果可能的話,請忽略它或向該樣式/期刊的維護者提交錯誤報告。