rake4latex 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/bin/call_rake4latex.rb +7 -1
  2. data/bin/readme_call_rake4latex.txt +1 -0
  3. data/lib/rake4latex.rb +15 -14
  4. data/lib/rake4latex/analyse_texfile.rb +6 -4
  5. data/lib/rake4latex/base.rb +191 -63
  6. data/lib/rake4latex/clean.rb +9 -6
  7. data/lib/rake4latex/glossaries.rb +101 -0
  8. data/lib/rake4latex/latexrunner.rb +16 -27
  9. data/lib/rake4latex/rules.rb +81 -54
  10. data/lib/rake4latex/splitindex.rb +0 -1
  11. data/lib/rake4latex/tex_statistic.rb +18 -6
  12. data/lib/rake4latex_dtx.rb +3 -3
  13. data/lib/rake4latex_dvipdfm.rb +2 -2
  14. data/readme.html +32 -14
  15. data/readme.txt +21 -11
  16. data/test/_expected/bibtex_test.txt +9 -9
  17. data/test/_expected/bibtex_test_bib.txt +4 -4
  18. data/test/_expected/bibtex_test_build_rakefile.txt +3 -0
  19. data/test/_expected/dtx_test.txt +11 -11
  20. data/test/_expected/dvipdfm_test.txt +6 -6
  21. data/test/_expected/error_test.txt +3 -3
  22. data/test/_expected/error_test_ignore_error.txt +4 -4
  23. data/test/_expected/error_test_overview.txt +7 -2
  24. data/test/_expected/error_test_statistic.txt +2 -2
  25. data/test/_expected/gloss_test.txt +15 -15
  26. data/test/_expected/gloss_test_bib.txt +7 -7
  27. data/test/_expected/gloss_test_build_rakefile.txt +3 -0
  28. data/test/_expected/glossaries_test.txt +12 -0
  29. data/test/_expected/includes_test.txt +7 -7
  30. data/test/_expected/includes_test_build_rakefile.txt +3 -0
  31. data/test/_expected/index_test.txt +6 -6
  32. data/test/_expected/longtable_test.txt +5 -5
  33. data/test/_expected/minitoc_test.txt +7 -7
  34. data/test/_expected/ps2pdf_test.txt +7 -7
  35. data/test/_expected/rail_error_test.txt +9 -9
  36. data/test/_expected/rail_test.txt +6 -6
  37. data/test/_expected/splitindex_test.txt +7 -7
  38. data/test/_expected/splitindex_test_build_rakefile.txt +9 -6
  39. data/test/_expected/supertabular_test.txt +5 -5
  40. data/test/_expected/supertabular_test_statistic.txt +1 -1
  41. data/test/_expected/two_tasks_test.txt +15 -0
  42. data/test/_expected/two_tasks_test_statistic.txt +11 -0
  43. data/test/_expected/varioref_test.txt +5 -5
  44. data/test/_expected/varioref_test_ignore_error.txt +7 -7
  45. data/test/_expected/z_complex_test.txt +12 -11
  46. data/test/_expected/z_complex_test_overview.txt +24 -9
  47. data/test/_expected/z_complex_test_overview_file.txt +2 -0
  48. data/test/_expected/z_complex_test_statistic.txt +2 -2
  49. data/test/bibtex/rakefile.rb +4 -2
  50. data/test/dtx/rakefile.rb +3 -3
  51. data/test/dvipdfm/rakefile.rb +4 -2
  52. data/test/error/rakefile.rb +10 -6
  53. data/test/gloss/rakefile.rb +3 -2
  54. data/test/glossaries/rakefile.rb +50 -0
  55. data/test/glossaries/sample.tex +133 -0
  56. data/test/includes/rakefile.rb +7 -6
  57. data/test/index/rakefile.rb +3 -2
  58. data/test/longtable/rakefile.rb +3 -2
  59. data/test/minitoc/rakefile.rb +3 -2
  60. data/test/ps2pdf/rakefile.rb +3 -2
  61. data/test/rail/rakefile.rb +5 -4
  62. data/test/rail_error/rakefile.rb +3 -2
  63. data/test/splitindex/rakefile.rb +7 -5
  64. data/test/supertabular/rakefile.rb +3 -2
  65. data/test/two_tasks/rakefile.rb +50 -0
  66. data/test/two_tasks/testdocument_1.tex +10 -0
  67. data/test/two_tasks/testdocument_2.tex +10 -0
  68. data/test/unittest_rake4latex.rb +27 -4
  69. data/test/unittest_rake4latex_testcases.rb +27 -11
  70. data/test/varioref/rakefile.rb +11 -5
  71. data/test/z_complex/rakefile.rb +8 -6
  72. data/test/z_complex/testdocument.tex +12 -1
  73. metadata +149 -28
