asciidoctor-latex 1.5.0.9.dev → 1.5.0.10.dev

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f54ad1364ee8f9fdae042829d8b92dfdb61eb8c
4
- data.tar.gz: 5da0bb1f53db9fbef476f533c56fe7bad09ccec6
3
+ metadata.gz: 85dd4804634903493f5c6abf39025bd00de836da
4
+ data.tar.gz: b70b6edfc9b937c5e6237bad53b120621e3644fc
5
5
  SHA512:
6
- metadata.gz: 91a5b3d9c3a331f5f1db186f89aa60d91f7e591637507c90373a90d0da6701237dd648f259b2e48c8c48d1a2d048524a43cfc8015e64dee8117f6953a64bf4bc
7
- data.tar.gz: 877c99c880818a3e04918bf03e4f2dca87e2e19164e600602a02700ca44124476483f964904b43d444a13f80daafde838df268eae5cdd00e245ba90e5eaf37ba
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
- # These are source file options for dialects of asciidoc:
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
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module LaTeX
3
- VERSION = '1.5.0.9.dev'
3
+ VERSION = '1.5.0.10.dev'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.9.dev
4
+ version: 1.5.0.10.dev
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Carlson