latex: book
This commit is contained in:
parent
8acc6e91d1
commit
5c59396e5d
8 changed files with 121 additions and 0 deletions
17
README.md
17
README.md
|
@ -5,6 +5,7 @@
|
|||
- [LaTeX](#latex)
|
||||
- [Document](#document)
|
||||
- [Presentation](#presentation)
|
||||
- [Book](#book)
|
||||
- [Python](#python)
|
||||
- [OCaml](#ocaml)
|
||||
- [Rust](#rust)
|
||||
|
@ -34,6 +35,8 @@ Copy and paste [`cpp/`](./cpp/) directory, and you should be good to go!
|
|||
|
||||
### Document
|
||||
|
||||
This is for simple document.
|
||||
|
||||
Copy and paste [`latex/document`](./latex/document/) directory,
|
||||
and you should be good to go!
|
||||
|
||||
|
@ -44,6 +47,8 @@ and you should be good to go!
|
|||
|
||||
### Presentation
|
||||
|
||||
This is for presentations.
|
||||
|
||||
Copy and paste [`latex/presentation`](./latex/presentation/) directory,
|
||||
and you should be good to go!
|
||||
|
||||
|
@ -54,6 +59,18 @@ and you should be good to go!
|
|||
> It is by default configured to build `slides.tex` and output `slides.pdf`.
|
||||
> There is a more advanced file with more examples named `slides_advanced.tex`.
|
||||
|
||||
### Book
|
||||
|
||||
This is for complex document.
|
||||
|
||||
Copy and paste [`latex/book`](./latex/book/) directory,
|
||||
and you should be good to go!
|
||||
|
||||
- **Run `make` to compile the document.**
|
||||
- **Run `make clean` to clean artifacts.**
|
||||
|
||||
> It is by default configured to output `book.pdf`.
|
||||
|
||||
## Python
|
||||
|
||||
Copy and paste [`python/`](./python/) directory, and you should be good to go!
|
||||
|
|
8
latex/book/.gitignore
vendored
Normal file
8
latex/book/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
*
|
||||
|
||||
!.gitignore
|
||||
!Makefile
|
||||
!*.tex
|
||||
!*.bib
|
||||
|
||||
!sections/
|
18
latex/book/Makefile
Normal file
18
latex/book/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
NAME = book
|
||||
|
||||
TEX = $(NAME).tex
|
||||
SRC = $(TEX)
|
||||
PDF = $(TEX:.tex=.pdf)
|
||||
|
||||
TEXMK = latexmk -lualatex -shell-escape -interaction=nonstopmode
|
||||
|
||||
.PHONY: $(PDF)
|
||||
|
||||
all: $(PDF)
|
||||
|
||||
$(PDF): %.pdf: %.tex
|
||||
$(TEXMK) $<
|
||||
|
||||
EXTS = aux fdb_latexmk fls log nav out snm synctex.gz toc bbl blg sta
|
||||
clean:
|
||||
rm -rf $(PDF) _minted-$(NAME)/ $(foreach ext,$(EXTS),$(NAME).$(ext))
|
53
latex/book/book.tex
Normal file
53
latex/book/book.tex
Normal file
|
@ -0,0 +1,53 @@
|
|||
\documentclass{article}
|
||||
|
||||
% Files
|
||||
\usepackage[subpreambles=true]{standalone}
|
||||
\usepackage{import}
|
||||
|
||||
\usepackage[T1]{fontenc} % encoding
|
||||
\renewcommand{\familydefault}{\sfdefault} % sans-serif font
|
||||
|
||||
\usepackage[french]{babel} % langages
|
||||
\frenchsetup{SmallCapsFigTabCaptions=false}
|
||||
|
||||
% Bibliography
|
||||
\bibliographystyle{unsrt}
|
||||
\nocite{*}
|
||||
|
||||
% Metadata
|
||||
\def\docTitle{Title}
|
||||
\def\docAuthor{Author}
|
||||
|
||||
% Dependencies
|
||||
\usepackage[
|
||||
pdfauthor={\docAuthor},
|
||||
pdftitle={\docTitle},
|
||||
hidelinks,
|
||||
]{hyperref}
|
||||
|
||||
|
||||
\title{\docTitle}
|
||||
\author{\docAuthor}
|
||||
\date{}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\flushbottom
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
|
||||
\section{First section}
|
||||
\import{sections/}{section1}
|
||||
|
||||
\section{Second section}
|
||||
\import{sections/}{section2}
|
||||
|
||||
\section{Third section}
|
||||
\import{sections/}{section3}
|
||||
|
||||
\clearpage
|
||||
\appendix
|
||||
\bibliography{sources}
|
||||
|
||||
\end{document}
|
7
latex/book/sections/section1.tex
Normal file
7
latex/book/sections/section1.tex
Normal file
|
@ -0,0 +1,7 @@
|
|||
\documentclass[class=article]{standalone}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Here is the first section.
|
||||
|
||||
\end{document}
|
7
latex/book/sections/section2.tex
Normal file
7
latex/book/sections/section2.tex
Normal file
|
@ -0,0 +1,7 @@
|
|||
\documentclass[class=article]{standalone}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Here is the second section.
|
||||
|
||||
\end{document}
|
7
latex/book/sections/section3.tex
Normal file
7
latex/book/sections/section3.tex
Normal file
|
@ -0,0 +1,7 @@
|
|||
\documentclass[class=article]{standalone}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Here is the third section.
|
||||
|
||||
\end{document}
|
4
latex/book/sources.bib
Normal file
4
latex/book/sources.bib
Normal file
|
@ -0,0 +1,4 @@
|
|||
@misc{example,
|
||||
author = {John Doe},
|
||||
howpublished = {\url{https://example.com}}
|
||||
}
|
Loading…
Reference in a new issue