From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Defining a new emphasis Date: Mon, 07 May 2012 12:39:25 +0200 Message-ID: <87zk9k2s2q.fsf@gmail.com> References: <4gd36gl7i1.fsf@somewhere.org> <87lil449xx.fsf@gmail.com> <4gehqwguh9.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRLOo-0004Ca-Vt for emacs-orgmode@gnu.org; Mon, 07 May 2012 06:42:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRLOk-0005m7-D6 for emacs-orgmode@gnu.org; Mon, 07 May 2012 06:42:38 -0400 Received: from plane.gmane.org ([80.91.229.3]:58137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRLOk-0005lu-4C for emacs-orgmode@gnu.org; Mon, 07 May 2012 06:42:34 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SRLOb-0002SN-UL for emacs-orgmode@gnu.org; Mon, 07 May 2012 12:42:25 +0200 In-Reply-To: <4gehqwguh9.fsf@somewhere.org> (Francesco Pizzolante's message of "Mon, 07 May 2012 12:23:46 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Francesco Pizzolante Cc: mailing-list-org-mode , Francesco Pizzolante Hello, "Francesco Pizzolante" 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