@@ -19,7 +19,7 @@ Dir.chdir('../../lib'){ require 'rake4latex_dvipdfm'}
19
19
 
20
20
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
21
21
 
22
- task :basefile => 'testdocument.tex'
22
+ Rake4LaTeX::Basefile.set("testdocument.tex")
23
23
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
24
24
 
25
25
  task :default => [:touch]
@@ -39,5 +39,7 @@ task :test => [ :touch, 'testdocument.pdf' ]
39
39
  if $0 == __FILE__
40
40
  app = Rake.application
41
41
  #~ Rake4LaTeX.set_latexrunner_default(:loglevel, Log4r::DEBUG)
42
- app[:default].invoke
42
+ #~ app[:default].invoke
43
+ app[:test].invoke
44
+ app[:clobber].invoke
43
45
  end
@@ -1,13 +1,14 @@
1
1
  #
2
2
  # Test error
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
- task :basefile => 'testdocument.tex'
7
+ Rake4LaTeX::Basefile.set("testdocument.tex")
7
8
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
8
9
 
9
10
  task :ignore_error do
10
- Rake4LaTeX.set_latexrunner_default(:texerrors_allowed, true)
11
+ Rake4LaTeX::Basefile.set("testdocument.tex")[:texerrors_allowed] = true
11
12
  end
12
13
 
13
14
  task :default => :touch
@@ -24,9 +25,12 @@ task :test_overview => [ :log_overview ]
24
25
  if $0 == __FILE__
25
26
  app = Rake.application
26
27
  #~ app[:default].invoke
27
- app[:test_ignore_error].invoke
28
- app[:log_archive].invoke
29
- app[:log_overview].invoke
28
+ #~ app[:test].invoke
29
+ app[:test_statistic].invoke
30
+ #~ app[:test_ignore_error].invoke
31
+ #~ app[:log_archive].invoke
32
+ #~ app[:log_overview].invoke
33
+ #~ app[:clobber].invoke
30
34
  end
31
35
 
32
36
 
@@ -2,7 +2,8 @@
2
2
  #Test gloss
3
3
  #Glossaries auf Basis von BibTeX
4
4
  #
5
- Dir.chdir('../../lib'){ require 'rake4latex'}
5
+ $:.unshift('../../lib')
6
+ require 'rake4latex'
6
7
  =begin
7
8
  Erzeugt .gls.aux bzw. test_gloss_newgloss.animals.aux
8
9
  Diese normal verwenden.
@@ -25,7 +26,7 @@ file 'testdocument.pdf' => deps
25
26
 
26
27
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
27
28
 
28
- task :basefile => 'testdocument.tex'
29
+ Rake4LaTeX::Basefile.set("testdocument.tex")
29
30
  task :touch => 'testdocument.tex' ##Zeitstempel anpassen/Kompilation erzwingen
30
31
 
31
32
  task :default => :touch
