macaw 0.0.1 → 0.0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -16
- data/Gemfile +4 -0
- data/Gemfile.lock +27 -0
- data/LICENSE.txt +1 -1
- data/README.md +82 -0
- data/Rakefile +132 -0
- data/bin/macaw +308 -0
- data/lib/macaw.rb +2 -3
- data/lib/macaw/i18n/de.yml +171 -0
- data/lib/macaw/i18n/en.yml +157 -0
- data/lib/macaw/i18n/es.yml +159 -0
- data/lib/macaw/i18n/fr.yml +160 -0
- data/lib/macaw/i18n/it.yml +157 -0
- data/lib/macaw/i18n/pt-BR.yml +154 -0
- data/lib/macaw/i18n/pt.yml +155 -0
- data/lib/macaw/i18n/ru.yml +159 -0
- data/lib/macaw/i18n/tr.yml +148 -0
- data/lib/macaw/rules/animate.rb +26 -0
- data/lib/macaw/rules/biber.rb +8 -0
- data/lib/macaw/rules/bibtex.rb +8 -0
- data/lib/macaw/rules/clean.rb +10 -0
- data/lib/macaw/rules/dvipdfm.rb +9 -0
- data/lib/macaw/rules/dvipdfmx.rb +9 -0
- data/lib/macaw/rules/dvips.rb +9 -0
- data/lib/macaw/rules/dvipsps2pdf.rb +10 -0
- data/lib/macaw/rules/frontespizio.rb +14 -0
- data/lib/macaw/rules/indent.rb +36 -0
- data/lib/macaw/rules/latex.rb +17 -0
- data/lib/macaw/rules/lmkclean.rb +13 -0
- data/lib/macaw/rules/lualatex.rb +17 -0
- data/lib/macaw/rules/lualatexmk.rb +17 -0
- data/lib/macaw/rules/luatex.rb +17 -0
- data/lib/macaw/rules/make.rb +9 -0
- data/lib/macaw/rules/makeglossaries.rb +9 -0
- data/lib/macaw/rules/makeindex.rb +16 -0
- data/lib/macaw/rules/nomencl.rb +17 -0
- data/lib/macaw/rules/pdflatex.rb +17 -0
- data/lib/macaw/rules/pdflatexmk.rb +17 -0
- data/lib/macaw/rules/pdftex.rb +16 -0
- data/lib/macaw/rules/ps2pdf.rb +16 -0
- data/lib/macaw/rules/sketch.rb +14 -0
- data/lib/macaw/rules/songidx.rb +8 -0
- data/lib/macaw/rules/sumatrapdf.rb +10 -0
- data/lib/macaw/rules/tex.rb +9 -0
- data/lib/macaw/rules/texcount.rb +9 -0
- data/lib/macaw/rules/xdvipdfmx.rb +9 -0
- data/lib/macaw/rules/xelatex.rb +16 -0
- data/lib/macaw/rules/xelatexmk.rb +14 -0
- data/lib/macaw/rules/xetex.rb +15 -0
- data/lib/macaw/version.rb +2 -2
- data/macaw.gemspec +24 -17
- data/test/test_macaw.rb +8 -0
- metadata +133 -30
@@ -0,0 +1,26 @@
|
|
1
|
+
# Make animated .gif file from .pdf
|
2
|
+
# author: Chris Hughes
|
3
|
+
# last edited by: cmh, June 6th 2013
|
4
|
+
# requires arara 3.0+
|
5
|
+
#
|
6
|
+
# Sample usage:
|
7
|
+
#
|
8
|
+
# % arara: animate
|
9
|
+
# % arara: animate: {density: 200}
|
10
|
+
# % arara: animate: {density: 200, delay: 20}
|
11
|
+
#
|
12
|
+
# This rule is really just a shortcut for commands like the following
|
13
|
+
#
|
14
|
+
# convert -delay 10 -loop 0 -density 300 myfile.pdf myfile.gif
|
15
|
+
#
|
16
|
+
# which will output myfile.gif
|
17
|
+
#
|
18
|
+
class Macaw
|
19
|
+
def animate(delay=nil, loop=nil, density=nil)
|
20
|
+
delay ||= 10
|
21
|
+
loop ||= 0
|
22
|
+
density ||= 300
|
23
|
+
|
24
|
+
Macaw.system "convert -delay #{delay} -loop #{loop} -density #{density} #{~"#{@base}.pdf"} #{~"#{@base}.gif"}"
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# DVIPS rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# requires arara 3.0+
|
4
|
+
class Macaw
|
5
|
+
def dvipsps2pdf(options=nil, output=nil)
|
6
|
+
output ||= @base
|
7
|
+
Macaw.system "dvips #{~"#{@base}.dvi"} -o #{~"#{@base}.ps"} #{options}"
|
8
|
+
Macaw.system "ps2pdf #{options} #{~"#{@base}.ps"} #{~"#{output}.pdf"}"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Frontespizio rule for arara
|
2
|
+
# author: Francesco Endrici
|
3
|
+
# author: Enrico Gregorio
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def frontespizio(engine)
|
7
|
+
engine ||= 'pdflatex'
|
8
|
+
|
9
|
+
Macaw.system "#{engine} #{~@base}"
|
10
|
+
Macaw.system "#{engine} #{~"#{@base}-frn"}"
|
11
|
+
Macaw.system "dvips -o #{~"#{@base}-frn.eps"} #{~"#{@base}-frn"}" if engine == 'latex'
|
12
|
+
Macaw.system "#{engine} #{~@base}"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'os'
|
2
|
+
# indent rule for arara
|
3
|
+
# author: Paulo Cereda, Chris Hughes
|
4
|
+
# last updated: 11/9/2013
|
5
|
+
# requires arara 3.0+
|
6
|
+
#
|
7
|
+
# Sample usage:
|
8
|
+
#
|
9
|
+
# % arara: indent
|
10
|
+
# % arara: indent: {overwrite: yes}
|
11
|
+
# % arara: indent: {output: myfile.tex, silent: no}
|
12
|
+
# % arara: indent: {output: myfile.tex, silent: yes, overwrite: yes}
|
13
|
+
# % arara: indent: {trace: true}
|
14
|
+
# % arara: indent: {localSettings: true}
|
15
|
+
# % arara: indent: {onlyDefault: on}
|
16
|
+
# % arara: indent: { cruft: /home/cmhughes/Desktop }
|
17
|
+
#
|
18
|
+
# Directories with spaces will cause issues in the cruft call.
|
19
|
+
#
|
20
|
+
# Note: output will take priority above overwrite
|
21
|
+
class Macaw
|
22
|
+
def indent(overwrite=nil, silent=nil, trace=nil, localSettings=nil, output=nil, onlyDefault=nil, cruft=nil)
|
23
|
+
cmd = ["latexindent.#{OS.windows? ? 'exe' : 'pl'}"]
|
24
|
+
cmd << '-s' if silent
|
25
|
+
cmd << '-t' if trace
|
26
|
+
cmd << '-l' if localSettings
|
27
|
+
cmd << "-c=#{~cruft}" if cruft
|
28
|
+
cmd << '-w' if overwrite
|
29
|
+
cmd << '-d' if onlyDefault
|
30
|
+
cmd << "-o #{~output}" if output
|
31
|
+
cmd << ~@file
|
32
|
+
cmd << ~output if output
|
33
|
+
|
34
|
+
Macaw.system cmd
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# LaTeX rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def latex(action=nil, shell=nil, synctex=nil, draft=nil, options=nil)
|
7
|
+
cmd = ['latex']
|
8
|
+
cmd << "--interaction=#{action}" if action
|
9
|
+
cmd << '--draftmode' if draft
|
10
|
+
cmd << shell ? '--shell-escape' : '--no-shell-escape'
|
11
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
12
|
+
cmd << options
|
13
|
+
cmd << ~@file
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Clean rule for arara, via latexmk
|
2
|
+
# author: Brent Longborough
|
3
|
+
# requires arara 3.0+
|
4
|
+
class Macaw
|
5
|
+
def lmkclean(include=nil)
|
6
|
+
include ||= '-c'
|
7
|
+
|
8
|
+
cmd = ['latexmk']
|
9
|
+
cmd << include.downcase if include && %w{all -c}.include(include.downcase)
|
10
|
+
cmd << ~@file
|
11
|
+
Macaw.system cmd
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# LuaLaTeX rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def lualatex(action=nil, shell=nil, synctex=nil, draft=nil, options=nil)
|
7
|
+
cmd = ['lualatex']
|
8
|
+
cmd << "--interaction=#{action}" if action
|
9
|
+
cmd << '--draftmode' if draft
|
10
|
+
cmd << "--#{shell ? '' : 'no-'}shell-escape"
|
11
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
12
|
+
cmd << options
|
13
|
+
cmd << ~@file
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# LaTeXmk with LuaLaTeX rule for arara
|
2
|
+
# author: Brent Longborough
|
3
|
+
# requires: arara 3.0+
|
4
|
+
class Macaw
|
5
|
+
def lualatexmk(action=nil, shell=nil, synctex=nil, options=nil, style=nil)
|
6
|
+
cmd = []
|
7
|
+
cmd << "latexmk -e '$pdflatex=q/lualatex%O%S/'"
|
8
|
+
cmd << "--interaction=#{action}" if action
|
9
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
10
|
+
cmd << shell ? '--shell-escape' : '--no-shell-escape'
|
11
|
+
cmd << options
|
12
|
+
cmd << "$makeindex=q/makeindex %O -s #{style}.ist -o %D %S/" if style
|
13
|
+
cmd << "-pdf #{~@file}"
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# LuaTeX rule for arara
|
2
|
+
# author: Paulo Cereda
|
3
|
+
# requires arara 3.0+
|
4
|
+
|
5
|
+
class Macaw
|
6
|
+
def luatex(action=nil, shell=nil, synctex=nil, draft=nil, options=nil)
|
7
|
+
cmd = ['luatex']
|
8
|
+
cmd << "--interaction=#{action}" if action
|
9
|
+
cmd << '--draftmode' if draft
|
10
|
+
cmd << "--#{shell ? '' : 'no-'}shell-escape"
|
11
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
12
|
+
cmd << options
|
13
|
+
cmd << ~@file
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# MakeIndex rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def makeindex(style=nil, german=nil, options=nil, extension=nil)
|
7
|
+
extension ||= 'idx'
|
8
|
+
|
9
|
+
cmd = ['makeindex']
|
10
|
+
cmd << '-g' if german
|
11
|
+
cmd << "-s #{style}" if style
|
12
|
+
cmd << ~"#{@base}.#{extension}"
|
13
|
+
|
14
|
+
Macaw.system cmd
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Nomencl rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def nomencl(style=nil, options=nil)
|
7
|
+
style ||= nomencl
|
8
|
+
|
9
|
+
cmd = ['makeindex']
|
10
|
+
cmd << options
|
11
|
+
cmd << ~"#{@base}.nlo"
|
12
|
+
cmd << '-s ' + ~"#{style}.ist" if style
|
13
|
+
cmd << '-o ' + ~"#{@base}.nls"
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# PDFLaTeX rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def pdflatex(action=nil, shell=nil, synctex=nil, draft=nil, options=nil)
|
7
|
+
cmd = ['pdflatex']
|
8
|
+
cmd << "--interaction=#{action}" if action
|
9
|
+
cmd << '--draftmode' if draft
|
10
|
+
cmd << shell ? '--shell-escape' : '--no-shell-escape'
|
11
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
12
|
+
cmd << options
|
13
|
+
cmd << ~@file
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# LaTeXmk with pdfLaTeX rule for arara
|
2
|
+
# author: Brent Longborough
|
3
|
+
# requires arara 3.0+
|
4
|
+
class Macaw
|
5
|
+
def pdflatexmk(action=nil, shell=nil, synctex=nil, options=nil, style=nil)
|
6
|
+
cmd = ["latexmk -e '$pdflatex=q/pdflatex%O%S/'"]
|
7
|
+
cmd << "--interaction=#{action}" if action
|
8
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
9
|
+
cmd << "--#{shell ? '' : 'no-'}shell-escape"
|
10
|
+
cmd << options
|
11
|
+
cmd << "-e '$makeindex=q/makeindex %O -s #{~"#{style}.ist"} -o %D %S/'" if style
|
12
|
+
cmd << '-pdf'
|
13
|
+
cmd << ~@file
|
14
|
+
|
15
|
+
Macaw.system cmd
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# PDFTeX rule for arara
|
2
|
+
# author: Paulo Cereda
|
3
|
+
# requires arara 3.0+
|
4
|
+
class Macaw
|
5
|
+
def pdftex(action=nil, shell=nil, synctex=nil, draft=nil, options=nil)
|
6
|
+
cmd = ['pdftex']
|
7
|
+
cmd << "--interaction=#{action}" if action
|
8
|
+
cmd << '--draftmode' if draft
|
9
|
+
cmd << "--#{shell ? '' : 'no-'}shell-escape"
|
10
|
+
cmd << "--synctex=#{synctex ? 1 : 0}"
|
11
|
+
cmd << options
|
12
|
+
cmd << ~@file
|
13
|
+
|
14
|
+
Macaw.system cmd
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# PS2PDF rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def ps2pdf(options=nil, output=nil)
|
7
|
+
output ||= @base
|
8
|
+
|
9
|
+
cmd = ['ps2pdf']
|
10
|
+
cmd << options
|
11
|
+
cmd << ~"#{@base}.ps"
|
12
|
+
cmd << ~"#{output}.pdf"
|
13
|
+
|
14
|
+
Macaw.system cmd
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# TeX rule for arara
|
2
|
+
# author: Marco Daniel
|
3
|
+
# last edited by: Paulo Cereda
|
4
|
+
# requires arara 3.0+
|
5
|
+
class Macaw
|
6
|
+
def tex(action, shell=nil, options=nil)
|
7
|
+
Macaw.system ['tex', action ? "--interaction=#{action}" : nil, "--#{shell ? '' : 'no-'}shell-escape", options, ~@file]
|
8
|
+
end
|
9
|
+
end
|