From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: How to create a function to italicize in latex in emacs? Date: Wed, 27 Jul 2011 14:16:52 -0700 Message-ID: <87ei1bifuj.fsf@ericabrahamsen.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1311801451 27542 80.91.229.12 (27 Jul 2011 21:17:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2011 21:17:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 27 23:17:26 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmBTg-0001oy-CS for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2011 23:17:16 +0200 Original-Received: from localhost ([::1]:47281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmBTf-0007JV-Jy for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2011 17:17:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmBTb-0007JP-D4 for help-gnu-emacs@gnu.org; Wed, 27 Jul 2011 17:17:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmBTa-00087o-KP for help-gnu-emacs@gnu.org; Wed, 27 Jul 2011 17:17:11 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:57727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmBTa-00087b-CQ for help-gnu-emacs@gnu.org; Wed, 27 Jul 2011 17:17:10 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QmBTU-0001gK-Vm for help-gnu-emacs@gnu.org; Wed, 27 Jul 2011 23:17:04 +0200 Original-Received: from 63.226.249.211 ([63.226.249.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2011 23:17:04 +0200 Original-Received: from eric by 63.226.249.211 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2011 23:17:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 63.226.249.211 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:qtznzr6UbKhxEp1trtiugohLGUE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81817 Archived-At: On Tue, Jul 26 2011, Pedro Costa wrote: > 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 and it's added textit around the word. Do > I have to create a lisp function in .emacs? How do I do that? If you're editing a latex file you should be using a latex mode to do that, and the latex mode will provide these sorts of commands. Auctex is a great one: using that, select the word and then hit C-c C-f C-i to surround it with \textit{}. Or just hit the command with nothing selected, and point will be left between the braces, ready to type. Eric