From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Francesco Pizzolante <fpz@missioncriticalit.com>
Cc: mailing-list-org-mode
<public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org>,
Francesco Pizzolante
<public-fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@plane.gmane.org>
Subject: Re: Defining a new emphasis
Date: Mon, 07 May 2012 12:39:25 +0200 [thread overview]
Message-ID: <87zk9k2s2q.fsf@gmail.com> (raw)
In-Reply-To: <4gehqwguh9.fsf@somewhere.org> (Francesco Pizzolante's message of "Mon, 07 May 2012 12:23:46 +0200")
Hello,
"Francesco Pizzolante" <fpz@missioncriticalit.com> 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
prev parent reply other threads:[~2012-05-07 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 8:28 Defining a new emphasis Francesco Pizzolante
2012-05-07 9:28 ` Nicolas Goaziou
[not found] ` <87lil449xx.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-07 10:23 ` Francesco Pizzolante
2012-05-07 10:39 ` Nicolas Goaziou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zk9k2s2q.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=fpz@missioncriticalit.com \
--cc=public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org \
--cc=public-fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@plane.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.