[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t"
From: |
Stefan Pofahl |
Subject: |
Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t" |
Date: |
Tue, 06 Sep 2005 15:17:35 +0200 |
On 5 Sep 2005 at 19:38, Ralf Angeli wrote:
> > On 5 Sep 2005 at 14:44, Ralf Angeli wrote:
> >> It expects the symbol of a function returning a file name. You
> >> cannot throw random garbage at it.
> > What do you mean by random garbage?
>
> %t
I don't like your language, it was no "random garbage", the reason
I choose it was, that I'm not an expert in lisp.
>
> > I'm just looking for a symbol of a function that returns the propper
> > filename depending on my selection in the auctex-context-menu:
> > running the master-file or the buffer/region with the next
> > latex-run.
>
> At last you say how you want to control the whole thing. (I suppose
> with "auctex-context-menu" you mean the Command menu.)
>
> Well, you may have noticed that your command is picking up the the
> selected option if invoked from the menu. So you could abuse the
> function used when calling a command from the menu. That means
> (TeX-command-menu "Texify") should do what you want.
Ralf, thank you very much, that was what I'm looking for, this is a
good tip.
You improved my init.el for miktex-users very much :-)
Regards, Stefan
======================================================================
My init.el
======================================================================
;;; c:\.xemacs\init.el
;; for xemacs under win32 together with auctex and miktex
;; this sample-file is made for beginners, please read carefully
;; the comments, it is for LaTeX-users.
;; It is tested under XEMACS 21.4.13, OS: WIN32(W2K-Windows2000)
;; auctex vers. 1.53 (xemacs-auctex version 1.42)
;; be careful with the new auctex, it is not tested with
;; xemacs-win32.21.4.13
;; for tips for your local xemacs see also the actual file
;; sample.init.el of your xemacs distribution.
;; Ulm, Germany, Nov. 2004, address@hidden
;; What you need:
; - acrord32.exe (Acrobat reader), please check the program path
; - kill.exe (Terminator of processes, e.g. part of resource kit)
; (necessary to kill arcord32.exe)
; - ghostview and ghostscript, please check the program path
; - gnuclient (includet in gnuserv-2.1p1.zip), for inverse search,
; copy gnuclientw.exe, gnudoit.exe, gnuserv.exe in the home dir of
; "xemacs.exe", e.g.: "C:\Program Files\XEmacs\XEmacs-21.4.13\i586-
pc-win32\"
; exchange the file "gnuserv.el" from this package with file that
is shipped
; with your xemacs installation and byte compile it to
"gnuserv.elc"
; - miktex package "latex2e-help-texinfo.cab" and inside this
package
; you have to extract "latex2e-help-texinfo-src.cab" an copy the
files
; to a propper xemacs directory (for further information read
instructions below)
; - put miktex and xemacs in your invoroment variable "path",
; e.g.: path=
C:\Programme\Miktex\texmf\miktex\bin;%SystemRoot%\system32;%SystemRoot
%;c:\bin\bat;C:\Program Files\XEmacs\XEmacs-21.4.13\i586-pc-win32;
; - set the rights correctly:
; cacls "C:\.xemacs\*.el" /t /e /g ZSW119\spofahl:w
; cacls "C:\.recent-files.el" /t /e /g ZSW119\spofahl:w
; - mount.exe (part of cygwin, necessary for ispell, it expects a
; path like / instead of c:\)
; - some batchfiles, such as:
;
"C:\\Programme\\miktex\\texmf\\miktex\\bin\\latex2dvi2ps2pdf.bat"
; "C:\\Programme\\miktex\\texmf\\miktex\\bin\\dvipdfmx.bat"
; (please check the program pathes inside the batch-files)
; - grep.exe (part of unix utils / gnu utils for win32
"UnxUtils.zip" and "UnxUpdates.zip"
; necessary for grep-command under ref-tex, put this binary in the
folder of xemacs.exe
;; ------- Changes ---------------------------------------------------
-----
; Vers.1.0.0 Nov.2004 Start
; Vers.1.0.1 Sep.2004 Tip by Ralf Angeli: Use `TeX-command-menu'
to call the functions from `TeX-Command-list'
;; ------- Start -----------------------------------------------------
-----
;;;; base configuration of xemacs under win32:
;; debug on error:
(setq debug-on-error t
stack-trace-on-error t) ;; give error message, if there is an
error
;; add to load path
(setq load-path (cons "C:\\Program Files\\XEmacs\\xemacs-
packages\\lisp\\" load-path))
;; I don't know how to load also the subdirectories of "\\lisp\\" so
I only load one
;; DIR at a time, I tried two suggestions from the net, but both were
not working
;; with my xemacs on WIN32. MULE stands for (for "MULti-lingual
Enhancement to GNU Emacs")
(add-to-list 'load-path
(expand-file-name "C:\\Program Files\\XEmacs\\XEmacs-
21.4.13\\lisp\\mule\\"))
;; location of ltx-help
;; add directory `latex2e-help-texinfo' to the variable `load-path':
(add-to-list 'load-path
"C:\\Programme\\miktex\\texmf\\source\\info\\latex2e-help-
texinfo\\....")
;; -------- end define search-path ------------------
;;; load libraries:
;; --------- WIN32 Preparations -------------
(load "win32-native") ;; I don't know if it makes sense, but it
sounds god ;-)
;; ------- FONT LOCK --------------
;; Load it now so we can modify the fonts
(require 'font-lock)
;; Maximum colour but minimum chatter
(setq-default font-lock-maximum-decoration t
font-lock-verbose nil)
;; Of all the modes, font-lock *least* needs a modeline
;; indicator. If the buffer is colourful, font-lock is on.
;; The only thing you lose is the ability to toggle it.
;; origin: http://xemacs.seanm.ca/cvs/init/init.el
(let ((el (assq 'font-lock-mode minor-mode-alist)))
(if el (setcdr el '(""))))
;;; ----- position and size of the Window -----------
(setq default-frame-plist '((top . 000) (left . 000)
(width . 120) (height . 44) (cursor-color . "red")
(background-color . "wheat")
(vertical-scroll-bars . right)
;fonts found on the mailing list, uncomment one at your
convenience
;(font . "-*-Courier-normal-r-*-*-13-97-*-*-c-*-*-ansi-")
;(font . "-*-Terminal-normal-r-*-*-8-60-*-*-c-*-*-oem-")
;(font . "-*-Terminal-normal-r-*-*-12-72-*-*-c-80-*-oem-")
;(font . "-*-Terminal-normal-r-*-*-8-60-*-*-c-*-*-oem-")
;(font . "-*-Terminal-normal-r-*-*-19-142-*-*-c-*-*-oem-")
)
)
;;; Add the following to display the column number
(column-number-mode 1)
;;; Add the following to display the line number:
(line-number-mode 1)
;;; Stop down-arrow from adding empty lines to the bottom of the
buffers?
(setq next-line-add-newlines nil)
;; Use C-h v or `Help->Commands, Variables, Keys->Describe
Variable...'
;; to find out what these variables mean.
(setq
find-file-compare-truenames t
minibuffer-max-depth nil
)
;;;; change char set
;; -------------------------------------------------------------------
;; bat-mode.el; Author: Adrian Aichner <address@hidden>
(autoload 'bat-mode "bat-mode" "bat-mode Editing Mode" t)
(setq auto-mode-alist
(append '(("\\.bat\\b" . bat-mode))
auto-mode-alist))
(add-hook 'bat-mode-hook 'turn-on-font-lock)
;(modify-coding-system-alist 'file "\\.bat\\'" 'iso-ascii)
; have not yet found a library for the OEM-charset
; perhaps 'recode.el' can help
;; -------------------------------------------------------------------
;;;; behave like a Program under MS-Windows
;;
;;; pending-delete-mode causes typed text to replace a selection,
;;; rather than append -- standard behavior under all window systems
;;; nowadays.
(load "pending-del")
(pending-delete-mode 1)
;;; enable region selection with shift+arrows (on by default in 21.5
;;; and up)
(setq shifted-motion-keys-select-region t)
;;--------------------------------------------------------------------
-----------------------
;;;; format: column width, auto-fill-mode, auto-indent
(setq-default fill-column 85) ; column width, (Textbreite)
;; enable auto-formating, -line-wrapping, -indent
(add-hook 'text-mode-hook 'turn-on-auto-fill) ; turn on auto-fill-
mode
;; indent-line
(setq default-major-mode 'indented-text-mode)
(setq indent-line-function 'indent-relative-maybe) ;; from xemacs
help-file
;;--------------------------------------------------------------------
-----------------------
;;;; dired.el
;(load "dired") ;; to use it together with `recent-files', it has to
loaded first.
;;--------------------------------------------------------------------
-----------------------
;;;; recent-files.el
;;; provides a menu: `Recent_Files', with a list of the recently
opened files
;;(load "recent-files")
(require 'recent-files)
(recent-files-initialize)
(setq recent-files-number-of-entries 25)
;;; In order to use recent-files with `dired', `dired' has to be
loaded first.
;;--------------------------------------------------------------------
-----------------------
;;;; Autosave-Files at one Place (from sample.init.el)
;;
;; ********************
;; Put all of your autosave files in one place, instead of scattering
;; them around the file system. This has many advantages -- e.g. it
;; will eliminate slowdowns caused by editing files on a slow NFS
;; server. (*Provided* that your home directory is local or on a
;; fast server! If not, pick a value for `auto-save-directory' that
;; is fast fast fast!)
;;
;; Unfortunately, the code that implements this (auto-save.el) is
;; broken on Windows in 21.4 and earlier.
(unless (and (eq system-type 'windows-nt)
(not (emacs-version>= 21 5)))
(setq auto-save-directory (expand-file-name "~/.autosave/")
auto-save-directory-fallback auto-save-directory
auto-save-hash-p nil
efs-auto-save t
efs-auto-save-remotely nil
;; now that we have auto-save-timeout, let's crank this up
;; for better interactive response.
auto-save-interval 2000
)
;; We load this afterwards because it checks to make sure the
;; auto-save-directory exists (creating it if not) when it's
loaded.
(require 'auto-save)
)
;;;; --- func-menu.el ------------------------------------------------
-----------
;; Support for non X Window versions of Emacs:
;; ===========================================
;; This package can also be used for non X versions of Emacs. In this
case,
;; only modeline display and completing read input from the
minibuffer are
;; possible.
;; (add-hook 'find-file-hooks 'fume-setup-buffer) ;; this line
collides with AUCTeX,
;; don't use it. This will disable for example some key bindings for
LaTeX-mode.
;;; The following is the AUCTeX compatible code of Stephen J.
Turnbull to enabel
;;; find file-file-hooks outside latex- and tex-mode:
(defun polatexly-correct-fume-setup-buffer ()
(unless (memq major-mode '(LaTeX-mode latex-mode tex-mode))
(fume-setup-buffer)))
(add-hook 'find-file-hooks 'polatexly-correct-fume-setup-buffer)
;;; --- End code of Stephen J. Turnbull ---
(add-hook 'Manual-mode-hook 'turn-on-fume-mode)
;;; ------ End of func-menu.el ---------------------------------------
-------------
;;;; resize-minibuffer -----------------------------------------------
--------------
;;;; ********************
;;; resize-minibuffer-mode makes the minibuffer automatically
;;; resize as necessary when it's too small to hold its contents.
(when (fboundp 'resize-minibuffer-mode)
(resize-minibuffer-mode)
(setq resize-minibuffer-window-exactly nil))
;;;; ------- END resize-minibuffer ---------------------------------
------------
;
;;;; ------ gnuserver ---------------------------------------------
------------
;;; XEmacs start as multi instance one. The GNUserv provides one
instance mode.
;;; good for inverse search with yap (mikTeX), you have to install
a special gnuserv
;;; for win32, I took `gnuserv-2.1p1.zip', this is for ntemacs, but
it works with
;;; win32-xemacs too, but you have to start xemacs first, perhaps
there is although
;;; a version for xemacs, you need this while winclient.exe is not
able to pass line
;;; number to xemacs.
;;; (for locations see at the end of the file)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))
;;; attention!!! I had also to edit custom.el,
;;; I inserted in custom.el `'(gnuserv-frame (selected-frame))', now
it looks like:
;;; (custom-set-variables
;;; '(column-number-mode t)
;;; '(gnuserv-frame t)
;;; '(gnuserv-frame (selected-frame))
;;; '(server-make-window-visible t)
;;; '(font-lock-mode t nil (font-lock))
;;; '(modeline-scrolling-method (quote scrollbar)))
;; * * *
;;; Here another comment, Omri Guttman told me, found in:
;;; (http://list-archive.xemacs.org/xemacs-nt/199909/msg00023.html)
;;
;;; > (1) (error/warning) Error in process filter: (void-function
;;; > gnuserv-edit-files-quickly)
;;;
;;; I had similar problems, and hacked this together: give it a try,
I do not
;;; know if it will solve your problem. I have been using it for a
few months
;;; now,
;;; and it works mostly fine. Sometimes I get problems with files not
being
;;; found by XEmacs
;;; when using gnuclient, but only if the files contain spaces: must
be a
;;; Explorer problem
;;; invoking gnuclient.
;;;
;;;; This function is needed I guess because we use gnuclient, but
with XEmacs
;;;; instead of Gnu Emacs:
;; (defun server-edit-files-quickly (list &rest flags)
;; (gnuserv-edit-files '(mswindows) list (or flags 'quick)))
;; (defun server-edit-files (list &rest flags)
;; (gnuserv-edit-files '(mswindows) list))
;;;;;------End xemacs base configuration------------------------------
------------------
;;;;; ------ LaTeX ---------------------------------------------------
------------------
;;;; ltx-help.el (part of miktex package "latex2e-help-texinfo.cab") -
--
;; Lookup latex commands in info pages (part of miktex).
;; I have not managed to install it properly, especially jumping
;; to the help of the current command, perhaps someone can give me a
tip?
;; But I can jump to the latex-help and search inside the help-file.
;; To do: copy the directory of ltx-help.el into the "lisp" directory
of your xemacs,
;; e.g.: "C:\\Program Files\\XEmacs\\xemacs-packages\\lisp\\",
;; load "ltx-help.el" into your xemacs and compile the lisp-file with
the function call
;; "M-x byte-compile-buffer" RET,
;; load "latex2e.texi" into your xemacs, make info files for xemacs
with the
;; function call: `M-x texinfo-format-buffer' copy the info files
`latex' `latex-1'
;; [...] `latex-n' (that you have created) to the `info'-directory
;; of your xemacs, e.g. "C:\\Program Files\\XEmacs\\XEmacs-
21.4.13\\info"
;; Now you are ready to use the latex-help to look up a latex command
or
;; environment in the latex online manual. If point is at such a
;; command, this will be the default.
(load "ltx-help")
;; Bind latex-help to C-h C-l:
;(define-key help-map "\C-l" 'latex-help)
;; To load latex-help when loading AUC-TeX or some other LaTeX/TeX
mode
;; and bind the it to C-C i key (you need add-hook, a very nice
package).
(add-hook 'LaTeX-mode-hook ; for AUCTeX-LaTeX-mode
(function (lambda ()
(define-key LaTeX-mode-map '[(control c)i] 'latex-
help))))
;;;---- end ---- ltx-help.el ---- end ----------------
;;;; ---- x-symbol --- nice symbols for LaTeX text code ------------
-----------
;; Under MS-Windows with XEmacs, X-Symbol just supports a limited
number of characters
;; (Latin-1, Latin-5, and half the math symbols) and no super- and
subscripts, due to
;; missing MS-Windows fonts (*note Wishlist Fonts::).
;; This package require package `font-lock' (distributed with Emacs
and XEmacs), the use
;; of package `lazy-shot' is recommended, see *NoteSyntax Hiliting
Packages::.
;; Images are not yet supported under MS-Windows. For more
Informations try the functions:
;; `M-x' `x-symbol-package-info' and `M-x' `x-symbol-package-web'
(x-symbol-initialize)
;; x-symbol: load the recomended package `lazy-shot':
(add-hook 'font-lock-mode-hook 'turn-on-lazy-shot)
;; Do not use `lazy-shot' in combination with lazy-lock.
;; lazy-lock doesn't have a variable for its modeline name, so we
have
;; to do a bit of surgery.
(and (assoc 'lazy-lock-mode minor-mode-alist)
(setcdr (cdr (cadr (assoc 'lazy-lock-mode minor-mode-alist)))
""))
;;;; latex-math-symbol.el --- LaTeX math symbol decoder
;; This file is part of MU (Message Utilities).
;; Keywords: LaTeX, math, mule
;; my version of `latex-math-symbol.el' was incompatible with my
auctex
;(autoload 'latex-math-decode-buffer "latex-math-symbol" nil t)
;(add-hook 'mime-viewer/plain-text-preview-hook
; 'latex-math-decode-buffer)
;;; ---- END latex-math-symbol.el ------------------------------------
------------------
;;;; --- AUC TeX -----------------------------------------------------
-------
(require 'tex-mik) ;; please read the file install.windows
;; don't use (require 'tex-site) if you use
"miktex"
;;; If you want to make AUC TeX aware of style files and multi-file
;;; documents right away, insert the following in your `init.el'
file.
(setq TeX-parse-self t) ; Enable parse on load.
(setq TeX-auto-save t) ; Enable parse on save.
(setq-default TeX-master nil) ; Query for master file.
;(setq-default TeX-master "master") ; All master files called
"master" (I don't like it).
;;
;;; change in macro-completion-mode after hitting '\'
(setq TeX-electric-escape t) ;turn on macro-completion-mode after
hitting `\'
;;; Inverse search, Source Specials
;; Source Specials will move the DVI viewer to the location
corresponding to point
;; (forward search), and it will use emacsclient or gnuclient to have
the previewer
;; move Emacs to a location corresponding to a control-click in the
previewer window.
;; It has to be stressed very strongly however, that Source Specials
can cause diferences
;; in page breaks, in spacing, can seriously interfere with various
packages and should
;; thus never be used for the final version of a document. In
particular, fine-tuning the
;; page breaks should be done with Source Specials switched off.
;; You can permanently activate TeX-source-specials-mode with
(setq TeX-source-specials-mode 1)
;;; - Variable: TeX-auto-regexp-list
;; Parse all TeX and LaTeX commands that AUC TeX can use constant:
'TeX-auto-full-regexp-list.
(setq-default TeX-auto-regexp-list 'TeX-auto-full-regexp-list)
;;; To get a full featured LaTeX-section command, insert:
(setq LaTeX-section-hook
'(LaTeX-section-heading
LaTeX-section-title
LaTeX-section-toc
LaTeX-section-section
LaTeX-section-label))
;;; ----------- german quotation ---------------------------------
----------------
;; if you have an old auctex this works but is not fine
; (setq TeX-open-quote "\"`")
; (setq TeX-close-quote "\"'")
; (setq TeX-quote-after-quote 't)
;; or bit more clever:
; (add-hook 'LaTeX-mode-hook
; (function (lambda ()
; ;;
; ;; 1. besondere Behandlung fuer dt. Texte (u.a. fuer ")
; (TeX-run-style-hooks "german") ;; nur AucTeX
; ;;
; ;; 2. turn off special behavior of key "
; ; (local-set-key "\"" 'self-insert-command)
; ;; 3. only insert " instead of ``...'':
; ; (setq TeX-open-quote "\"")
; ; (setq TeX-close-quote "\"")
; ;;
; ;; 4. insert "`..."' instead of ``...'':
; (setq TeX-open-quote "\"`")
; (setq TeX-close-quote "\"'")
; ;; 5. Determines the behavior of the key ". If it is non-nil,
; ;; typing " will insert a literal double quote.
; ;; The respective values of LaTeX-german-open-quote
; ;; and LaTeX-german-close-quote
; ;; will be inserted after typing " once again.
; ;(setq TeX-quote-after-quote 't)
; )))
;; if you have auctex vers. 11.50 or newer that is better but for me
it is not working
;; perhaps you find out what the trick is:
(setq LaTeX-german-open-quote "\"`")
(setq LaTeX-german-close-quote "\"'")
(setq LaTeX-german-quote-after-quote 't)
;;; ------------------------------------------------------------------
----------------
;;; some more menu entries in the command list:
;;; see tex-mik.el from package auctex: %v is defined in tex-mik.el
;;; other variables are defined in tex.el from auctex
;;; the meaning of some auctex-varibles:
;symbols defined in tex.el in "TeX-expand-list":
;%b name slave tex-file %d dvi-file %f ps-file
;%l "latex"
;%n line number %p printcommand %q "lpq" %r (TeX-style-
check TeX-print-style)
;%s master-file-name without extention
;%v yap command view line
;%t name of current command file: master-file or buffer or
_region_.tex
;;;; ---- Begin of own Command Menu Entries entries: -----------------
-------------------
;;; Put your first entry at the End of the list.
;; there are some more suggestion in my old init.el, see there
;; TeX-command-list is defined in tex.el
;; You have five arguments: 1.)name, 2.)command,
;; 3.) The function which actually start the process.
;; Several such hooks has been defined, e.g. "TeX-run-discard" (see
"tex-buf.el")
;; 4.) If the fourth element is non-nil, the user will get a chance
to
;; modify the expanded string.
;; 5.) The fifth element indicates in which mode(s) the command
should be
;; present in the Command menu. Use t if it should be active in any
;; mode. If it should only be present in some modes, specify a list
with
;; the respective mode names.
;; So if you want to check a new entry in the menu change the fourth
argument to "t"
;; The function "TeX-run-command" has the advantage, that it sends a
message after run
(eval-after-load "tex"
'(progn
(add-to-list 'TeX-command-list
(list "---- end-custom-menue ----------------------------" "")
)
(add-to-list 'TeX-command-list
(list "View Log File"
"\"C:\\Program Files\\XEmacs\\XEmacs-21.4.13\\i586-pc-
win32\\gnuclientw.exe\" -F %s\.log"
'TeX-run-discard nil nil)
)
;;; for command evaluation / zum _berprüfen der Variablenwerte:
; (add-to-list 'TeX-command-list
; (list "View-Command" "echo b %b pdfout %(PDFout) t %t >
c:\\bla.txt"
; 'TeX-run-discard t nil)
; )
;; ---
(add-to-list 'TeX-command-list
(list "View-Line" "\"%V\""
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "Ghostview PS"
"C:\\Programme\\Ghostgum\\gsview\\gsview32.exe -t1 -e %f"
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "Acrobat Reader"
"\"C:\\Programme\\Adobe\\Acrobat 6.0\\Reader\\acrord32.exe\"
%s\.pdf"
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "Ghostview pdf"
"C:\\Programme\\Ghostgum\\gsview\\gsview32.exe -t1 -e %s\.pdf"
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "---- view commands -------------------------------" "")
)
(add-to-list 'TeX-command-list
(list "BibTeX-8bit" "bibtex8 -H --8bit %s"
'TeX-run-BibTeX nil nil)
)
(add-to-list 'TeX-command-list
(list "Mount C"
"\"C:\\Programme\\cygwin\\bin\\mount.exe\" -f c: /"
'TeX-run-shell t nil)
)
(add-to-list 'TeX-command-list
(list "---- else -----------------------------------------------"
"")
)
(add-to-list 'TeX-command-list
(list "Texify pdf" "texify --clean --pdf %t"
'TeX-run-command nil t)
)
;; this produces smaller pdf-files than `texify --pdf', but it
works only interaktive,
;; you have to input the pdf-file-name manually, perhaps someone
has a better idea for that
(add-to-list 'TeX-command-list
(list "Ghostview PS->PDF"
"C:\\Programme\\Ghostgum\\gsview\\gsview32.exe -t1 -
fpdfwrite -r600x600 -sOutputFile=\"%s.pdf\" \"%f\""
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "gscript PS-> PDF"
"C:\\Programme\\gs\\gs8.00\\bin\\gswin32c.exe -dNOPAUSE -q -
sDEVICE=pdfwrite -r600x600 -sOutputFile=\"%s.pdf\" -dBATCH \"%f\""
'TeX-run-command nil nil)
)
(add-to-list 'TeX-command-list
(list "latex2dvi2ps -> PDF -> acrobat"
"C:\\Programme\\miktex\\texmf\\miktex\\bin\\latex2dvi2ps2pdf.bat %s
%t"
'TeX-run-discard nil nil)
)
;; --------------------------------------------------------------
----------------------
;; @echo off
;; REM latex2dvi2ps2pdf.bat
;; REM %1 name %2 tex
;; SET f_dvi=%1.dvi
;; SET f_ps=%1.ps
;; SET f_pdf=%1.pdf
;; C:\windows\system32\kill.exe AcroRd32
;; C:\Programme\miktex\texmf\miktex\bin\texify.exe --tex-opt=--
src --quiet %2
;; C:\Programme\miktex\texmf\miktex\bin\dvips.exe %f_dvi% -N0 -
Pamz -Ppdf -G0 -o %f_ps%
;; "C:\\Programme\\gs\\gs8.00\\bin\\gswin32c.exe" -dNOPAUSE -q -
sDEVICE=pdfwrite -r600x600 -sOutputFile=%f_pdf% -dBATCH %f_ps%
;; call "C:\Programme\Adobe\Acrobat 5.0\Reader\acrord32.exe"
%f_pdf%
;; echo ---------------------------------------------------------
-----------------
;; echo latex2dvi2ps2pdf: Done!
;; --------------------------------------------------------------
----------------------
;; dvipdfmx.exe is beatiful miktex-programm, but I don't know
which map is the best, you have to try yourself
(add-to-list 'TeX-command-list
(list "DVIPDFM-> PDF"
"C:\\Programme\\miktex\\texmf\\miktex\\bin\\dvipdfmx.exe -f
dvipdfm_ndl14.map -o %s.pdf %d"
'TeX-run-command nil nil)
)
;; --------------------------------------------------------------
----------------------
;; REM code for batchfile dvipdfmx.bat, kill.exe is part of the
recource kit from MS
;; @echo off
;; C:\windows\system32\kill.exe AcroRd32.exe
;; C:\Programme\miktex\texmf\miktex\bin\texify --tex-opt=--src --
quiet %1
;; C:\Programme\miktex\texmf\miktex\bin\dvipdfmx.exe -f
dvipdfm_ndl14.map -o %2 %3
;; call "C:\Programme\Adobe\Acrobat 5.0\Reader\acrord32.exe" %2
;; echo ---------------------------------------------------------
-----------------
;; echo Done!
;; --------------------------------------------------------------
----------------------
(add-to-list 'TeX-command-list
(list "batch file DVIPDFM-> PDF"
"C:\\Programme\\miktex\\texmf\\miktex\\bin\\dvipdfmx.bat %t
%s.pdf %d"
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "---- destill PDF Files --------------------------------" "")
)
(add-to-list 'TeX-command-list
(list "DVIPS-> PS landscape for pdf"
"dvips %d -N0 -Ppdf -G0 -T 297mm,210mm -o %f "
'TeX-run-command nil nil)
)
(add-to-list 'TeX-command-list
(list "DVIPS-> PS for pdf" "dvips %d -N0 -Pamz -Ppdf -G0 -o
%f "
'TeX-run-command nil t)
)
(add-to-list 'TeX-command-list
(list "DVIPS-> PS normal" "dvips %d -N0 -Pamz -G0 -o %f "
'TeX-run-command nil nil)
)
(add-to-list 'TeX-command-list
(list "---- create Postscript Files ---------------------" "")
)
(add-to-list 'TeX-command-list
(list "All Texify run-viewer"
"texify --tex-opt=--src --run-viewer --clean %t"
'TeX-run-command nil t)
)
(add-to-list 'TeX-command-list
(list "Texify" "texify --tex-opt=--src --quiet %t"
'TeX-run-command nil t)
)
(add-to-list 'TeX-command-list
(list "Clean Dir" "del /q *.aux *.log %s.out %s.exa %s.ilg
%s.idx %s.ind %s.lof %s.lot %s.toc %s.bbl %s.blg %s.dvi %s.ps %s.pdf
%s.rel TAGS .\\auto\\%s.el .\\auto\\ *.bak *.bix *~"
'TeX-run-discard nil nil)
)
(add-to-list 'TeX-command-list
(list "---- start-custom-menue --------------------------" "")
)
) ; end of << '(progn >>
) ; end of << (eval-after-load "tex" >>
;;;; ---- End of own Command Menu Entries entries: -------------------
-----------------
;;;;; ------- End AucTeX ---------------------------------------------
---------------
;; -------------------------------------------------------------------
---------------------
;;;;; ------- RefTeX -------------------------------------------------
----------------------
;; turns on RefTex:
;(load "reftex")
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX
mode
(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
(setq reftex-vref-is-default t) ; vref is default
(setq reftex-toc-follow-mode t)
(setq reftex-extra-bindings t)
(setq reftex-enable-partial-scans t)
(setq reftex-save-parse-info t)
(setq reftex-use-multiple-selection-buffers t)
;; RefTeX contains code to interface with AUCTeX. When this
interface is
;; turned on, both packages will interact closely.
(setq reftex-plug-into-AUCTeX t)
;; Bib-cite version 3.06 and later can be configured so that bib-
cite's
;; mouse functions use RefTeX for displaying references and
citations.
;; This can be useful in particular when working with the LaTeX `xr'
;; package or with an explicit `thebibliography' environment (rather
than
;; BibTeX). Bib-cite cannot handle those, but RefTeX does. To make
use
;; of this feature, try
(setq bib-cite-use-reftex-view-crossref t)
;; should look for labels also in equationarray environment
;; see documentation of ref-tex: 3.4.1 Theorem and Axiom Environments
(setq reftex-label-alist
'(("equationarray" ?e "aqarray:" "~\\vref{%s}" nil
("equation" "eqa.") )
))
(add-hook 'LaTeX-mode-hook
(lambda ()
(LaTeX-add-environments
'("equationarray" LaTeX-env-label)
)))
;;; ------- END RefTeX -----------------------------------------------
---------------------
;;;;; Spelling
;;; ispell ispell-local-dictionary-alist
;;; binaries are not includet in xemacs for win32, I took:
;;; "ispell-3.2.06-cygwin-1.3-bin.tar.gz.tar" and "cygwin1.dll",
;;; it works, but not fine, perhaps someone can add the necessary
;;; things here, I still have not found for example the file
german8.hash
;;; proper for ispell-3.2.06-cygwin-1.3.
;;; (for locations see at the end of the file)
;;;; ----- german --------
(setq ispell-local-dictionary-alist
'(
("deutsch" ; deutsch.aff
"[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
("deutsch8"
"[a-zA-Z\304\326\334\344\366\337\374]"
"[^a-zA-Z\304\326\334\344\366\337\374]"
"[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
)
)
;(setq ispell-local-dictionary-alist
; '(("german8" "[a-zA-Z-+_Sö_n]" "[^a-zA-Z-+_Sö_n]" "[']" t
; ("-C" "-d" "Deutsch8") "~latin1" iso-8859-1)
; ))
;;;;german default dictionary
(setq flyspell-default-dictionary "deutsch8")
;;;; ----- end german ----
;; When running ispell, consider all 1-3 character words as correct.
(setq ispell-extra-args '("-W" "3"))
;;
;(setq ispell-menu-map nil)
(load-library "ispell")
;; use ispell in tex-mode
(setq ispell-parser 'tex)
;(setq ispell-parser 'latex)
(autoload 'ispell-word "ispell" "Check the spelling of word in
buffer." t)
(autoload 'ispell-region "ispell" "Check the spelling of region." t)
(autoload 'ispell-buffer "ispell" "Check the spelling of buffer." t)
;;;
;;; Flyspell is a minor Emacs mode performing on-the-fly spelling
;;; checking.
;;;
;;; To install flyspell, add this to your ~/.emacs file:
;;;
;(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checking"
t)
;(autoload 'global-flyspell-mode "flyspell" "On-the-fly spelling" t)
;;;; --- customizing the key definitions -----------------------------
---------------------
;;; --- LaTeX-mode-map -----
(defalias 'neuezeile
(read-kbd-macro "\\newline RET <right> RET"))
(defalias 'lower_index
(read-kbd-macro "_{} <left>"))
(defalias 'cdot
(read-kbd-macro "\\cdot RET <right> SPC"))
(add-hook 'LaTeX-mode-hook
'(lambda nil
; control key bindings
(define-key LaTeX-mode-map '(control !) "\\!\n") ;; negativ
space `\!'
(define-key LaTeX-mode-map '(control ,) "\\,\n") ;; small
space `\,'
(define-key LaTeX-mode-map '(control \`) 'TeX-next-error)
;; next error
;(define-key LaTeX-mode-map '[(control return)] "\\newline\n")
;; newline (\f = C-f, \n = C-n)
(define-key LaTeX-mode-map '[(control return)] 'neuezeile)
;; newline
(define-key LaTeX-mode-map '[(control _)] 'lower_index)
;; lower index _{}
(define-key LaTeX-mode-map '[(control :)] 'cdot)
;; \cdot{}
;(define-key LaTeX-mode-map '"\C-RET" "\\newline\n") ;; "\C-
RET" = (control return); newline
(define-key LaTeX-mode-map '[(control c)~] 'LaTeX-math-mode)
;; LaTeX-math-mode
(define-key LaTeX-mode-map '[(control c)(control a)] 'do-LaTeX)
;; safe buffer, run latex
(define-key LaTeX-mode-map '[(control c)(control v)] 'do-
DVIview);; view dvi-file (allready predefined)
(define-key LaTeX-mode-map '(control f1) 'do-texify2dvi2ps2pdf)
;; do texify2dvi2ps2pdf
(define-key LaTeX-mode-map '(control f4) 'do-Texify)
;; do Texify
(define-key LaTeX-mode-map '(control f5) 'do-PDF)
;; do PDF
(define-key LaTeX-mode-map '(meta f12) 'do-All-LaTeX)
;; compile and view Latex
) ) ;;end add-hook 'LaTeX-mode-hook
;;; see beneath for the definition of the functions bound to the
keys.
;;; if you want to change the TeX-font selection command insert the
following, the original
;;; key binding `c-c c-f' collides with func-mode, (see above)
;; (define-key LaTeX-mode-map '[(control c)(control v)] #'TeX-
font)
;;; --- END LaTeX-mode-map -----
;;; ------------------------------------------------------------------
-
;;; --- global key map -----------------------------------------------
-
; control key bindings
(global-set-key '(control backspace) 'backward-kill-word) ;; kill
word backward
; meta key bindings
(global-set-key "\e$" 'ispell-word) ;; meta-shift-$, spell
word
; function key bindings
(global-set-key 'f1 'advertised-undo) ;; Undo
(global-set-key 'f2 'kill-primary-selection) ;; Cut
(global-set-key 'f3 'copy-primary-selection) ;; Copy
(global-set-key 'f4 'yank-clipboard-selection) ;; Paste
(global-set-key 'f5 'find-file) ;; C-x C-f
(global-set-key 'f7 'save-buffer) ;; C-x C-s
(global-set-key '(meta f9) 'auto-fill-mode) ;; Toggle auto-
filling.
;;; --- global key map -----------------------------------------------
-
;;--------------------------------------------------------------------
----------------------
;;;; define functions that can be bind to key strokes
;; If you receive an error-message:
;; ----------------------------------------
;; While compiling the end of the data:
;; ** the function TeX-command is not known to be defined.
;; ----------------------------------------
;; You can put the following before the definition,
;; because it is only a compiler warning:
(eval-when-compile
(require 'tex)) ;; (tip from: David Kastrup)
;;
(defun do-LaTeX ()
"LaTex the curent file."
(interactive)
(save-buffer)
(TeX-command-menu "LaTeX")
;(TeX-command "Texify" 'TeX-master-file)
;(TeX-command "Texify" 'TeX-active-buffer) is not working
)
(defun do-DVIview ()
"YAPview the curent file."
(interactive)
(save-buffer)
(TeX-command-menu "View-Line")
;(TeX-command "View-Line" 'TeX-master-file)
)
(defun do-All-LaTeX ()
"Texify the curent file and view."
(interactive)
(save-buffer)
(TeX-command "All Texify run-viewer" 'TeX-master-file)
)
(defun do-Texify ()
"Texify the curent file and view line."
(interactive)
(save-buffer)
(TeX-command-menu "Texify")
;(TeX-command "Texify" 'TeX-master-file)
)
(defun do-PDF ()
"Texify the curent file and view line."
(interactive)
(save-buffer)
(TeX-command "batch file DVIPDFM-> PDF" 'TeX-master-file)
)
(defun do-texify2dvi2ps2pdf ()
"Texify the curent file and view line."
(interactive)
(save-buffer)
(TeX-command "latex2dvi2ps -> PDF -> acrobat" 'TeX-master-file)
)
;;;; end of init.el
;;; ********************
;;; some interesting things:
;;; http://www.math.auc.dk/~dethlef/Tips/download.html
;;; http://www.zonix.de/div/el/emacs_tex.html
;;; http://www.dotemacs.de/
;;; Have fun with xemacs + LaTeX!
- [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Stefan Pofahl, 2005/09/03
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Ralf Angeli, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Stefan Pofahl, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Ralf Angeli, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Stefan Pofahl, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Ralf Angeli, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Stefan Pofahl, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Ralf Angeli, 2005/09/05
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t",
Stefan Pofahl <=
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", Ralf Angeli, 2005/09/06
- Re: [AUCTeX] add to a key stroke: texify --tex-opt=--src --quiet %t", David Kastrup, 2005/09/07