[OS X TeX] Two question regarding CarbonEmacs

Peter Dyballa Peter_Dyballa at Web.DE
Mon Nov 29 01:53:53 CET 2004


Am 26.11.2004 um 16:50 schrieb Martin Buchmann:

> Hi all,
>
> has anyone tried to installed the preview-latex package [1] with  
> CarbonEmacs? I installed with Xemacs under X11 but it would be much  
> nicer to have it as a Macintosh application. I just don't know to  
> install  the sourceforge package, i.e. running configure doesn't find  
> or accept he CarbonEmacs.

Hello!

When you're using Enrico Franconi's Enhanced Carbon Emacs (v.  
21.3.50.03.11.14.CVS) (http://www.inf.unibz.it/~franconi/mac-emacs/,  
download from  
http://www.esm.psu.edu/mac-tex/ 
Enhanced%20Carbon%20Emacs%20%2821.3.50.03.11.14.CVS%29.dmg) then  
nothing's needed -- except:

    * A working LaTeX installation
    * A recent GhostScript
    * The `texinfo' package

You can find this all in Gerben Wierda's i-Packages, even dvipng is  
there, the utility that generates the graphics that can be displayed in  
Emacs. This copy (Emacs) from  
http://www.webweavertech.com/ovidiu/emacs.html and this one (Carbon  
Emacs) from http://mindlube.com/products/emacs/index.html both need  
everything: the three things above +

    * A working AUCTeX installation (http://www.gnu.org/software/auctex/)

I think this missing piece is best installed via Fink.

Enrico Franconi has made two mistakes: these files

/Applications/Emacs.app/Contents/Resources/site-lisp/preview-latex/doc/ 
preview-latex.info
/Applications/Emacs.app/Contents/Resources/site-lisp/preview-latex/doc/ 
preview-latex.info-1
/Applications/Emacs.app/Contents/Resources/site-lisp/preview-latex/doc/ 
preview-latex.info-2
/Applications/Emacs.app/Contents/Resources/site-lisp/preview-latex/doc/ 
preview-latex.info-3

belong into /Applications/Emacs.app/Contents/Resources/info/ and the  
file /Applications/Emacs.app/Contents/Resources/info/dir needs this  
line added as line #51

* preview-latex: (preview-latex).       To preview LaTeX constructs

and this addition at the end:

Emacs
* preview-latex: (preview-latex).       A preview mode for GNU Emacs

(Maybe he didn't really install preview-latex, he just made it.)  
Actually this is kind of cosmetics is needed to enable you to study the  
infos on preview-latex.

Reftex's version is quite recent 4.21, but preview-latex is 0.7.3. So I  
tried an update. In Terminal.

1. A directory in which to make preview-latex: 'mkdir -p  
~/Library/texmf/src'
2. Go there: 'cd ~/Library/texmf/src' or 'pushd ~/Library/texmf/src'
3. Unpack the archive: 'tar zxvf '<and now drag and drop the archive  
preview-latex-0.8.1.tar.gz from Finder into the Terminal> and finish  
pressing RET
4. You've seen what's in the package, go now into its source directory:  
'cd preview-latex-0.8.1' or 'pushd preview-latex-0.8.1'
5. Now comes a delicate step: configuration. './configure --help' shows  
what options are possible, but you have to make a reasonable choice and  
set reasonable values. './configure --prefix=/usr/local/teTeX  
--with-texmf-dir=/usr/local/teTeX/share/texmf.local  
--with-emacs=/sw/bin/emacs' would be a good choice, but for Enhanced  
Carbon Emacs we need a different approach. configure's helpful output  
shows the importance of PREFIX and EPREFIX, but we have to put the TeX  
related files somewhere onto the /usr/local/teTeX/share/texmf.local  
tree and Emacs Lisp related somewhere into the /Applications/"Enhanced  
Carbon Emacs".app/Contents/Resources tree. I thought this could be  
fine: './configure --with-texmf-dir=/usr/local/teTeX/share/texmf.local  
--with-emacs=/Applications/Emacs.app/Contents/Resources/site-lisp/emacs  
--with-tex-site=/Applications/Emacs.app/Contents/Resources/site-lisp/ 
auctex  
--with-lispdir=/Applications/Emacs.app/Contents/Resources/site-lisp/ 
preview' ... but one of the configuration statements was this:

     /Applications/Emacs.app/Contents/Resources/site-lisp/emacs -batch  
-eval '(let* ((x (unless (and (boundp '\''image-types) image-types)
                  (error "This Emacs does not support images"))))  
(write-region (if (stringp x) (princ x '\''ignore) (prin1-to-string x))  
nil "./conftest-3127"))'

It led to this printing on the Terminal: configure: error: "You need an  
Emacs that supports images"

So finally: Enrico Franconi's Enhanced Carbon Emacs is *not* usable for  
preview-latex! (But it's very useful to copy settings, .el files, learn  
about efficient modes and .el files!)


The other carbonized Emacsen have reftex but no auctex or  
preview-latex. And they have no shell script by the name of "emacs".  
Enrico Franconi's script is that simple:

> #!/bin/sh
> ### Launch mac-emacs from shell
> /Applications/Emacs.app/Contents/MacOS/Emacs "$@"

After you've created this file invoke in Terminal 'chmod 755  
/Applications/Emacs.app/Contents/Resources/site-lisp/emacs'.
And they don't have auctex. I don't whether it's important to install  
AUCTeX for the specific Emacs version -- I just created sym(bolic)  
links to that auctex that was installed via Fink:

ln -s /sw/share/emacs21/site-lisp/auctex  
/Applications/Emacs.app/Contents/Resources/site-lisp

OK! So we can continue with the next step ouf our process(ion)!

6. Successfully configuered you can make the package: 'make'.
7. Now do the installation: 'sudo make -k install'.
8. One step by hand is needed (IMO): 'cp preview-latex.el  
/Applications/Emacs.app/Contents/Resources/site-lisp'
9. Start Emacs.app and create a site-start.el file in  
/Applications/Emacs.app/Contents/Resources/site-lisp with about that  
content:

(unless (boundp 'preview-latex)
   (add-to-list 'load-path  
"/Applications/Emacs.app/Contents/Resources/site-lisp/preview")
   (load "preview-latex"))
< again here fits in the site-start.el from Enrico Franconi's Enhanced  
Carbon Emacs >
;;; Carbon emacs does not handle inline images ???
   (autoload 'LaTeX-preview-setup "preview")
   (add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)

10. Enrico Franconi enhanced his version with many extras. So you'll  
have to remove or comment a lot of lines of his site-start.el. You  
could simplify some of his statements:

> (defvar pdf-previewer-program "texdoc" "PDF previewer")
> (defvar ps-previewer-program  "texdoc" "PS previewer")
> (defvar dvi-previewer-program "texdoc" "DVI previewer")

and edit TeX-macro-global to this

> ;; Directories containing the sites TeX macro files and style files
> (setq TeX-macro-global '("/usr/local/teTeX/share/texmf.local/tex/"
>                          "/usr/local/teTeX/share/texmf.gwtex/tex/"
>                          "/usr/local/teTeX/share/texmf.tetex/tex/"
>                          "/usr/local/teTeX/share/texmf/tex/"
>                          "~/Library/texmf/tex/"))

You should create a ~/.MacOSX/environment.plist file. See  
/Developer/ADC Reference  
Library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Concepts/ 
EnvironmentVars.html or  
http://developer.apple.com/documentation/MacOSX/Conceptual/ 
BPRuntimeConfig/Concepts/EnvironmentVars.html and  
http://developer.apple.com/qa/qa2001/qa1067.html and  
http://developer.apple.com/qa/qa2001/qa1255.html. Then these lines in  
site-start.el (somewhere at the beginning) would work correctly.

(setenv "INFOPATH"
    (concat (getenv "INFOPATH")
              ":/Applications/Emacs.app/Contents/Resources/info"))

preview-latex starts a bit slow. Sometimes you might need to invoke the  
previewing more than once.


>
> My next issue is similar. I'm using a literate programming tool called  
> noweb [2] for which an emacs mode exists but i don't know how to  
> install it.

This needs a C compiler. It works better with Icon  
(http://www.cs.arizona.edu/icon).

You know how to unpack an archive and how to go to the src.

Without Icon uncomment the lines #10 #11 with a'#'. Set CFLAGS to  
'-DTEMPNAM' because Mac OS X 10.3.6 at least has tempnam(3). These  
settings will help:

BIN=/usr/local/bin
LIB=/usr/local/lib
MAN=/usr/local/man
MANEXT=1
MAN7EXT=7
TEXINPUTS=/usr/local/teTeX/share/texmf.local/tex/noweb
ELISP=/Applications/Emacs.app/Contents/Resources/site-lisp

'make all'
'sudo make -k install'
'make clean'

;; Put this into your ~/.emacs to use this mode automagically.
;;
;; (autoload 'noweb-mode "noweb-mode" "Editing noweb files." t)
;; (setq auto-mode-alist (append (list (cons "\\.nw$" 'noweb-mode))
;;                            auto-mode-alist))


For me it works ...

--
Greetings

   Pete

"Let's face it; we don't want a free market economy either."
         James Farley, president, Coca-Cola Export Corp., 1959

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list