TeX - LaTeX Asked by Daniel Bandeira on May 16, 2021
I was trying to understanding how the size of a page is determined in terms of TeX primitives. As first attempt, I’ve tried to occupy completely the page with a simple header (a line) , a footer (in form of a big T) and centralized text content. But I’ve failed in this mission ("You lose!"). Please, take a look in my code.
% initial configuration
voffset=-1in
hoffset=-1in
hsize=10em
vsize=10em
% defining layout page (at least, trying it)
output{%
shipoutvbox{% this layout was uncaple to eliminate all margins! Bottom and right margins persist
leftskip=0pt
rightskip=0pt
hrule height 0pt depth 7pt
vfill
box255
vfil
hrule height 7pt depth 0pt
hbox to hsize{hfilvrule height 70pt hfil}}}
% hyphining at will (or almost this)
pretolerance=45
tolerance=10000
% local defintions
defcorrection#1{%
ifcase#1
moveright
or moveright-
or moveleft
or moveleft-
or kern % this generates a disaster! It's reasonable, but I haven't got it
or kern-
else
defeliminatehsize##1{}
expandaftereliminatehsizefi}
defarg{4} % in this cases, leads to kern
% finally, text content of page
vfil
noindent Umas verdades quar seram tambem vadjust{correctionarghsizevbox to 0pt{hbox to 0pt {vbox{hsize=7emnoindent Mulambo Silvestre}}}} semper que tardia nostrum vitae moscaribatus.
vfil
penalty-10000
end
It could looks ungly at first but it’s really simple. So… questions are:
1) Why there are a right and a bottom margin in the output? (I’m usingbTeX 3.14159265 (TeX Live 2019/dev/Debian) and displaying dvi files with evince)
2) Why the box255 was not centralized?
3) Why a weird output (creating new pages!!!) when arg values 4 (a kern is used as correction). I hope it was lost only part of the content, the same as in arg = 5 or arg = 1.
Thanks in advance.
ad 1) there is no TeX primitives which controls page size when dvi output is used. The page size is set by configuration of pdf viewer or using an obscure special. Dvi is old format which does not include the information about page sizes.
ad 2) box255 is not vertically centralized because there is only one line in it and the vsize is set to 10em. Then smoething like setbox255=vbox to10em{single line}
is internally processed, the box255 has its height 10em and the single line is here at the top (with underfull vbox
, but message about it is not appended).
ad 3) the vadjust inserts vertical material: the kernhsize
followed by a vbox
. This is much more than given vsize
, so first line (without vadjust
) is pocessed as first page (with underfull vbox
), second line (with a big vadjust
) is processed as second page (with overfull vbox
).
I don't know what is your intend but I know that things can be done more simple.
Answered by wipet on May 16, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP