summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-29 22:24:28 +0000
committerKarl Berry <karl@freefriends.org>2017-04-29 22:24:28 +0000
commit85935959636bed572e9a4916d5373565cbcdc79b (patch)
treecefad06ac27ff673ee40c9fdae8adaf2f732e731 /Build
parentf73d138cf7df8989e3e97d47731a4ca4754fd399 (diff)
lwarp (29apr17)
git-svn-id: svn://tug.org/texlive/trunk@44119 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua78
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl28
2 files changed, 71 insertions, 35 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua b/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
index 9b7e7e29197..07334170924 100755
--- a/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
+++ b/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
@@ -4,7 +4,7 @@
-- Print the usage of the lwarpmk command:
-printversion = "v0.29"
+printversion = "v0.30"
function printhelp ()
print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -45,8 +45,9 @@ latexname = "pdflatex" (or "lualatex", or "xelatex")
sourcename = "projectname" (the source-code filename w/o .tex)
homehtmlfilename = "index" (or perhaps the project name)
htmlfilename = "" (or "projectname" - filename prefix)
-uselatexmk = "false" (or "true" to use latexmk to build PDFs)
+latexmk = "false" (or "true" to use latexmk to build PDFs)
languge = "english" (use a language supported by xindy)
+xdyfile = "lwarp.xdy" (or a custom file based on lwarp.xdy)
--
Filenames must contain only letters, numbers, underscore, or dash.
Values must be in "quotes".
@@ -90,6 +91,8 @@ local conffile = "lwarpmk.conf"
if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
-- Default language:
language = "english"
+-- Default xdyfile:
+xdyfile = "lwarp.xdy"
-- Verify the file exists:
if (lfs.attributes(conffile,"mode")==nil) then -- file not exists
print("lwarpmk: " .. conffile .." does not exist.")
@@ -104,7 +107,7 @@ io.input(conffile) ;
local linenum = 0
for line in io.lines() do -- scan lines
linenum = linenum + 1
-i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w-_]*)\"") ;
+i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w%-_%.]*)\"") ;
-- Error if incorrect enclosing characters:
if ( i == nil ) then
print ( linenum .. " : " .. line ) ;
@@ -133,8 +136,9 @@ elseif ( cvarname == "latexname" ) then
elseif ( cvarname == "sourcename" ) then sourcename = cvalue
elseif ( cvarname == "homehtmlfilename" ) then homehtmlfilename = cvalue
elseif ( cvarname == "htmlfilename" ) then htmlfilename = cvalue
-elseif ( cvarname == "uselatexmk" ) then uselatexmk = cvalue
+elseif ( cvarname == "latexmk" ) then latexmk = cvalue
elseif ( cvarname == "language" ) then language = cvalue
+elseif ( cvarname == "xdyfile" ) then xdyfile = cvalue
else
print ( linenum .. " : " .. line ) ;
print ("lwarpmk: Incorrect variable name \"" .. cvarname .. "\" in " .. conffile ..".\n" ) ;
@@ -160,6 +164,16 @@ dirslash = "\\"
opquote= "\""
else print ( "lwarpmk: Select Unix or Windows for opsystem" )
end --- for Windows
+
+-- set xindycmd according to pdflatex vs xelatex/lualatex:
+if ( latexname == "pdflatex" ) then
+xindycmd = "texindy -C utf8"
+glossarycmd = "xindy -C utf8"
+else
+xindycmd = "xindy -M texindy -C utf8"
+glossarycmd = "xindy -C utf8"
+end
+
end -- loadconf
function refreshdate ()
@@ -215,8 +229,10 @@ end
function pdftohtml ()
-- Convert to text:
- print ("lwarpmk: Converting " .. sourcename .."_html.pdf to " .. sourcename .. "_html.html")
- os.execute("pdftotext -enc UTF-8 -nopgbrk -layout " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html")
+ print ("lwarpmk: Converting " .. sourcename
+ .."_html.pdf to " .. sourcename .. "_html.html")
+ os.execute("pdftotext -enc UTF-8 -nopgbrk -layout "
+ .. sourcename .. "_html.pdf " .. sourcename .. "_html.html")
-- Split the result into individual HTML files:
splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html")
end
@@ -273,6 +289,24 @@ end
end -- do
end -- function
+-- Use latexmk to compile source and index:
+-- fsuffix is "" for print, or "_html" for HTML
+function compilelatexmk ( fsuffix )
+ -- The recorder option is required to detect changes in <project>.tex
+ -- while we are loading <project>_html.tex.
+ err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder "
+ .. "-e "
+ .. opquote
+ .. "$makeindex = q/"
+ .. xindycmd
+ .. " -M " .. xdyfile
+ .. " -L " .. language .. " /"
+ .. opquote
+ .. " -pdflatex=\"" .. latexname .." %O %S\" "
+ .. sourcename..fsuffix ..".tex" ) ;
+ if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
+end
+
-- lwarpmk --version :
if (arg[1] == "--version") then
@@ -288,8 +322,8 @@ print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX lwarp pack
if arg[1] == "print" then
loadconf ()
-if ( uselatexmk == "true" ) then
- os.execute ( "latexmk -pdf -dvi- -ps- -pdflatex=\"" .. latexname .." %O %S\" " .. sourcename ..".tex" ) ;
+if ( latexmk == "true" ) then
+ compilelatexmk ("")
print ("lwarpmk: Done.")
else -- not latexmk
verifyfileexists (sourcename .. ".tex") ;
@@ -316,7 +350,11 @@ end -- not latexmk
elseif arg[1] == "printindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
-os.execute("texindy -M lwarp_html.xdy " .. sourcename .. ".idx")
+os.execute(
+ xindycmd
+ .. " -M " .. xdyfile
+ .. " -L " .. language
+ .. " " .. sourcename .. ".idx")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
@@ -330,7 +368,7 @@ elseif arg[1] == "printglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")
-os.execute("xindy -L " .. language .. " -C utf8 -I xindy -M " .. sourcename ..
+os.execute(glossarycmd .. " -L " .. language .. " -I xindy -M " .. sourcename ..
" -t " .. sourcename .. ".glg -o " .. sourcename .. ".gls "
.. sourcename .. ".glo")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
@@ -342,15 +380,8 @@ print ("lwarpmk: Done.")
elseif arg[1] == "html" then
loadconf ()
-if ( uselatexmk == "true" ) then
- -- The recorder option is required to detect changes in <project>.tex
- -- while we are loading <project>_html.tex.
- err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder "
- .. "-e "
- .. opquote .. "$makeindex = q/texindy -M lwarp_html.xdy/" .. opquote
- .. " -pdflatex=\"" .. latexname .." %O %S\" "
- .. sourcename .."_html.tex" ) ;
- if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
+if ( latexmk == "true" ) then
+ compilelatexmk ("_html")
pdftohtml ()
print ("lwarpmk: Done.")
else -- not latexmk
@@ -383,7 +414,12 @@ elseif arg[1] == "pdftohtml" then
elseif arg[1] == "htmlindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
-os.execute("texindy -M lwarp_html.xdy " .. sourcename .. "_html.idx")
+os.execute(
+ xindycmd
+ .. " -M " .. xdyfile
+ .. " -L " .. language
+ .. " " .. sourcename .. "_html.idx"
+)
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
@@ -397,7 +433,7 @@ elseif arg[1] == "htmlglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")
-os.execute("xindy -L " .. language .. " -C utf8 -I xindy -M " ..sourcename ..
+os.execute(glossarycmd .. " -L " .. language .. " -I xindy -M " ..sourcename ..
"_html -t " .. sourcename .. "_html.glg -o " ..sourcename ..
"_html.gls " ..sourcename .. "_html.glo")
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index f8f3e55ba42..ebc97294ea4 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,13 +1,13 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 44076 2017-04-27 08:51:00Z preining $
+# $Id: tlmgr.pl 44109 2017-04-28 23:12:11Z karl $
#
# Copyright 2008-2017 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-my $svnrev = '$Revision: 44076 $';
-my $datrev = '$Date: 2017-04-27 10:51:00 +0200 (Thu, 27 Apr 2017) $';
+my $svnrev = '$Revision: 44109 $';
+my $datrev = '$Date: 2017-04-29 01:12:11 +0200 (Sat, 29 Apr 2017) $';
my $tlmgrrevision;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
@@ -7134,6 +7134,12 @@ out).
If I<value> is given in addition, I<key> is set to I<value> in the
respective file. I<No error checking is done!>
+Here is a practical example of changing configuration values. If the
+execution of (some or all) system commands via C<\write18> was left
+enabled during installation, you can disable it afterwards:
+
+ tlmgr conf texmf shell_escape 0
+
For C<texmf>, an additional subcommand C<auxtrees> allows adding and
removing arbitrary additional texmf trees, completely under user
control. C<texmf auxtrees show> shows the list of additional trees,
@@ -7145,18 +7151,12 @@ C<ROOT/texmf.cnf>. Example:
tlmgr conf texmf auxtrees add /my/quick/test/tree
tlmgr conf texmf auxtrees remove /my/quick/test/tree
-In all cases the file used can be explicitly specified via the option
-C<--conffile I<file>>, in case one wants to operate on a different file.
+In all cases the configuration file can be explicitly specified via the
+option C<--conffile> I<file>, if desired.
-The C<PATH> value shown is that used by C<tlmgr>. The directory in
-which the C<tlmgr> executable is found is automatically prepended to the
-PATH value inherited from the environment.
-
-A practical example of changing configuration values: if the execution of
-(some or all) system commands via C<\write18> was left enabled during
-installation, you can disable it afterwards:
-
- tlmgr conf texmf shell_escape 0
+The C<PATH> value shown is as used by C<tlmgr>. The directory in which
+the C<tlmgr> executable is found is automatically prepended to the PATH
+value inherited from the environment.
Warning: The general facility is here, but tinkering with settings in
this way is strongly discouraged. Again, no error checking on either