缺少 \begin{document} 錯誤

缺少 \begin{document} 錯誤

儘管我的程式碼中\begin{document}有一個,但我還是收到了遺失的錯誤。\begin{document}

其他文件在這裡(https://drive.google.com/drive/folders/0B4GteP8rSaosSGZDLTJrbFJlUWs?usp=sharing)。看來參考書目會引起問題。

\documentclass[11pt]{article}

\usepackage{ifthen}
\newboolean{PrintVersion}
\setboolean{PrintVersion}{false} 
% CHANGE THIS VALUE TO "true" as necessary, to improve printed results for hard copies
% by overriding some options of the hyperref package below.

%\usepackage{nomencl} % For a nomenclature (optional; available from ctan.org)
\usepackage{amsmath,amssymb,amstext} % Lots of math symbols and environments
\usepackage[pdftex]{graphicx} % For including graphics N.B. pdftex graphics driver 

\usepackage[pdftex,letterpaper=true,pagebackref=false]{hyperref} % with basic options
        % N.B. pagebackref=true provides links back from the References to the body text. This can cause trouble for printing.
\hypersetup{
    plainpages=false,       % needed if Roman numbers in frontpages
    pdfpagelabels=true,     % adds page number as label in Acrobat's page count
    bookmarks=true,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={uWaterloo\ LaTeX\ Thesis\ Template},    % title: CHANGE THIS TEXT!
    pdfnewwindow=true,      % links in new window
    colorlinks=true,        % false: boxed links; true: colored links
    linkcolor=blue,         % color of internal links
    citecolor=green,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=cyan           % color of external links
}
\ifthenelse{\boolean{PrintVersion}}{   % for improved print quality, change some hyperref options
\hypersetup{    % override some previously defined hyperref options
%    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black}
}{} % end of ifthenelse (no else)
\bibliography{bibfiles.d/.master,bibfiles.d/.psd,bibfiles.d/.Cook2012}


\begin{document}
fhjh  hjkhj
hohilkj
\end{document}

答案1

我可以想到兩種診斷:

  • 您只是未能加載biblatex包。 (考慮這種情況的一個原因是您的文件不包含\bibliographystyle指令;BibTeX 需要這樣的指令,但 biblatex 不需要。)如果biblatex未載入,則\bibliography指令一定不放在序言中。如果只是加載biblatex包失敗,請加載它。您還應該更改指令

    \bibliography{bibfiles.d/.master,bibfiles.d/.psd,bibfiles.d/.Cook2012}
    

    \addbibresource{bibfiles.d/.master.bib,bibfiles.d/.psd.bib,bibfiles.d/.Cook2012.bib}
    

    (在 biblatex 下,\bibliography已棄用。)請注意新增的.bib檔案副檔名。您仍然計劃提供一些\cite說明和\printbibliography說明,對吧?

  • 您確實不打算加載該biblatex包。在這種情況下,該\bibliography指令不得放置在序言中。相反,它應該放置在文件正文中應放置格式化參考書目的位置。\bibliographystyle當然,您還需要提供合適的指示。而且,您還將提供一些\cite說明,對嗎?

順便問一下,這三個bib文件真的都是以.(點)開頭嗎?如果它們位於類 UNIX 系統上,這將使它們「隱藏」。

相關內容