This is an excerpt of the book “Better Books with LaTeX.” The book comes with a LaTeX template you can use to easily create your own books.

As you have learned by now, LaTeX documents are projects consisting of a whole folder of files as opposed to everything being in a single file such as with Word documents. While this adds a bit of an overhead, this way of creating documents shines once your project gets larger—or when you work on multiple books. As opposed to fiction books, in non-fiction books you will encounter repetitions over the span of your series or your general field.

For example, in my philosophy book series, each book can stand on its own. This means I have to repeat some of the definitions, examples, or explanations from previous books. Sure, you can copy and paste it and are done with it. But managing books over a lifetime requires working in updates. What if you want to change something in your definitions? Will you be able to keep the texts identical? Or even for novels, you might want to bring out a new edition of a particular book. Will you manage several different author pages, publisher information pages, advertisement pages, and so on?

Once you become proficient with your work, you will have to advance one level and manage your content. LaTeX projects offer the solution for this: you can simply link files of another project to yours and insert it seamlessly. The way to do it in Overleaf is this:

  • Select the folder where you want the file to be linked to.
  • Click on the arrow right of the folder name and select “Add…” and “File from other Project.”
  • Select the project, and then the file you want to link.

Once linked, you can use the file like a normal file in your project. Linked files show a different icon (a small chain) and you can simply access them via “\input{folder/file}”. You can of course also link images or any other type of file and use it with the corresponding commands (e.g., “\includegraphics{folder/file}”).

There are some limitations by Overleaf to this approach, though. Those might be fixed in the future, but at the moment, you can edit the file only in the original project, and when edited in the original project, you have to go again into the menu and select “Refresh linked files.”

What are possible candidates for linking? Let us take a look at the template:

  • Whole sections if you create a new version of your book with a different focus.
  • The bibliography—imagine having like a single library for all your projects.
  • Individual glossary, idea, or question items.
  • Images in general.
  • Template style files (in the lib directory).
  • The htlatex tools (latexmkrchtlatex.cfg, and site.css).

For the latter two items (the template style files, and the htlatex tools), you might have to be careful when linking them and making changes as it might change the paging of all your projects that use the file. On the other hand, if you plan to create new editions with a new layout anyways, it is easier and less likely to cause errors to have all your style files in one place and make each change only once.

For example, let us assume you have five LaTeX projects and want to change the book size from 5.25”x8” to 6”x9”. If the style files are linked, you would need to make only one change in thelib/bookformat.tex file and refresh the other projects and you are done. Of course it means that the layout of all the books change, but that is what you wanted anyways.

So, ultimately, the benefit depends on your situation. I advise to simply keep this feature in mind, and start writing your first few books. Once you can see a possible benefit of reorganizing your books, start by creating a central main project in Overleaf which houses your shared bibliography, glossary items, and so on, and link to them in the individual projects.

Whenever you make changes to your general template settings, you no longer have to make changes in each project individually. Instead, you can change it in the central main project, and then just refresh all the linked files in each of your book projects for the changes to take effect. For example, you have found a spelling error in your bibliography. You can fix this issue in the central main project and have the other projects refresh their bibliography, instead of having to apply the fix to every single bibliography file of each project.

Did you know?

Please note, though, that this is just the outline of the general idea. If you are seriously considering managing all your books in Overleaf , you need to do some planning. If you need help with project management, how you can organize your ideas, and bring them to paper quickly, we can help! -→ Read more in Writing Better Books, the Agile Way