This is probably impossible, given how TeX works, but here's what I want to do:
I'm writing a document class for printing on letterhead in LaTeX, and I want TeX to insert space between the date/address and the greeting, if necessary, so that the greeting starts at or below a certain distance from the top of the page. For example, let's say my date and addresses take me to 2.73 inches from the top of the page; I would then insert 0.27in of space before printing the greeting. If I'm at 2.96 inches, I insert 0.04in. If I'm more than 3in from the top, I insert nothing.
Is this possible?
Page Layout ⇒ Checking the absolute position of text
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Checking the absolute position of text
For relative positioning in arbitrary text, I would use
Stefan
\tikzmark
and set additional text using a TikZ overlay on the page. Example: Highlighting in a matrix.Stefan
LaTeX.org admin
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Re: Checking the absolute position of text
I'm not trying to connect two points of text here---I'm trying to determine how much vertical space (including text/images/etc.) has been inserted since the page started, and then (if necessary) insert more whitespace before the next block of text.
I don't see how to do that from the example in the previous post.
Think of it this way: I want a certain line of text to start at (or below) 3 inches (say) from the top of the page. This would be trivial if there were no other text on the page above the 3-inch mark, but of course, there IS other text on the page above it.
I don't see how to do that from the example in the previous post.
Think of it this way: I want a certain line of text to start at (or below) 3 inches (say) from the top of the page. This would be trivial if there were no other text on the page above the 3-inch mark, but of course, there IS other text on the page above it.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Checking the absolute position of text
Hi,
just quickly at the moment, yes, it's not about connecting something. What I meant, is setting a coordinate (depending on content) and using it. With if-then, or a calculation, and finally printing something as an overlay.
Maybe we (or another reader) could work on a real small code sample.
Stefan
just quickly at the moment, yes, it's not about connecting something. What I meant, is setting a coordinate (depending on content) and using it. With if-then, or a calculation, and finally printing something as an overlay.
Maybe we (or another reader) could work on a real small code sample.
Stefan
LaTeX.org admin