texlive[44470] trunk: ptex2pdf (5jun17)

commits+karl at tug.org commits+karl at tug.org
Tue Jun 6 01:10:36 CEST 2017


Revision: 44470
          http://tug.org/svn/texlive?view=revision&revision=44470
Author:   karl
Date:     2017-06-06 01:10:36 +0200 (Tue, 06 Jun 2017)
Log Message:
-----------
ptex2pdf (5jun17)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md
    trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua	2017-06-05 23:09:50 UTC (rev 44469)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua	2017-06-05 23:10:36 UTC (rev 44470)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 
 NAME = "ptex2pdf[.lua]"
-VERSION = "0.9"
+VERSION = "20170604.0"
 AUTHOR = "Norbert Preining"
 AUTHOREMAIL = "norbert at preining.info"
 SHORTDESC = "Convert Japanese TeX documents to pdf"
@@ -9,7 +9,8 @@
 Main purpose of the script is easy support of Japanese typesetting
 engines in TeXworks. As TeXworks typesetting setup does not allow
 for multistep processing, this script runs one of the ptex based
-programs (ptex, uptex, eptex, platex, uplatex) followed by dvipdfmx.
+programs (ptex, uptex, eptex, euptex, platex, uplatex) followed
+by dvipdfmx.
 ]]
 USAGE = [[
 [texlua] ptex2pdf[.lua] { option | basename[.tex] } ... 
@@ -28,9 +29,9 @@
 LICENSECOPYRIGHT = [[
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016      by Japanese TeX Development Community  
-(c) Copyright 2013-2016 Norbert Preining norbert at preining.info  
-(c) Copyright 2012 Bob Tennent rdt at cs.queensu.ca  
+(c) Copyright 2016-2017 Japanese TeX Development Community  
+(c) Copyright 2013-2017 Norbert Preining norbert at preining.info  
+(c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca  
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -73,62 +74,61 @@
 
 for ptex files:
 
-| Setting     |  Value           |
-|-------------|------------------|
-| Name:       |  pTeX to pdf     |
-| Program:    |  ptex2pdf        |
-| Arguments:  |  -ot             |
-|             |  $synctexoption  |
-|             |  $fullname       |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pTeX (ptex2pdf)    |
+| Program:    | ptex2pdf           |
+| Arguments:  | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
-
 for platex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | pLaTeX to pdf  |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pLaTeX (ptex2pdf)  |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uptex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upTeX to pdf   |
-| Program:    | ptex2pdf       |
-| Arguments:  | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upTeX (ptex2pdf)   |
+| Program:    | ptex2pdf           |
+| Arguments:  | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uplatex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upLaTeX to pdf |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upLaTeX (ptex2pdf) |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 If you need special kanji encodings for one of these programs,
-add the respective `-kanji` option after the `$synctexoption`. Example:
+add the respective `-kanji` option with the `$synctexoption`. Example:
 
 for platex files in SJIS encoding:
 
-| Setting     | Value                       |
-|-------------|-----------------------------|
-| Name:       | pLaTeX/SJIS to pdf          |
-| Program:    | ptex2pdf                    |
-| Arguments:  | -l                          |
-|             | -ot                         |
-|             | $synctexoption -kanji=sjis  |
-|             | $fullname                   |
+| Setting     | Value                      |
+|-------------|----------------------------|
+| Name:       | pLaTeX/SJIS (ptex2pdf)     |
+| Program:    | ptex2pdf                   |
+| Arguments:  | -l                         |
+|             | -ot                        |
+|             | -kanji=sjis $synctexoption |
+|             | $fullname                  |
 ]]
 
 DEVELPLACE = "http://github.com/texjporg/ptex2pdf"
@@ -168,6 +168,10 @@
   update copyright and development place (now in texjp)  
   support 'flag=val' to specify option values  
   only allow one (1) filename argument  
+- version 20170603.0  
+  start version number in the format YYYYMMDD.0  
+  better support for cp932 windows filenames  
+  first replace all backslash chars to slash chars  
 ]]
 
 
@@ -242,6 +246,14 @@
   print("This is " .. NAME .. " version ".. VERSION .. ".")
 end
 
+function print_ifdebug(message) -- for debugging: accepts only one argument
+  --print("DEBUG: " .. message) -- uncomment for debugging
+end
+
+function slashify(str) -- replace "\" with "/", mainly for path strings on cp932 windows
+  return (tostring(str):gsub("[\x81-\x9f\xe0-\xfc]?.", { ["\\"] = "/" }))
+end
+
 if #arg == 0 then
   usage()
   os.exit(0)
@@ -360,7 +372,8 @@
 if ( filename == "" ) then
   print("No filename argument given, exiting.")
   os.exit(1)
-else 
+else
+  filename = slashify(filename)
   if ( kpse.find_file(filename) == nil ) then
     -- try .tex extension
     if ( kpse.find_file(filename .. ".tex") == nil ) then
@@ -380,9 +393,10 @@
     -- if it has already an extension, we need to drop it to get the dvi name
     bname = string.gsub(filename, "^(.*)%.[^.]+$", "%1")
   end
-  -- filename may contain "/" or "\", but the intermediate output is written
+  -- filename may contain "/", but the intermediate output is written
   -- in current directory, so we need to drop it
-  bname = string.gsub(bname, "^.*[/\\](.*)$", "%1")
+  -- note that all "\" has been replaced with "/"
+  bname = string.gsub(bname, "^.*/(.*)$", "%1")
 end
 
 -- we are still here, so we found a file
@@ -410,10 +424,8 @@
   end
 else
   print("ptex2pdf processing of " .. filename .. " failed.\n")
-    --[[ uncomment for debugging
-    print("tex = ", tex)
-    print("dvipdf = ", dvipdf)
-    --]]
+  print_ifdebug("tex = " .. tex)
+  print_ifdebug("dvipdf = " .. dvipdf)
   os.exit(2)
 end
 

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2017-06-05 23:09:50 UTC (rev 44469)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2017-06-05 23:10:36 UTC (rev 44470)
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 44422 2017-05-19 15:07:25Z karl $
+# $Id: tlmgr.pl 44452 2017-06-04 23:45:39Z karl $
 #
 # Copyright 2008-2017 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
@@ -6,8 +6,8 @@
 # or any later version.
 #
 
-my $svnrev = '$Revision: 44422 $';
-my $datrev = '$Date: 2017-05-19 17:07:25 +0200 (Fri, 19 May 2017) $';
+my $svnrev = '$Revision: 44452 $';
+my $datrev = '$Date: 2017-06-05 01:45:39 +0200 (Mon, 05 Jun 2017) $';
 my $tlmgrrevision;
 my $prg;
 if ($svnrev =~ m/: ([0-9]+) /) {
@@ -2559,8 +2559,12 @@
   # if --list is given:    nothing
   # other options just change the behavior
   if (!($opts{"list"} || @ARGV || $opts{"all"} || $opts{"self"})) {
-    tlwarn("$prg update: specify --list, --all, --self, or a list of package names.\n");
-    return ($F_ERROR);
+    if ($opts{"dry-run"}) {
+      $opts{"list"} = 1; # update -n same as update -n --list
+    } else {
+      tlwarn("$prg update: specify --list, --all, --self, or a list of package names.\n");
+      return ($F_ERROR);
+    }
   }
 
   init_tlmedia_or_die();
@@ -8883,7 +8887,7 @@
 distribution (L<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 44422 2017-05-19 15:07:25Z karl $
+$Id: tlmgr.pl 44452 2017-06-04 23:45:39Z karl $
 =cut
 
 # to remake HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md	2017-06-05 23:09:50 UTC (rev 44469)
+++ trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md	2017-06-05 23:10:36 UTC (rev 44470)
@@ -11,7 +11,8 @@
 Main purpose of the script is easy support of Japanese typesetting
 engines in TeXworks. As TeXworks typesetting setup does not allow
 for multistep processing, this script runs one of the ptex based
-programs (ptex, uptex, eptex, platex, uplatex) followed by dvipdfmx.
+programs (ptex, uptex, eptex, euptex, platex, uplatex) followed
+by dvipdfmx.
 
 ## Usage ##
 
@@ -57,62 +58,61 @@
 
 for ptex files:
 
-| Setting     |  Value           |
-|-------------|------------------|
-| Name:       |  pTeX to pdf     |
-| Program:    |  ptex2pdf        |
-| Arguments:  |  -ot             |
-|             |  $synctexoption  |
-|             |  $fullname       |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pTeX (ptex2pdf)    |
+| Program:    | ptex2pdf           |
+| Arguments:  | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
-
 for platex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | pLaTeX to pdf  |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pLaTeX (ptex2pdf)  |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uptex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upTeX to pdf   |
-| Program:    | ptex2pdf       |
-| Arguments:  | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upTeX (ptex2pdf)   |
+| Program:    | ptex2pdf           |
+| Arguments:  | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uplatex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upLaTeX to pdf |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upLaTeX (ptex2pdf) |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 If you need special kanji encodings for one of these programs,
-add the respective `-kanji` option after the `$synctexoption`. Example:
+add the respective `-kanji` option with the `$synctexoption`. Example:
 
 for platex files in SJIS encoding:
 
-| Setting     | Value                       |
-|-------------|-----------------------------|
-| Name:       | pLaTeX/SJIS to pdf          |
-| Program:    | ptex2pdf                    |
-| Arguments:  | -l                          |
-|             | -ot                         |
-|             | $synctexoption -kanji=sjis  |
-|             | $fullname                   |
+| Setting     | Value                      |
+|-------------|----------------------------|
+| Name:       | pLaTeX/SJIS (ptex2pdf)     |
+| Program:    | ptex2pdf                   |
+| Arguments:  | -l                         |
+|             | -ot                        |
+|             | -kanji=sjis $synctexoption |
+|             | $fullname                  |
 
 
 ## Development place ##
@@ -154,14 +154,18 @@
   update copyright and development place (now in texjp)  
   support 'flag=val' to specify option values  
   only allow one (1) filename argument  
+- version 20170603.0  
+  start version number in the format YYYYMMDD.0  
+  better support for cp932 windows filenames  
+  first replace all backslash chars to slash chars  
 
 ## Copyright and License ##
 
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016      by Japanese TeX Development Community  
-(c) Copyright 2013-2016 Norbert Preining norbert at preining.info  
-(c) Copyright 2012 Bob Tennent rdt at cs.queensu.ca  
+(c) Copyright 2016-2017 Japanese TeX Development Community  
+(c) Copyright 2013-2017 Norbert Preining norbert at preining.info  
+(c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca  
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the

Modified: trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua	2017-06-05 23:09:50 UTC (rev 44469)
+++ trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua	2017-06-05 23:10:36 UTC (rev 44470)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 
 NAME = "ptex2pdf[.lua]"
-VERSION = "0.9"
+VERSION = "20170604.0"
 AUTHOR = "Norbert Preining"
 AUTHOREMAIL = "norbert at preining.info"
 SHORTDESC = "Convert Japanese TeX documents to pdf"
@@ -9,7 +9,8 @@
 Main purpose of the script is easy support of Japanese typesetting
 engines in TeXworks. As TeXworks typesetting setup does not allow
 for multistep processing, this script runs one of the ptex based
-programs (ptex, uptex, eptex, platex, uplatex) followed by dvipdfmx.
+programs (ptex, uptex, eptex, euptex, platex, uplatex) followed
+by dvipdfmx.
 ]]
 USAGE = [[
 [texlua] ptex2pdf[.lua] { option | basename[.tex] } ... 
@@ -28,9 +29,9 @@
 LICENSECOPYRIGHT = [[
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016      by Japanese TeX Development Community  
-(c) Copyright 2013-2016 Norbert Preining norbert at preining.info  
-(c) Copyright 2012 Bob Tennent rdt at cs.queensu.ca  
+(c) Copyright 2016-2017 Japanese TeX Development Community  
+(c) Copyright 2013-2017 Norbert Preining norbert at preining.info  
+(c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca  
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -73,62 +74,61 @@
 
 for ptex files:
 
-| Setting     |  Value           |
-|-------------|------------------|
-| Name:       |  pTeX to pdf     |
-| Program:    |  ptex2pdf        |
-| Arguments:  |  -ot             |
-|             |  $synctexoption  |
-|             |  $fullname       |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pTeX (ptex2pdf)    |
+| Program:    | ptex2pdf           |
+| Arguments:  | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
-
 for platex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | pLaTeX to pdf  |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | pLaTeX (ptex2pdf)  |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uptex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upTeX to pdf   |
-| Program:    | ptex2pdf       |
-| Arguments:  | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upTeX (ptex2pdf)   |
+| Program:    | ptex2pdf           |
+| Arguments:  | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 for uplatex files:
 
-| Setting     | Value          |
-|-------------|----------------|
-| Name:       | upLaTeX to pdf |
-| Program:    | ptex2pdf       |
-| Arguments:  | -l             |
-|             | -u             |
-|             | -ot            |
-|             | $synctexoption |
-|             | $fullname      |
+| Setting     | Value              |
+|-------------|--------------------|
+| Name:       | upLaTeX (ptex2pdf) |
+| Program:    | ptex2pdf           |
+| Arguments:  | -l                 |
+|             | -u                 |
+|             | -ot                |
+|             | $synctexoption     |
+|             | $fullname          |
 
 If you need special kanji encodings for one of these programs,
-add the respective `-kanji` option after the `$synctexoption`. Example:
+add the respective `-kanji` option with the `$synctexoption`. Example:
 
 for platex files in SJIS encoding:
 
-| Setting     | Value                       |
-|-------------|-----------------------------|
-| Name:       | pLaTeX/SJIS to pdf          |
-| Program:    | ptex2pdf                    |
-| Arguments:  | -l                          |
-|             | -ot                         |
-|             | $synctexoption -kanji=sjis  |
-|             | $fullname                   |
+| Setting     | Value                      |
+|-------------|----------------------------|
+| Name:       | pLaTeX/SJIS (ptex2pdf)     |
+| Program:    | ptex2pdf                   |
+| Arguments:  | -l                         |
+|             | -ot                        |
+|             | -kanji=sjis $synctexoption |
+|             | $fullname                  |
 ]]
 
 DEVELPLACE = "http://github.com/texjporg/ptex2pdf"
@@ -168,6 +168,10 @@
   update copyright and development place (now in texjp)  
   support 'flag=val' to specify option values  
   only allow one (1) filename argument  
+- version 20170603.0  
+  start version number in the format YYYYMMDD.0  
+  better support for cp932 windows filenames  
+  first replace all backslash chars to slash chars  
 ]]
 
 
@@ -242,6 +246,14 @@
   print("This is " .. NAME .. " version ".. VERSION .. ".")
 end
 
+function print_ifdebug(message) -- for debugging: accepts only one argument
+  --print("DEBUG: " .. message) -- uncomment for debugging
+end
+
+function slashify(str) -- replace "\" with "/", mainly for path strings on cp932 windows
+  return (tostring(str):gsub("[\x81-\x9f\xe0-\xfc]?.", { ["\\"] = "/" }))
+end
+
 if #arg == 0 then
   usage()
   os.exit(0)
@@ -360,7 +372,8 @@
 if ( filename == "" ) then
   print("No filename argument given, exiting.")
   os.exit(1)
-else 
+else
+  filename = slashify(filename)
   if ( kpse.find_file(filename) == nil ) then
     -- try .tex extension
     if ( kpse.find_file(filename .. ".tex") == nil ) then
@@ -380,9 +393,10 @@
     -- if it has already an extension, we need to drop it to get the dvi name
     bname = string.gsub(filename, "^(.*)%.[^.]+$", "%1")
   end
-  -- filename may contain "/" or "\", but the intermediate output is written
+  -- filename may contain "/", but the intermediate output is written
   -- in current directory, so we need to drop it
-  bname = string.gsub(bname, "^.*[/\\](.*)$", "%1")
+  -- note that all "\" has been replaced with "/"
+  bname = string.gsub(bname, "^.*/(.*)$", "%1")
 end
 
 -- we are still here, so we found a file
@@ -410,10 +424,8 @@
   end
 else
   print("ptex2pdf processing of " .. filename .. " failed.\n")
-    --[[ uncomment for debugging
-    print("tex = ", tex)
-    print("dvipdf = ", dvipdf)
-    --]]
+  print_ifdebug("tex = " .. tex)
+  print_ifdebug("dvipdf = " .. dvipdf)
   os.exit(2)
 end
 



More information about the tex-live-commits mailing list