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