Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting horigin to (1in,1in) #182

Open
Udi-Fogiel opened this issue Jun 4, 2024 · 2 comments
Open

setting horigin to (1in,1in) #182

Udi-Fogiel opened this issue Jun 4, 2024 · 2 comments

Comments

@Udi-Fogiel
Copy link
Contributor

To simplify calculations of \hoffset and \voffset OpTeX set \pdfhorigin and \pdfvorigin to 0pt. LuaTeX, on the other hand, define four new primitives, \pagerightoffset, \pageleftoffset, \pagetopoffset and \pagebottomtoffset, which are being used according to \pagedirection. These registers actually dose not have the annoying 1in by default, but when OpTeX does

\_pdfvorigin=0pt
\_pdfhorigin=0pt

this 1in is added to them. I suggest instead of shifting \pdf(h/v)origin, just doing

\_let\_voffset\_pagetopoffset
\_let\_hoffset\_pageleftoffset

for example the following gives the same output

\_pdfhorigin=1in
\_pdfvorigin=1in
\_pagetopoffset\_voffset
\_pageleftoffset\_hoffset
Hello
\bye
Hello
\bye

This way there will be no need for the 1in even in the calculation of `\pagerightofset'.

@olsak
Copy link
Owner

olsak commented Jun 4, 2024

I see that \pagerightoffset, \pageleftoffset, \pagetopoffset and \pagebottomtoffset are mentioned in LuaTeX manual but they are not documented here. Simply: don't use them. I don't see any reason to add more complications with more primitives. Setting \pdfvorigin=0pt \pdfhorigin=0pt is clear solution of 1in obscurity (of classical TeX) and we don't need more.

@Udi-Fogiel
Copy link
Contributor Author

I'm also starting to wonder if should \bodydir and \pagedir used at all. It seems they do more harm than good sometimes. Their purpose in not entirely clear, but they make it possible to use layouts designed for LTR typesetting in RTL typesetting without many modifications. Not using them would mean there will be a need to modify some macros, such as margin notes (marginal notes should be on the right side on even pages in RTL documents), or multi column layout (the order of the columns is reversed if \bodydir is not set correctly).

@olsak If Ill start working on an approach that do not requires \bodydir, \pagedir nor \pagerightoffset will you be interested in that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants