From fccbbdebf9887a283cd611aba2e1fc0a605aec8e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 20 Jan 2020 03:01:03 +0000 Subject: CTAN sync 202001200301 --- language/japanese/ptex2pdf/README.md | 12 +++++++----- language/japanese/ptex2pdf/ptex2pdf.lua | 34 +++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'language') diff --git a/language/japanese/ptex2pdf/README.md b/language/japanese/ptex2pdf/README.md index 6cbd1d6878..bf4890b6aa 100644 --- a/language/japanese/ptex2pdf/README.md +++ b/language/japanese/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/language/japanese/ptex2pdf/ptex2pdf.lua b/language/japanese/ptex2pdf/ptex2pdf.lua index e05b75c495..4f601437a1 100755 --- a/language/japanese/ptex2pdf/ptex2pdf.lua +++ b/language/japanese/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 -- cgit v1.2.3