latex_markup

LaTeX support.

Description

latex_markup( $content ); 

Backward compatibility requires support for both [latex][/latex],, and "$latex $" shortcodes.

$latex e^ + 1 = 0$ -> [latex]e^ + 1 = 0[/latex] $latex [a, b]$ -> [latex][a, b][/latex]

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'latex_markup' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/latex.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = latex_markup($content); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/latex.php  
  1. function latex_markup( $content ) { 
  2. $regex = '% 
  3. \$latex(?:=\s*|\s+) 
  4. ((?: 
  5. [^$]+ # Not a dollar 
  6. (?<=(?<!\\\\)\\\\)\$ # Dollar preceded by exactly one slash 
  7. )+) 
  8. (?<!\\\\)\$ # Dollar preceded by zero slashes 
  9. %ix'; 
  10. return preg_replace_callback( $regex, 'latex_src', $content );