3

I try make a macro that has to work differently depending upon page size and orientation.

What are the commands to determine page size (a4, a5, a6) and orientation (portrait or lanscape) ?

Tarass
  • 16,912
  • Off course ! Thank's. Please, write an answer. – Tarass Jun 03 '14 at 08:55
  • 3
    There are various Q&A's on the site that show the image of the LaTeX page layout, such as here: http://tex.stackexchange.com/questions/158675/killmargins-package/158686#158686. Those images tell what LaTeX length corresponds to what page dimension. – Steven B. Segletes Jun 03 '14 at 10:07
  • 1
    I knew all this, my question was "give me directly paper size as a4, a5, a6, letter ... without any calculation" ;-). Thank you. – Tarass Jun 03 '14 at 11:35
  • "Without any calculation??!!" Next thing you'll be wanting a backslash character in OT1 encoding 8^b – Steven B. Segletes Jun 03 '14 at 11:41

1 Answers1

4

I use \paperwidth&\paperheight, \pdfpagewidth&\pdfpageheight (sometimes I use \maxdimen, if needed) and \ifdim...\else...\fi when I need to set up something depending on these dimensions.

There is one fine example, please see http://www.tug.org/utilities/plain/cseq.html#ifdim-rp

Malipivo
  • 13,287