Class: MultipleLabelWarning
- Inherits:
-
TexWarning
- Object
- TexWarning
- MultipleLabelWarning
- Defined in:
- lib/trex.rb
Instance Attribute Summary
Attributes inherited from TexWarning
Instance Method Summary collapse
- #extract_line(string, index, lines) ⇒ Object
- #format_warning_message(line, string) ⇒ Object
-
#initialize(source, limits = 40) ⇒ MultipleLabelWarning
constructor
A new instance of MultipleLabelWarning.
Methods inherited from TexWarning
#add_error, #empty?, #expand_input, #format_error, #handle, #has_error?, #render_line, #size, #sort, #to_s
Constructor Details
#initialize(source, limits = 40) ⇒ MultipleLabelWarning
Returns a new instance of MultipleLabelWarning.
942 943 944 945 946 |
# File 'lib/trex.rb', line 942 def initialize(source, limits=40) super('Multiply defined Labels', /LaTeX Warning: Label.*? multiply/, /.*/, limits) @source = source end |
Instance Method Details
#extract_line(string, index, lines) ⇒ Object
952 953 954 955 |
# File 'lib/trex.rb', line 952 def extract_line(string, index, lines) label = self.(0, string) `sed -ne /\label{#{label}}/= #{@source}`.split.join(',') end |
#format_warning_message(line, string) ⇒ Object
948 949 950 |
# File 'lib/trex.rb', line 948 def (line, string) string.match(/Label `(.*?)' /)[1] end |