First of all, I am a newbie here and I have no idea to post a query but I have a problem for which I require your help. I even don't know what should be the title of my problem but what my intuition said, I just titled it above. Apologize if I am wrong. Let me tell you my situation first.
I am writing a problem book in mathematics. The book (say book.tex) is divided in several chapters (say chapter1, chapter2, ..., chapter 7). Each chapter will have three sections: "Notes" followed by "Exercises" and then "Solution" with not less than 100 pages.
I know how to use \input
or \include
in a latex document to include multiple files in a single latex document. But while I was doing so, I found that each chapters are much bigger in amount individually and the latex file itself(for the concerned chapter) is getting bigger. I mean to say that suppose I am writing chapter 1. I found even chapter 1 is getting so bigger that the parts "Notes", "Exercise" and "Solution" are making it too complicated.
So what the alternative I have chosen is that I am writing chapter 1 as another new latex document (say CH1.tex) using \input
with NotesCH1.tex, ExercisesCH1.tex and SolutionsCH1.tex Once the document for chapter 1 is finished, I will have to copy-paste busyness in the actual chapter1.tex my book.tex file.
Although I am working on this way, but some times its getting too tedious. Because unless the chapters individually are completed, I can't copy them and paste them in the main latex file.
Today I came to know about the package subfiles
. I have read about it. Tried also and found helpful. It helps to include subfiles in to the main files. So what I did, I created book.tex as master file, under it chapter1.tex as subfile using \include
. But still my problem is not solved. I found that Notes, Exercise and Solution all must be in the same file chapter1.tex
Can't I do like this: in the chapter1.tex I use \include
with Notes.tex, Exercise.tex and Solution.tex and run the master file so that every thing will be compiled together?
For the master file Book.tex
\documentclass{book}
\usepackage{subfiles}
\begin{document}
\include{ch1.tex}
\end{document}
For chapter 1
\documentclass[Book.tex]{subfiles}
\begin{document}
\include{NotesCh1.tex}
\include{ExerciseCh1.tex}
\include{Solutions.tex}
\end{document}
For NotesCh1.tex
This is some notes
For ExerciseCh1.tex
Some exercises
For Solutions.tex
The solutions
I tried as much information about my problem to provide. Please help me. If possible please provide me the latex command or procedures how shall I overcome it. If this has been discussed before, at least provide me that link.
Thanks in advance for your valuable advise
\input
). See Markdown help.\include{ch1.tex}
while you claim to use subfiles. You need to write\subfile{ch1.tex}
to properly usesubfiles
:)