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 | |
parent | 3967f27bf07cac9b78abbfd0b37bea691a6031af (diff) |
ptex2pdf (19jan20)
git-svn-id: svn://tug.org/texlive/trunk@53457 c570f23f-e606-0410-a88d-b1316a301751
7 files changed, 55 insertions, 33 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua b/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua index e05b75c4951..4f601437a1f 100755 --- a/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua +++ b/Build/source/texk/texlive/linked_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 diff --git a/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr b/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr index 5fde39e2c2d..f66c75f0b78 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr +++ b/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr @@ -10,7 +10,7 @@ # Originally written as `texhash' by Thomas Esser, Okt., 1994. # Public domain. -version='$Id: mktexlsr 46343 2018-01-17 00:55:32Z preining $' +version='$Id: mktexlsr 53254 2019-12-29 19:18:55Z karl $' progname=`echo $0 | sed 's%.*/%%'` usage="Usage: $progname [OPTION]... [DIR]... diff --git a/Build/source/texk/texlive/linked_scripts/texlive/mktexmf b/Build/source/texk/texlive/linked_scripts/texlive/mktexmf index bb868c12a8d..5d6d24a5e42 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/mktexmf +++ b/Build/source/texk/texlive/linked_scripts/texlive/mktexmf @@ -7,7 +7,7 @@ # Originally written by Thomas Esser. # Public domain. -version='$Id: mktexmf 34656 2014-07-18 23:38:50Z karl $' +version='$Id: mktexmf 53254 2019-12-29 19:18:55Z karl $' # preferentially use subprograms from our own directory. mydir=`echo "$0" | sed 's,/[^/]*$,,'` diff --git a/Build/source/texk/texlive/linked_scripts/texlive/mktexpk b/Build/source/texk/texlive/linked_scripts/texlive/mktexpk index 2672dc7f78c..2b06f38a89d 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/mktexpk +++ b/Build/source/texk/texlive/linked_scripts/texlive/mktexpk @@ -7,7 +7,7 @@ # Originally written by Thomas Esser, Karl Berry, and Olaf Weber. # Public domain. -version='$Id: mktexpk 34656 2014-07-18 23:38:50Z karl $' +version='$Id: mktexpk 53254 2019-12-29 19:18:55Z karl $' progname=`echo $0 | sed 's%.*/%%'` # preferentially use subprograms from our own directory. diff --git a/Build/source/texk/texlive/linked_scripts/texlive/mktextfm b/Build/source/texk/texlive/linked_scripts/texlive/mktextfm index 46e30a9c5dc..97d22939758 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/mktextfm +++ b/Build/source/texk/texlive/linked_scripts/texlive/mktextfm @@ -7,7 +7,7 @@ # Primarily written by Thomas Esser, Karl Berry, and Olaf Weber. # Public domain. -version='$Id: mktextfm 34656 2014-07-18 23:38:50Z karl $' +version='$Id: mktextfm 53254 2019-12-29 19:18:55Z karl $' progname=`echo $0 | sed 's%.*/%%'` # preferentially use subprograms from our own directory. 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 |