def insert_styles
        #TODO More customizable(reset.css, from file etc.)
        if @@lock_top_right
          extra_styles = <<-STYLES
            #footnotes_debug {position: fixed; top: 0px; right: 0px; width: 100%; z-index: 10000; margin-top: 0;}
            #footnotes_debug #toggle_footnotes {position: absolute; right: 0; top: 0; background: #fff; border: 1px solid #ccc; color: #9b1b1b; font-size: 20px; text-align: center; padding: 8px; opacity: 0.9;}
            #footnotes_debug #toggle_footnotes:hover {opacity: 1;}
            #footnotes_debug #all_footnotes {display: none; padding: 15px; background: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.4);}
            #footnotes_debug fieldset > div {max-height: 500px; overflow: scroll;}
          STYLES
        else
          extra_styles = <<-STYLES
            #footnotes_debug #toggle_footnotes {display: none;}
          STYLES
        end
        insert_text :before, /<\/head>/i, <<-HTML
        <!-- Footnotes Style -->
        <style type="text/css">
          #footnotes_debug {font-size: #{@@font_size}; font-family: Consolas, monaco, monospace; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px; background: #fff;}
          #footnotes_debug th, #footnotes_debug td {color: #444; line-height: 18px;}
          #footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height: 18px;}
          #footnotes_debug table {text-align: left; width: 100%;}
          #footnotes_debug table td {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table td strong {color: #9b1b1b;}
          #footnotes_debug table th {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table tr:nth-child(2n) td {background: #f5f5f5;}
          #footnotes_debug table tr:nth-child(2n + 1) td {background: #fff;}
          #footnotes_debug tbody {text-align: left;}
          #footnotes_debug .name_values td {vertical-align: top;}
          #footnotes_debug legend {background-color: #fff;}
          #footnotes_debug fieldset {text-align: left; border: 1px dashed #aaa; padding: 0.5em 1em 1em 1em; margin: 1em 2em; color: #444; background-color: #FFF;}
          #{extra_styles}
          /* Aditional Stylesheets */
          #{@notes.map(&:stylesheet).compact.join("\n")}
        </style>
        <!-- End Footnotes Style -->
        HTML
      end
def insert_styles
        #TODO More customizable(reset.css, from file etc.)
        if @@lock_top_right
          extra_styles = <<-STYLES
            #footnotes_debug {position: fixed; top: 0px; right: 0px; width: 100%; z-index: 10000; margin-top: 0;}
            #footnotes_debug #toggle_footnotes {position: absolute; right: 0; top: 0; background: #fff; border: 1px solid #ccc; color: #9b1b1b; font-size: 20px; text-align: center; padding: 8px; opacity: 0.9;}
            #footnotes_debug #toggle_footnotes:hover {opacity: 1;}
            #footnotes_debug #all_footnotes {display: none; padding: 15px; background: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.4);}
            #footnotes_debug fieldset > div {max-height: 500px; overflow: scroll;}
          STYLES
        else
          extra_styles = <<-STYLES
            #footnotes_debug #toggle_footnotes {display: none;}
          STYLES
        end
        insert_text :before, /<\/head>/i, <<-HTML
        <!-- Footnotes Style -->
        <style type="text/css">
          #footnotes_debug {font-size: #{@@font_size}; font-family: Consolas, monaco, monospace; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px; background: #fff;}
          #footnotes_debug th, #footnotes_debug td {color: #444; line-height: 18px;}
          #footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height: 18px;}
          #footnotes_debug table {text-align: left; width: 100%;}
          #footnotes_debug table td {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table td strong {color: #9b1b1b;}
          #footnotes_debug table th {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table tr:nth-child(2n) td {background: #f5f5f5;}
          #footnotes_debug table tr:nth-child(2n + 1) td {background: #fff;}
          #footnotes_debug tbody {text-align: left;}
          #footnotes_debug .name_values td {vertical-align: top;}
          #footnotes_debug legend {background-color: #fff;}
          #footnotes_debug fieldset {text-align: left; border: 1px dashed #aaa; padding: 0.5em 1em 1em 1em; margin: 1em 2em; color: #444; background-color: #FFF;}
          #{extra_styles}
          /* Aditional Stylesheets */
          #{@notes.map(&:stylesheet).compact.join("\n")}
        </style>
        <!-- End Footnotes Style -->
        HTML
      end
Insertion methods