emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inserting LaTex expressions using a filter fails


From: Mart van de Wege
Subject: Re: Inserting LaTex expressions using a filter fails
Date: Wed, 6 Jan 2021 08:50:16 +0100

On Tue, 05 Jan 2021 22:58:33 +0100
Juan Manuel Macías <maciaschain@posteo.net> wrote:

> Hello,
> 
> Mart van de Wege <mvdwege@gmail.com> writes:
> 
> > I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2}
> > during export to LaTex, and obviously I'm doing something wrong, or
> > I don't understand the documentation.
> >
> > I use the following code to set up the filter:
> >
> > #+BIND: org-export-filter-item-functions (latex-replace-half)
> > #+BEGIN_SRC emacs-lisp :exports results :results none
> >
> >   (defun latex-replace-half (text backend info)
> >     (when (org-export-derived-backend-p backend 'latex)
> >       (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
> > #+END_SRC  
> 
> You must add a double escape character to the backslash:
> 
> ...
>       (replace-regexp-in-string  "½" "\\\\sfrac{1}{2}" text)))
> ...
> 
Thanks!

But see my answer to Nick Dokos on the list, that does not do anything
either.

Regards,


Mart



reply via email to

[Prev in Thread] Current Thread [Next in Thread]