A LuaLaTeX Template with Subfiles Package
- The text is written in sub
.texfiles. - Automatic generation of main and sub
.texfiles - Automatic loads of sub
.texfiles by usingluacode* - Not redundant
\usepackage(./sty/common.styonly)
.
├── 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.texinMakefileparts/sub/*: use for generating sub.texfiles inMakefilesty/common.sty: listing of\usepackageutility/*: utility Lua codes
make article\title{}
\author{}
\date{\today}makeor
latexmkThe generated main.pdf is at cache/main.pdf
-
Basic
book.clsarticle.clsreport.cls
-
Slide
beamer.cls
-
REVTeX
revtex4-2.cls
-
Japanese
ltjsbook.clsltjsarticle.clsltjsreport.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}