TransWikia.com

How to skip horizontally by the negative amount of hoffset?

TeX - LaTeX Asked by ceving on February 9, 2021

I tried the following but nothing seems to work:

hskip -hoffset
hskip -thehoffset
hskip 0pt minushoffset
hskip 0pt minusthehoffset

What is the right syntax to reference hoffset?

Update

Complete example:

pdfpagewidth=210mm
pdfpageheight=297mm
hsize=pdfpagewidth advancehsize by -50mm
vsize=pdfpageheight advancevsize by -50mm
advancehoffset by -1in advancehoffset by 25mm
advancevoffset by -1in
deffalz{vrule width25mm height.1mm depth0pt}
hbox {The distance between the paper border and the left side of the
  line is 25mm, because hoffset is set to 25mm.}
hbox{hskip-25mmfalz Skipping by the numerical value works.}
hbox{hskip-hoffsetfalz But skipping by -hoffset does not work.}
bye

One Answer

The standard reference point is 1in from the left and the top margins. If you want it to be 25mm from both, you can do

advancehoffsetdimexpr25mm-1inrelax
advancevoffsetdimexpr25mm-1inrelax

or, since it's known that 1in = 25.4mm,

advancehoffset -0.4mm
advancevoffset -0.4mm

A simpler way with pdftex would be to do

pdfhorigin=25mm
pdfvorigin=25mm

If I compile the following with xetex

pdfpagewidth=210mm
pdfpageheight=297mm
hsize=pdfpagewidth advancehsize by -50mm
vsize=pdfpageheight advancevsize by -50mm
advancehoffset-0.4mm
advancevoffset-0.4mm

vglue -24mm % back up vertically by almost 25mm
vglue-topskip % remove the topskip
moveright-24mmvbox{hrule width 3cm depth 4pt}

bye

As you see there is 1mm of white space on the left and above the rule.

enter image description here

If I use 25mm, I get

enter image description here

Note that XeTeX doesn't really know anything about how the output is placed on the physical page: it is the same as TeX, in this respect, and relies on the output driver. In the case of TeX a conformant DVI driver will use (1in,1in) as origin and the same holds for xdvipdfmx.

Answered by egreg on February 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP