Are bibentry and subfile incompatible? [! LaTeX Error: Cannot be used in preamble.]












0














I am trying to construct a report document that consists of a series of documents that can also be compiled individually. In these subfile documents I have been using bibentry{} from the bibentry package to allow me to print a full citation in text.



Compiling the subfile documents individually works fine, and if I comment out the "bibentry" line in the subfile the main document is fine, but compiling the main file with the bibentry in the subfile fails and I receive the error



[! LaTeX Error: Cannot be used in preamble.]



Any advice would be welcomed. I'm not sure where to start with my troubleshooting.



Thanks.



The following files provide a minimal working example:





File Name: MainDocument.tex



documentclass{report}
usepackage[margin=0.5in]{geometry}

%For inclusion of subfiles
usepackage{subfiles}

%Path to the directory containing: "MainDocument.tex", "SubfileDocument.tex", and "Bibliography.bib"
newcommand{Troubleshooting}{Path to Troubleshooting Directory/MWE_SubfilesWithBibEntries/}

%%Bibliography
%% %Allows display of a full bib entry using the command bibentry{citationkey}
usepackage{bibentry}
nobibliography*

newcommand{Bibliography}{Bibliography.bib}
defbiblio{bibliographystyle{siam}bibliography{TroubleshootingBibliography}}

%Document Information
title{This Is a Document}

begin{document}
chapter{First}newpage
subfile{Troubleshooting SubfileDocument.tex}newpage
bibliographystyle{siam}
bibliography{TroubleshootingBibliography}
end{document}




File Name: SubfileDocument.tex



documentclass[Path to to troubleshooting directory /MWE_SubfilesWithBibEntries/MainDocument.tex]{subfiles}

begin{document}
section{first Section}
Interesting words here that describe something cool.\
Print text of relevant source:\
bibentry{testcitation}\
Cite relevant source cite{testcitation}
biblio
end{document}




File Name: Bibliography.bib



@article{testcitation,
abstract = {Words and more word},
author = {John Doe},
doi = {},
file = {},
journal = {Journal of Amazing Things},
keywords = {},
mendeley-tags = {},
month = {aug},
number = {8},
pages = {1000-1005},
publisher = {Publisher of Cool Things},
title = {{Article of Cool Things}},
url = {},
volume = {7},
year = {1995}
}









