anchor.diff:    <%# Footer %>
     <% row_counts = @ranges.collect{|hash| hash[:count] } %>
     <% if row_counts.sum > 0 %>
  +    <% graph_row_counts = (row_counts.size == 1 ? row_counts * 2 : row_counts) %>
       \begin{sparkline}{4}
  -    \spark <% row_counts.each_with_index do |row_count, index| %><%= " %0.2f " % (index / row_counts.size.to_f) %> <%= row_counts.sum > 0 ? "%0.2f" % (row_count / row_counts.sum.to_f) : '0.00' %><% end %> /
  +    \sparkrectangle 0.0 1.0
  +    \spark <% graph_row_counts.each_with_index do |row_count, index| %><%= " %0.2f " % (index / ([graph_row_counts.size - 1, 1].max).to_f) %> <%= graph_row_counts.max > 0 ? "%0.2f" % (row_count / graph_row_counts.max.to_f) : '0.00' %><% end %> /
       \end{sparkline}
     <% end %>
     &
  -  Total &
  +  \textbf{Total} &
     <% @ranges.each do |hash| %>
       <% count = hash[:count] %>
  -    <% "\\textcolor[gray]{0.5}{" if count == 0 %>
  -      <%= count == 0 ? '-' : count %>
  -      <% if @percent == 'row' and count > 0 and row_counts.sum > 0 %>
  -        \small{\textcolor[gray]{0.5}{<%= latex_safe((count * 100 / row_counts.sum).to_s + "%") %>}
  -      <% end %>
  -    <% "}" if count == 0 %>
  +    <%= count == 0 ? "\\textcolor[gray]{0.5}{-}" : count %>
  +    <% if @percent == 'row' and count > 0 and row_counts.sum > 0 %>
  +      \small{\textcolor[gray]{0.5}{<%= latex_safe((count * 100 / row_counts.sum).to_s + "%") %>}
  +    <% end %>
       &
     <% end %>
     <% count = @sheets.count %>
     <%= count == 0 ? "\\textcolor[gray]{0.5}{-}" : count %>} \\
  -  \midrule
   
   \end{longtable}
   
  
positive.code: 
      <% @ranges.each do |hash| %>
        <% count = hash[:scope].with_stratum(@variable, stratum[:value]).count %>
        <% "\\textcolor[gray]{0.5}{" if count == 0 %>
        <%= count == 0 ? '-' : count %>
  
        <% if @percent == 'row' and count > 0 and row_counts.sum > 0 %>
          \small{\textcolor[gray]{0.5}{<%= latex_safe((count * 100 / row_counts.sum).to_s + "%") %>}}
        <% end %>
        <% if @percent == 'column' and count > 0 and hash[:count] > 0 %>
          \small{\textcolor[gray]{0.5}{<%= latex_safe((count * 100 / hash[:count]).to_s + "%") %>}}
        <% end %>
        <% "}" if count == 0 %>
        &
      <% end %>
  
      <% count = @sheets.with_stratum(@variable, stratum[:value]).count %>
      <% "\\textcolor[gray]{0.5}{" if count == 0 %>
        <%= count == 0 ? '-' : count %>
        <% if @percent == 'column' and count > 0 and @sheets.count > 0 %>
          \small{\textcolor[gray]{0.5}{<%= latex_safe((count * 100 / @sheets.count).to_s + "%") %>}}
        <% end %>
      <% "}" if count == 0 %>
      \\
      \midrule
    <% end %>
  
negative.code: 
  \pagestyle{fancyplain}
  
  \definecolor{sparkrectanglecolor}{gray}{0.95}
  
  
  \begin{document}
  