Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-14 Thread Sebastien Vauban
Myles English wrote:
 Eric S Fraga writes:
 Myles English mylesengl...@gmail.com writes:
 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you checked to see if the postscript version uses the right paper
 size?  Just in case the ps - pdf conversion is at fault?  The pdf is
 created from the ps file.  In any case, both ps and pdf work just fine
 for me to A4 with ps-paper-type set to 'a4.

 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

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

And setting that in a custom command?

#+begin_src emacs-lisp
  (add-to-list 'org-agenda-custom-commands
   '(L Call list
 tags-todo phone
 ((ps-paper-type 'a4))
 (~/org-calls.pdf)) t)
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-14 Thread Eric S Fraga
Myles English mylesengl...@gmail.com writes:

 Eric,

 Eric S Fraga writes:
 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.

 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).

On my Debian system, the file /etc/papersize has simply a4 as the
contents.  No PAPERSIZE or similar.  According to the manual page for
papersize in section 5, this file is used unless overridden by the
environment variables PAPERSIZE or PAPERCONF, the latter pointing to a
file which specifies the size.

YMMV, of course.

Anyway, glad you sorted out your problem!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.0.3-193-g334581




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-14 Thread Myles English

Hi Seb,

Sebastien Vauban writes:

 Myles English wrote:

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

 And setting that in a custom command?

 #+begin_src emacs-lisp
   (add-to-list 'org-agenda-custom-commands
'(L Call list
  tags-todo phone
  ((ps-paper-type 'a4))
  (~/org-calls.pdf)) t)
 #+end_src

Sorry I don't understand what you mean.  The ps-paper-type is already
set to a4 but has no effect on the call to ps2pdf.

Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-14 Thread Sebastien Vauban
Hi Myles,

Myles English wrote:
 Sebastien Vauban writes:
 Myles English wrote:

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

 And setting that in a custom command?

 #+begin_src emacs-lisp
   (add-to-list 'org-agenda-custom-commands
'(L Call list
  tags-todo phone
  ((ps-paper-type 'a4))
  (~/org-calls.pdf)) t)
 #+end_src

 Sorry I don't understand what you mean.  The ps-paper-type is already
 set to a4 but has no effect on the call to ps2pdf.

OK, seems I've read too fast...

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Christian Egli
Myles English mylesengl...@gmail.com 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

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

Where do we pass options for ps? A quick rgrep shows that ps2pdf is used
in the agenda and two of the exporters (groff and man) so a better
option might be to set the papersize via the environment (GS_OPTIONS).

Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

-
Tag der offenen Tuer
Die SBS laedt Sie herzlich ein: 29. Juni 2013 von 9 bis 16 Uhr.
Mehr Informationen erhalten Sie unter http://www.sbs.ch/offenetuer



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Eric S Fraga
Myles English mylesengl...@gmail.com 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.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.0.3-193-g334581




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Rainer Stengele
Am 13.06.2013 10:11, schrieb Christian Egli:
 Myles English mylesengl...@gmail.com 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

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?
 

 Where do we pass options for ps? A quick rgrep shows that ps2pdf is used
 in the agenda and two of the exporters (groff and man) so a better
 option might be to set the papersize via the environment (GS_OPTIONS).
 
 Christian
 
+1
under Windows I see the same problem and like to set to 'a4 somewhere.

Rainer



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Myles English

Christian Egli writes:

 Myles English mylesengl...@gmail.com 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

 I wonder if we need to allow a set of options to be passed to ps2pdf as
 we do for ps?

 Where do we pass options for ps?

Ok, options aren't passed to ps but variables can be customised for the
emacs PostScript generator:

(customize-group ps-print)

 A quick rgrep shows that ps2pdf is used in the agenda and two of the
 exporters (groff and man) so a better option might be to set the
 papersize via the environment (GS_OPTIONS).

This worked.  I added this to my ~/.zshrc :

export GS_OPTIONS=-sPAPERSIZE=a4

Thanks,

Myles




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Myles English

Eric,

Eric S Fraga writes:

 Myles English mylesengl...@gmail.com 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



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-13 Thread Nick Dokos
Myles English mylesengl...@gmail.com writes:

 Eric,

 Eric S Fraga writes:

 Myles English mylesengl...@gmail.com 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




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Christian Egli
Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 This is how I try to print it:

 (org-agenda-write /home/myles/tmp/agenda.pdf nil nil *Org Agenda(a)*)

org-agenda-write uses ps-print to do the work so setting ps-paper-type
should indeed help.

 and setting this doesn't fix it either:

 (eval-after-load ps-print
   '(setq ps-paper-type 'a4))


Have you tried setting this variable with the custom interface, i.e. M-x
customize-variable RET ps-paper-type RET?

HTH
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Myles English

Hi Christian,

Christian Egli writes:

 Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you tried setting this variable with the custom interface, i.e. M-x
 customize-variable RET ps-paper-type RET?

The customise interface shows that ps-paper-type is indeed set to a4,
but still the agenda prints on US letter.

Any other ideas?

Myles



Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Eric S Fraga
Myles English mylesengl...@gmail.com writes:

 Hi Christian,

 Christian Egli writes:

 Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you tried setting this variable with the custom interface, i.e. M-x
 customize-variable RET ps-paper-type RET?

 The customise interface shows that ps-paper-type is indeed set to a4,
 but still the agenda prints on US letter.

Have you checked to see if the postscript version uses the right paper
size?  Just in case the ps - pdf conversion is at fault?  The pdf is
created from the ps file.  In any case, both ps and pdf work just fine
for me to A4 with ps-paper-type set to 'a4.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.0.3-193-g334581




Re: [O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-12 Thread Myles English

Eric S Fraga writes:

 Myles English mylesengl...@gmail.com writes:

 Trying to print an agenda to pdf always results in the paper size being
 US letter even though ps-paper-type is set to a4.

 Have you checked to see if the postscript version uses the right paper
 size?  Just in case the ps - pdf conversion is at fault?  The pdf is
 created from the ps file.  In any case, both ps and pdf work just fine
 for me to A4 with ps-paper-type set to 'a4.

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

I wonder if we need to allow a set of options to be passed to ps2pdf as
we do for ps?

Myles



[O] Agenda printing: org-agenda-write doesn't use ps-paper-type

2013-06-11 Thread Myles English
Hello,

Trying to print an agenda to pdf always results in the paper size being
US letter even though ps-paper-type is set to a4.

This is how I try to print it:

(org-agenda-write /home/myles/tmp/agenda.pdf nil nil *Org Agenda(a)*)

and setting this doesn't fix it either:

(eval-after-load ps-print
  '(setq ps-paper-type 'a4))

Is there something else I need to customise?

Thanks,

Myles