@@ -0,0 +1,50 @@
1
+ #
2
+ #Test Glossaries
3
+ #http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/glossaries/glossaries-manual.html
4
+ #
5
+ Dir.chdir('../../lib'){
6
+ require 'rake4latex'
7
+ require 'rake4latex/glossaries'
8
+ }
9
+ #~ require 'glossaries'
10
+
11
+
12
+ deps = [
13
+ 'sample.tex',
14
+ ]
15
+
16
+ file 'sample.dvi' => deps
17
+ file 'sample.pdf' => deps
18
+
19
+ #
20
+
21
+ #~ file 'sample.dvi' => LaTeXRunner.find_included_files( 'sample.tex' ).flatten.uniq
22
+
23
+ Rake4LaTeX::Basefile.set("sample.tex")
24
+ task :touch => 'sample.tex' ##Zeitstempel anpassen/Kompilation erzwingen
25
+
26
+ task :default => :touch
27
+ #~ task :default => 'sample.dvi'
28
+ task :default => 'sample.pdf'
29
+ task :default => :statistic
30
+ task :default => :clean
31
+
32
+ #fixme: CLEAN without previous TeX-Run does not work
33
+ CLEAN.include('sample.{acn,acr,alg,glg,ist}')
34
+
35
+
36
+ desc "Testtask for Unittest"
37
+ task :test => [ :touch, 'sample.pdf' ]
38
+
39
+
40
+ if $0 == __FILE__
41
+ app = Rake.application
42
+ #~ Rake4LaTeX.set_latexrunner_default(:maxruns, 1)
43
+ #~ Rake4LaTeX.set_latexrunner_default(:loglevel, Log4r::DEBUG)
44
+ #~ Rake4LaTeX.set_latexrunner_default(:texerrors_allowed, true)
45
+ #~ app[:default].invoke
46
+ app[:test].invoke
47
+
48
+ app[:clean].invoke
49
+ puts "!Fixme makeindex-Log"
50
+ end
@@ -0,0 +1,133 @@
1
+ \documentclass[a4paper]{report}
2
+
3
+ \usepackage[plainpages=false,colorlinks]{hyperref}
4
+ \usepackage[toc,style=treenoname,order=word,acronym]{glossaries}
5
+
6
+ \makeglossaries
7
+
8
+ \newglossaryentry{glossary}{name=glossary,
9
+ description={\nopostdesc},
10
+ plural={glossaries}}
11
+
12
+ \newglossaryentry{glossarylist}{
13
+ description={1) list of technical words},
14
+ sort={1},
15
+ parent={glossary}}
16
+
17
+ \newglossaryentry{glossarycol}{
18
+ description={2) collection of glosses},
19
+ sort={2},
20
+ parent={glossary}}
21
+
22
+ \newglossaryentry{Perl}{name=\texttt{Perl},
23
+ sort=Perl, % need a sort key because name contains a command
24
+ description=A scripting language}
25
+
26
+ \newglossaryentry{pagelist}{name=page list,
27
+ % description value has to be enclosed in braces
28
+ % because it contains commas
29
+ description={a list of individual pages or page ranges
30
+ (e.g.\ 1,2,4,7-9)}}
31
+
32
+ \newglossaryentry{mtrx}{name=matrix,
33
+ description={rectangular array of quantities},
34
+ % plural is not simply obtained by appending an s, so specify
35
+ plural=matrices}
36
+
37
+ % entry with a paragraph break in the description
38
+
39
+ \newglossaryentry{par}{name=paragraph,
40
+ description={distinct section of piece of
41
+ writing.\glspar Beginning on new, usually indented, line}}
42
+
43
+ % entry with two types of plural. Set the plural form to the
44
+ % form most likely to be used. If you want to use a different
45
+ % plural, you will need to explicity specify it in \glslink
46
+ \newglossaryentry{cow}{name=cow,
47
+ % this isn't necessary, as this form (appending an s) is
48
+ % the default
49
+ plural=cows,
50
+ % description:
51
+ description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult
52
+ female of any bovine animal}}
53
+
54
+ \newglossaryentry{bravo}{name={bravo},
55
+ description={\nopostdesc}}
56
+
57
+ \newglossaryentry{bravo1}{description={1) cry of approval (pl.\ bravos)},
58
+ sort={1},
59
+ plural={bravos},
60
+ parent=bravo}
61
+
62
+ \newglossaryentry{bravo2}{description={2) hired ruffian or killer (pl.\ bravoes)},
63
+ sort={2},
64
+ plural={bravoes},
65
+ parent=bravo}
66
+
67
+ \newglossaryentry{seal}{name=seal,description={sea mammal with
68
+ flippers that eats fish}}
69
+
70
+ \newglossaryentry{sealion}{name={sea lion},
71
+ description={large seal}}
72
+
73
+ \begin{document}
74
+
75
+ \title{Sample Document Using glossary Package}
76
+ \author{Nicola Talbot}
77
+ \pagenumbering{alph}% prevent duplicate page link names if using PDF
78
+ \maketitle
79
+
80
+ \pagenumbering{roman}
81
+ \tableofcontents
82
+
83
+ \chapter{Introduction}
84
+ \pagenumbering{arabic}
85
+
86
+ A \gls{glossarylist} is a very useful addition to any
87
+ technical document, although a \gls{glossarycol} can
88
+ also simply be a collection of glosses, which is
89
+ another thing entirely. Some documents have
90
+ multiple \glspl{glossarylist}.
91
+
92
+ Once you have run your document through \LaTeX, you
93
+ will then need to run the \texttt{.glo} file through
94
+ \texttt{makeindex}. You will need to set the output
95
+ file so that it creates a \texttt{.gls} file instead
96
+ of an \texttt{.ind} file, and change the name of
97
+ the log file so that it doesn't overwrite the index
98
+ log file (if you have an index for your document).
99
+ Rather than having to remember all the command line
100
+ switches, you can call the \gls{Perl} script
101
+ \texttt{makeglossaries} which provides a convenient
102
+ wrapper.
103
+
104
+ If a comma appears within the name or description, grouping
105
+ must be used, e.g.\ in the description of \gls{pagelist}.
106
+
107
+ \chapter{Plurals and Paragraphs}
108
+
109
+ Plurals are assumed to have the letter s appended, but if this is
110
+ not the case, as in \glspl{mtrx}, then you need to specify the
111
+ plural when you define the entry. If a term may have multiple
112
+ plurals (for example \glspl{cow}/\glslink{cow}{kine}) then
113
+ define the entry with the plural form most likely to be used and
114
+ explicitly specify the alternative form using \verb|\glslink|.
115
+ \Glspl{seal} and \glspl{sealion} have regular plural forms.
116
+
117
+ \Gls{bravo} is a homograph, but the plural forms are spelt
118
+ differently. The plural of \gls{bravo1}, a cry of approval,
119
+ is \glspl{bravo1}, whereas the plural of \gls{bravo2}, a hired
120
+ ruffian or killer, is \glspl{bravo2}.
121
+
122
+ \Glspl{par} can cause a problem in commands, so care is needed
123
+ when having a paragraph break in a \gls{glossarylist} entry.
124
+
125
+ \chapter{Ordering}
126
+
127
+ There are two types of ordering: word ordering (which places
128
+ ``\gls{sealion}'' before ``\gls{seal}'') and letter ordering
129
+ (which places ``\gls{seal}'' before ``\gls{sealion}'').
130
+
131
+ \printglossaries
132
+
133
+ \end{document}
@@ -1,8 +1,8 @@
1
1
  #
