Skip to content

Commit

Permalink
Fixed nil sections issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gcedo committed Jun 16, 2013
1 parent 6d7c8cb commit 981dabb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rlatex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,15 @@ def create_main_tex()
f.write("\\begin{document}\n\n")
f.write("\\maketitle\n")
f.write(" %%% INPUT\n")
@sections.each do |section|
f.write(" \\input{contents/#{section}.tex}\n")
end
@sections.each { |s| f.write(" \\input{contents/#{s}.tex}\n") } unless @sections.nil?

f.write("\\end{document}\n")
f.write("\n")
end
end

def create_sections()
@sections.each do |section|
create_section section
end
@sections.each { |section| create_section section } unless @sections.nil?
end

def create_section(section)
Expand Down

0 comments on commit 981dabb

Please sign in to comment.