# Trim size as fundamental TeX value

What are the fundamental TeX length names, corresponding to trim size and offsets?

I already know that `\pdfpagewidth` and `\pdfpageheight` will grab enough information to calculate the PDF MediaBox (in different units). These commands are independent of the latex document class, AFAIK.

And I know that if memoir class is used, I can grab the trim size and offsets from the values set using memoir commands: `\paperwidth` `\paperheight` `\trimtop` `\trimedge`. These can be used to calculate the size and position of the PDF TrimBox. I know how to do the calculations.

But the problem is that for the TrimBox, I rely on memoir-specific lengths. If memoir is not in use, no luck. So what I want to know is: Is there a universal set of lengths (by name) that latex uses regardless of document class, when it comes to the TrimBox? I don't need to know the values until AtBeginDocument.

Why I wish to know: I have improvements to pdfx package, which enable arbitrary document sizes. But my current solution relies on memoir to give me the lengths. I would like to make it more general.

• See this posting for example of displaying the layout and parameter values for a given document. tex.stackexchange.com/questions/251215/… – R. Schumacher Jul 4 '15 at 17:15
• I saw that earlier. I do not need to display the numerical values, or a diagram. What I need to know is the internal name of the TeX commands that are actually at the bottom of all that. The listed commands do not seem to be fundamental. – RobtA Jul 4 '15 at 19:00
• Then you are really interested in the "plain TeX" parameters, as they are at the very base of LaTeX or other formats e.g. ConTeXt, lillypond, and even Memoir(which is only a style build on LaTeX). A good reference in here. Warning, it is very hard to understand unless you have a copy of "The TeXbook" in hand. tug.org/utilities/plain/cseq.html#type-fam – R. Schumacher Jul 4 '15 at 19:29
• In addition to The TeXbook, you might want to look at TeX by Topic. – jon Jul 4 '15 at 21:28
• ^I believe neither of those will tell you the answer because I think you're looking for pdf-specific primitives. So maybe those can be found in pdftex, dvipdfmx, or luatex manuals. – morbusg Jul 5 '15 at 7:20