[macemacsjp-english 786] Re: emacs/latex problem

Back to archive index

Peter Dyballa Peter_Dybal****@Web*****
Wed Dec 20 07:25:54 JST 2006


Am 19.12.2006 um 22:10 schrieb Roussanka Loukanova:

>>> 2. Then, Ctrl-c Ctrl-c runs latex successfully but without creating
>>> pdf,
>>> i.e. it does not get the sequence of commands: dvips + ps2pdf.
>
> If right after the 1st Command (in Carbon Emacs, 1.6.0) Ctrl-c Ctrl-c,
> I confirm Latex, it creats a good dvi file. Then if I try, with  
> another
> Ctrl-c Ctrl-c, to type dvips in the Command minbuffer-line, Emacs  
> responds
> with [No match].

That's the wrong way! You have to choose one of the commands from the  
Commands menu! Everything else AUCTeX does not understand. If you  
want to use dvips you would need to add a dvips command first. This  
might work from LaTeX -> Customize AUCTeX -> Browse Options (this way  
I added XeTeX commands, one sort to use dvipdfmx and another one to  
use the Mac OS X default xdv2pdf).

Again, since you need to add a command to the Commands menu, think of  
adding a shell script as a PSTricks command. Herb Schulz' ps4pdf  
engine script goes (a bit edited by me):

	#!/bin/sh
	basefname=`basename "$1" .tex`
	# process the figures
	latex --shell-escape "$1"
	dvips -Ppdf -o "${basefname}-pics.ps" "${basefname}.dvi"
	ps2pdf -dAutoRotatePages=/None "${basefname}-pics.ps" "${basefname}- 
pics.pdf"
	pdfcrop "${basefname}-pics.pdf"
	mv "${basefname}-pics-crop.pdf" "${basefname}-pics.pdf"
	# remove intermediate files
	rm "${basefname}-pics.ps" "${basefname}.dvi"
	# process the file
	pdflatex "$1"

This is the short version of the ps4pdf scripts that come with the  
teTeX or TeX Live i-Packages. These teTeX scripts, coming from the  
same directory as latex or dvips, accept other arguments than only  
the DVI file name. The script above uses the --shell-escape option to  
allow latex to launch external commands to convert automatically file  
types. The teTeX ps4pdf script does not use this option, so it might  
fail with some PSTricks contents.

>
>> Can you show the contents of the corresponding output buffer?
>
> I'll paste it at the end of this email.

This is from the LaTeX run, and I had hoped to see something from  
dvips. Anyway, it's now obvious: there is no output from dvips  
because there is no dvips command yet in AUCTeX that could be launched.

Again: it does *not* work anymore with recent AUCTeX to put some  
lines of Elisp into ~/.emacs. Now you have to use the Emacs'  
customize system to change things. And AUCTeX's customize interface  
is in almost all options much too complicated while trying to take  
into account different paper sizes or orientation. And all your  
customisation goes into a special block in your .emacs file. To use  
consistently in all circumstances the same tools I've chosen to  
accommodate the texdoc script to use particular applications for  
particular file formats – and texdoc is in my AUCTeX the Viewer. To  
save my custom texdoc script from being erased by an i-Package update  
I've put into my ~/bin directory, which is in the search path for  
executables. The customisations AUCTeX has put into my .emacs file  
are, for example:

  '(TeX-command-list (quote (("TeX" "%(PDF)%(tex) %S%(PDFout) \"% 
(mode)\\input %t\"" TeX-run-TeX nil (plain-tex-mode texinfo-mode ams- 
tex-mode) :help "Run plain TeX") ("LaTeX" "%l \"%(mode)\\input{%t}\""  
TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("XeTeX"  
" xetex \"%(mode)\\input %t\"" TeX-run-TeX nil (plain-tex-mode  
context-mode ams-tex-mode)) ("XeLaTeX" "xelatex \"%(mode)\\input{%t} 
\"" TeX-run-TeX nil (latex-mode context-mode)) ("Makeinfo" "makeinfo % 
t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info  
output") ("Makeinfo HTML" "makeinfo --html %t" TeX-run-compile nil  
(texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "% 
(PDF)amstex %S%(PDFout) \"%(mode)\\input %t\"" TeX-run-TeX nil (ams- 
tex-mode) :help "Run AMSTeX") ("ConTeXt" "texexec --once --texutil % 
(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt  
once") ("ConTeXt Full" "texexec %(execopts)%t" TeX-run-TeX nil  
(context-mode) :help "Run ConTeXt until completion") ("ConTeXt Clean"  
"texutil --purgeall" TeX-run-interactive nil (context-mode) :help  
"Clean temporary ConTeXt files") ("BibTeX" "bibtex %s" TeX-run-BibTeX  
nil t :help "Run BibTeX") ("View" "%V" TeX-run-discard t t :help "Run  
Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file")  
("Queue" "%q" TeX-run-background nil t :help "View the printer  
queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX- 
run-command t t :help "Generate PostScript file") ("Index" "makeindex  
%s" TeX-run-command nil t :help "Create index file") ("Check"  
"lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file  
for correctness") ("Spell" "<ignored>" TeX-run-ispell-on-document nil  
t :help "Spell-check the document") ("XeTeX & xdvipfmx" "xetex - 
output-driver='xdvipdfmx -q -E' \"%(mode)\\input %t\"" TeX-run- 
command nil (plain-tex-mode context-mode ams-tex-mode)) ("XeLaTeX &  
xdvipfmx" "xelatex -output-driver='xdvipdfmx -q -E' \"%(mode)\\input % 
t\"" TeX-run-command nil (latex-mode context-mode ams-tex-mode))  
("Other" "" TeX-run-command t t :help "Run an arbitrary command"))))
  '(TeX-output-view-style (quote (("^dvi$" ("^landscape$" "^pstricks$\ 
\|^pst-\\|^psfrag$") "%(o?)dvips -t landscape %d -o && texdoc %f")  
("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "%(o?)dvips %d -o && texdoc % 
f") ("^dvi$" ("^a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4$" "^landscape 
$") "%(o?)xdvi %dS -paper a4r -s 0 %d") ("^dvi$" "^a4\\(?:dutch\\| 
paper\\|wide\\)\\|sem-a4$" "%(o?)xdvi %dS -paper a4 %d") ("^dvi 
$" ("^a5\\(?:comb\\|paper\\)$" "^landscape$") "%(o?)xdvi %dS -paper  
a5r -s 0 %d") ("^dvi$" "^a5\\(?:comb\\|paper\\)$" "%(o?)xdvi %dS - 
paper a5 %d") ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")  
("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d") ("^dvi$"  
"^legalpaper$" "%(o?)xdvi %dS -paper legal %d") ("^dvi$"  
"^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d") ("^dvi$"  
"." "%(o?)xdvi %dS %d") ("^pdf$" "." "texdoc %o") ("^html?$" "."  
"netscape %o"))))

Could be held in cuneiform, too, without reducing the users'  
understanding ...


Concerning TeXShop and TeXniscope as DVI viewers: you do *not* need  
to do anything of what you wrote! Both applications find internally  
that they are asked to display DVI and so they /automatically/  
convert DVI to PDF. Try with some DVI file on the command line:

	open -a TeXShop <the DVI file>

If you have the Console (from the Utilities folder inside the  
Applications) running and open, you would see how TeXShop converts  
the DVI file. The same for TeXniscope.

--
Greetings

   Pete

"We have to expect it, otherwise we would be surprised."





More information about the macemacsjp-english mailing list
Back to archive index