Simple boiplerplate to organize books in LaTeX and some scripts to help.
book.tex
is where you basic definitions are, title, author, chapter calls etc
cover.tex
is where the book cover is defined, maybe you won't have to change this file.
This directory is where your chapters are. You can create new chapter files with a script (see below) and to use them on your book add \subfile{../chapter/your-file-name.tex}
on book.tex
.
This is where layout configs and enviroments are. Maybe you won't have to change files here.
Well... This one is easy, right? hehe
A file named cover.jpg
will be automatically used in the book cover.
When you compile your book, the compilation logs will appear here. You may ignore this dir if everything is all right :)
This dir is where your pdf will be after compilation
Obs.: whenever you see yarn
you might change for npm run
if you don't have yarn installed.
$ yarn compile
Will compile book/book.tex
(do not change this filename) into pdf/your-book-name.pdf
. If your book name is not defined in package.json
the script will ask you, don't worry. If your book is called "Hi this is my book" the generated file will be pdf/hi-this-is-my-book.pdf
Notice that you might find a error with bibtex
execution, since it will fail if you don't have any bibliography on your book, but that is ok.
$ yarn count
Will count your words chapter by chapter and the total sum :)
$ yarn name
With this command, the script will ask your book name (as in compile script). You can change the name with this script how many times you want.
$ yarn chapter
The script will ask you a chapter name (you may say "chapter 1") and will create a file in chapters/
with the same in lower case separated with hyphens.
Notice that this script will not the chapter to your book, it's up to you add in whatever part of the book you may find appropriate (see the chapter explanation above in Structure section).
To be able to run the scripts, you must have installed:
It will work on a Linux or a Macintosh. If pdflatex
and npm/yarn
run on Windows powershell the scripts might work there :)
It is mostly configured to Brazilian Portuguese. You can change summary name adding this line to your code before \tableofcontents
on book/book.tex
:
\renewcommand*\contentsname{Summary}
This boilerplate was written using a eBook template from LaTeXTemplates from Luis Cobo and Vel under CC BY-NC-SA 3.0 with small modifications of mine.
The book cover is by Solen Freyissa.