From 09fd9c9121cefeb7ebe015102a51a796e2d8a314 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 9 Apr 2013 16:54:30 +0000 Subject: pfarrei (8apr13) git-svn-id: svn://tug.org/texlive/trunk@29796 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/pfarrei/pfarrei.tlu | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'Master/texmf-dist/scripts/pfarrei/pfarrei.tlu') diff --git a/Master/texmf-dist/scripts/pfarrei/pfarrei.tlu b/Master/texmf-dist/scripts/pfarrei/pfarrei.tlu index ee5f0ed8d67..f2756f6f907 100755 --- a/Master/texmf-dist/scripts/pfarrei/pfarrei.tlu +++ b/Master/texmf-dist/scripts/pfarrei/pfarrei.tlu @@ -28,7 +28,7 @@ -- The list of files belonging to the work `pfarrei' is given in -- the file `pfarrei.dtx'. -- -local version_number = string.sub( '$Revision: 20 $', 12, -2 ) +local version_number = string.sub( '$Revision: 33 $', 12, -2 ) local action_version = ' r' .. version_number .. '\n' .. [[ Copyright (c) 2013 Markus Kohm. @@ -62,7 +62,9 @@ local processing_opts = { ['-s'] = 'sidebyside', ['--sidebyside'] = 'sidebyside', ['-o'] = 'overwrite', - ['--overwrite'] = 'overwrite' + ['--overwrite'] = 'overwrite', + ['-d'] = 'debug', + ['--debug'] = 'debug', } -- detect action options and do action @@ -86,12 +88,14 @@ end -- process options and parameters local booklet = false local overwrite = false +local debug = false i = 1 while arg[i] do action = processing_opts[arg[i]] if action == 'booklet' then booklet = true elseif action == 'sidebyside' then booklet = false elseif action == 'overwrite' then overwrite = true + elseif action == 'debug' then debug = true elseif action == nil then -- build the temporary tex file local tmpdir = os.tmpdir("pfarrei.XXXXXX" ) @@ -99,7 +103,7 @@ while arg[i] do local basename = string.match( tmpfile,'(.*)%.[^.]*$') or tmpfile tmpfile = tmpdir..'/'..basename..'.tex' local file = assert( io.open( tmpfile, 'w' ) ) - if booklet then assert( file:write("\\def\\Booklet{}\n") ) end + if booklet then assert( file:write("\\PassOptionsToPackage{booklet}{pfarrei}\n") ) end assert( file:write("\\def\\OriginalFile{",arg[i],"}\n") ) assert( file:write("\\input{a5toa4.tex}\n") ) assert( file:flush() ) @@ -129,12 +133,17 @@ while arg[i] do end assert( destfile:close() ) srcfile:close() - tmpfile=tmpdir..'/'..basename - os.remove( tmpfile..'.aux' ) - os.remove( tmpfile..'.tex' ) - os.remove( tmpfile..'.log' ) - os.remove( tmpfile..'.pdf' ) - os.remove( tmpdir ) + if debug + then + print('DEBUG: Temporary files in: '..tmpdir); + else + tmpfile=tmpdir..'/'..basename + os.remove( tmpfile..'.aux' ) + os.remove( tmpfile..'.tex' ) + os.remove( tmpfile..'.log' ) + os.remove( tmpfile..'.pdf' ) + os.remove( tmpdir ) + end overwrite = false end i=i+1 -- cgit v1.2.3