missing begin{document} error












1















I'm getting a missing begin{document} error despite having a begin{document} in my code.



Other files here (https://drive.google.com/drive/folders/0B4GteP8rSaosSGZDLTJrbFJlUWs?usp=sharing). It appears the bibliography causes problems.



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}









share|improve this question

























  • I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

    – Troy
    May 1 '17 at 5:05











  • Your example compiles fine for me with no errors.

    – ShreevatsaR
    May 1 '17 at 5:05











  • bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

    – Johannes_B
    May 1 '17 at 5:12











  • @Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

    – Mico
    May 1 '17 at 5:56
















1















I'm getting a missing begin{document} error despite having a begin{document} in my code.



Other files here (https://drive.google.com/drive/folders/0B4GteP8rSaosSGZDLTJrbFJlUWs?usp=sharing). It appears the bibliography causes problems.



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}









share|improve this question

























  • I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

    – Troy
    May 1 '17 at 5:05











  • Your example compiles fine for me with no errors.

    – ShreevatsaR
    May 1 '17 at 5:05











  • bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

    – Johannes_B
    May 1 '17 at 5:12











  • @Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

    – Mico
    May 1 '17 at 5:56














1












1








1








I'm getting a missing begin{document} error despite having a begin{document} in my code.



Other files here (https://drive.google.com/drive/folders/0B4GteP8rSaosSGZDLTJrbFJlUWs?usp=sharing). It appears the bibliography causes problems.



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}









share|improve this question
















I'm getting a missing begin{document} error despite having a begin{document} in my code.



Other files here (https://drive.google.com/drive/folders/0B4GteP8rSaosSGZDLTJrbFJlUWs?usp=sharing). It appears the bibliography causes problems.



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}






biblatex bibtex bibliographies






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 1 '17 at 5:52









Mico

284k31388778




284k31388778










asked May 1 '17 at 4:50









Hao SunHao Sun

15518




15518













  • I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

    – Troy
    May 1 '17 at 5:05











  • Your example compiles fine for me with no errors.

    – ShreevatsaR
    May 1 '17 at 5:05











  • bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

    – Johannes_B
    May 1 '17 at 5:12











  • @Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

    – Mico
    May 1 '17 at 5:56



















  • I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

    – Troy
    May 1 '17 at 5:05











  • Your example compiles fine for me with no errors.

    – ShreevatsaR
    May 1 '17 at 5:05











  • bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

    – Johannes_B
    May 1 '17 at 5:12











  • @Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

    – Mico
    May 1 '17 at 5:56

















I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

– Troy
May 1 '17 at 5:05





I changed the tag from biblatex to bibtex because it doesn't seem like you're using the former.. Feel free to revert if I've misunderstood

– Troy
May 1 '17 at 5:05













Your example compiles fine for me with no errors.

– ShreevatsaR
May 1 '17 at 5:05





Your example compiles fine for me with no errors.

– ShreevatsaR
May 1 '17 at 5:05













bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

– Johannes_B
May 1 '17 at 5:12





bibliography tries to typeset the bibliography using thebibliography. This is bound to fail. Maybe the template used to load package biblatex? In that case, it would work, but the tempalte would still be deprecated syntax. On the other hand, looking at that hyperref madness the template provides, i would put it in the bin,

– Johannes_B
May 1 '17 at 5:12













@Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

– Mico
May 1 '17 at 5:56





@Troy - Deleting the biblatex tag may have been a bit premature: It could well be that the OP's template simply failed to provide the instruction usepackage[<various options>]{biblatex}.

– Mico
May 1 '17 at 5:56










1 Answer
1






active

oldest

votes


















2














