From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: How to create a function to italicize in latex in emacs?
Date: Wed, 27 Jul 2011 21:50:56 +0200 [thread overview]
Message-ID: <4E306C20.9010804@easy-emacs.de> (raw)
In-Reply-To: <CAJ8VZfVdOuZiC_GGi7we_Hf-sPZWURQbU02nXFqtGBMU6BLpiQ@mail.gmail.com>
Am 26.07.2011 12:58, schrieb Pedro Costa:
> Hi,
>
> I would like to italicize a word in latex in emacs automatically.
> Instead of write \textit{word}, I would like to select the "word" and
> then write M-x<my command> and it's added textit around the word. Do
> I have to create a lisp function in .emacs? How do I do that?
>
> Thanks,
>
>
Hi,
running the code below
you need a package thing-at-point-utils.el
from
http://launchpad.net/s-x-emacs-werkstatt/thing-at-point-utils/1.2/+download/thing-at-point-utils-1.2.tgz
otherwise
replace (ar-bounds-of-word-atpt) by a function delivering the borders of
the word, a cons
(defun textit ()
(interactive "*")
(let* ((bounds (ar-bounds-of-word-atpt))
(beg (car bounds))
(end (copy-marker (cdr bounds))))
(goto-char beg)
(insert "\\textit{")
(goto-char end)
(insert "}")))
HTH,
Andreas
--
https://launchpad.net/python-mode
https://launchpad.net/s-x-emacs-werkstatt/
next prev parent reply other threads:[~2011-07-27 19:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 10:58 How to create a function to italicize in latex in emacs? Pedro Costa
2011-07-27 19:31 ` dejfson
2011-07-27 19:50 ` Andreas Röhler [this message]
2011-07-27 19:53 ` suvayu ali
2011-07-27 21:16 ` Eric Abrahamsen
2011-07-28 3:54 ` R. Clayton
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=4E306C20.9010804@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=help-gnu-emacs@gnu.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.