Skip to content

Commit

Permalink
Be less picky about format of %!TEX directives
Browse files Browse the repository at this point in the history
  • Loading branch information
sanssecours committed May 24, 2015
1 parent 0e5b5c5 commit 4542284
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Support/lib/Ruby/latex.rb
Expand Up @@ -25,7 +25,8 @@ module LaTeX
# doctest: Parse the tex directives in 'xelatex.tex'
#
# >> LaTeX.options('Tests/TeX/xelatex.tex')
# => {"TS-program"=>"xelatex"}
# => {"TS-program"=>"xelatex", "spellcheck"=>"en-US",
# "encoding"=>"UTF-8 Unicode"}
#
# doctest: Parse the tex directives in 'packages_input1.tex'
#
Expand All @@ -35,7 +36,7 @@ def self.options(filepath)
opts = {}
File.foreach(filepath).first(20).each do |line|
opts[Regexp.last_match[1]] = Regexp.last_match[2] if
line =~ /^%!TEX (\S*) =\s*(\S.*\S)\s*$/
line =~ /^\s*%\s*!TEX\s*(\S+)\s*=\s*(.+)\s*$/
end
opts
end
Expand Down
4 changes: 3 additions & 1 deletion Tests/TeX/xelatex.tex
@@ -1,4 +1,6 @@
%!TEX TS-program = xelatex
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode
% !TEX spellcheck = en-US

\documentclass[a4paper, 12pt]{report}

Expand Down

0 comments on commit 4542284

Please sign in to comment.