Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
h20y6m committed Aug 11, 2022
1 parent bfd8165 commit 3d14629
Show file tree
Hide file tree
Showing 14 changed files with 963 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/*

*.zip

*.pdf
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) 2010 ASCII MEDIA WORKS
Copyright (c) 2016-2022 Japanese TeX Development Community
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77 changes: 77 additions & 0 deletions build.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
module = "plexpl3"
bundle = ""

maindir = "."

checkengines = {"ptex","uptex"}
stdengine = "ptex"
checkformat = "latex"
checkopts = " -interaction=nonstopmode -no-guess-input-enc -kanji=utf8 "

installfiles = {"plexpl3.ltx","plexpl3.sty"}

typesetexe = "platex"
typesetopts = " -interaction=nonstopmode -no-guess-input-enc -kanji=utf8 "

unpackexe = "ptex"
unpackopts = " -interaction=nonstopmode -no-guess-input-enc -kanji=utf8 "

-- Do not break non-ascii chars in log file
asciiengines = {}

-- Typeseting with dvipdfmx
function typeset(file,dir,exe)
dir = dir or "."
local errorlevel = tex(file,dir,exe)
if errorlevel ~= 0 then
return errorlevel
end
local name = jobname(file)
errorlevel = biber(name,dir) + bibtex(name,dir)
if errorlevel ~= 0 then
return errorlevel
end
for i = 2,typesetruns do
errorlevel =
makeindex(name,dir,".glo",".gls",".glg",glossarystyle) +
makeindex(name,dir,".idx",".ind",".ilg",indexstyle) +
tex(file,dir,exe)
if errorlevel ~= 0 then break end
end
-- Run dvipdfmx if .dvi file extists
if fileexists(dir .. "/" .. name .. dviext) then
errorlevel = runcmd("dvipdfmx " .. name, dir, {})
end
return errorlevel
end

local function mkfmts(engines,dir)
for _,engine in pairs(engines) do
engine = string.gsub(engine,"latex$","tex")
local ininame = string.gsub(engine,"tex$","latex.ini")
if engine:match("u?ptex") then
engine = "e" .. engine
end
runcmd(engine .. " -etex -ini " .. ininame, dir, {})
end
return 0
end

function checkinit_hook()
local engines = options.engine
if not engines then
local target = options.target
if target == 'check' or target == 'bundlecheck' then
engines = checkengines
elseif target == 'save' then
engines = {stdengine}
else
error'Unexpected target in call to checkinit_hook'
end
end
return mkfmts(engines, testdir)
end

function docinit_hook()
return mkfmts({typesetexe},typesetdir)
end
Loading

0 comments on commit 3d14629

Please sign in to comment.