runtex 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/lib/Code_zum_Pluendern_rtex4newrtex.rb +275 -0
  2. data/lib/catch_output.rb +99 -0
  3. data/lib/runtex.rb +221 -0
  4. data/lib/runtex_bibtex.rb +111 -0
  5. data/lib/runtex_job_chain.rb +371 -0
  6. data/lib/runtex_latex.rb +373 -0
  7. data/lib/runtex_makeindex.rb +114 -0
  8. data/lib/runtex_pathes.yaml +59 -0
  9. data/lib/runtex_rail.rb +116 -0
  10. data/lib/runtex_splitindex.rb +78 -0
  11. data/lib/runtex_tool.rb +128 -0
  12. data/lppl.txt +416 -0
  13. data/readme +73 -0
  14. data/unittest/expected/test_bibliography_babelbib.debug1.txt +31 -0
  15. data/unittest/expected/test_bibliography_babelbib.debug2.txt +16 -0
  16. data/unittest/expected/test_bibliography_babelbib.tex.runtex_summary.txt +19 -0
  17. data/unittest/expected/test_bibliography_babelbib_1.txt +15 -0
  18. data/unittest/expected/test_bibliography_babelbib_2.txt +11 -0
  19. data/unittest/expected/test_bibliography_plain.debug1.txt +45 -0
  20. data/unittest/expected/test_bibliography_plain.debug2.txt +16 -0
  21. data/unittest/expected/test_bibliography_plain.tex.runtex_summary.txt +18 -0
  22. data/unittest/expected/test_bibliography_plain_1.txt +19 -0
  23. data/unittest/expected/test_bibliography_plain_2.txt +11 -0
  24. data/unittest/expected/test_error.debug1.txt +22 -0
  25. data/unittest/expected/test_error.debug2.txt +12 -0
  26. data/unittest/expected/test_error.tex.runtex_summary.txt +15 -0
  27. data/unittest/expected/test_error_1.txt +15 -0
  28. data/unittest/expected/test_error_2.txt +12 -0
  29. data/unittest/expected/test_gloss.debug1.txt +45 -0
  30. data/unittest/expected/test_gloss.debug2.txt +16 -0
  31. data/unittest/expected/test_gloss.tex.runtex_summary.txt +18 -0
  32. data/unittest/expected/test_gloss_1.txt +19 -0
  33. data/unittest/expected/test_gloss_2.txt +11 -0
  34. data/unittest/expected/test_gloss_newgloss.debug1.txt +58 -0
  35. data/unittest/expected/test_gloss_newgloss.debug2.txt +20 -0
  36. data/unittest/expected/test_gloss_newgloss.tex.runtex_summary.txt +24 -0
  37. data/unittest/expected/test_gloss_newgloss_1.txt +23 -0
  38. data/unittest/expected/test_gloss_newgloss_2.txt +13 -0
  39. data/unittest/expected/test_glossaries.debug1.txt +56 -0
  40. data/unittest/expected/test_glossaries.debug2.txt +28 -0
  41. data/unittest/expected/test_glossaries.tex.runtex_summary.txt +30 -0
  42. data/unittest/expected/test_glossaries_1.txt +24 -0
  43. data/unittest/expected/test_glossaries_2.txt +19 -0
  44. data/unittest/expected/test_index.debug1.txt +35 -0
  45. data/unittest/expected/test_index.debug2.txt +18 -0
  46. data/unittest/expected/test_index.tex.runtex_summary.txt +24 -0
  47. data/unittest/expected/test_index2.debug1.txt +58 -0
  48. data/unittest/expected/test_index2.debug2.txt +29 -0
  49. data/unittest/expected/test_index2.tex.runtex_summary.txt +27 -0
  50. data/unittest/expected/test_index2_1.txt +23 -0
  51. data/unittest/expected/test_index2_2.txt +17 -0
  52. data/unittest/expected/test_index_1.txt +21 -0
  53. data/unittest/expected/test_index_2.txt +17 -0
  54. data/unittest/expected/test_makeindex.debug1.txt +35 -0
  55. data/unittest/expected/test_makeindex.debug2.txt +18 -0
  56. data/unittest/expected/test_makeindex.tex.runtex_summary.txt +18 -0
  57. data/unittest/expected/test_makeindex_1.txt +15 -0
  58. data/unittest/expected/test_makeindex_2.txt +11 -0
  59. data/unittest/expected/test_packagedoc_dtx.debug1.txt +54 -0
  60. data/unittest/expected/test_packagedoc_dtx.debug2.txt +27 -0
  61. data/unittest/expected/test_packagedoc_dtx.dtx.runtex_summary.txt +31 -0
  62. data/unittest/expected/test_packagedoc_dtx_1.txt +18 -0
  63. data/unittest/expected/test_packagedoc_dtx_2.txt +13 -0
  64. data/unittest/expected/test_rail.debug1.txt +35 -0
  65. data/unittest/expected/test_rail.debug2.txt +12 -0
  66. data/unittest/expected/test_rail.tex.runtex_summary.txt +12 -0
  67. data/unittest/expected/test_rail_1.txt +13 -0
  68. data/unittest/expected/test_rail_2.txt +9 -0
  69. data/unittest/expected/test_rail_error.debug1.txt +37 -0
  70. data/unittest/expected/test_rail_error.debug2.txt +35 -0
  71. data/unittest/expected/test_rail_error.tex.runtex_summary.txt +18 -0
  72. data/unittest/expected/test_rail_error_1.txt +18 -0
  73. data/unittest/expected/test_rail_error_2.txt +18 -0
  74. data/unittest/expected/test_splitindex.debug1.txt +64 -0
  75. data/unittest/expected/test_splitindex.debug2.txt +32 -0
  76. data/unittest/expected/test_splitindex.tex.runtex_summary.txt +31 -0
  77. data/unittest/expected/test_splitindex_1.txt +21 -0
  78. data/unittest/expected/test_splitindex_2.txt +15 -0
  79. data/unittest/expected/test_test.debug1.txt +32 -0
  80. data/unittest/expected/test_test.debug2.txt +12 -0
  81. data/unittest/expected/test_test.tex.runtex_summary.txt +12 -0
  82. data/unittest/expected/test_test_1.txt +15 -0
  83. data/unittest/expected/test_test_2.txt +9 -0
  84. data/unittest/expected/test_test_bibliography.debug1.txt +31 -0
  85. data/unittest/expected/test_test_gloss.debug1.txt +45 -0
  86. data/unittest/expected/test_test_gloss_newgloss.debug1.txt +58 -0
  87. data/unittest/expected/test_test_glossaries.debug1.txt +48 -0
  88. data/unittest/expected/test_test_index.debug1.txt +35 -0
  89. data/unittest/expected/test_test_index2.debug1.txt +58 -0
  90. data/unittest/expected/test_test_makeindex.debug1.txt +35 -0
  91. data/unittest/expected/test_test_rail.debug1.txt +35 -0
  92. data/unittest/expected/test_test_splitindex.debug1.txt +64 -0
  93. data/unittest/expected/test_test_test.debug1.txt +32 -0
  94. data/unittest/testcases.yaml +427 -0
  95. data/unittest/unittest_catch_output.rb +66 -0
  96. data/unittest/unittest_runtex.rb +282 -0
  97. metadata +149 -0
@@ -0,0 +1,59 @@
1
+ latex:
2
+ call: latex
3
+ parameters:
4
+ - [ -interaction=, batchmode, :no_space_sep ]
5
+ - [nil, :filename]
6
+ pdflatex:
7
+ call: pdflatex
8
+ parameters:
9
+ - [ -interaction=, batchmode, :no_space_sep ]
10
+ - [nil, :filename]
11
+ xelatex:
12
+ call: xelatex
13
+ parameters:
14
+ - [ -interaction=, batchmode, :no_space_sep ]
15
+ - [nil, :filename]
16
+ pdflualatex:
17
+ call: pdflualatex
18
+ parameters:
19
+ - [ -interaction=, batchmode, :no_space_sep ]
20
+ - [nil, :filename]
21
+ bibtex:
22
+ call: bibtex
23
+ parameters:
24
+ - [nil, :source ]
25
+ makeindex:
26
+ call: makeindex
27
+ parameters:
28
+ - ['-s', :format, :optional]
29
+ - ['-o', :file_out ]
30
+ - ['-t', :file_log ]
31
+ - [nil, :file_in]
32
+ rail:
33
+ call: C:/usr/texmf/tex/Latex/rail/rail.exe
34
+ #Programm must be in path
35
+ #~ call: rail.exe
36
+ parameters:
37
+ - [ -t, :railfile ]
38
+ #~ option: " -t < #{@options[:source]} > #{@options[:target]}"
39
+ dvips:
40
+ call: dvips
41
+ #~ ps2pdf:
42
+ #~ cmd = 'gswin32c'
43
+ #~ if filename != ""
44
+ #~ cmd += ' -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite '
45
+ #~ cmd += "-sOutputFile=#{filename}.pdf -c save pop -f #{filename}.ps"
46
+ dvipdfm:
47
+ call: dvipdfm
48
+ latex_ps:
49
+ call: LaTeX
50
+ post: [ DVIPS ]
51
+ latex_pdf:
52
+ call: LaTeX
53
+ post:
54
+ - DVIPDF
55
+ latex_ps_pdf:
56
+ call: LaTeX
57
+ post:
58
+ - DVIPDF
59
+ - PS2PDF
@@ -0,0 +1,116 @@
1
+ #
2
+ # This file is part of the runtex-bundle
3
+ #
4
+
5
+ module RunTeX
6
+
7
+ # The package rail.sty requires a run of rail.exe.
8
+ # If a rail-diagramms changed (or the sequence of different diagrams) the program must run again.
9
+ class Rail < Tool
10
+ def initialize(job, options = {})
11
+ super(job, options, {})
12
+ @options.keys.each{|key|
13
+ case key
14
+ when :source
15
+ when :target
16
+ else
17
+ @job.log.error( "#{@step} #{self.class}: Unknown option #{key}" ) if @job.log.error?
18
+ end
19
+ }
20
+ end #initialize
21
+ #Call Rail
22
+ def execute( step )
23
+ super(step)
24
+
25
+ @job.log.debug( "#{@step} Call Rail.exe to create rail-diagramms." ) if @job.log.debug?
26
+
27
+ @result = {
28
+ :error => [],
29
+ :info => [],
30
+ }
31
+
32
+ if File.exist?( @options[:source])
33
+ @job.add2zip( @options[:source] )
34
+ else
35
+ @job.log.error( "#{@step} Rail: Source-File is missing" ) if @job.log.error?
36
+ @result[:error] << "Rail: Source-File is missing"
37
+ end
38
+
39
+ if File.exist?( @options[:target] )
40
+ @job.add2zip( @options[:target] )
41
+ raoold = File.readlines(@options[:target])
42
+ end
43
+
44
+ configuration = Job_chain::Configuration['rail']
45
+ #Rail.exe don't like long filenames, but via pipe it works
46
+ #Problem with pipes: There is a bug with closing the file, delete/zip runs into error.
47
+ #~ cmd = configuration['call'] + " -t < #{@options[:source]} > #{@options[:target]}"
48
+ #-> Rename files for 8-char size, so rail.exe can handle it
49
+ File.rename(@options[:source], 'rail_tmp.rai')
50
+ cmd = build_cmd('rail', :railfile => 'rail_tmp')
51
+ subrc = nil
52
+ stdout, stderr = catch_screen_output{ subrc = system(cmd) }
53
+ @job.log.error( "#{@step} Error Rail: #{cmd}") if !subrc and @job.log.error?
54
+
55
+ #rename back
56
+ File.rename('rail_tmp.rai', @options[:source]) #must exist
57
+ if File.exist?('rail_tmp.rao')
58
+ File.rename('rail_tmp.rao', @options[:target])
59
+ #~ # Delete first two lines from rao-File (contains Version-Message)
60
+ rao = File.readlines( @options[:target] )
61
+ rao.each{ |raoline|
62
+ raoline.sub!(/^(This is Rail.*)/, '%\1')
63
+ raoline.sub!(/^(\(stdin.*)/, '%\1')
64
+ raoline.sub!(/^\)/, '%\1)') #last line
65
+ }
66
+ File.open( @options[:target], 'w' ){|rao2|
67
+ rao2 << rao
68
+ }
69
+ else
70
+ @result[:error] << "No rao-File created"
71
+ @job.log.error( "#{@step} Error Rail: No rao-File created") if @job.log.error?
72
+ @job.stop_rerun( :rail, "Rail: No rao-file created") #block rerun for rail
73
+ end #rao-file created
74
+
75
+
76
+ stderr.each{ |errline|
77
+ case errline
78
+ when /(.*), line (.*): (.*)/
79
+ #$1: Filename (e.g. 'stdin')
80
+ @result[:error] << "Line #{$2}: #{$3}"
81
+ @job.stop_rerun( :rail, "Rail: #{$3} on line #{$2}") #block rerun for rail
82
+ end
83
+ }
84
+
85
+ stdout.each{ |stdout_line|
86
+ case stdout_line
87
+ when /This is Rail, Version (.*)\s/
88
+ @result[:info] << "Rail version #{$1} was called"
89
+ when /(Der Prozess kann nicht auf die Datei zugreifen, .*)/
90
+ @result[:error] << "#{$1}"
91
+ end
92
+ }
93
+
94
+ if File.exist?( @options[:target] )
95
+ @job.add2zip( @options[:target] )
96
+ raonew = File.readlines(@options[:target])
97
+ if raoold != raonew
98
+ @job.please_rerun("Rail: rao-file changed")
99
+ end
100
+ else
101
+ @job.log.error( "#{@step} Rail: .rao-File is missing" ) if @job.log.error?
102
+ @result[:error] << "Rail: .rao-File is missing"
103
+ end
104
+
105
+ @job.helpfiles << @options[:target]
106
+ @job.helpfiles << @options[:source]
107
+
108
+ return @result
109
+ end #execute
110
+ #Used in logger
111
+ def inspect()
112
+ "Rail"
113
+ end
114
+
115
+ end #Rail
116
+ end #module RunTeX
@@ -0,0 +1,78 @@
1
+ #
2
+ # This file is part of the runtex-bundle
3
+ #
4
+
5
+ module RunTeX
6
+
7
+ #Splitindex - Define multiple indices by splitting the main index.
8
+ class Splitindex < Tool
9
+ def initialize(job, options = {})
10
+ super(job, options, {})
11
+ #fixme obligatory parameter
12
+ @options.keys.each{|key|
13
+ case key
14
+ when :source
15
+ else
16
+ @job.log.error( "#{@step} #{self.class}: Unknown option #{key}" ) if @job.log.error?
17
+ end
18
+ }
19
+ end #initialize
20
+ #Split the index into the sub-Indices
21
+ def execute( step )
22
+ super(step)
23
+
24
+ @job.log.debug( "#{@step} Split index into sub indices (#{self.class})" ) if @job.log.debug?
25
+
26
+ @result = {
27
+ :error => [],
28
+ :info => [],
29
+ }
30
+ #Get existing index-data first
31
+ if File.exist?( @options[:source] )
32
+ @job.add2zip( @options[:source] )
33
+ else
34
+ Logger.add( 1, self.class, "No idx-file for splitindex (#{@source})")
35
+ @result[:error] << "Error: No idx-file for splitindex (#{@options[:source]})"
36
+ end
37
+
38
+ targets = {}
39
+ #Example:
40
+ #~ \indexentry[Fields]{MANDT!MARA|hyperpage}{4}
41
+ #~ \indexentry[DataElement]{MANDT!MARA-MANDT|hyperpage}{4}
42
+
43
+ File.readlines(@options[:source]).each{|idx_line|
44
+ case idx_line
45
+ when /\indexentry\[(.+?)\]\{(.+?)\}\{(.+?)\}/
46
+ targets[$1] = [] unless targets[$1]
47
+ targets[$1] << "\\indexentry{#{$2}}{#{$3}}"
48
+ when /\indexentry\{(.+?)\}\{(.+?)\}/
49
+ targets['idx'] = [] unless targets['idx']
50
+ targets['idx'] << "\\indexentry{#{$1}}{#{$2}}"
51
+ end
52
+ }
53
+ @job.helpfiles << @options[:source]
54
+
55
+ targets.each{|target, content|
56
+ @job.log.debug( "#{@step} Build Split-index #{target}" ) if @job.log.debug?
57
+ @result[:info] << "Build Split-index #{target}"
58
+ File.open("#{@job.basename}-#{target}.idx", 'w'){| idx |
59
+ idx << content.join("\n")
60
+ }
61
+ #Call makeindex for each element
62
+ @job << Makeindex.new( @job,
63
+ :name => "Sub-Index #{target}",
64
+ :file_in => "#{@job.basename}-#{target}.idx",
65
+ :file_out => "#{@job.basename}-#{target}.ind",
66
+ :file_log => "#{@job.basename}-#{target}.ilg"
67
+ #~ :format => glossaries_format
68
+ )
69
+ }
70
+ return @result
71
+ end #execute
72
+ #Used in logger
73
+ def inspect()
74
+ "SplitIndex<>"
75
+ end
76
+
77
+ end #Splitindex
78
+ end #module RunTeX
@@ -0,0 +1,128 @@
1
+ #
2
+ # This file is part of the runtex-bundle
3
+ #
4
+
5
+ module RunTeX
6
+ # This class defines some generic methods.
7
+ # This methods must be implemented by each tool which is needed.
8
+ # The different tools can be:
9
+ # - LaTeX itself (or pdfLaTeX...)
10
+ # - makeindex (or yindy...)
11
+ # - bibtex
12
+ # - rail
13
+ # Each tool must implement:
14
+ # - execute: runs the tool, returning true or false. False is a hard error, stopping the further processing
15
+ # - analyse: Return a hash with number of errors, warnings... errorlist...
16
+ # - postprocess: Actions, which must be done afterwords
17
+ # A tool may require other tools (LaTeX need BibTeX, Makeindex...)
18
+ class Tool
19
+ #Some Tools have screen output.
20
+ #runtex should run silent in background, so we have to redirect the output.
21
+ include Catch_output
22
+ #Defines some general attributes and set the options.
23
+ #
24
+ #The redefined method code has only two parameters,
25
+ #the default is set un the super-call.
26
+ def initialize( job, options, defaults )
27
+ @options = defaults.merge(options)
28
+ @job = job
29
+ @step = "%02i " % @job.texrun unless @step
30
+ #~ @job.log.debug( "#{@step} Create #{self} (#{@options.inspect})" ) if @job.log.debug?
31
+ @result = {} #Result of the last execution
32
+ end
33
+ #Actual step
34
+ attr_reader :step
35
+ #Read options
36
+ attr_reader :options
37
+ #A summary of the last Tool#execute
38
+ def summary( option = :list)
39
+ return 'No summary available' if @result.empty?
40
+
41
+ (@result.keys - [:error, :warning, :info, :rejected]).each{|key|
42
+ @job.log.fatal("RunTeX::Tool#summary: Unknown key #{key.inspect}") if @job.log.fatal?
43
+ puts self.inspect
44
+ puts @result.inspect
45
+ puts @result.to_yaml
46
+ }
47
+ @job.log.fatal("RunTeX::Tool#summary: Unknown option #{option.inspect}") if @job.log.fatal? and ! [:list, :count].include?(option)
48
+
49
+ summary = ''
50
+
51
+ [ [:error, 'Errors'],
52
+ [:warning,'Warnings'],
53
+ [:rejected,'Rejected entries'], #makeindex, should correspond with errors
54
+ [:info,'Information'],
55
+ ].each{|key, text|
56
+ next unless @result[key]
57
+ next if @result[key].respond_to?(:empty?) and @result[key].empty?
58
+ case option
59
+ when :list
60
+ summary << "#{text}:\n"
61
+ summary << @result[key].to_yaml.sub(/--- \n/, '')
62
+ when :count
63
+ summary << "#{text}: #{@result[key].size}; "
64
+ end
65
+ }
66
+
67
+ return summary
68
+ end
69
+
70
+ #Build the command.
71
+ #
72
+ #Bases is the configuration.
73
+ #
74
+ #The key 'call' defines the programm.
75
+ #
76
+ #'parameters' contains a list of all parameters for the call.
77
+ #Each parameter contains at least two values: a flag and a content.
78
+ #
79
+ #The content may be a string or a symbol. If it is a symbol,
80
+ #the value must be a key in the hash 'par_values'.
81
+ #(Exception: option :optional)
82
+ #
83
+ #After the two main parameters (which can be 'nil'), options can be used:
84
+ #-:no_space_sep between the flag and the value is no space.
85
+ # Example: latex -interaction=batchmode instead latex -interaction= batchmode
86
+ #-:optional the parameter is suppressed if the value is empty.
87
+ def build_cmd( configurationkey, par_values = @options )
88
+
89
+ configuration = Job_chain::Configuration[configurationkey]
90
+
91
+ par_list = []
92
+ configuration['parameters'].each{|flag, key, *options|
93
+ next if options.include?(:optional) and ! par_values[key]
94
+ #~ puts flag.inspect
95
+ #~ puts options.inspect
96
+ parameter = ''
97
+ parameter << flag if flag and flag != 'nil'
98
+ parameter << ' ' unless options.include?(:no_space_sep)
99
+ case key
100
+ when Symbol
101
+ parameter << par_values[key] if par_values[key]
102
+ if ! options.include?(:optional) and ! par_values[key]
103
+ @job.log.error( "Parameter #{key.inspect} (#{flag}) missing to execute #{configurationkey}") if @job.log.error?
104
+ next
105
+ end
106
+ when String #a constand
107
+ parameter << key
108
+ end
109
+ par_list << parameter
110
+ }
111
+ #~ puts par_list.inspect
112
+ cmd = "#{configuration['call']} #{par_list.join(' ')}"
113
+ end
114
+
115
+ #Call the tool.
116
+ #Result is a hash with:
117
+ #- errors
118
+ #- warnings
119
+ #- messages
120
+ def execute( step )
121
+ #~ raise "Method execute not redefined for #{self.class}"
122
+ @step = "%02i-%02i" % [ @job.texrun, step ]
123
+ @job.log.info( "#{@step} Call #{self.inspect}" ) if @job.log.info?
124
+ @summary = 'No summary available'
125
+ end
126
+ end #Tool
127
+
128
+ end #module RunTeX
@@ -0,0 +1,416 @@
1
+ The LaTeX Project Public License
2
+ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
+
4
+ LPPL Version 1.3c 2008-05-04
5
+
6
+ Copyright 1999 2002-2008 LaTeX3 Project
7
+ Everyone is allowed to distribute verbatim copies of this
8
+ license document, but modification of it is not allowed.
9
+
10
+
11
+ PREAMBLE
12
+ ========
13
+
14
+ The LaTeX Project Public License (LPPL) is the primary license under
15
+ which the LaTeX kernel and the base LaTeX packages are distributed.
16
+
17
+ You may use this license for any work of which you hold the copyright
18
+ and which you wish to distribute. This license may be particularly
19
+ suitable if your work is TeX-related (such as a LaTeX package), but
20
+ it is written in such a way that you can use it even if your work is
21
+ unrelated to TeX.
22
+
23
+ The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
24
+ below, gives instructions, examples, and recommendations for authors
25
+ who are considering distributing their works under this license.
26
+
27
+ This license gives conditions under which a work may be distributed
28
+ and modified, as well as conditions under which modified versions of
29
+ that work may be distributed.
30
+
31
+ We, the LaTeX3 Project, believe that the conditions below give you
32
+ the freedom to make and distribute modified versions of your work
33
+ that conform with whatever technical specifications you wish while
34
+ maintaining the availability, integrity, and reliability of
35
+ that work. If you do not see how to achieve your goal while
36
+ meeting these conditions, then read the document `cfgguide.tex'
37
+ and `modguide.tex' in the base LaTeX distribution for suggestions.
38
+
39
+
40
+ DEFINITIONS
41
+ ===========
42
+
43
+ In this license document the following terms are used:
44
+
45
+ `Work'
46
+ Any work being distributed under this License.
47
+
48
+ `Derived Work'
49
+ Any work that under any applicable law is derived from the Work.
50
+
51
+ `Modification'
52
+ Any procedure that produces a Derived Work under any applicable
53
+ law -- for example, the production of a file containing an
54
+ original file associated with the Work or a significant portion of
55
+ such a file, either verbatim or with modifications and/or
56
+ translated into another language.
57
+
58
+ `Modify'
59
+ To apply any procedure that produces a Derived Work under any
60
+ applicable law.
61
+
62
+ `Distribution'
63
+ Making copies of the Work available from one person to another, in
64
+ whole or in part. Distribution includes (but is not limited to)
65
+ making any electronic components of the Work accessible by
66
+ file transfer protocols such as FTP or HTTP or by shared file
67
+ systems such as Sun's Network File System (NFS).
68
+
69
+ `Compiled Work'
70
+ A version of the Work that has been processed into a form where it
71
+ is directly usable on a computer system. This processing may
72
+ include using installation facilities provided by the Work,
73
+ transformations of the Work, copying of components of the Work, or
74
+ other activities. Note that modification of any installation
75
+ facilities provided by the Work constitutes modification of the Work.
76
+
77
+ `Current Maintainer'
78
+ A person or persons nominated as such within the Work. If there is
79
+ no such explicit nomination then it is the `Copyright Holder' under
80
+ any applicable law.
81
+
82
+ `Base Interpreter'
83
+ A program or process that is normally needed for running or
84
+ interpreting a part or the whole of the Work.
85
+
86
+ A Base Interpreter may depend on external components but these
87
+ are not considered part of the Base Interpreter provided that each
88
+ external component clearly identifies itself whenever it is used
89
+ interactively. Unless explicitly specified when applying the
90
+ license to the Work, the only applicable Base Interpreter is a
91
+ `LaTeX-Format' or in the case of files belonging to the
92
+ `LaTeX-format' a program implementing the `TeX language'.
93
+
94
+
95
+
96
+ CONDITIONS ON DISTRIBUTION AND MODIFICATION
97
+ ===========================================
98
+
99
+ 1. Activities other than distribution and/or modification of the Work
100
+ are not covered by this license; they are outside its scope. In
101
+ particular, the act of running the Work is not restricted and no
102
+ requirements are made concerning any offers of support for the Work.
103
+
104
+ 2. You may distribute a complete, unmodified copy of the Work as you
105
+ received it. Distribution of only part of the Work is considered
106
+ modification of the Work, and no right to distribute such a Derived
107
+ Work may be assumed under the terms of this clause.
108
+
109
+ 3. You may distribute a Compiled Work that has been generated from a
110
+ complete, unmodified copy of the Work as distributed under Clause 2
111
+ above, as long as that Compiled Work is distributed in such a way that
112
+ the recipients may install the Compiled Work on their system exactly
113
+ as it would have been installed if they generated a Compiled Work
114
+ directly from the Work.
115
+
116
+ 4. If you are the Current Maintainer of the Work, you may, without
117
+ restriction, modify the Work, thus creating a Derived Work. You may
118
+ also distribute the Derived Work without restriction, including
119
+ Compiled Works generated from the Derived Work. Derived Works
120
+ distributed in this manner by the Current Maintainer are considered to
121
+ be updated versions of the Work.
122
+
123
+ 5. If you are not the Current Maintainer of the Work, you may modify
124
+ your copy of the Work, thus creating a Derived Work based on the Work,
125
+ and compile this Derived Work, thus creating a Compiled Work based on
126
+ the Derived Work.
127
+
128
+ 6. If you are not the Current Maintainer of the Work, you may
129
+ distribute a Derived Work provided the following conditions are met
130
+ for every component of the Work unless that component clearly states
131
+ in the copyright notice that it is exempt from that condition. Only
132
+ the Current Maintainer is allowed to add such statements of exemption
133
+ to a component of the Work.
134
+
135
+ a. If a component of this Derived Work can be a direct replacement
136
+ for a component of the Work when that component is used with the
137
+ Base Interpreter, then, wherever this component of the Work
138
+ identifies itself to the user when used interactively with that
139
+ Base Interpreter, the replacement component of this Derived Work
140
+ clearly and unambiguously identifies itself as a modified version
141
+ of this component to the user when used interactively with that
142
+ Base Interpreter.
143
+
144
+ b. Every component of the Derived Work contains prominent notices
145
+ detailing the nature of the changes to that component, or a
146
+ prominent reference to another file that is distributed as part
147
+ of the Derived Work and that contains a complete and accurate log
148
+ of the changes.
149
+
150
+ c. No information in the Derived Work implies that any persons,
151
+ including (but not limited to) the authors of the original version
152
+ of the Work, provide any support, including (but not limited to)
153
+ the reporting and handling of errors, to recipients of the
154
+ Derived Work unless those persons have stated explicitly that
155
+ they do provide such support for the Derived Work.
156
+
157
+ d. You distribute at least one of the following with the Derived Work:
158
+
159
+ 1. A complete, unmodified copy of the Work;
160
+ if your distribution of a modified component is made by
161
+ offering access to copy the modified component from a
162
+ designated place, then offering equivalent access to copy
163
+ the Work from the same or some similar place meets this
164
+ condition, even though third parties are not compelled to
165
+ copy the Work along with the modified component;
166
+
167
+ 2. Information that is sufficient to obtain a complete,
168
+ unmodified copy of the Work.
169
+
170
+ 7. If you are not the Current Maintainer of the Work, you may
171
+ distribute a Compiled Work generated from a Derived Work, as long as
172
+ the Derived Work is distributed to all recipients of the Compiled
173
+ Work, and as long as the conditions of Clause 6, above, are met with
174
+ regard to the Derived Work.
175
+
176
+ 8. The conditions above are not intended to prohibit, and hence do not
177
+ apply to, the modification, by any method, of any component so that it
178
+ becomes identical to an updated version of that component of the Work as
179
+ it is distributed by the Current Maintainer under Clause 4, above.
180
+
181
+ 9. Distribution of the Work or any Derived Work in an alternative
182
+ format, where the Work or that Derived Work (in whole or in part) is
183
+ then produced by applying some process to that format, does not relax or
184
+ nullify any sections of this license as they pertain to the results of
185
+ applying that process.
186
+
187
+ 10. a. A Derived Work may be distributed under a different license
188
+ provided that license itself honors the conditions listed in
189
+ Clause 6 above, in regard to the Work, though it does not have
190
+ to honor the rest of the conditions in this license.
191
+
192
+ b. If a Derived Work is distributed under a different license, that
193
+ Derived Work must provide sufficient documentation as part of
194
+ itself to allow each recipient of that Derived Work to honor the
195
+ restrictions in Clause 6 above, concerning changes from the Work.
196
+
197
+ 11. This license places no restrictions on works that are unrelated to
198
+ the Work, nor does this license place any restrictions on aggregating
199
+ such works with the Work by any means.
200
+
201
+ 12. Nothing in this license is intended to, or may be used to, prevent
202
+ complete compliance by all parties with all applicable laws.
203
+
204
+
205
+ NO WARRANTY
206
+ ===========
207
+
208
+ There is no warranty for the Work. Except when otherwise stated in
209
+ writing, the Copyright Holder provides the Work `as is', without
210
+ warranty of any kind, either expressed or implied, including, but not
211
+ limited to, the implied warranties of merchantability and fitness for a
212
+ particular purpose. The entire risk as to the quality and performance
213
+ of the Work is with you. Should the Work prove defective, you assume
214
+ the cost of all necessary servicing, repair, or correction.
215
+
216
+ In no event unless required by applicable law or agreed to in writing
217
+ will The Copyright Holder, or any author named in the components of the
218
+ Work, or any other party who may distribute and/or modify the Work as
219
+ permitted above, be liable to you for damages, including any general,
220
+ special, incidental or consequential damages arising out of any use of
221
+ the Work or out of inability to use the Work (including, but not limited
222
+ to, loss of data, data being rendered inaccurate, or losses sustained by
223
+ anyone as a result of any failure of the Work to operate with any other
224
+ programs), even if the Copyright Holder or said author or said other
225
+ party has been advised of the possibility of such damages.
226
+
227
+
228
+ MAINTENANCE OF THE WORK
229
+ =======================
230
+
231
+ The Work has the status `author-maintained' if the Copyright Holder
232
+ explicitly and prominently states near the primary copyright notice in
233
+ the Work that the Work can only be maintained by the Copyright Holder
234
+ or simply that it is `author-maintained'.
235
+
236
+ The Work has the status `maintained' if there is a Current Maintainer
237
+ who has indicated in the Work that they are willing to receive error
238
+ reports for the Work (for example, by supplying a valid e-mail
239
+ address). It is not required for the Current Maintainer to acknowledge
240
+ or act upon these error reports.
241
+
242
+ The Work changes from status `maintained' to `unmaintained' if there
243
+ is no Current Maintainer, or the person stated to be Current
244
+ Maintainer of the work cannot be reached through the indicated means
245
+ of communication for a period of six months, and there are no other
246
+ significant signs of active maintenance.
247
+
248
+ You can become the Current Maintainer of the Work by agreement with
249
+ any existing Current Maintainer to take over this role.
250
+
251
+ If the Work is unmaintained, you can become the Current Maintainer of
252
+ the Work through the following steps:
253
+
254
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
255
+ the Copyright Holder, if the two differ) through the means of
256
+ an Internet or similar search.
257
+
258
+ 2. If this search is successful, then enquire whether the Work
259
+ is still maintained.
260
+
261
+ a. If it is being maintained, then ask the Current Maintainer
262
+ to update their communication data within one month.
263
+
264
+ b. If the search is unsuccessful or no action to resume active
265
+ maintenance is taken by the Current Maintainer, then announce
266
+ within the pertinent community your intention to take over
267
+ maintenance. (If the Work is a LaTeX work, this could be
268
+ done, for example, by posting to comp.text.tex.)
269
+
270
+ 3a. If the Current Maintainer is reachable and agrees to pass
271
+ maintenance of the Work to you, then this takes effect
272
+ immediately upon announcement.
273
+
274
+ b. If the Current Maintainer is not reachable and the Copyright
275
+ Holder agrees that maintenance of the Work be passed to you,
276
+ then this takes effect immediately upon announcement.
277
+
278
+ 4. If you make an `intention announcement' as described in 2b. above
279
+ and after three months your intention is challenged neither by
280
+ the Current Maintainer nor by the Copyright Holder nor by other
281
+ people, then you may arrange for the Work to be changed so as
282
+ to name you as the (new) Current Maintainer.
283
+
284
+ 5. If the previously unreachable Current Maintainer becomes
285
+ reachable once more within three months of a change completed
286
+ under the terms of 3b) or 4), then that Current Maintainer must
287
+ become or remain the Current Maintainer upon request provided
288
+ they then update their communication data within one month.
289
+
290
+ A change in the Current Maintainer does not, of itself, alter the fact
291
+ that the Work is distributed under the LPPL license.
292
+
293
+ If you become the Current Maintainer of the Work, you should
294
+ immediately provide, within the Work, a prominent and unambiguous
295
+ statement of your status as Current Maintainer. You should also
296
+ announce your new status to the same pertinent community as
297
+ in 2b) above.
298
+
299
+
300
+ WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
301
+ ======================================================
302
+
303
+ This section contains important instructions, examples, and
304
+ recommendations for authors who are considering distributing their
305
+ works under this license. These authors are addressed as `you' in
306
+ this section.
307
+
308
+ Choosing This License or Another License
309
+ ----------------------------------------
310
+
311
+ If for any part of your work you want or need to use *distribution*
312
+ conditions that differ significantly from those in this license, then
313
+ do not refer to this license anywhere in your work but, instead,
314
+ distribute your work under a different license. You may use the text
315
+ of this license as a model for your own license, but your license
316
+ should not refer to the LPPL or otherwise give the impression that
317
+ your work is distributed under the LPPL.
318
+
319
+ The document `modguide.tex' in the base LaTeX distribution explains
320
+ the motivation behind the conditions of this license. It explains,
321
+ for example, why distributing LaTeX under the GNU General Public
322
+ License (GPL) was considered inappropriate. Even if your work is
323
+ unrelated to LaTeX, the discussion in `modguide.tex' may still be
324
+ relevant, and authors intending to distribute their works under any
325
+ license are encouraged to read it.
326
+
327
+ A Recommendation on Modification Without Distribution
328
+ -----------------------------------------------------
329
+
330
+ It is wise never to modify a component of the Work, even for your own
331
+ personal use, without also meeting the above conditions for
332
+ distributing the modified component. While you might intend that such
333
+ modifications will never be distributed, often this will happen by
334
+ accident -- you may forget that you have modified that component; or
335
+ it may not occur to you when allowing others to access the modified
336
+ version that you are thus distributing it and violating the conditions
337
+ of this license in ways that could have legal implications and, worse,
338
+ cause problems for the community. It is therefore usually in your
339
+ best interest to keep your copy of the Work identical with the public
340
+ one. Many works provide ways to control the behavior of that work
341
+ without altering any of its licensed components.
342
+
343
+ How to Use This License
344
+ -----------------------
345
+
346
+ To use this license, place in each of the components of your work both
347
+ an explicit copyright notice including your name and the year the work
348
+ was authored and/or last substantially modified. Include also a
349
+ statement that the distribution and/or modification of that
350
+ component is constrained by the conditions in this license.
351
+
352
+ Here is an example of such a notice and statement:
353
+
354
+ %% pig.dtx
355
+ %% Copyright 2005 M. Y. Name
356
+ %
357
+ % This work may be distributed and/or modified under the
358
+ % conditions of the LaTeX Project Public License, either version 1.3
359
+ % of this license or (at your option) any later version.
360
+ % The latest version of this license is in
361
+ % http://www.latex-project.org/lppl.txt
362
+ % and version 1.3 or later is part of all distributions of LaTeX
363
+ % version 2005/12/01 or later.
364
+ %
365
+ % This work has the LPPL maintenance status `maintained'.
366
+ %
367
+ % The Current Maintainer of this work is M. Y. Name.
368
+ %
369
+ % This work consists of the files pig.dtx and pig.ins
370
+ % and the derived file pig.sty.
371
+
372
+ Given such a notice and statement in a file, the conditions
373
+ given in this license document would apply, with the `Work' referring
374
+ to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
375
+ generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
376
+ referring to any `LaTeX-Format', and both `Copyright Holder' and
377
+ `Current Maintainer' referring to the person `M. Y. Name'.
378
+
379
+ If you do not want the Maintenance section of LPPL to apply to your
380
+ Work, change `maintained' above into `author-maintained'.
381
+ However, we recommend that you use `maintained', as the Maintenance
382
+ section was added in order to ensure that your Work remains useful to
383
+ the community even when you can no longer maintain and support it
384
+ yourself.
385
+
386
+ Derived Works That Are Not Replacements
387
+ ---------------------------------------
388
+
389
+ Several clauses of the LPPL specify means to provide reliability and
390
+ stability for the user community. They therefore concern themselves
391
+ with the case that a Derived Work is intended to be used as a
392
+ (compatible or incompatible) replacement of the original Work. If
393
+ this is not the case (e.g., if a few lines of code are reused for a
394
+ completely different task), then clauses 6b and 6d shall not apply.
395
+
396
+
397
+ Important Recommendations
398
+ -------------------------
399
+
400
+ Defining What Constitutes the Work
401
+
402
+ The LPPL requires that distributions of the Work contain all the
403
+ files of the Work. It is therefore important that you provide a
404
+ way for the licensee to determine which files constitute the Work.
405
+ This could, for example, be achieved by explicitly listing all the
406
+ files of the Work near the copyright notice of each file or by
407
+ using a line such as:
408
+
409
+ % This work consists of all files listed in manifest.txt.
410
+
411
+ in that place. In the absence of an unequivocal list it might be
412
+ impossible for the licensee to determine what is considered by you
413
+ to comprise the Work and, in such a case, the licensee would be
414
+ entitled to make reasonable conjectures as to which files comprise
415
+ the Work.
416
+