diff options
author | Karl Berry <karl@freefriends.org> | 2020-01-19 21:36:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-01-19 21:36:06 +0000 |
commit | e280b8ce79a873437681e1be0a382efeee2e272d (patch) | |
tree | 5ee8f83e2a8fbbe82cd673bdbcc0ea338c01c7e9 /Master/texmf-dist | |
parent | 3967f27bf07cac9b78abbfd0b37bea691a6031af (diff) |
ptex2pdf (19jan20)
git-svn-id: svn://tug.org/texlive/trunk@53457 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/ptex2pdf/README.md | 12 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua | 34 |
2 files changed, 29 insertions, 17 deletions
diff --git a/Master/texmf-dist/doc/latex/ptex2pdf/README.md b/Master/texmf-dist/doc/latex/ptex2pdf/README.md index 6cbd1d68788..bf4890b6aa2 100644 --- a/Master/texmf-dist/doc/latex/ptex2pdf/README.md +++ b/Master/texmf-dist/doc/latex/ptex2pdf/README.md @@ -17,7 +17,7 @@ by dvipdfmx. ## Usage ## ````` -[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... +[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... options: -v version -h help -help print full help (installation, TeXworks setup) @@ -160,18 +160,20 @@ http://github.com/texjporg/ptex2pdf first replace all backslash chars to slash chars - version 20170622.0 pass all non-optional arguments before filename to TeX engine -- version 20180514.0 +- version 20180514.0 Windows: for uptex use command_line_encoding=utf8, for all other turn it off (set to none) -- version 20181212.0 +- version 20181212.0 support directories containing dots (thanks kn1cht) +- version 20200119.0 + check invalid PATH string beforehand on windows ## Copyright and License ## Originally based on musixtex.lua from Bob Tennent. -(c) Copyright 2016-2018 Japanese TeX Development Community -(c) Copyright 2013-2018 Norbert Preining norbert@preining.info +(c) Copyright 2016-2020 Japanese TeX Development Community +(c) Copyright 2013-2020 Norbert Preining norbert@preining.info (c) Copyright 2012 Bob Tennent rdt@cs.queensu.ca This program is free software; you can redistribute it and/or modify it diff --git a/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua b/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua index e05b75c4951..4f601437a1f 100755 --- a/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua +++ b/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua @@ -1,7 +1,7 @@ #!/usr/bin/env texlua NAME = "ptex2pdf[.lua]" -VERSION = "20181212.0" +VERSION = "20200119.0" AUTHOR = "Norbert Preining" AUTHOREMAIL = "norbert@preining.info" SHORTDESC = "Convert Japanese TeX documents to pdf" @@ -13,7 +13,7 @@ programs (ptex, uptex, eptex, euptex, platex, uplatex) followed by dvipdfmx. ]] USAGE = [[ -[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... +[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... options: -v version -h help -help print full help (installation, TeXworks setup) @@ -29,8 +29,8 @@ options: -v version LICENSECOPYRIGHT = [[ Originally based on musixtex.lua from Bob Tennent. -(c) Copyright 2016-2018 Japanese TeX Development Community -(c) Copyright 2013-2018 Norbert Preining norbert@preining.info +(c) Copyright 2016-2020 Japanese TeX Development Community +(c) Copyright 2013-2020 Norbert Preining norbert@preining.info (c) Copyright 2012 Bob Tennent rdt@cs.queensu.ca This program is free software; you can redistribute it and/or modify it @@ -174,11 +174,13 @@ CHANGELOG = [[ first replace all backslash chars to slash chars - version 20170622.0 pass all non-optional arguments before filename to TeX engine -- version 20180514.0 +- version 20180514.0 Windows: for uptex use command_line_encoding=utf8, for all other turn it off (set to none) -- version 20181212.0 +- version 20181212.0 support directories containing dots (thanks kn1cht) +- version 20200119.0 + check invalid PATH string beforehand on windows ]] @@ -338,7 +340,7 @@ repeat end end --if this_arg == ... narg = narg+1 -until narg > #arg +until narg > #arg whoami() @@ -424,9 +426,17 @@ if (outputdir ~= ".") then dvipdfopts = "-o \"" .. bname .. ".pdf\"" end print("Processing ".. filename) -if (os.execute(tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\"") == 0) and - (dvipdf == "" or (os.execute(dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\"") == 0)) then - if dvipdf ~= "" then +texcmd = tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\"" +tex_return = os.execute(texcmd) +-- if os.execute(texcmd) returns -1 on Windows, then +-- cmd.exe is not included in PATH, or some invalid string found before cmd.exe +if os.type == 'windows' and tex_return == -1 then + print("Invalid PATH setting found. Please ensure that cmd.exe can be found.\n") +end +dvipdfcmd = dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\"" +if tex_return == 0 and + (dvipdf == "" or (os.execute(dvipdfcmd) == 0)) then + if dvipdf ~= "" then print(bname .. ".pdf generated by " .. dvipdf .. ".") end if intermediate == 1 then -- clean-up: @@ -436,8 +446,8 @@ if (os.execute(tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\"" end else print("ptex2pdf processing of " .. filename .. " failed.\n") - print_ifdebug("tex = " .. tex) - print_ifdebug("dvipdf = " .. dvipdf) + print_ifdebug("tex = " .. texcmd) + print_ifdebug("dvipdf = " .. dvipdfcmd) os.exit(2) end |