share|improve this question



























    0














    I am trying to construct a report document that consists of a series of documents that can also be compiled individually. In these subfile documents I have been using bibentry{} from the bibentry package to allow me to print a full citation in text.



    Compiling the subfile documents individually works fine, and if I comment out the "bibentry" line in the subfile the main document is fine, but compiling the main file with the bibentry in the subfile fails and I receive the error



    [! LaTeX Error: Cannot be used in preamble.]



    Any advice would be welcomed. I'm not sure where to start with my troubleshooting.



    Thanks.



    The following files provide a minimal working example:





    File Name: MainDocument.tex



    documentclass{report}
    usepackage[margin=0.5in]{geometry}

    %For inclusion of subfiles
    usepackage{subfiles}

    %Path to the directory containing: "MainDocument.tex", "SubfileDocument.tex", and "Bibliography.bib"
    newcommand{Troubleshooting}{Path to Troubleshooting Directory/MWE_SubfilesWithBibEntries/}

    %%Bibliography
    %% %Allows display of a full bib entry using the command bibentry{citationkey}
    usepackage{bibentry}
    nobibliography*

    newcommand{Bibliography}{Bibliography.bib}
    defbiblio{bibliographystyle{siam}bibliography{TroubleshootingBibliography}}

    %Document Information
    title{This Is a Document}

    begin{document}
    chapter{First}newpage
    subfile{Troubleshooting SubfileDocument.tex}newpage
    bibliographystyle{siam}
    bibliography{TroubleshootingBibliography}
    end{document}




    File Name: SubfileDocument.tex



    documentclass[Path to to troubleshooting directory /MWE_SubfilesWithBibEntries/MainDocument.tex]{subfiles}

    begin{document}
    section{first Section}
    Interesting words here that describe something cool.\
    Print text of relevant source:\
    bibentry{testcitation}\
    Cite relevant source cite{testcitation}
    biblio
    end{document}




    File Name: Bibliography.bib



    @article{testcitation,
    abstract = {Words and more word},
    author = {John Doe},
    doi = {},
    file = {},
    journal = {Journal of Amazing Things},
    keywords = {},
    mendeley-tags = {},
    month = {aug},
    number = {8},
    pages = {1000-1005},
    publisher = {Publisher of Cool Things},
    title = {{Article of Cool Things}},
    url = {},
    volume = {7},
    year = {1995}
    }









    share|improve this question

























      0












      0








      0







      I am trying to construct a report document that consists of a series of documents that can also be compiled individually. In these subfile documents I have been using bibentry{} from the bibentry package to allow me to print a full citation in text.



      Compiling the subfile documents individually works fine, and if I comment out the "bibentry" line in the subfile the main document is fine, but compiling the main file with the bibentry in the subfile fails and I receive the error



      [! LaTeX Error: Cannot be used in preamble.]



      Any advice would be welcomed. I'm not sure where to start with my troubleshooting.



      Thanks.



      The following files provide a minimal working example:





      File Name: MainDocument.tex



      documentclass{report}
      usepackage[margin=0.5in]{geometry}

      %For inclusion of subfiles
      usepackage{subfiles}

      %Path to the directory containing: "MainDocument.tex", "SubfileDocument.tex", and "Bibliography.bib"
      newcommand{Troubleshooting}{Path to Troubleshooting Directory/MWE_SubfilesWithBibEntries/}

      %%Bibliography
      %% %Allows display of a full bib entry using the command bibentry{citationkey}
      usepackage{bibentry}
      nobibliography*

      newcommand{Bibliography}{Bibliography.bib}
      defbiblio{bibliographystyle{siam}bibliography{TroubleshootingBibliography}}

      %Document Information
      title{This Is a Document}

      begin{document}
      chapter{First}newpage
      subfile{Troubleshooting SubfileDocument.tex}newpage
      bibliographystyle{siam}
      bibliography{TroubleshootingBibliography}
      end{document}




      File Name: SubfileDocument.tex



      documentclass[Path to to troubleshooting directory /MWE_SubfilesWithBibEntries/MainDocument.tex]{subfiles}

      begin{document}
      section{first Section}
      Interesting words here that describe something cool.\
      Print text of relevant source:\
      bibentry{testcitation}\
      Cite relevant source cite{testcitation}
      biblio
      end{document}




      File Name: Bibliography.bib



      @article{testcitation,
      abstract = {Words and more word},
      author = {John Doe},
      doi = {},
      file = {},
      journal = {Journal of Amazing Things},
      keywords = {},
      mendeley-tags = {},
      month = {aug},
      number = {8},
      pages = {1000-1005},
      publisher = {Publisher of Cool Things},
      title = {{Article of Cool Things}},
      url = {},
      volume = {7},
      year = {1995}
      }









      share|improve this question













      I am trying to construct a report document that consists of a series of documents that can also be compiled individually. In these subfile documents I have been using bibentry{} from the bibentry package to allow me to print a full citation in text.



      Compiling the subfile documents individually works fine, and if I comment out the "bibentry" line in the subfile the main document is fine, but compiling the main file with the bibentry in the subfile fails and I receive the error



      [! LaTeX Error: Cannot be used in preamble.]



      Any advice would be welcomed. I'm not sure where to start with my troubleshooting.



      Thanks.



      The following files provide a minimal working example:





      File Name: MainDocument.tex



      documentclass{report}
      usepackage[margin=0.5in]{geometry}

      %For inclusion of subfiles
      usepackage{subfiles}

      %Path to the directory containing: "MainDocument.tex", "SubfileDocument.tex", and "Bibliography.bib"
      newcommand{Troubleshooting}{Path to Troubleshooting Directory/MWE_SubfilesWithBibEntries/}

      %%Bibliography
      %% %Allows display of a full bib entry using the command bibentry{citationkey}
      usepackage{bibentry}
      nobibliography*

      newcommand{Bibliography}{Bibliography.bib}
      defbiblio{bibliographystyle{siam}bibliography{TroubleshootingBibliography}}

      %Document Information
      title{This Is a Document}

      begin{document}
      chapter{First}newpage
      subfile{Troubleshooting SubfileDocument.tex}newpage
      bibliographystyle{siam}
      bibliography{TroubleshootingBibliography}
      end{document}




      File Name: SubfileDocument.tex



      documentclass[Path to to troubleshooting directory /MWE_SubfilesWithBibEntries/MainDocument.tex]{subfiles}

      begin{document}
      section{first Section}
      Interesting words here that describe something cool.\
      Print text of relevant source:\
      bibentry{testcitation}\
      Cite relevant source cite{testcitation}
      biblio
      end{document}




      File Name: Bibliography.bib



      @article{testcitation,
      abstract = {Words and more word},
      author = {John Doe},
      doi = {},
      file = {},
      journal = {Journal of Amazing Things},
      keywords = {},
      mendeley-tags = {},
      month = {aug},
      number = {8},
      pages = {1000-1005},
      publisher = {Publisher of Cool Things},
      title = {{Article of Cool Things}},
      url = {},
      volume = {7},
      year = {1995}
      }






      bibentry






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      Laura S.Laura S.

      417




      417






















          0






          active

          oldest

          votes











          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%2f469238%2fare-bibentry-and-subfile-incompatible-latex-error-cannot-be-used-in-pream%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f469238%2fare-bibentry-and-subfile-incompatible-latex-error-cannot-be-used-in-pream%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

          Lallio

          Futebolista

          Jornalista