I can think of two diagnoses:





  • You simply failed to load the biblatex package. (A reason for contemplating this scenario is that your document doesn't include a bibliographystyle instruction; such an instruction is required by BibTeX, but not by biblatex.) If biblatex isn't loaded, the bibliography instruction must not be placed in the preamble. If it's simple failure of loading the biblatex package, do load it. You should also change the instruction



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


    to



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


    (Under biblatex, bibliography is deprectated.) Note the addition of the .bib filename extensions. You're still planning on providing a few cite instructions and a printbibliography instruction too, right?



  • You really do not intend to load the biblatex package. In that case, the bibliography directive mustn't be placed in the preamble. Instead, it should be placed in the body of the document, in the location where the formatted bibliography should be placed. You will also need to provide a suitable bibliographystyle directive, of course. And, you'll also be providing a few cite instructions, right?



Incidentally, do the three bib files really all start with a . (dot)? This would make the "hidden" if they are located on a unix-like system.






share|improve this answer


























  • Maybe worthy to note that no bib style was provided as well.

    – Troy
    May 1 '17 at 6:09











  • @Troy - Good observation! I'll add it to the body of the answer. :-)

    – Mico
    May 1 '17 at 6:09













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f367573%2fmissing-begindocument-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














I can think of two diagnoses:





  • You simply failed to load the biblatex package. (A reason for contemplating this scenario is that your document doesn't include a bibliographystyle instruction; such an instruction is required by BibTeX, but not by biblatex.) If biblatex isn't loaded, the bibliography instruction must not be placed in the preamble. If it's simple failure of loading the biblatex package, do load it. You should also change the instruction



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


    to



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


    (Under biblatex, bibliography is deprectated.) Note the addition of the .bib filename extensions. You're still planning on providing a few cite instructions and a printbibliography instruction too, right?



  • You really do not intend to load the biblatex package. In that case, the bibliography directive mustn't be placed in the preamble. Instead, it should be placed in the body of the document, in the location where the formatted bibliography should be placed. You will also need to provide a suitable bibliographystyle directive, of course. And, you'll also be providing a few cite instructions, right?



Incidentally, do the three bib files really all start with a . (dot)? This would make the "hidden" if they are located on a unix-like system.






share|improve this answer


























  • Maybe worthy to note that no bib style was provided as well.

    – Troy
    May 1 '17 at 6:09











  • @Troy - Good observation! I'll add it to the body of the answer. :-)

    – Mico
    May 1 '17 at 6:09


















2














I can think of two diagnoses:





  • You simply failed to load the biblatex package. (A reason for contemplating this scenario is that your document doesn't include a bibliographystyle instruction; such an instruction is required by BibTeX, but not by biblatex.) If biblatex isn't loaded, the bibliography instruction must not be placed in the preamble. If it's simple failure of loading the biblatex package, do load it. You should also change the instruction



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


    to



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


    (Under biblatex, bibliography is deprectated.) Note the addition of the .bib filename extensions. You're still planning on providing a few cite instructions and a printbibliography instruction too, right?



  • You really do not intend to load the biblatex package. In that case, the bibliography directive mustn't be placed in the preamble. Instead, it should be placed in the body of the document, in the location where the formatted bibliography should be placed. You will also need to provide a suitable bibliographystyle directive, of course. And, you'll also be providing a few cite instructions, right?



Incidentally, do the three bib files really all start with a . (dot)? This would make the "hidden" if they are located on a unix-like system.






share|improve this answer


























  • Maybe worthy to note that no bib style was provided as well.

    – Troy
    May 1 '17 at 6:09











  • @Troy - Good observation! I'll add it to the body of the answer. :-)

    – Mico
    May 1 '17 at 6:09
















2












2








2







I can think of two diagnoses:





  • You simply failed to load the biblatex package. (A reason for contemplating this scenario is that your document doesn't include a bibliographystyle instruction; such an instruction is required by BibTeX, but not by biblatex.) If biblatex isn't loaded, the bibliography instruction must not be placed in the preamble. If it's simple failure of loading the biblatex package, do load it. You should also change the instruction



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


    to



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


    (Under biblatex, bibliography is deprectated.) Note the addition of the .bib filename extensions. You're still planning on providing a few cite instructions and a printbibliography instruction too, right?



  • You really do not intend to load the biblatex package. In that case, the bibliography directive mustn't be placed in the preamble. Instead, it should be placed in the body of the document, in the location where the formatted bibliography should be placed. You will also need to provide a suitable bibliographystyle directive, of course. And, you'll also be providing a few cite instructions, right?



Incidentally, do the three bib files really all start with a . (dot)? This would make the "hidden" if they are located on a unix-like system.






share|improve this answer















I can think of two diagnoses:





  • You simply failed to load the biblatex package. (A reason for contemplating this scenario is that your document doesn't include a bibliographystyle instruction; such an instruction is required by BibTeX, but not by biblatex.) If biblatex isn't loaded, the bibliography instruction must not be placed in the preamble. If it's simple failure of loading the biblatex package, do load it. You should also change the instruction



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


    to



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


    (Under biblatex, bibliography is deprectated.) Note the addition of the .bib filename extensions. You're still planning on providing a few cite instructions and a printbibliography instruction too, right?



  • You really do not intend to load the biblatex package. In that case, the bibliography directive mustn't be placed in the preamble. Instead, it should be placed in the body of the document, in the location where the formatted bibliography should be placed. You will also need to provide a suitable bibliographystyle directive, of course. And, you'll also be providing a few cite instructions, right?



Incidentally, do the three bib files really all start with a . (dot)? This would make the "hidden" if they are located on a unix-like system.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 1 '17 at 6:12

























answered May 1 '17 at 5:51









MicoMico

284k31388778




284k31388778













  • Maybe worthy to note that no bib style was provided as well.

    – Troy
    May 1 '17 at 6:09











  • @Troy - Good observation! I'll add it to the body of the answer. :-)

    – Mico
    May 1 '17 at 6:09





















  • Maybe worthy to note that no bib style was provided as well.

    – Troy
    May 1 '17 at 6:09











  • @Troy - Good observation! I'll add it to the body of the answer. :-)

    – Mico
    May 1 '17 at 6:09



















Maybe worthy to note that no bib style was provided as well.

– Troy
May 1 '17 at 6:09





Maybe worthy to note that no bib style was provided as well.

– Troy
May 1 '17 at 6:09













@Troy - Good observation! I'll add it to the body of the answer. :-)

– Mico
May 1 '17 at 6:09







@Troy - Good observation! I'll add it to the body of the answer. :-)

– Mico
May 1 '17 at 6:09




















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f367573%2fmissing-begindocument-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?