Class: RepeatedPageNumberWarning

Inherits:
TexWarning show all
Defined in:
lib/trex.rb

Instance Attribute Summary

Attributes inherited from TexWarning

#filestate, #limit

Instance Method Summary collapse

Methods inherited from TexWarning

#add_error, #empty?, #expand_input, #extract_line, #format_error, #handle, #has_error?, #render_line, #size, #sort, #to_s

Constructor Details

#initialize(limits = 1) ⇒ RepeatedPageNumberWarning

Returns a new instance of RepeatedPageNumberWarning.



776
777
778
779
780
# File 'lib/trex.rb', line 776

def initialize(limits=1)
    super('PDF Repeated Page Number',
          /destination with the same identifier \(name\{page\./, limits)
    @additionaInputLines = 4
end

Instance Method Details

#format_warning_message(line, string) ⇒ Object



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'lib/trex.rb', line 782

def format_warning_message(line, string)
    match = /^l\.[0-9]+ (.*\n.*)/.match(string)[1]
    match.gsub!(/\s*\n\s*/, '')
    name = /^(.*)\)/.match(string)
    if not name.nil?
        name = name[1]
    else
        #fix this
    end
    if line.to_i == 0
        prefix = "\n"
        separator = ""
    else
        prefix = ""
        separator = " "*Math.log(line.to_i).floor
    end
    "#{prefix} near: #{match}.\n#{separator} try using plainpages=false or pdfpagelabels in hyperref
   see: http://en.wikibooks.org/wiki/LaTeX/Hyperlinks#Problems_with_Links_and_Pages"
end