Plugin Directory

Changeset 489018


Ignore:
Timestamp:
01/12/2012 09:23:57 PM (14 years ago)
Author:
divinenephron
Message:

Wrapped images and tables in a figure environment.

Location:
latex-everything/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • latex-everything/trunk/article-to-latex.php

    r489017 r489018  
    3939    function __destruct () {
    4040        // Unlink temporary files
    41         /*
    4241        unlink( $this->latex_file );
    4342        unlink( $this->pdf_file );
    4443        unlink( $this->latex_file . '.aux' );
    4544        unlink( $this->latex_file . '.log' );
    46         */
    4745    }
    4846
  • latex-everything/trunk/html-to-latex.php

    r489017 r489018  
    303303                $text );
    304304    }
     305
     306    // Run on <img> and <table> nodes before output
     307    function float_filter ( $latex, $element ) {
     308        return "\\begin{figure}[htbp]\n{$latex}\n\\end{figure}\n";
     309    }
    305310}
    306311
     
    317322
    318323// Register filters
     324add_filter('a2l_img_element', array('A2l_Html_To_Latex', 'float_filter'), 98);
     325add_filter('a2l_table_element', array('A2l_Html_To_Latex', 'float_filter'), 98);
    319326add_filter('a2l_text', array('A2l_Html_To_Latex', 'urlify_filter'), 98);
    320327add_filter('a2l_text', array('A2l_Html_To_Latex', 'quote_expansion_filter'), 99);
Note: See TracChangeset for help on using the changeset viewer.