mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-06-01 18:15:17 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b90c11e4a | ||
|
|
84c32c4d01 | ||
|
|
7fc52cfd28 |
49
build.lua
49
build.lua
@@ -8,7 +8,7 @@
|
|||||||
Do Check Before Upload
|
Do Check Before Upload
|
||||||
--]==========================================]--
|
--]==========================================]--
|
||||||
module = "elegantbook"
|
module = "elegantbook"
|
||||||
version = "4.7"
|
version = "4.7 2026-05-01"
|
||||||
maintainer = "Ran Wang"
|
maintainer = "Ran Wang"
|
||||||
uploader = maintainer
|
uploader = maintainer
|
||||||
maintainid = "ElegantLaTeX"
|
maintainid = "ElegantLaTeX"
|
||||||
@@ -25,7 +25,7 @@ description = [[ElegantBook is designed for writing Books. This template is
|
|||||||
--]==========================================]--
|
--]==========================================]--
|
||||||
ctanzip = module
|
ctanzip = module
|
||||||
excludefiles = {"*~"}
|
excludefiles = {"*~"}
|
||||||
textfiles = {"*.md", "LICENSE", "*.lua", "*.cls", "*.bib"}
|
textfiles = {"*.md", "LICENSE", "*.lua", "*.cls", "*.bib", "*.tex"}
|
||||||
typesetexe = "latexmk -pdf"
|
typesetexe = "latexmk -pdf"
|
||||||
typesetfiles = {module .. "-cn.tex", module .. "-en.tex"}
|
typesetfiles = {module .. "-cn.tex", module .. "-en.tex"}
|
||||||
typesetopts = "-interaction=nonstopmode"
|
typesetopts = "-interaction=nonstopmode"
|
||||||
@@ -35,6 +35,9 @@ imagesuppdir = "image"
|
|||||||
figuresuppdir = "figure"
|
figuresuppdir = "figure"
|
||||||
specialtypesetting = specialtypesetting or {}
|
specialtypesetting = specialtypesetting or {}
|
||||||
specialtypesetting[module .. "-cn.tex"] = {cmd = "latexmk -pdfxe"}
|
specialtypesetting[module .. "-cn.tex"] = {cmd = "latexmk -pdfxe"}
|
||||||
|
binaryfiles = {"*.png", "*.jpg", "*.pdf"}
|
||||||
|
sourcefiles = {"*.cls", "*.bib"}
|
||||||
|
docfiles = {"*.pdf", "*.md", "LICENSE", module .. "-cn.tex", module .. "-en.tex"}
|
||||||
|
|
||||||
uploadconfig = {
|
uploadconfig = {
|
||||||
pkg = module,
|
pkg = module,
|
||||||
@@ -48,7 +51,6 @@ uploadconfig = {
|
|||||||
note = note,
|
note = note,
|
||||||
license = "lppl1.3c",
|
license = "lppl1.3c",
|
||||||
ctanPath = "/macros/latex/contrib/" .. module .. "/",
|
ctanPath = "/macros/latex/contrib/" .. module .. "/",
|
||||||
home = repository,
|
|
||||||
support = repository .. "/issues",
|
support = repository .. "/issues",
|
||||||
bugtracker = repository .. "/issues",
|
bugtracker = repository .. "/issues",
|
||||||
repository = repository,
|
repository = repository,
|
||||||
@@ -56,47 +58,48 @@ uploadconfig = {
|
|||||||
update = true
|
update = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--[==========================================[--
|
||||||
|
Custom Hooks for Directory Structure
|
||||||
|
--]==========================================]--
|
||||||
|
|
||||||
function tex(file, dir, cmd)
|
function tex(file, dir, cmd)
|
||||||
dir = dir or "."
|
dir = dir or "."
|
||||||
cmd = cmd or typesetexe .. " " .. typesetopts
|
cmd = cmd or typesetexe .. " " .. typesetopts
|
||||||
return run(dir, cmd .. " " .. file)
|
return run(dir, cmd .. " " .. file)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Copy required files into the typeset build dir
|
|
||||||
function docinit_hook()
|
function docinit_hook()
|
||||||
-- Copy .cls, .bib support files
|
|
||||||
for _, glob in pairs(typesetsuppfiles) do
|
for _, glob in pairs(typesetsuppfiles) do
|
||||||
cp(glob, currentdir, typesetdir)
|
cp(glob, currentdir, typesetdir)
|
||||||
end
|
end
|
||||||
-- Copy image subdirectory
|
|
||||||
for _, subdir in pairs({imagesuppdir, figuresuppdir}) do
|
for _, subdir in pairs({imagesuppdir, figuresuppdir}) do
|
||||||
local dest = typesetdir .. "/" .. subdir
|
local dest = typesetdir .. "/" .. subdir
|
||||||
mkdir(dest)
|
mkdir(dest)
|
||||||
cp("*", subdir, dest)
|
cp("*", subdir, dest)
|
||||||
end
|
end
|
||||||
-- Copy tex source files
|
|
||||||
for _, texfile in pairs(typesetfiles) do
|
for _, texfile in pairs(typesetfiles) do
|
||||||
cp(texfile, currentdir, typesetdir)
|
cp(texfile, currentdir, typesetdir)
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Pack CTAN directory: cls, bib, tex sources, PDFs, and asset subdirs
|
|
||||||
function copyctan()
|
function copyctan()
|
||||||
local pkgdir = ctandir .. "/" .. ctanpkg
|
local target = ctandir .. "/" .. ctanpkg
|
||||||
mkdir(pkgdir)
|
mkdir(target)
|
||||||
for _, glob in pairs(typesetsuppfiles) do
|
|
||||||
cp(glob, currentdir, pkgdir)
|
for _, f in ipairs(textfiles) do
|
||||||
end
|
cp(f, ".", target)
|
||||||
for _, texfile in pairs(typesetfiles) do
|
|
||||||
cp(texfile, currentdir, pkgdir)
|
|
||||||
end
|
|
||||||
for _, glob in pairs(pdffiles or {"*.pdf"}) do
|
|
||||||
cp(glob, typesetdir, pkgdir)
|
|
||||||
end
|
|
||||||
for _, subdir in pairs({imagesuppdir, figuresuppdir}) do
|
|
||||||
local dest = pkgdir .. "/" .. subdir
|
|
||||||
mkdir(dest)
|
|
||||||
cp("*", subdir, dest)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cp("*.pdf", typesetdir, target)
|
||||||
|
|
||||||
|
mkdir(target .. "/" .. figuresuppdir)
|
||||||
|
cp("*", figuresuppdir, target .. "/" .. figuresuppdir)
|
||||||
|
|
||||||
|
mkdir(target .. "/" .. imagesuppdir)
|
||||||
|
cp("*", imagesuppdir, target .. "/" .. imagesuppdir)
|
||||||
|
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
% It is available at https://github.com/ElegantLaTeX/ElegantBook
|
% It is available at https://github.com/ElegantLaTeX/ElegantBook
|
||||||
% -----------------------------------------------------------------------------
|
% -----------------------------------------------------------------------------
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesClass{elegantbook}[2026/2/27 v4.6 ElegantBook document class]
|
\ProvidesClass{elegantbook}[2026/05/01 v4.7 ElegantBook document class]
|
||||||
|
|
||||||
%%%
|
%%%
|
||||||
\RequirePackage{kvoptions}
|
\RequirePackage{kvoptions}
|
||||||
|
|||||||
Reference in New Issue
Block a user