2
2
  # Test includes
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
5
-
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
6
6
 
7
7
  deps = [
8
8
  'testdocument.tex', 'testincludes/testinclude1.tex', 'testincludes/testinclude2.tex',
@@ -17,14 +17,15 @@ deps = [
17
17
  file 'testdocument.dvi' => deps
18
18
  file 'testdocument.pdf' => deps
19
19
 
20
- task :basefile => 'testdocument.tex'
20
+ Rake4LaTeX::Basefile.set("testdocument.tex")
21
21
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
22
22
 
23
23
 
24
- task :default => :touch
24
+ #~ task :default => :touch
25
25
  #~ task :default => 'testdocument.dvi'
26
- task :default => 'testdocument.pdf'
27
- task :default => :clean
26
+ #~ task :default => 'testdocument.pdf'
27
+ #~ task :default => :clean
28
+ task :default => :build_rakefile
28
29
 
29
30
  desc "Testtask for Unittest"
30
31
  task :test => [ :touch, 'testdocument.pdf' ]
@@ -1,7 +1,8 @@
1
1
  #
2
2
  #Test index
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
7
  #~ deps = [
7
8
  #~ 'testdocument.tex'
@@ -11,7 +12,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
11
12
 
12
13
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
13
14
 
14
- task :basefile => 'testdocument.tex'
15
+ Rake4LaTeX::Basefile.set("testdocument.tex")
15
16
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
16
17
 
17
18
 
@@ -1,7 +1,8 @@
1
1
  #
2
2
  #Test index
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
7
  #Prepeare longtable-content
7
8
  #~ 6.times{
@@ -19,7 +20,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
19
20
 
20
21
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
21
22
 
22
- task :basefile => 'testdocument.tex'
23
+ Rake4LaTeX::Basefile.set("testdocument.tex")
23
24
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
24
25
 
25
26
  task :default => [:touch]
@@ -1,4 +1,5 @@
1
- Dir.chdir('../../lib'){ require 'rake4latex'}
1
+ $:.unshift('../../lib')
2
+ require 'rake4latex'
2
3
 
3
4
  #~ deps = [
4
5
  #~ 'testdocument.tex'
@@ -8,7 +9,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
8
9
 
9
10
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
10
11
 
11
- task :basefile => 'testdocument.tex'
12
+ Rake4LaTeX::Basefile.set("testdocument.tex")
12
13
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
13
14
 
14
15
  task :default => :touch
@@ -19,13 +19,13 @@ Dir.chdir('../../lib'){ require 'rake4latex_ps2pdf'}
19
19
 
20
20
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
21
21
 
22
- task :basefile => 'testdocument.tex'
22
+ Rake4LaTeX::Basefile.set("testdocument.tex")
23
23
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
24
24
 
25
25
  task :default => [:touch]
26
26
  #~ task :default => 'testdocument.dvi'
27
27
  task :default => 'testdocument.pdf'
28
- task :default => :clean
28
+ #~ task :default => :clean
29
29
 
30
30
  #~ task :clean do
31
31
  #~ puts CLEAN.inspect
@@ -40,4 +40,5 @@ if $0 == __FILE__
40
40
  app = Rake.application
41
41
  #~ Rake4LaTeX.set_latexrunner_default(:loglevel, Log4r::DEBUG)
42
42
  app[:default].invoke
43
+ #~ app[:clobber].invoke
43
44
  end
@@ -1,7 +1,8 @@
1
1
  #
2
2
  #Test rail
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
7
  #~ deps = [
7
8
  #~ 'testrail.tex'
@@ -11,7 +12,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
11
12
 
12
13
  #~ file 'testrail.dvi' => LaTeXRunner.find_included_files( 'testrail.tex' ).flatten.uniq
13
14
 
14
- task :basefile => 'testrail.tex'
15
+ Rake4LaTeX::Basefile.set("testrail.tex")
15
16
  task :touch => 'testrail.tex' #Zeitstempel anpassen/Kompilation erzwingen
16
17
 
17
18
  task :default => :touch
@@ -33,6 +34,6 @@ if $0 == __FILE__
33
34
  #~ Rake4LaTeX.set_latexrunner_default(:loglevel, Log4r::DEBUG)
34
35
  #~ Rake4LaTeX.set_latexrunner_default(:texerrors_allowed, true)
35
36
  #~ app[:default].invoke
36
- #~ app[:test].invoke
37
- #~ app[:clean].invoke
37
+ app[:test].invoke
38
+ app[:clean].invoke
38
39
  end
@@ -1,7 +1,8 @@
1
1
  #
2
2
  #Test rail_error
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
7
  #~ deps = [
7
8
  #~ 'testrail.tex'
@@ -11,7 +12,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
11
12
 
12
13
  #~ file 'testrail.dvi' => LaTeXRunner.find_included_files( 'testrail.tex' ).flatten.uniq
13
14
 
14
- task :basefile => 'testrail_error.tex'
15
+ Rake4LaTeX::Basefile.set("testrail_error.tex")
15
16
  task :touch => 'testrail_error.tex' #Zeitstempel anpassen/Kompilation erzwingen
16
17
 
17
18
  task :default => :touch
@@ -1,7 +1,8 @@
1
1
  #
2
2
  #Testcase splitindex
3
3
  #
4
- Dir.chdir('../../lib'){ require 'rake4latex'}
4
+ $:.unshift('../../lib')
5
+ require 'rake4latex'
5
6
 
6
7
  #~ deps = [
7
8
  #~ 'testdocument.tex'
@@ -11,7 +12,7 @@ Dir.chdir('../../lib'){ require 'rake4latex'}
11
12
 
12
13
  #~ file 'testdocument.dvi' => LaTeXRunner.find_included_files( 'testdocument.tex' ).flatten.uniq
13
14
 
14
- task :basefile => 'testdocument.tex'
15
+ Rake4LaTeX::Basefile.set("testdocument.tex")
15
16
  task :touch => 'testdocument.tex' #Zeitstempel anpassen/Kompilation erzwingen
16
17
 
17
18
  #Not detected by set4clean:
@@ -20,7 +21,7 @@ CLEAN.add("testdocument-*") #splitidx-helpfiles
20
21
  task :default => :touch
21
22
  #~ task :default => 'testdocument.dvi'
22
23
  task :default => 'testdocument.pdf'
23
- #~ task :default => :clean
24
+ task :default => :clean
24
25
 
25
26
  #~ task :clean do
26
27
  #~ puts CLEAN.inspect
@@ -38,6 +39,7 @@ task :test_build_rakefile => [ :build_rakefile ]
38
39
 
39
40
  if $0 == __FILE__
40
41
  app = Rake.application
41
- app[:default].invoke
42
- app[:test_build_rakefile].invoke
42
+ #~ app[:default].invoke
43
+ app[:test].invoke
44
+ #~ app[:test_build_rakefile].invoke
43
45
  end