pdflayout.sty 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. % Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
  2. % This file is part of GNU Emacs.
  3. % GNU Emacs is free software: you can redistribute it and/or modify
  4. % it under the terms of the GNU General Public License as published by
  5. % the Free Software Foundation, either version 3 of the License, or
  6. % (at your option) any later version.
  7. % GNU Emacs is distributed in the hope that it will be useful,
  8. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. % GNU General Public License for more details.
  11. % You should have received a copy of the GNU General Public License
  12. % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  13. % This file defines `\pdflayout':
  14. % - \pdflayout=(0) is A4 portrait,
  15. % - \pdflayout=(1) is letter (US) portrait,
  16. % - \pdflayout=(0l) is A4 landscape.
  17. % - \pdflayout=(1l) is letter (US) landscape,
  18. \input ifpdf.sty
  19. \ifpdf
  20. \def\pdflayout=(#1#2){
  21. \if0#1 % A4
  22. \pdfpagewidth=21cm
  23. \pdfpageheight=29.7cm
  24. \else\if1#1 % Letter
  25. \pdfpagewidth=8.5in
  26. \pdfpageheight=11in
  27. \fi\fi
  28. \if l#2 % Landscape
  29. \edef\oldwidth{\the\pdfpagewidth}
  30. \pdfpagewidth=\pdfpageheight
  31. \pdfpageheight=\oldwidth
  32. \fi
  33. }
  34. \else
  35. \def\pdflayout=(#1#2){}
  36. \fi