From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.help Subject: Re: Add items to TeX-font-list Date: Sun, 09 Feb 2003 16:45:43 +0100 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <848ywpjw48.fsf@lucy.is.informatik.uni-duisburg.de> References: <84adh8huu5.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1044805900 8470 80.91.224.249 (9 Feb 2003 15:51:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 9 Feb 2003 15:51:40 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18htk3-0002CS-00 for ; Sun, 09 Feb 2003 16:51:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18htj7-0000FA-03 for gnu-help-gnu-emacs@m.gmane.org; Sun, 09 Feb 2003 10:50:41 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!pd9e1e5fd.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 64 Original-NNTP-Posting-Host: pd9e1e5fd.dip.t-dialin.net (217.225.229.253) Original-X-Trace: fu-berlin.de 1044805566 42359292 217.225.229.253 (16 [73968]) User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 Cancel-Lock: sha1:TD9W7d/lN7pajkAeALM2O6emeBA= Original-Xref: shelby.stanford.edu gnu.emacs.help:109980 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6485 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6485 Piet van Oostrum writes: >>>>>> kai.grossjohann@uni-duisburg.de (Kai Großjohann) (KG) wrote: > > KG> My document does \usepackage{nifty-macros} (where the > KG> nifty-macros.sty for the most part consists of kludgy macros), so I > KG> created a file style/nifty-macros.el which does > > KG> (TeX-add-style-hook > KG> "kg-thesis-macros" > KG> (lambda () > KG> (add-to-list 'TeX-font-list (list ?d "\\DefTerm{" "}")))) > > I think it is safer to use "nifty-macros" rather than "kg-thesis-macros". > I am not sure if it really is necessary, but I think it wouldn't harm to > try it. Ayee. I was using "nifty-macros" in my posting in a feeble attempt to be funny. And then I revealed my cluelessness by not changing the stuff I copied and pasted from the actual source files :-{ Anyhow, I think that the name does matter. Here is the complete file style/kg-thesis-macros.el as it exists now, and it works quite well. This is rather amazing, considering that I don't know what I'm doing at all. O the wonders of AUC-TeX. Kudos to Carsten for RefTeX and the useful hints, to Per for AUC TeX, and to David for the dash :-) ^W^W I mean the maintenance of AUC-TeX. ;; From Carsten Dominik . ;; Define a custom function to insert the environment. You need a ;; custom function since you want the extra argument (the title) (defun kai-LaTeX-env-title-and-label (environment) "Insert ENVIRONMENT, prompt for title and insert label." (let ((title (read-string "Title: "))) (LaTeX-insert-environment environment (concat "[" title "]")) (and (LaTeX-label environment) (newline-and-indent)))) (TeX-add-style-hook "kg-thesis-macros" (lambda () (add-to-list 'LaTeX-font-list (list ?d "\\DefTerm{" "}" "\\text{" "}")) (add-to-list 'LaTeX-font-list (list ?c "\\Code{" "}")) (add-to-list 'LaTeX-font-list (list ?o "\\operatorname{" "}")) (add-to-list 'LaTeX-font-list (list ?s "\\synt{" "}")) ;; Tell RefTeX to derive labels for the definition environment from ;; context. (make-local-variable 'reftex-insert-label-flags) (setq reftex-insert-label-flags (list (concat (nth 0 reftex-insert-label-flags) "d") (nth 1 reftex-insert-label-flags))) ;; Tell LaTeX about the definition environment and how to insert it. (LaTeX-add-environments '("definition" kai-LaTeX-env-title-and-label)) (LaTeX-add-environments '("todo" LaTeX-env-item)) (reftex-add-label-environments '(("definition" ?d "def:" "~\\ref{%s}" "\\\\begin{definition}\\[" ("definition") nil))) (reftex-add-label-environments '(("observation" ?o "obs:" "~\\ref{%s}" "\\\\begin{observation}\\[" ("observation") nil))))) -- A turnip curses Elvis