2

What is the TeX equivalent of

\usepackage[paperwidth=10cm, 
            paperheight=15cm,
            margin=0mm,
            bottom=1mm]{geometry}

?

I know nothing in TeX and so far, I am playing with expressions such as

\newlength{\initialVerticalHeight}
\setlength{\initialVerticalHeight}{5cm}

\newlength{\bottomMargin}
\setlength{\bottomMargin}{1mm}

\global\setlength\paperheight\initialVerticalHeight%
\global\setlength\pdfpageheight\initialVerticalHeight%
\global\setlength\textheight{\dimexpr\paperheight-\bottomMargin}%

but I can't find the equivalent of left(margin) and top(margin).

Is it very complicated? I'm trying to avoid using geometry package because I'm doing tricky things and want to have a clear understanding of what is happening.

  • 1
    Why do you want to reinvent the wheel? Btw, do you mean TeX or LaTeX? – Bernard Sep 18 '15 at 0:39
  • When I tried to figure it out for myself, I used links listed here: tex.stackexchange.com/questions/241575/… You may use that as a starting point. Also search this forum by voffset, hoffset, hsize, vsize; if you use pdftex, look also into pdftexmagfix.tex – Igor Liferenko Sep 18 '15 at 2:42
  • Even better, look into the source of OPmac package, or use it directly. – Igor Liferenko Sep 18 '15 at 2:48
  • @Bernard I need to understand how things work. I don't know if this is TeX or LaTeX. What I mean is how can I achieve the same result with more basic tools. What I need to do ultimately is beyond the capabilities of geometry. – Colas Sep 18 '15 at 2:50
  • 1
    Well, then Touhami's answer looks reasonable, and Igor's is impracticable. By the way, \setlength is LaTeX, not Plain. – erreka Sep 18 '15 at 18:15
2

Here is a solution

\documentclass{article}
\usepackage{lipsum}

\newlength{\bottomMargin}
\setlength{\bottomMargin}{1mm}

% paper size
\setlength{\paperwidth}{10cm}
\setlength{\paperheight}{15cm}
\setlength{\pdfpagewidth}{\paperwidth}
\setlength{\pdfpageheight}{\paperheight}
% horizontal dimensions
\setlength{\oddsidemargin}{-1in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{\paperwidth}
% vertical dimension
\setlength{\topmargin}{-1in}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
%\setlength{\topskip}{10pt}   if you are about new class
%\setlength\footskip{30pt} if you want a footer, here no place for footer
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\bottomMargin}



\begin{document}
\lipsum
\end{document}

Latex format set \topskip=10pt standard class set it 10pt, 11pt ,12pt. It should never be set 0pt

Note number of lines in the page is also factor in the text height or the bottom magin.

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.