all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kai.grossjohann@uni-duisburg.de (Kai Großjohann)
Subject: Re: Add items to TeX-font-list
Date: Sun, 09 Feb 2003 16:45:43 +0100	[thread overview]
Message-ID: <848ywpjw48.fsf@lucy.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: wzvfzvept9.fsf@nono.cs.uu.nl

Piet van Oostrum <piet@cs.uu.nl> 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 <dominik@astro.uva.nl>.
;; 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

      reply	other threads:[~2003-02-09 15:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07 17:19 Add items to TeX-font-list Kai Großjohann
2003-02-07 19:34 ` Piet van Oostrum
2003-02-07 20:14   ` Kai Großjohann
2003-02-07 21:29     ` Piet van Oostrum
2003-02-07 21:36 ` Piet van Oostrum
2003-02-09 15:45   ` Kai Großjohann [this message]

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=848ywpjw48.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@uni-duisburg.de \
    /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.