Nicolas Goaziou writes: > Rasmus writes: > >>> Correct. Then, fixing it is more important than caring about some user >>> filter. >> >> OK, can I help? > > Sure, please go ahead. I've just enclosed a quick patch (as in doesn't contain proper commit msg), but it's basically the previous patch minus the removal of \text in math plus some quick checks towards potential nasty filters. It works with the following test file, but let me know about more hair-pulling test cases, and/or filters. #+BEGIN_SRC Org * filters :noexport: #+begin_src emacs-lisp (defun test-filter (script backend info) (when (org-export-derived-backend-p backend 'latex) (if (string-match "a" script) "" script))) (defun test-filter2 (script backend info) (when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string "zz" "" script))) (add-to-list 'org-export-filter-subscript-functions 'test-filter) (add-to-list 'org-export-filter-subscript-functions 'test-filter2) #+end_src * test | | mathp | text | |----------------------+-------+------| | merge maybe | \beta_t | \times_t | | long merge maybe | \beta_tb | \times_tb | | filter drop | \beta_abc | \times_abc | | filter replace all | \beta_zz | \times_zz | | filter replace parts | \beta_zzx | \times_zzx | #+END_SRC The output is something like this (hline removed) & mathp & text \\ %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%% merge maybe & $\beta_{\text{t}}$ & \texttimes{}$_{\text{t}}$ \\ long merge maybe & $\beta_{\text{tb}}$ & \texttimes{}$_{\text{tb}}$ \\ filter drop & $\beta$ & \texttimes{} \\ filter replace all & $\beta_{\text{}}$ & \texttimes{}$_{\text{}}$ \\ filter replace parts & $\beta_{\text{x}}$ & \texttimes{}$_{\text{x}}$ \\