Splitting a document per chapter with preample for Latexian live preview












5















Currently, I have my main LaTeX document set up as follows:



documentclass[12pt]{report}
usepackage{mystyle}
title{Mytitle} author{Me} date{}

begin{document}
pagestyle{plain}
maketitle
chapter{Introduction}
input{chapters/chapter01}
end{document}


While my chapters themselves contain no preamble, no begin/end document etc, just the contents of the chapter itself.



I use Latexian and really enjoy the live preview function in a split screen. I would like to write each individual chapter and use the live preview feature, however, I cannot compile/preview each chapter on its own without its own preamble, begin/end document etc.



Is there a way around this? It feels very clunky to have to switch back and forth between a window containing just my chapter and one containing the entire thesis. Similarly, it feels very clunky to have each chapter contain everything necessary to compile and then manually comment out the extra lines from every single chapter when I wish to compile them all together.










share|improve this question

























  • Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

    – cfr
    Jan 17 '17 at 3:04











  • @cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

    – Echan
    Jan 17 '17 at 5:10











  • @cfr The feature was fairly well hidden, but that completely solved my issue.

    – Echan
    Jan 17 '17 at 5:37











  • You should put te chapter{<title>} command within te chapter file.

    – Johannes_B
    Jan 17 '17 at 7:24











  • look into the subfiles package.

    – samcarter
    Jan 17 '17 at 9:35
















5















Currently, I have my main LaTeX document set up as follows:



documentclass[12pt]{report}
usepackage{mystyle}
title{Mytitle} author{Me} date{}

begin{document}
pagestyle{plain}
maketitle
chapter{Introduction}
input{chapters/chapter01}
end{document}


While my chapters themselves contain no preamble, no begin/end document etc, just the contents of the chapter itself.



I use Latexian and really enjoy the live preview function in a split screen. I would like to write each individual chapter and use the live preview feature, however, I cannot compile/preview each chapter on its own without its own preamble, begin/end document etc.



Is there a way around this? It feels very clunky to have to switch back and forth between a window containing just my chapter and one containing the entire thesis. Similarly, it feels very clunky to have each chapter contain everything necessary to compile and then manually comment out the extra lines from every single chapter when I wish to compile them all together.










share|improve this question

























  • Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

    – cfr
    Jan 17 '17 at 3:04











  • @cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

    – Echan
    Jan 17 '17 at 5:10











  • @cfr The feature was fairly well hidden, but that completely solved my issue.

    – Echan
    Jan 17 '17 at 5:37











  • You should put te chapter{<title>} command within te chapter file.

    – Johannes_B
    Jan 17 '17 at 7:24











  • look into the subfiles package.

    – samcarter
    Jan 17 '17 at 9:35














5












5








5


1






Currently, I have my main LaTeX document set up as follows:



documentclass[12pt]{report}
usepackage{mystyle}
title{Mytitle} author{Me} date{}

begin{document}
pagestyle{plain}
maketitle
chapter{Introduction}
input{chapters/chapter01}
end{document}


While my chapters themselves contain no preamble, no begin/end document etc, just the contents of the chapter itself.



I use Latexian and really enjoy the live preview function in a split screen. I would like to write each individual chapter and use the live preview feature, however, I cannot compile/preview each chapter on its own without its own preamble, begin/end document etc.



Is there a way around this? It feels very clunky to have to switch back and forth between a window containing just my chapter and one containing the entire thesis. Similarly, it feels very clunky to have each chapter contain everything necessary to compile and then manually comment out the extra lines from every single chapter when I wish to compile them all together.










share|improve this question
















Currently, I have my main LaTeX document set up as follows:



documentclass[12pt]{report}
usepackage{mystyle}
title{Mytitle} author{Me} date{}

begin{document}
pagestyle{plain}
maketitle
chapter{Introduction}
input{chapters/chapter01}
end{document}


While my chapters themselves contain no preamble, no begin/end document etc, just the contents of the chapter itself.



I use Latexian and really enjoy the live preview function in a split screen. I would like to write each individual chapter and use the live preview feature, however, I cannot compile/preview each chapter on its own without its own preamble, begin/end document etc.



Is there a way around this? It feels very clunky to have to switch back and forth between a window containing just my chapter and one containing the entire thesis. Similarly, it feels very clunky to have each chapter contain everything necessary to compile and then manually comment out the extra lines from every single chapter when I wish to compile them all together.







chapters preamble latexian






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 16 at 12:11









Jonas Stein

3,22042644




3,22042644










asked Jan 17 '17 at 1:27









EchanEchan

26628




26628













  • Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

    – cfr
    Jan 17 '17 at 3:04











  • @cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

    – Echan
    Jan 17 '17 at 5:10











  • @cfr The feature was fairly well hidden, but that completely solved my issue.

    – Echan
    Jan 17 '17 at 5:37











  • You should put te chapter{<title>} command within te chapter file.

    – Johannes_B
    Jan 17 '17 at 7:24











  • look into the subfiles package.

    – samcarter
    Jan 17 '17 at 9:35



















  • Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

    – cfr
    Jan 17 '17 at 3:04











  • @cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

    – Echan
    Jan 17 '17 at 5:10











  • @cfr The feature was fairly well hidden, but that completely solved my issue.

    – Echan
    Jan 17 '17 at 5:37











  • You should put te chapter{<title>} command within te chapter file.

    – Johannes_B
    Jan 17 '17 at 7:24











  • look into the subfiles package.

    – samcarter
    Jan 17 '17 at 9:35

















Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

– cfr
Jan 17 '17 at 3:04





Doesn't Latexian allow you to set a master document or main file or similar? Many editors have a concept of a project so that compiling any file in that project can be configured to compile the main/master file. If you use include rather than input, you can use includeonly{}as mentioned below. Alternatively, look at standalone or import for other possibilities.

– cfr
Jan 17 '17 at 3:04













@cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

– Echan
Jan 17 '17 at 5:10





@cfr I have never heard of this feature before, but it looks like what I am after. I will have to see whether or not Latexian can do this, thank you.

– Echan
Jan 17 '17 at 5:10













@cfr The feature was fairly well hidden, but that completely solved my issue.

– Echan
Jan 17 '17 at 5:37





@cfr The feature was fairly well hidden, but that completely solved my issue.

– Echan
Jan 17 '17 at 5:37













You should put te chapter{<title>} command within te chapter file.

– Johannes_B
Jan 17 '17 at 7:24





You should put te chapter{<title>} command within te chapter file.

– Johannes_B
Jan 17 '17 at 7:24













look into the subfiles package.

– samcarter
Jan 17 '17 at 9:35





look into the subfiles package.

– samcarter
Jan 17 '17 at 9:35










3 Answers
3






active

oldest

votes


















1














