Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created September 18, 2018 13:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
LaTeXの数式が画面からはみ出さないようにするための小細工用プログラム片。Wordpressの記事本文の処理用フィルタ関数の中でお使いください。
$content = preg_replace('/\\\\begin\{(align|eqnarray)/','<div class="tex-equations">\\begin{$1',$content);
$content = preg_replace('/\\\\end\{(align|eqnarray)(\*?)\}/','\\end{$1$2}</div>',$content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment