/
githubmirror
/
pandoc
Обзор
Документация
Войти
/
githubmirror
/
pandoc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/latex-package-dependencies.lua
26 строк
594 B
John MacFarlane
Add tools/latex-package-dependencies.lua.
18 окт 2022, 07:59
18 окт 2022, 07:59
4de3a9c
Код
Авторство
О чём код?
-- Print latex packages needed by pandoc's default latex template. -- Usage: pandoc lua tools/latex-package-dependencies.lua local templ = pandoc.template.default("latex") local packages = {} templ:gsub("\\usepackage *%b[] *%{([^}]*)%}", function(capt) capt:gsub("([^,]+)", function (pkg) if not pkg:find("%$") then packages[pkg] = true end end) end) templ:gsub("\\usepackage *%{([^}]*)%}", function(capt) capt:gsub("([^,]+)", function (pkg) if not pkg:find("%$") then packages[pkg] = true end end) end) for pkg,_ in pairs(packages) do print(pkg) end