texstyles 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34d3bf8527240d16f2a1d9329dc69fc5eab74e23
4
- data.tar.gz: a238adb5be7890918a7d68a4bee1203cde14b3ee
3
+ metadata.gz: bd7186174250baef81cbd37f7377bb05bdadcfae
4
+ data.tar.gz: 830a92742305dc2e448f8bf60a465385a9075c78
5
5
  SHA512:
6
- metadata.gz: 233c667b3a00ef3b226e10840e09f8af9b2c76dad9c4c0a12aec99bc68802848af521bfc5e8a527fe5a8dd22bf048cc3c0b4f2541928b5fd223c4e91e98008dc
7
- data.tar.gz: a6a9b867ae3f72859a59d9a09ba499c8d4a4049dacbd3c20654e5d5edf6e0bcbfe97ae5ceae6df338a5d56ebd7de319ee02aa4f3cabd8ec480cefda7de92a356
6
+ metadata.gz: 750eb47437966ea4daa151792bbc7d73d9e8ab376219070a107d72c1eb7094da6154a31bdc31b990ae9b7df7ffee05772ffa5f0609bde3d4dd73fbc7d96763eb
7
+ data.tar.gz: 1513ad2514f64b3b50df05fbdbb5f9879423fa3b00befc55be6baacbbd7b0bce2f34d44d58247140387772746c292fbf5848daa956a24b48d9b06b3a566a8c68
@@ -22,13 +22,36 @@ module Texstyles
22
22
  else
23
23
  {}
24
24
  end
25
- @default_packages = @meta['default_packages'] || {}
26
- @all_rule = @default_packages['*']
25
+ @meta_default_packages = @meta['default_packages'] || {}
26
+ @all_rule = @meta_default_packages['*']
27
27
  @all_compatible = (@all_rule == true)
28
28
  @none_compatible = (@all_rule == false)
29
29
  end
30
30
 
31
- def render_latex
31
+ def render_latex(options = {})
32
+ @default_packages = options[:default_packages].to_s
33
+ @header = options[:header].to_s
34
+ @alternative_author_string = options[:alternative_author_string].to_s
35
+ @long_title = options[:long_title].to_s
36
+ @short_title = options[:short_title].to_s
37
+ @first_author = options[:first_author].to_s
38
+ @first_affiliation = options[:first_affiliation].to_s
39
+ @coauthor_list = options[:coauthor_list].to_a
40
+ @coauthor_affiliations = options[:coauthor_affiliations].to_a
41
+
42
+ @abstract = options[:abstract].to_s
43
+ if !@abstract.empty?
44
+ @abstract_begin_end = if @abstract.match(/\{abstract\}/)
45
+ @abstract
46
+ else
47
+ "\\begin{abstract}\n" + @abstract + "%\n\\end{abstract}%\n"
48
+ end
49
+ @abstract_command = "\\abstract{" + @abstract + "%\n}\n\n"
50
+ else
51
+ @abstract_begin_end = ""
52
+ @abstract_command = ""
53
+ end
54
+
32
55
  @erb && @erb.result(binding)
33
56
  end
34
57
 
@@ -41,7 +64,7 @@ module Texstyles
41
64
  end
42
65
 
43
66
  def package_compatible?(package_name)
44
- @all_compatible || (!@none_compatible && (@default_packages[package_name] != false))
67
+ @all_compatible || (!@none_compatible && (@meta_default_packages[package_name] != false))
45
68
  end
46
69
 
47
70
  end
@@ -48,7 +48,7 @@
48
48
 
49
49
  \end{flushleft}
50
50
 
51
- <% if @abstract and !@abstract.blank? %>
51
+ <% if @abstract && !@abstract.empty? %>
52
52
  \section*{Abstract}
53
53
  <%=@abstract%>
54
54
  <% end %>
@@ -49,7 +49,7 @@
49
49
  <% end %>
50
50
  \end{flushleft}
51
51
 
52
- <% if @abstract and !@abstract.blank? %>
52
+ <% if @abstract && !@abstract.empty? %>
53
53
  \section*{Abstract}
54
54
  <%=@abstract%>
55
55
  <% end %>
@@ -63,7 +63,7 @@
63
63
 
64
64
  % Please keep the abstract between 250 and 300 words
65
65
 
66
- <% if @abstract and !@abstract.blank? %>
66
+ <% if @abstract && !@abstract.empty? %>
67
67
  \section*{Abstract}
68
68
  <%=@abstract%>
69
69
  <% end %>
@@ -223,7 +223,7 @@
223
223
 
224
224
  \end{flushleft}
225
225
  % Please keep the abstract below 300 words
226
- <% if @abstract and !@abstract.blank? %>
226
+ <% if @abstract && !@abstract.empty? %>
227
227
  \section*{Abstract}
228
228
  <%=@abstract%>
229
229
  <% end %>
@@ -90,7 +90,7 @@
90
90
 
91
91
  \maketitle
92
92
 
93
- <% if @abstract and !@abstract.blank? %>
93
+ <% if @abstract && !@abstract.empty? %>
94
94
 
95
95
  \begin{sciabstract}
96
96
  <%=@abstract%>
@@ -108,7 +108,7 @@
108
108
 
109
109
  % Place your abstract within the special {sciabstract} environment.
110
110
 
111
- <% if @abstract and !@abstract.blank? %>
111
+ <% if @abstract && !@abstract.empty? %>
112
112
 
113
113
  \begin{sciabstract}
114
114
  <%=@abstract%>
@@ -52,7 +52,7 @@
52
52
 
53
53
  \frontmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54
54
 
55
- <% if @abstract and !@abstract.blank? %>
55
+ <% if @abstract && !@abstract.empty? %>
56
56
  \extrachap{Abstract}
57
57
  <%=@abstract%>
58
58
  <% end %>
@@ -52,7 +52,7 @@
52
52
 
53
53
  \maketitle% this prints the handout title, author, and date
54
54
 
55
- <% if @abstract and !@abstract.blank? %>
55
+ <% if @abstract && !@abstract.empty? %>
56
56
  \begin{abstract}
57
57
  \noindent <%=@abstract%>
58
58
  \end{abstract}
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "texstyles"
4
- spec.version = "0.0.4"
4
+ spec.version = "0.0.5"
5
5
 
6
6
  spec.authors = ["Deyan Ginev"]
7
7
  spec.email = ["deyan@authorea.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texstyles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deyan Ginev