You are not logged in.
Pages: 1
How do I get the filename of the file open in the active buffer? I'm trying to make a function to compile a LaTeX file into a PDF - when I do this i can uninstall Texmaker. Here is what I have so far:
; My LaTeX Wizard
(defun latex-wizard ()
(interactive)
(insert "\\documentclass[12pt,a4paper,oneside]{article}\n")
(insert "\\usepackage[latin1]{inputenc}\n")
(insert "\\usepackage{amsmath}\n")
(insert "\\usepackage{amsfonts}\n")
(insert "\\usepackage{amssymb}\n")
(insert "\\author{Michael Walker}\n")
(insert "\\title{}\n")
(insert "\\begin{document}\n")
(insert "\n")
(insert "\\maketitle{}\n")
(insert "\n")
(insert "\\end{document}\n"))
; Compile a LaTeX source file into a PDF.
(defun latex-compile-pdf ()
(interactive)
(execute "/usr/bin/pdflatex" "-interaction=nonstopmode" ""))
(provide 'latex-wizard)
(provide 'latex-compile-pdf)
edit: I also need to know how to escape the returned filename so it works as a command line argument.
edit 2: Finally, I need to know how to make it output the .pdf, .loc, etc files in the same directory as the .tex file.
Last edited by Barrucadu (2008-11-08 00:26:30)
Offline
(buffer-file-name) for the first question.
Offline
I came up with a solution after turning to google and posted it in my blog
Offline
Ever heard of AucTex? It's the standard LaTeX package for emacs and it's really full featured.
Offline
Pages: 1