From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Agenda printing: org-agenda-write doesn't use ps-paper-type Date: Thu, 13 Jun 2013 17:59:00 -0400 Message-ID: <87zjuty8nv.fsf@pierrot.dokosmarshall.org> References: <87a9mwdtrh.fsf@gmail.com> <87y5afkcoa.fsf@sbs.ch> <878v2fej7n.fsf@gmail.com> <871u87nwrs.fsf@ucl.ac.uk> <87y5afc7q2.fsf@gmail.com> <87d2rqa1p8.fsf@ucl.ac.uk> <87vc5hd9uc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFY9-0006Zx-Dd for emacs-orgmode@gnu.org; Thu, 13 Jun 2013 17:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnFY7-0001Wm-KR for emacs-orgmode@gnu.org; Thu, 13 Jun 2013 17:59:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:46987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFY7-0001Wf-EV for emacs-orgmode@gnu.org; Thu, 13 Jun 2013 17:59:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UnFY5-0004rS-0D for emacs-orgmode@gnu.org; Thu, 13 Jun 2013 23:59:17 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Jun 2013 23:59:16 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Jun 2013 23:59:16 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Myles English writes: > Eric, > > Eric S Fraga writes: > >> Myles English writes: >> >>> Thanks for checking it. Yes, I had to change this line in >>> org-agenda.el: >>> >>> - (call-process "ps2pdf" nil nil nil >>> + (call-process "ps2pdf" nil nil nil "-sPAPERSIZE=a4" >> >> If you use a4 sized paper all (or most of) the time, you can set this in >> /etc/papersize on Linux. I think this is what ps2pdf looks at by >> default. >> >> I think paperconfig (8) is used to set this property properly. > > Thanks for the suggestions. I looked into this for my Arch Linux but it > had no effect on ps2pdf. Making the /etc/papersize file and then > setting PAPERSIZE=a4 or PAPERCONF=/etc/papersize did not produce an A4 > pdf document (even after installing libpaper). > > Setting GS_OPTIONS="-sPAPERSIZE=a4" worked. > > What also worked was manually adding this to the .ps file: > > %%BeginPaperSize: a4 > %%EndPaperSize > > I am wondering if ps-print should have known to add this because > ps-paper-type is set to a4? > > Thanks, > Myles > > Just as another possibility: if there is no cleaner way, one quick-and-dirty workaround for such problems (this one, the latex preview/mint-requires-shell-escape one, etc.) is to have little personal wrapper scripts that call the "real" program and pass the appropriate args. E.g. create ~/bin/ps2pdf containing --8<---------------cut here---------------start------------->8--- #! /bin/bash /usr/bin/ps2pdf -sPAPERSIZE=a4 $* --8<---------------cut here---------------end--------------->8--- make it executable and make sure that ~/bin is before /usr/bin in your PATH. call-process calls ps2pfs which resolves to ~/bin/ps2pdf and that one calls /usr/bin/ps2pdf - be sure to use the full pathname here or all hell will break loose. This has the potential of creating a lot of confusion, so I wouldn't do it if there is another way (as there is in this case), but if one is getting desperate... -- Nick