emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: Nicolas Goaziou <n.goaziou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: mailing-list-org-mode
	<public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org>,
	Francesco Pizzolante
	<public-fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY-wOFGN7rlS/M9smdsby/KFg@public.gmane.org>
Subject: Re: Defining a new emphasis
Date: Mon, 07 May 2012 12:23:46 +0200	[thread overview]
Message-ID: <4gehqwguh9.fsf@somewhere.org> (raw)
In-Reply-To: <87lil449xx.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Nicolas Goaziou's message of "Mon, 07 May 2012 11:28:10 +0200")



Hi Nicolas,

>> I'm trying to define a new emphasis 
>
> Please don't. We're in the process of hard-coding emphasis markers.

OK. Understood.


>> 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}

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?

Thanks,
 Francesco

  parent reply	other threads:[~2012-05-07 10:23 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 [this message]
2012-05-07 10:39       ` Nicolas Goaziou

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4gehqwguh9.fsf@somewhere.org \
    --to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
    --cc=n.goaziou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg@public.gmane.org \
    --cc=public-fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY-wOFGN7rlS/M9smdsby/KFg@public.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).