[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Defining a new emphasis
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Defining a new emphasis |
Date: |
Mon, 07 May 2012 12:39:25 +0200 |
Hello,
"Francesco Pizzolante" <address@hidden> writes:
> My goal is, in fact, to keep the default behavior of the '=' marker and
> redefine
> the behavior of the '~' marker.
>
> I'd like '~' to behave exactly the same way = does but using \textsf instead
> of
> \texttt. Is it possible?
Certainly. Even if we hard code syntax, the user always has the final
word on the produced text.
For now, the easiest way is to customize `org-e-latex-text-markup-alist'
and associate `protectedtexttt' to `code' value.
Then, since you want to change "texttt" into "textsf" in `code' objects
(~text~), add your filter to the right place (and remove the previous
one):
#+begin_src emacs-lisp
(add-to-list 'org-export-filter-code-functions 'my-latex-verbatim-filter)
#+end_src
In a few days, it will be also possible to write a function like the
following (which basically means "treat code as verbatim, but use textsf
instead of texttt"):
#+begin_src emacs-lisp
(defun my-latex-code-handler (code contents info)
"Handle `code' objects in LaTeX back-end."
(replace-regexp-in-string
"\\`\\\\texttt" "\\\\textsf"
(org-e-latex-verbatim code contents info)))
#+end_src
And tell the export engine to treat `code' objects with your function
instead of the default one.
Regards,
--
Nicolas Goaziou