[Tex/LaTex] How to determine the actual inner and outer margins

margins

I somehow have the feeling this is a dumb question, but I just can't find anything 🙁

How can I determine the actual values of the inner and outer margins of my document, or still better: the right and left margins of the current page?

Background is that I'm working on a package to manage music examples, and one of the kinds these come are multi-page pdf files.
Additional to other methods I would like to add an option to automatically offset the included pdf pages depending on being on an odd or even page.

For this I would like to read out the margins of the current page.

Best Answer

The reference point (unless changed with \hoffset and \voffset) is 1in in and 1in down from the top left of the page.

Relative to that point the left margin in LaTeX is \oddsidemargin on odd pages and \evensidemargin on even pages. The total paper width is \paperwidth so the right margin on an odd page is \paperwidth - \textwidth - \oddsidemargin - 1in.