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

  • Off course ! Thank's. Please, write an answer.
    – Tarass
    Jun 3 '14 at 8:55
  • 3
    There are various Q&A's on the site that show the image of the LaTeX page layout, such as here: tex.stackexchange.com/questions/158675/killmargins-package/…. Those images tell what LaTeX length corresponds to what page dimension. Jun 3 '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 3 '14 at 11:35
  • "Without any calculation??!!" Next thing you'll be wanting a backslash character in OT1 encoding 8^b Jun 3 '14 at 11:41

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.