asciidoctor-latex 1.5.0.9.dev → 1.5.0.10.dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +27 -0
- data/README.adoc +11 -3
- data/lib/asciidoctor/latex/converter.rb +9 -1
- data/lib/asciidoctor/latex/tex_preprocessor.rb +20 -0
- data/lib/asciidoctor/latex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85dd4804634903493f5c6abf39025bd00de836da
|
4
|
+
data.tar.gz: b70b6edfc9b937c5e6237bad53b120621e3644fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5400c082e5187f9707725f8dfad5aab3038524f986bb56cf2b3194a4d6d74df77e176e47bfc75858081dfca7f0963caa2d4030d2bd4692111e253c5124333d91
|
7
|
+
data.tar.gz: d22ce18568779340c1dfeff0d980bbd5d766d090454260fd55c8a222166be1e6a7c25697e1c7b5810699e34f74502dbefac37a8270c37cc5a5df5fa846883fc8
|
data/CHANGELOG.adoc
CHANGED
@@ -22,6 +22,33 @@ for cross-referencing, e.g.,
|
|
22
22
|
`[env.equation#hohoho]`, then it is numbered.
|
23
23
|
////
|
24
24
|
|
25
|
+
1.5.0.10.dev:: NOTE: Version 1.5.0.10 introduces
|
26
|
+
a new syntax with switches for three 'dialects'
|
27
|
+
of asciidoc: asciidoc itself, 'manuscript',
|
28
|
+
and 'latex'. More on this later.
|
29
|
+
|
30
|
+
----
|
31
|
+
|
32
|
+
# Invoke asciidoctor-latex for LaTeX output by
|
33
|
+
#
|
34
|
+
# asciidoctor-latex -a dialect=asciidoc foo.adoc
|
35
|
+
# asciidoctor-latex -a dialect=manuscript foo.adoc
|
36
|
+
# asciidoctor-latex -a dialect=latex foo.adoc
|
37
|
+
#
|
38
|
+
# Be sure to use XeLaTex for tex'ing
|
39
|
+
# For html output, use
|
40
|
+
#
|
41
|
+
# asciidoctor-latex -a dialect=asciidoc foo.adoc -b html
|
42
|
+
# asciidoctor-latex -a dialect=manuscript foo.adoc -b html
|
43
|
+
# asciidoctor-latex -a dialect=latex foo.adoc -b html
|
44
|
+
#
|
45
|
+
# The above are *source file* options for dialects of asciidoc:
|
46
|
+
#
|
47
|
+
# asciidoc
|
48
|
+
# asciidoc-manuscript
|
49
|
+
# asciidoc-latex
|
50
|
+
----
|
51
|
+
|
25
52
|
1.5.0.8dev:: One can now say
|
26
53
|
----
|
27
54
|
$ asciidoctor-latex -a preprocess=no -b html bar.adoc
|
data/README.adoc
CHANGED
@@ -59,18 +59,26 @@ Beta alert!
|
|
59
59
|
NOTE: Version 1.5.0.7 is "stable". Version 1.5.0.9 introduces
|
60
60
|
new syntax with switches for three 'dialects' See below.
|
61
61
|
|
62
|
-
# Invoke asciidoctor-latex by
|
62
|
+
# Invoke asciidoctor-latex for LaTeX output by
|
63
63
|
#
|
64
|
-
# asciidoctor-latex foo.adoc
|
64
|
+
# asciidoctor-latex -a dialect=asciidoc foo.adoc
|
65
65
|
# asciidoctor-latex -a dialect=manuscript foo.adoc
|
66
66
|
# asciidoctor-latex -a dialect=latex foo.adoc
|
67
67
|
#
|
68
|
-
#
|
68
|
+
# Be sure to use XeLaTex for tex'ing
|
69
|
+
# For html output, use
|
70
|
+
#
|
71
|
+
# asciidoctor-latex -a dialect=asciidoc foo.adoc -b html
|
72
|
+
# asciidoctor-latex -a dialect=manuscript foo.adoc -b html
|
73
|
+
# asciidoctor-latex -a dialect=latex foo.adoc -b html
|
74
|
+
#
|
75
|
+
# The above are *source file* options for dialects of asciidoc:
|
69
76
|
#
|
70
77
|
# asciidoc
|
71
78
|
# asciidoc-manuscript
|
72
79
|
# asciidoc-latex
|
73
80
|
#
|
81
|
+
#
|
74
82
|
|
75
83
|
=== From GitHub
|
76
84
|
|
@@ -469,9 +469,11 @@ module Asciidoctor::LaTeX
|
|
469
469
|
|
470
470
|
register_for 'latex'
|
471
471
|
|
472
|
+
# puts "HOLA!".red
|
473
|
+
|
472
474
|
# Note: invoke asciidoctor-latex by
|
473
475
|
#
|
474
|
-
# asciidoctor-latex foo.adoc
|
476
|
+
# asciidoctor-latex -a dialect=asciidoc foo.adoc
|
475
477
|
# asciidoctor-latex -a dialect=manuscript foo.adoc
|
476
478
|
# asciidoctor-latex -a dialect=latex foo.adoc
|
477
479
|
#
|
@@ -481,6 +483,12 @@ module Asciidoctor::LaTeX
|
|
481
483
|
|
482
484
|
# puts "options: #{document.options}"
|
483
485
|
|
486
|
+
if ['asciidoc', 'manuscript'].include? document.attributes['dialect']
|
487
|
+
|
488
|
+
preprocessor DollarPreprocessor if document.basebackend? 'tex'
|
489
|
+
|
490
|
+
end
|
491
|
+
|
484
492
|
if ['latex', 'manuscript'].include? document.attributes['dialect']
|
485
493
|
preprocessor ClickStyleInsert if document.attributes['css_extras'] == 'include'
|
486
494
|
preprocessor MacroPreprocessor
|
@@ -99,4 +99,24 @@ module Asciidoctor::LaTeX
|
|
99
99
|
end
|
100
100
|
|
101
101
|
end
|
102
|
+
|
103
|
+
# Map $ to \$ for dialect = 'asciidoctor' or 'manuscript' and
|
104
|
+
# basebackend = 'tex'
|
105
|
+
class DollarPreprocessor < Asciidoctor::Extensions::Preprocessor
|
106
|
+
|
107
|
+
def process document, reader
|
108
|
+
return reader if reader.eof?
|
109
|
+
replacement_lines = reader.read_lines.map do |line|
|
110
|
+
|
111
|
+
if line.include? '$' and document.basebackend? 'tex'
|
112
|
+
line = line.gsub('$', '\$')
|
113
|
+
end
|
114
|
+
|
115
|
+
line
|
116
|
+
end
|
117
|
+
reader.unshift_lines replacement_lines
|
118
|
+
reader
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
102
122
|
end
|