Convert your chapters in complete documents (with the same preample that the main document) and then go to CTAN to known about the topic subdoc: in­clude com­plete doc­u­ments in other doc­u­ments. In particular, docmute or standalone packages is what your are looking for. It is a simple as add one of these packages to the preamble of the main document (there are many examples of use of both packages in this site, for example this answer.



I suggest also move rest of the preamble to a preamble.tex file and left in the main document only input{preamble} and use only this command in the preambles of the child fles, because if you need change some change in the preambles, you only have to do once, avoiding mistakes.



Alternatively, as suggested in the other answer, you can also preview the main document with only a chapter, using includeonly{...} in the preamble of the main document, but note that this command affect to include commands, not to input (see When should I use input vs. include?), so in your example, you should change chapter{...}input{...} by only include{...} with chapter{...} included in the child document.






share|improve this answer

































    0














    Another approach is to have a compile01.tex file which contains:



    documentclass{thesis_template}
    usepackage{../my_preamble}% all your package loads and custom macros in one file. (You could also input it)
    begin{document}
    input{chapter01}
    end{document}


    You'd then have compile02.tex etc. as well. I didn't use this approach for chapters (I wanted to test the bibliography and TOC often enough that it wasn't worth it, instead I preferred to use includeonly or comment out the include/inputlines in my thesis_master.tex ). But I did set up something similar for TikZ pictures to avoid compiling the whole thesis while fine-tuning a figure.






    share|improve this answer
























    • Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

      – Fran
      Jan 17 '17 at 14:11













    • @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

      – Chris H
      Jan 17 '17 at 14:26



















    -1














    Plenty of other questions on this same topic. I think the easiest way to do it is to put a line like this in your preamble:



    includeonly{chapter2}


    Typeset single chapter from book



    Edit: And use include instead of input






    share|improve this answer





















    • 2





      This really doesn't address the question and adding this to the preamble in the question will just produce an error.

      – cfr
      Jan 17 '17 at 3:02











    • @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

      – Tom Anderson
      Jan 21 '17 at 4:36











    • @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

      – Joseph Wright
      Jan 21 '17 at 8:14






    • 1





      The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

      – cfr
      Jan 21 '17 at 19:10






    • 1





      By the way, it was not me who down-voted your answer. @JosephWright ??

      – cfr
      Jan 21 '17 at 19:11











    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%2f349080%2fsplitting-a-document-per-chapter-with-preample-for-latexian-live-preview%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Convert your chapters in complete documents (with the same preample that the main document) and then go to CTAN to known about the topic subdoc: in­clude com­plete doc­u­ments in other doc­u­ments. In particular, docmute or standalone packages is what your are looking for. It is a simple as add one of these packages to the preamble of the main document (there are many examples of use of both packages in this site, for example this answer.



    I suggest also move rest of the preamble to a preamble.tex file and left in the main document only input{preamble} and use only this command in the preambles of the child fles, because if you need change some change in the preambles, you only have to do once, avoiding mistakes.



    Alternatively, as suggested in the other answer, you can also preview the main document with only a chapter, using includeonly{...} in the preamble of the main document, but note that this command affect to include commands, not to input (see When should I use input vs. include?), so in your example, you should change chapter{...}input{...} by only include{...} with chapter{...} included in the child document.






    share|improve this answer






























      1














      Convert your chapters in complete documents (with the same preample that the main document) and then go to CTAN to known about the topic subdoc: in­clude com­plete doc­u­ments in other doc­u­ments. In particular, docmute or standalone packages is what your are looking for. It is a simple as add one of these packages to the preamble of the main document (there are many examples of use of both packages in this site, for example this answer.



      I suggest also move rest of the preamble to a preamble.tex file and left in the main document only input{preamble} and use only this command in the preambles of the child fles, because if you need change some change in the preambles, you only have to do once, avoiding mistakes.



      Alternatively, as suggested in the other answer, you can also preview the main document with only a chapter, using includeonly{...} in the preamble of the main document, but note that this command affect to include commands, not to input (see When should I use input vs. include?), so in your example, you should change chapter{...}input{...} by only include{...} with chapter{...} included in the child document.






      share|improve this answer




























        1












        1








        1







        Convert your chapters in complete documents (with the same preample that the main document) and then go to CTAN to known about the topic subdoc: in­clude com­plete doc­u­ments in other doc­u­ments. In particular, docmute or standalone packages is what your are looking for. It is a simple as add one of these packages to the preamble of the main document (there are many examples of use of both packages in this site, for example this answer.



        I suggest also move rest of the preamble to a preamble.tex file and left in the main document only input{preamble} and use only this command in the preambles of the child fles, because if you need change some change in the preambles, you only have to do once, avoiding mistakes.



        Alternatively, as suggested in the other answer, you can also preview the main document with only a chapter, using includeonly{...} in the preamble of the main document, but note that this command affect to include commands, not to input (see When should I use input vs. include?), so in your example, you should change chapter{...}input{...} by only include{...} with chapter{...} included in the child document.






        share|improve this answer















        Convert your chapters in complete documents (with the same preample that the main document) and then go to CTAN to known about the topic subdoc: in­clude com­plete doc­u­ments in other doc­u­ments. In particular, docmute or standalone packages is what your are looking for. It is a simple as add one of these packages to the preamble of the main document (there are many examples of use of both packages in this site, for example this answer.



        I suggest also move rest of the preamble to a preamble.tex file and left in the main document only input{preamble} and use only this command in the preambles of the child fles, because if you need change some change in the preambles, you only have to do once, avoiding mistakes.



        Alternatively, as suggested in the other answer, you can also preview the main document with only a chapter, using includeonly{...} in the preamble of the main document, but note that this command affect to include commands, not to input (see When should I use input vs. include?), so in your example, you should change chapter{...}input{...} by only include{...} with chapter{...} included in the child document.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:36









        Community

        1




        1










        answered Jan 17 '17 at 8:55









        FranFran

        53.3k6119183




        53.3k6119183























            0














            Another approach is to have a compile01.tex file which contains:



            documentclass{thesis_template}
            usepackage{../my_preamble}% all your package loads and custom macros in one file. (You could also input it)
            begin{document}
            input{chapter01}
            end{document}


            You'd then have compile02.tex etc. as well. I didn't use this approach for chapters (I wanted to test the bibliography and TOC often enough that it wasn't worth it, instead I preferred to use includeonly or comment out the include/inputlines in my thesis_master.tex ). But I did set up something similar for TikZ pictures to avoid compiling the whole thesis while fine-tuning a figure.






            share|improve this answer
























            • Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

              – Fran
              Jan 17 '17 at 14:11













            • @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

              – Chris H
              Jan 17 '17 at 14:26
















            0














            Another approach is to have a compile01.tex file which contains:



            documentclass{thesis_template}
            usepackage{../my_preamble}% all your package loads and custom macros in one file. (You could also input it)
            begin{document}
            input{chapter01}
            end{document}


            You'd then have compile02.tex etc. as well. I didn't use this approach for chapters (I wanted to test the bibliography and TOC often enough that it wasn't worth it, instead I preferred to use includeonly or comment out the include/inputlines in my thesis_master.tex ). But I did set up something similar for TikZ pictures to avoid compiling the whole thesis while fine-tuning a figure.






            share|improve this answer
























            • Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

              – Fran
              Jan 17 '17 at 14:11













            • @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

              – Chris H
              Jan 17 '17 at 14:26














            0












            0








            0







            Another approach is to have a compile01.tex file which contains:



            documentclass{thesis_template}
            usepackage{../my_preamble}% all your package loads and custom macros in one file. (You could also input it)
            begin{document}
            input{chapter01}
            end{document}


            You'd then have compile02.tex etc. as well. I didn't use this approach for chapters (I wanted to test the bibliography and TOC often enough that it wasn't worth it, instead I preferred to use includeonly or comment out the include/inputlines in my thesis_master.tex ). But I did set up something similar for TikZ pictures to avoid compiling the whole thesis while fine-tuning a figure.






            share|improve this answer













            Another approach is to have a compile01.tex file which contains:



            documentclass{thesis_template}
            usepackage{../my_preamble}% all your package loads and custom macros in one file. (You could also input it)
            begin{document}
            input{chapter01}
            end{document}


            You'd then have compile02.tex etc. as well. I didn't use this approach for chapters (I wanted to test the bibliography and TOC often enough that it wasn't worth it, instead I preferred to use includeonly or comment out the include/inputlines in my thesis_master.tex ). But I did set up something similar for TikZ pictures to avoid compiling the whole thesis while fine-tuning a figure.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 17 '17 at 10:02









            Chris HChris H

            6,44122057




            6,44122057













            • Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

              – Fran
              Jan 17 '17 at 14:11













            • @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

              – Chris H
              Jan 17 '17 at 14:26



















            • Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

              – Fran
              Jan 17 '17 at 14:11













            • @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

              – Chris H
              Jan 17 '17 at 14:26

















            Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

            – Fran
            Jan 17 '17 at 14:11







            Although your suggestion will not produce the same result that includeonly in main.tex and simplify check partial results, basically translate the hassle of having to compile main.tex to the hassle of of compile through a third file for each chapter, but the main point of the question is see a live preview while editing chapter01.tex, that is not really solved in this way

            – Fran
            Jan 17 '17 at 14:11















            @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

            – Chris H
            Jan 17 '17 at 14:26





            @Fran I don't use Latexian so it wasn't obvious to me that this wouldn't generate a live preview until you said so. My thesis files were big enough that for all but the introduction, compilation of a single chapter took a few tens of seconds on a fast machine. With frequent saving it would be almost constantly updating. So I compiled on my own schedule

            – Chris H
            Jan 17 '17 at 14:26











            -1














            Plenty of other questions on this same topic. I think the easiest way to do it is to put a line like this in your preamble:



            includeonly{chapter2}


            Typeset single chapter from book



            Edit: And use include instead of input






            share|improve this answer





















            • 2





              This really doesn't address the question and adding this to the preamble in the question will just produce an error.

              – cfr
              Jan 17 '17 at 3:02











            • @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

              – Tom Anderson
              Jan 21 '17 at 4:36











            • @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

              – Joseph Wright
              Jan 21 '17 at 8:14






            • 1





              The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

              – cfr
              Jan 21 '17 at 19:10






            • 1





              By the way, it was not me who down-voted your answer. @JosephWright ??

              – cfr
              Jan 21 '17 at 19:11
















            -1














            Plenty of other questions on this same topic. I think the easiest way to do it is to put a line like this in your preamble:



            includeonly{chapter2}


            Typeset single chapter from book



            Edit: And use include instead of input






            share|improve this answer





















            • 2





              This really doesn't address the question and adding this to the preamble in the question will just produce an error.

              – cfr
              Jan 17 '17 at 3:02











            • @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

              – Tom Anderson
              Jan 21 '17 at 4:36











            • @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

              – Joseph Wright
              Jan 21 '17 at 8:14






            • 1





              The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

              – cfr
              Jan 21 '17 at 19:10






            • 1





              By the way, it was not me who down-voted your answer. @JosephWright ??

              – cfr
              Jan 21 '17 at 19:11














            -1












            -1








            -1







            Plenty of other questions on this same topic. I think the easiest way to do it is to put a line like this in your preamble:



            includeonly{chapter2}


            Typeset single chapter from book



            Edit: And use include instead of input






            share|improve this answer















            Plenty of other questions on this same topic. I think the easiest way to do it is to put a line like this in your preamble:



            includeonly{chapter2}


            Typeset single chapter from book



            Edit: And use include instead of input







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:35









            Community

            1




            1










            answered Jan 17 '17 at 2:59









            Tom AndersonTom Anderson

            992




            992








            • 2





              This really doesn't address the question and adding this to the preamble in the question will just produce an error.

              – cfr
              Jan 17 '17 at 3:02











            • @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

              – Tom Anderson
              Jan 21 '17 at 4:36











            • @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

              – Joseph Wright
              Jan 21 '17 at 8:14






            • 1





              The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

              – cfr
              Jan 21 '17 at 19:10






            • 1





              By the way, it was not me who down-voted your answer. @JosephWright ??

              – cfr
              Jan 21 '17 at 19:11














            • 2





              This really doesn't address the question and adding this to the preamble in the question will just produce an error.

              – cfr
              Jan 17 '17 at 3:02











            • @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

              – Tom Anderson
              Jan 21 '17 at 4:36











            • @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

              – Joseph Wright
              Jan 21 '17 at 8:14






            • 1





              The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

              – cfr
              Jan 21 '17 at 19:10






            • 1





              By the way, it was not me who down-voted your answer. @JosephWright ??

              – cfr
              Jan 21 '17 at 19:11








            2




            2





            This really doesn't address the question and adding this to the preamble in the question will just produce an error.

            – cfr
            Jan 17 '17 at 3:02





            This really doesn't address the question and adding this to the preamble in the question will just produce an error.

            – cfr
            Jan 17 '17 at 3:02













            @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

            – Tom Anderson
            Jan 21 '17 at 4:36





            @cfr not sure I understand your comment. Because you also posted above: "If you use include rather than input, you can use includeonly{}as mentioned below." Why post the same advice as me and downvote my brief response plus link to information? Is it because you thought I should copy more of their answer?

            – Tom Anderson
            Jan 21 '17 at 4:36













            @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

            – Joseph Wright
            Jan 21 '17 at 8:14





            @TomAnderson I think the problem is that the code in the question doesn't have any chapters, so more is needed than just adding includeonly: the source also needs to be set up correctly.

            – Joseph Wright
            Jan 21 '17 at 8:14




            1




            1





            The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

            – cfr
            Jan 21 '17 at 19:10





            The source in the question doesn't use include{}. You can't use includeonly{} with input{}.

            – cfr
            Jan 21 '17 at 19:10




            1




            1





            By the way, it was not me who down-voted your answer. @JosephWright ??

            – cfr
            Jan 21 '17 at 19:11





            By the way, it was not me who down-voted your answer. @JosephWright ??

            – cfr
            Jan 21 '17 at 19:11


















            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%2f349080%2fsplitting-a-document-per-chapter-with-preample-for-latexian-live-preview%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

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?