1

I am a newbie to Emacs and have just installed GNU Emacs from emacsformacos.com on OSX "El Capitan" but couldn't figure out how to correctly link Mactex 2015 to Emacs.

  • When trying to Latex a tex file I got the following message bash-3.2$ latex \nonstopmode\input test.tex bash: latex: command not found bash-3.2$
  • I have create an .emacs file with the following entry only (setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)

It seems latex have successfully created a dvi file. I am not sure how correct is what I did ?

  • How can I do a pdflatex ?
  • Is there a way to configure a shortcut to Latex > Pdf > Preview the results directly.

Thanks in advance for your help.

Sean Allred
  • 27,421
fai391
  • 93
  • Welcome to this forum, do you have an example of your code? – Arne Timperman Nov 08 '15 at 19:37
  • What version of Emacs/AUCTeX do you have? The relevant variable here is TeX-PDF-mode, but it's default value is t (i.e., use PDF) in recent versions. Also, you may need to (add-to-list 'exec-path "/Library/TeX/texbin"). – Sean Allred Nov 08 '15 at 19:58
  • @Arne I have a very minimal code like \documentclass[12pt]{article} \begin{document} \title{Main Title} \author{{\bf Author}} \maketitle \section{Introduction} Equation can be written as [ s^s+x^2=5, ] \end{document} – fai391 Nov 09 '15 at 04:33
  • @SeanAllred Thanks. Emacs version is

    GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org

    and Mactex 2015 https://tug.org/mactex/mactex-download.html

    – fai391 Nov 09 '15 at 04:37
  • @SeanAllred Here is the result of C-c C-f bash-3.2$ latex \nonstopmode\input test.tex

    This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=latex) restricted \write18 enabled. entering extended mode LaTeX2e <2015/01/01> Babel <3.9l> and hyphenation patterns for 79 languages loaded. (./test.tex (/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/local/texlive/2015/texmf-dist/tex/latex/base/size12.clo)) (./test.aux) [1] (./test.aux) ) Output written on test.dvi

    – fai391 Nov 09 '15 at 04:42
  • @user75983 You're not using AUCTeX, right? In Emacs' builtin tex-mode, if I press C-c C-c the default command is pdflatex, but if you want a more advanced *TeX editor I'll suggest you to install AUCTeX from GNU ELPA. – giordano Nov 09 '15 at 09:25
  • @giordano Thank you for mentioning AUCTeX. I just installed it and it seems great. Any recommendations or tips for getting more of AUCTeX will be appreciated. – fai391 Nov 09 '15 at 19:08
  • For sure the (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) in your init file gives you access to most of the features AUCTeX provides. You may want to give a look at the manual. On this site there are also some interesting questions, among them: Useful shortcuts or key bindings or predefined commands for emacs+AUCTeX and What is your favorite Emacs and/or AUCTeX command/trick?. – giordano Nov 09 '15 at 20:19
  • @giordano Thanks. After modifying the .emacs file, I got the following error message when starting emacs

    Wrong type argument: listp, t

    Any idea about it

    – fai391 Nov 11 '15 at 05:09
  • Does pdflatex work from your shell? If yes, then use the package exec-path-from-shell to set up the correct path in emacs. See http://emacs.stackexchange.com/a/10737/2710 . – Andrew Swann Nov 11 '15 at 07:36
  • @user75983 Without viewing your init file it's impossible to say what's wrong, and this would be off-topic here anyway. For more Emacs-specific questions there is https://emacs.stackexchange.com/ – giordano Nov 11 '15 at 09:14

0 Answers0