help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing with emacs: Not working


From: Joe Fineman
Subject: Re: Printing with emacs: Not working
Date: Fri, 27 Feb 2009 20:24:21 -0500
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.3 (windows-nt)

DaveLG526 <David.Gillooly@gmail.com> writes:

> I have been using emacs for about a month and really like it.  It
> wasn't till today that I tried to print something. I see this
> message but nothig i sever printed: Spooling with options (page
> headers are not supported)...done.

I Am Not A Programmer.  I have gotten so consistently frustrated
trying to make lpr-buffer, lpr-region, tex-buffer, & tex-print work
that I have resorted to the following workarounds:

(defun lprl (r/b)
  "Print all or part of buffer with TeX literal mode."
  (interactive "cr(egion) or b(uffer)?")
  (save-window-excursion
    (let ((passage (if (equal r/b ?r)
                       (buffer-substring (region-beginning) (region-end))
                     (buffer-substring (point-min) (point-max)))))
      (find-file "/usr/own/f/hdwe/printer/hp/Lpr-scratch.tex")
      (delete-region (point-min) (point-max))
      (insert-file "~/tex/Tex-literal-hdr")
      (goto-char (point-max))
      (insert passage)
      (goto-char (point-max))
      (insert-file "~/tex/Tex-literal-ftr")
      (untabify (point-min) (point-max))
      (goto-char (point-min))
      (replace-regexp "\e.\\|\C-r" "")
      (save-buffer)
      (shell-command "latex /usr/own/f/hdwe/printer/hp/Lpr-scratch.tex") 
;Doesn't understand tilde
      (shell-command "dvips -f /usr/own/f/hdwe/printer/hp/Lpr-scratch.dvi | 
gsprint - color - ")
      )))

----------------------------------------------------------------------
Tex-literal-hdr:
\documentclass[12pt]{article}
\pagestyle{empty}
\setlength{\oddsidemargin}{-.25in}
\setlength{\topmargin}{-.75in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
----------------------------------------------------------------------
Tex-literal-ftr:
\end{verbatim}

\end{document}
----------------------------------------------------------------------

\begin{document}
\setlength{\baselineskip}{.1667in}
\noindent
\begin{verbatim}

(defun lprt ()
  "Print the TeX file in the current buffer."
  (interactive)
  (save-window-excursion
    (let ((file (buffer-string)))
      (find-file "~/hdwe/printer/hp/Lpr-scratch.tex")
      (delete-region (point-min) (point-max))
      (insert file))
    (save-buffer)
    (shell-command "latex /usr/own/f/hdwe/printer/hp/Lpr-scratch.tex") ;Doesn't 
understand tilde
    (shell-command "dvips -f /usr/own/f/hdwe/printer/hp/Lpr-scratch.dvi | 
gsprint - color - ")
    ))
-- 
---  Joe Fineman    joe_f@verizon.net

||:  First you go to hell, then your body rots, and then you die.  :||


reply via email to

[Prev in Thread] Current Thread [Next in Thread]