A LuaLaTeX Template with Subfiles Package
- The text is written in sub
.tex
files. - Automatic generation of main and sub
.tex
files - Automatic loads of sub
.tex
files by usingluacode*
- Not redundant
\usepackage
(./sty/common.sty
only)
.
├── Makefile
├── README.md
├── generate.sh
├── parts
│ └── sub
│ ├── article.tex
│ ├── beamer.tex
│ ├── book.tex
│ ├── report.tex
│ └── revtex.tex
├── sty
│ └── common.sty
└── utility
├── core.lua
├── figure.lua
└── load.lua
generate.sh
: use for generatingmain.tex
inMakefile
parts/sub/*
: use for generating sub.tex
files inMakefile
sty/common.sty
: listing of\usepackage
utility/*
: utility Lua codes
make article
\title{}
\author{}
\date{\today}
make
or
latexmk
The generated main.pdf
is at cache/main.pdf
-
Basic
book.cls
article.cls
report.cls
-
Slide
beamer.cls
-
REVTeX
revtex4-2.cls
-
Japanese
ltjsbook.cls
ltjsarticle.cls
ltjsreport.cls
.
├── fig
├── main.bib
├── main.tex
├── sty
│ └── common.sty
├── sub
│ └── part1
│ ├── section0.tex
│ ├── section1.tex
│ ├── section10.tex
│ ├── section2.tex
│ ├── section3.tex
│ ├── section4.tex
│ ├── section5.tex
│ ├── section6.tex
│ ├── section7.tex
│ ├── section8.tex
│ └── section9.tex
└── utility
├── core.lua
├── figure.lua
└── load.lua
main.tex
\documentclass[11pt, a4paper]{article}
\usepackage{./sty/common}
\begin{luacode*}
local core = require("./utility/core")
\end{luacode*}
\graphicspath{{./fig/}}
\title{}
\author{}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\begin{luacode*}
local load = require("./utility/load")
local subfile = load.SubFile:new("sub", 0, 10)
subfile:article()
\end{luacode*}
\bibliography{main}
\bibliographystyle{unsrt}
\end{document}
sub/part1/section0.tex
\documentclass[../../main]{subfiles}
\begin{document}
\end{document}