Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created September 18, 2018 13:31
Show Gist options
  • Save pandanote-info/13f3ba9b1e0f5b5b725c51cc1750ff78 to your computer and use it in GitHub Desktop.
Save pandanote-info/13f3ba9b1e0f5b5b725c51cc1750ff78 to your computer and use it in GitHub Desktop.
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