rake4latex 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/{call_rake4latex.rb → rake4latex.rb} +5 -1
- data/bin/{readme_call_rake4latex.txt → readme_rake4latex.txt} +0 -0
- data/lib/rake4latex.rb +6 -8
- data/lib/rake4latex/base.rb +60 -15
- data/lib/rake4latex/clean.rb +37 -32
- data/lib/rake4latex/glossaries.rb +3 -4
- data/lib/rake4latex/latexrunner.rb +9 -4
- data/lib/rake4latex/rail.rb +80 -0
- data/lib/rake4latex/rules.rb +25 -56
- data/lib/rake4latex/splitindex.rb +7 -7
- data/lib/rake4latex_dtx.rb +6 -4
- data/lib/rake4latex_dvipdfm.rb +3 -10
- data/lib/rake4latex_ps2pdf.rb +4 -8
- data/readme.html +37 -12
- data/readme.txt +23 -8
- data/test/_expected/bibtex_test.txt +0 -1
- data/test/_expected/bibtex_test_bib.txt +0 -1
- data/test/_expected/bibtex_test_build_rakefile.txt +0 -1
- data/test/_expected/dtx_test.txt +0 -1
- data/test/_expected/dtx_test_sty.txt +0 -1
- data/test/_expected/dvipdfm_test.txt +0 -1
- data/test/_expected/error_test.txt +0 -1
- data/test/_expected/error_test_ignore_error.txt +0 -1
- data/test/_expected/error_test_overview.txt +11 -12
- data/test/_expected/error_test_statistic.txt +0 -1
- data/test/_expected/gloss_test.txt +0 -1
- data/test/_expected/gloss_test_bib.txt +0 -1
- data/test/_expected/gloss_test_build_rakefile.txt +0 -1
- data/test/_expected/glossaries_test.txt +0 -1
- data/test/_expected/includes_test.txt +0 -1
- data/test/_expected/includes_test_build_rakefile.txt +1 -2
- data/test/_expected/index_test.txt +0 -1
- data/test/_expected/longtable_test.txt +0 -1
- data/test/_expected/minitoc_test.txt +0 -1
- data/test/_expected/ps2pdf_test.txt +0 -1
- data/test/_expected/rail_error_test.txt +2 -3
- data/test/_expected/rail_test.txt +0 -1
- data/test/_expected/splitindex_test.txt +0 -1
- data/test/_expected/splitindex_test_build_rakefile.txt +0 -1
- data/test/_expected/supertabular_test.txt +0 -1
- data/test/_expected/supertabular_test_statistic.txt +1 -2
- data/test/_expected/two_tasks_test.txt +0 -1
- data/test/_expected/two_tasks_test_statistic.txt +0 -1
- data/test/_expected/varioref_test.txt +0 -1
- data/test/_expected/varioref_test_ignore_error.txt +1 -2
- data/test/_expected/z_complex_test.txt +0 -1
- data/test/_expected/z_complex_test_overview.txt +58 -58
- data/test/_expected/z_complex_test_overview_file.txt +0 -1
- data/test/_expected/z_complex_test_statistic.txt +0 -1
- data/test/bibtex/rakefile.rb +4 -9
- data/test/gloss/rakefile.rb +0 -7
- data/test/glossaries/rakefile.rb +4 -5
- data/test/rake4latex_testhelper.rb +76 -0
- data/test/test_extract.rb +29 -0
- data/test/unittest_rail.rb +154 -0
- data/test/unittest_rake4latex.rb +1 -0
- data/test/unittest_rake4latex_testcases.rb +96 -63
- data/test/unittest_splitindex.rb +14 -3
- metadata +89 -117
@@ -24,10 +24,11 @@ class Splitindex
|
|
24
24
|
(@targets[$1] ||= []) << "\\indexentry{#{$2}}{#{$3}}"
|
25
25
|
when /\indexentry\{(.+?)\}\{(.+?)\}/
|
26
26
|
(@targets['idx'] ||= []) << "\\indexentry{#{$1}}{#{$2}}"
|
27
|
+
else
|
28
|
+
@logger.warn("Unknown indexentry-type for splitindex (#{idx_line.split})")
|
27
29
|
end
|
28
30
|
} #File.readlines(@basename)
|
29
|
-
|
30
|
-
@indices = ( @targets.keys << 'idx' ).uniq!
|
31
|
+
@indices = ( @targets.keys << 'idx' ).uniq
|
31
32
|
end
|
32
33
|
#List of all indices
|
33
34
|
attr_reader :indices
|
@@ -62,12 +63,11 @@ class Splitindex
|
|
62
63
|
#Call makeindex for the given idx-file
|
63
64
|
def call_makeindex( idxname )
|
64
65
|
cmd = Rake4LaTeX.build_cmd( 'makeindex', :file_in => idxname )
|
65
|
-
stdout, stderr =
|
66
|
-
|
67
|
-
|
68
|
-
if $? != 0
|
69
|
-
@logger.fatal("There where Makeindex errors. for #{idxname}\n#{stderr}")
|
66
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
67
|
+
if wait_thr.value.exitstatus != 0
|
68
|
+
@logger.fatal("There where Makeindex errors for #{idxname}\n#{stderr.readlines.join}")
|
70
69
|
end
|
70
|
+
|
71
71
|
end #call_makeindex()
|
72
72
|
#~ #Loop on index names.
|
73
73
|
#~ def each_idxname()
|
data/lib/rake4latex_dtx.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#encoding: utf-8
|
1
2
|
=begin rdoc
|
2
3
|
Define the rules to handle dtx-files.
|
3
4
|
|
@@ -50,7 +51,7 @@ rule '.pdf' => '.dtx' do |t|
|
|
50
51
|
:dummy => nil
|
51
52
|
)
|
52
53
|
runner.execute #Does all the work and calls the "post-prerequisites"
|
53
|
-
#~ puts "fixme: makeindex
|
54
|
+
#~ puts "fixme: makeindex for glo"
|
54
55
|
#~ `makeindex -s gglo.ist -o blindtext.gls blindtext.glo`
|
55
56
|
end
|
56
57
|
|
@@ -60,9 +61,10 @@ tex_postrule '.gls' => '.glo' do |task|
|
|
60
61
|
# `makeindex -s gglo.ist -o blindtext.gls blindtext.glo`
|
61
62
|
cmd = Rake4LaTeX.build_cmd( 'makeindex_glo', { :file_in => task.source, :file_out => task.name }, task )
|
62
63
|
task.texrunner.logger.debug("\t#{cmd}")
|
63
|
-
stdout, stderr =
|
64
|
-
|
65
|
-
|
64
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
65
|
+
if wait_thr.value.exitstatus != 0
|
66
|
+
task.texrunner.logger.fatal("Error in makeindex for version history\n#{stdout.readlines.join}")
|
67
|
+
end
|
66
68
|
end
|
67
69
|
|
68
70
|
|
data/lib/rake4latex_dvipdfm.rb
CHANGED
@@ -26,15 +26,8 @@ rule '.pdf' => '.dvi' do |t|
|
|
26
26
|
Rake4LaTeX::Basefile.set(t.source).logger.info("Call dvipdfm for <#{t.source}>")
|
27
27
|
cmd = Rake4LaTeX.build_cmd( 'dvipdfm', :filename => t.source )
|
28
28
|
|
29
|
-
stdout, stderr =
|
30
|
-
|
31
|
-
#stdout
|
32
|
-
#stderr -> "ps2pdf testdocument.ps"
|
33
|
-
puts stdout
|
34
|
-
puts '==========='
|
35
|
-
puts stderr
|
36
|
-
}
|
37
|
-
if $? != 0
|
38
|
-
Rake4LaTeX::Basefile.set(t.source).logger.fatal("There where dvipdfm errors. \n#{stdout}")
|
29
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
30
|
+
if wait_thr.value.exitstatus != 0
|
31
|
+
Rake4LaTeX::Basefile.set(t.source).logger.fatal("There where dvipdfm errors. \n#{stdout.readlines}")
|
39
32
|
end
|
40
33
|
end
|
data/lib/rake4latex_ps2pdf.rb
CHANGED
@@ -14,14 +14,10 @@ desc "Build a pdf-file via ps2dvi"
|
|
14
14
|
rule '.pdf' => '.ps' do |t|
|
15
15
|
Rake4LaTeX::Logger.info("Call ps2pdf for <#{t.source}>")
|
16
16
|
cmd = Rake4LaTeX.build_cmd( 'ps2pdf', :filename => t.source )
|
17
|
-
|
18
|
-
stdout, stderr =
|
19
|
-
|
20
|
-
#stdout
|
21
|
-
#stderr -> "ps2pdf testdocument.ps"
|
22
|
-
}
|
23
|
-
if $? != 0
|
24
|
-
Rake4LaTeX::Logger.fatal("There where ps2pdf errors. \n#{stdout}")
|
17
|
+
|
18
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
19
|
+
if wait_thr.value.exitstatus != 0
|
20
|
+
Rake4LaTeX::Logger.fatal("There where ps2pdf errors. \n#{stdout.readlines.join}")
|
25
21
|
end
|
26
22
|
end
|
27
23
|
|
data/readme.html
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
<!--
|
2
2
|
|
3
|
-
Build by
|
3
|
+
Build by C:/Appl/Ruby193/lib/ruby/gems/1.9.1/gems/docgenerator-2.1.0/lib/docgenerator/document.rb
|
4
4
|
Dir: C:/usr/script/rake4latex
|
5
|
-
Creator: Docgenerator 2.
|
5
|
+
Creator: Docgenerator 2.1.0 - http://rubygems.org/gems/docgenerator
|
6
6
|
Target: readme.html
|
7
|
-
|
7
|
+
2015/03/25 11:49:52
|
8
8
|
|
9
9
|
Generation-Info-End
|
10
10
|
-->
|
11
11
|
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
|
12
12
|
<html>
|
13
13
|
<head >
|
14
|
-
<title>Rake4LaTeX V0.1.
|
14
|
+
<title>Rake4LaTeX V0.1.5</title>
|
15
15
|
</head>
|
16
16
|
<body ><h1 >rake4latex: TeX-Build-Tool</h1>
|
17
17
|
<h2 >Introduction</h2>
|
@@ -79,7 +79,7 @@ Example:
|
|
79
79
|
call_rake4latex.rb -e my_file
|
80
80
|
</pre>
|
81
81
|
<p >
|
82
|
-
Windows users can pick up a stand alone executable of call_rake4latex at CTAN: <a href = "http://ctan.org/tex-archive/support/rake4latex"
|
82
|
+
Windows users can pick up a stand alone executable of call_rake4latex at CTAN: <a href = "http://ctan.org/tex-archive/support/rake4latex">http://ctan.org/tex-archive/support/rake4latex</a>
|
83
83
|
</p>
|
84
84
|
<h3 >rake4latex as lib in your application</h3>
|
85
85
|
<p >
|
@@ -202,9 +202,9 @@ The rake process to generate the document is independent of any package. But so
|
|
202
202
|
For the following packages exist special solutions:
|
203
203
|
</p>
|
204
204
|
<ul >
|
205
|
-
<li > splitindex (splitindex is replaced by internal routines) <a href = "http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/"
|
206
|
-
<li > gloss (glossary based on bibTeX) <a href = "http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/"
|
207
|
-
<li > rail (creating rail-diagramms) <a href = "http://www.ctan.org/tex-archive/support/rail/"
|
205
|
+
<li > splitindex (splitindex is replaced by internal routines) <a href = "http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/">http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/</a> </li>
|
206
|
+
<li > gloss (glossary based on bibTeX) <a href = "http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/">http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/</a> </li>
|
207
|
+
<li > rail (creating rail-diagramms) <a href = "http://www.ctan.org/tex-archive/support/rail/">http://www.ctan.org/tex-archive/support/rail/</a> </li>
|
208
208
|
<li > glossaries (glossary based on makeindex) <ul >
|
209
209
|
<li >use gloss.sty instead or </li>
|
210
210
|
<li >load rake4latex/glossaries.rb </li>
|
@@ -300,6 +300,12 @@ Usage:
|
|
300
300
|
task :basefile => 'myfile'
|
301
301
|
task :default => [ 'myfile.pdf', :clean ]
|
302
302
|
</pre>
|
303
|
+
<p >
|
304
|
+
When may also add a parameter with the basename of a file to delete the auxiliary files:
|
305
|
+
</p>
|
306
|
+
<pre>
|
307
|
+
rake clean[myfile.tx]
|
308
|
+
</pre>
|
303
309
|
<h3 >log_archive</h3>
|
304
310
|
<p >
|
305
311
|
With _clean_ you loose all logs. With _log_archive_ you create a zip-file with all logs.
|
@@ -394,13 +400,13 @@ There are additional packages requiring additonal runs.
|
|
394
400
|
0.0.1 2010-01-03
|
395
401
|
</p>
|
396
402
|
<ul >
|
397
|
-
<li > First release published at gemcutter <a href = "http://gemcutter.org/gems/rake4latex"
|
403
|
+
<li > First release published at gemcutter <a href = "http://gemcutter.org/gems/rake4latex">http://gemcutter.org/gems/rake4latex</a> </li>
|
398
404
|
</ul>
|
399
405
|
<p >
|
400
406
|
0.1.0 2010-01-07
|
401
407
|
</p>
|
402
408
|
<ul >
|
403
|
-
<li > rubyforge project rake4latex: <a href = "http://rubyforge.org/projects/rake4latex/"
|
409
|
+
<li > rubyforge project rake4latex: <a href = "http://rubyforge.org/projects/rake4latex/">http://rubyforge.org/projects/rake4latex/</a> </li>
|
404
410
|
<li > Add support dvips + ps2pdf (and dvipdfm, xelatex, lualatex) </li>
|
405
411
|
<li > Configurable programm settings (rake4latex.yaml) </li>
|
406
412
|
<li > Define a caller call_rake4latex </li>
|
@@ -431,11 +437,30 @@ There are additional packages requiring additonal runs.
|
|
431
437
|
<li > Minor corrections for Ruby 1.9 </li>
|
432
438
|
</ul>
|
433
439
|
<p >
|
434
|
-
0.1.3 2011-08
|
440
|
+
0.1.3 2011-08-19
|
435
441
|
</p>
|
436
442
|
<ul >
|
437
443
|
<li > clean: add fixme.sty (lox) </li>
|
438
|
-
<li > correction splitindex and unittest_splitindex.rb</li>
|
444
|
+
<li > correction splitindex and unittest_splitindex.rb </li>
|
445
|
+
</ul>
|
446
|
+
<p >
|
447
|
+
0.1.4
|
448
|
+
</p>
|
449
|
+
<ul >
|
450
|
+
<li > rail: correction for ruby 1.9 </li>
|
451
|
+
<li > replaced knut_tools (catch_output) with Open3.popen3 </li>
|
452
|
+
<li > include Rake::DSL for newer rake versions </li>
|
453
|
+
</ul>
|
454
|
+
<p >
|
455
|
+
wait_thr.value.exitstatus
|
456
|
+
</p>
|
457
|
+
<p >
|
458
|
+
0.1.5
|
459
|
+
</p>
|
460
|
+
<ul >
|
461
|
+
<li > Correction for splitindex </li>
|
462
|
+
<li > Clean for pdfcomment.sty </li>
|
463
|
+
<li > Suppress the task descriptions (See Rake4LaTeX.mk_taskdescriptions)</li>
|
439
464
|
</ul>
|
440
465
|
</body>
|
441
466
|
</html>
|
data/readme.txt
CHANGED
@@ -55,7 +55,7 @@ Example:
|
|
55
55
|
call_rake4latex.rb my_file
|
56
56
|
call_rake4latex.rb -e my_file
|
57
57
|
|
58
|
-
Windows users can pick up a stand alone executable of call_rake4latex at CTAN: http://ctan.org/tex-archive/support/rake4latex
|
58
|
+
Windows users can pick up a stand alone executable of call_rake4latex at CTAN: http://ctan.org/tex-archive/support/rake4latex
|
59
59
|
|
60
60
|
rake4latex as lib in your application
|
61
61
|
------------------------------
|
@@ -156,9 +156,9 @@ Supported (checked) packages
|
|
156
156
|
The rake process to generate the document is independent of any package. But some packages requires additional actions.
|
157
157
|
|
158
158
|
For the following packages exist special solutions:
|
159
|
-
- splitindex (splitindex is replaced by internal routines) http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/
|
160
|
-
- gloss (glossary based on bibTeX) http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/
|
161
|
-
- rail (creating rail-diagramms) http://www.ctan.org/tex-archive/support/rail/
|
159
|
+
- splitindex (splitindex is replaced by internal routines) http://www.ctan.org/tex-archive/macros/latex/contrib/splitindex/
|
160
|
+
- gloss (glossary based on bibTeX) http://www.ctan.org/tex-archive/macros/latex/contrib/gloss/
|
161
|
+
- rail (creating rail-diagramms) http://www.ctan.org/tex-archive/support/rail/
|
162
162
|
- glossaries (glossary based on makeindex) - use gloss.sty instead or
|
163
163
|
- load rake4latex/glossaries.rb
|
164
164
|
|
@@ -233,6 +233,9 @@ Usage:
|
|
233
233
|
task :basefile => 'myfile'
|
234
234
|
task :default => [ 'myfile.pdf', :clean ]
|
235
235
|
|
236
|
+
When may also add a parameter with the basename of a file to delete the auxiliary files:
|
237
|
+
rake clean[myfile.tx]
|
238
|
+
|
236
239
|
log_archive
|
237
240
|
------------------------------
|
238
241
|
|
@@ -313,10 +316,10 @@ Version History
|
|
313
316
|
------------------------------
|
314
317
|
|
315
318
|
0.0.1 2010-01-03
|
316
|
-
- First release published at gemcutter http://gemcutter.org/gems/rake4latex
|
319
|
+
- First release published at gemcutter http://gemcutter.org/gems/rake4latex
|
317
320
|
|
318
321
|
0.1.0 2010-01-07
|
319
|
-
- rubyforge project rake4latex: http://rubyforge.org/projects/rake4latex/
|
322
|
+
- rubyforge project rake4latex: http://rubyforge.org/projects/rake4latex/
|
320
323
|
- Add support dvips + ps2pdf (and dvipdfm, xelatex, lualatex)
|
321
324
|
- Configurable programm settings (rake4latex.yaml)
|
322
325
|
- Define a caller call_rake4latex
|
@@ -340,7 +343,19 @@ Version History
|
|
340
343
|
- Replaced Rake4LaTeX.set_latexrunner_default with Rake4LaTeX::Basefile#[]=
|
341
344
|
- Minor corrections for Ruby 1.9
|
342
345
|
|
343
|
-
0.1.3 2011-08
|
346
|
+
0.1.3 2011-08-19
|
344
347
|
- clean: add fixme.sty (lox)
|
345
|
-
- correction splitindex and unittest_splitindex.rb
|
348
|
+
- correction splitindex and unittest_splitindex.rb
|
349
|
+
|
350
|
+
0.1.4
|
351
|
+
- rail: correction for ruby 1.9
|
352
|
+
- replaced knut_tools (catch_output) with Open3.popen3
|
353
|
+
- include Rake::DSL for newer rake versions
|
354
|
+
|
355
|
+
wait_thr.value.exitstatus
|
356
|
+
|
357
|
+
0.1.5
|
358
|
+
- Correction for splitindex
|
359
|
+
- Clean for pdfcomment.sty
|
360
|
+
- Suppress the task descriptions (See Rake4LaTeX.mk_taskdescriptions)
|
346
361
|
|
data/test/_expected/dtx_test.txt
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
1
|
Log-overview for testdocument.tex
|
3
2
|
Document : 1 page, 1 error (testdocument.log)
|
4
|
-
---
|
5
|
-
testdocument.log:
|
6
|
-
:latex_errors:
|
7
|
-
- Undefined control sequence. [log#
|
8
|
-
:output:
|
9
|
-
- Output written on testdocument.pdf (1 pages) [log#
|
3
|
+
---
|
4
|
+
testdocument.log:
|
5
|
+
:latex_errors:
|
6
|
+
- Undefined control sequence. [log#273]
|
7
|
+
:output:
|
8
|
+
- Output written on testdocument.pdf (1 pages) [log#303]
|
10
9
|
|
11
10
|
========
|
12
11
|
Detailed analyse of testdocument.log
|
@@ -14,8 +13,8 @@ testdocument.log:
|
|
14
13
|
###########
|
15
14
|
##The following list may contain wrong line assignments
|
16
15
|
###########
|
17
|
-
---
|
18
|
-
:output:
|
19
|
-
- Output written on testdocument.pdf (1 pages) [page0] [log#
|
20
|
-
:latex_errors:
|
21
|
-
- Undefined control sequence. (./testdocument.tex) [log#
|
16
|
+
---
|
17
|
+
:output:
|
18
|
+
- Output written on testdocument.pdf (1 pages) [page0] [log#17] - []
|
19
|
+
:latex_errors:
|
20
|
+
- Undefined control sequence. (./testdocument.tex) [log#57] - []
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
=begin
|
3
2
|
Rakefile for LaTeX-project testdocument
|
4
3
|
|
@@ -19,7 +18,7 @@ task :basefile => 'testdocument.tex'
|
|
19
18
|
#
|
20
19
|
file 'testdocument.pdf' => 'testdocument.tex'
|
21
20
|
file 'testdocument.dvi' => 'testdocument.tex'
|
22
|
-
# ---
|
21
|
+
# ---
|
23
22
|
# - testdocument.tex
|
24
23
|
# - - testincludes/testinclude1.tex
|
25
24
|
# - - testincludes/testinclude2.tex
|
@@ -1,10 +1,9 @@
|
|
1
|
-
|
2
1
|
INFO testrail_error: StartLaTeXRunner for testrail_error.tex
|
3
2
|
INFO testrail_error: Excute pdflatex -interaction=batchmode testrail_error.tex
|
4
3
|
INFO testrail_error: Rerun necessary (aux-file changed)
|
5
4
|
INFO testrail_error: Call target testrail_error.rao (testrail_error.rai changed)
|
6
|
-
ERROR testrail_error: Rail error: stdin, line 2: syntax error
|
7
|
-
ERROR testrail_error: Rail error: stdin, line 3: syntax error
|
5
|
+
ERROR testrail_error: Rail error: stdin, line 2: syntax error
|
6
|
+
ERROR testrail_error: Rail error: stdin, line 3: syntax error
|
8
7
|
WARN testrail_error: No rail diagramms generated
|
9
8
|
INFO testrail_error: Excute pdflatex -interaction=batchmode testrail_error.tex
|
10
9
|
INFO testrail_error: TeX-run stopped after 2 runs
|