From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Defining a new emphasis Date: Mon, 07 May 2012 11:28:10 +0200 Message-ID: <87lil449xx.fsf@gmail.com> References: <4gd36gl7i1.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRKHp-00018W-JB for emacs-orgmode@gnu.org; Mon, 07 May 2012 05:31:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRKHk-0002MB-Rp for emacs-orgmode@gnu.org; Mon, 07 May 2012 05:31:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:37093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRKHk-0002LI-Ho for emacs-orgmode@gnu.org; Mon, 07 May 2012 05:31:16 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SRKHe-0000Ws-FU for emacs-orgmode@gnu.org; Mon, 07 May 2012 11:31:10 +0200 In-Reply-To: <4gd36gl7i1.fsf@somewhere.org> (Francesco Pizzolante's message of "Mon, 07 May 2012 10:28:54 +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 Hello, "Francesco Pizzolante" writes: > I'm trying to define a new emphasis Please don't. We're in the process of hard-coding emphasis markers. > that would work like org-code (=) except that it would export to > \textsf instead of \texttt in LaTeX. If that's related to export, you can tweak the export of verbatim (=text=) output. For example, in the new exporter (if you use development Org, you can (require 'org-export) and just call M-x org-export-dispatch), it just means to change \texttt into \textsf through verbatim filters (list of function applied to the output of each verbatim object). It's a way to have the last words over export engine. Here is the code: #+begin_src emacs-lisp (defun my-latex-verbatim-filter (text backend info) "In `e-latex' backend, change \"texttt\" into \"textsf\"." ;; No change for other backends. (if (not (eq backend 'e-latex)) text (replace-regexp-in-string "\\`\\\\texttt" "\\\\textsf" text))) (add-to-list 'org-export-filter-verbatim-functions 'my-latex-verbatim-filter) #+end_src If you call `org-export-dispatch' on a buffer containing: =look_at:my~ti ny\reference^string= you will get: \textsf{look\_at:my\textasciitilde{}ti ny\textbackslash{}reference\textasciicircum{}string} Regards, -- Nicolas Goaziou