[texworks] Fwd: Call for Help: Testing

Stefan Löffler st.loeffler at gmail.com
Mon Feb 21 07:19:20 CET 2022


Dear Philip,

On 18.02.22 11:48, Philip Taylor (Hellenic Institute) wrote:
> Thank you for this, Stefan, but now I see a ?new? artifact — depending 
> on the degree of zoom, in single-page continuous view the Y-origin of 
> the first page can be either  -30, -15 or 0.  The reason appears to be 
> that at small sizes (less zoom), it is impossible to select page 1 as 
> the current page.

Yes, this is a known problem (unfortunately with no solution known to 
me, at least ;)).
The problem is that when you scroll (or zoom), Tw needs to automatically 
keep track of where you are and what your page you are currently on 
(e.g., to display in the statusbar). It does so (roughly) by picking the 
page that is currently displayed in the center. More precisely, it looks 
at all pages visible in the top half of the screen and picks the last 
one it finds. This typically works well, but if there are many pages 
visible in the top half (such as at very low zoom levels), it becomes 
impossible to "scroll" to the first page (or the second, third, ... page 
for that matter) as there are always pages after it that fit the 
selection criteria (better).

I've toyed around with a few ideas, such as preferring to keep the 
current page if it is still in view, but that would mean that if even a 
single pixel is still on screen, that page keeps being the "current" 
page, even though visually it's certainly not as it's barely visible. 
Then you could introduce conditions such as "at least x % of the page 
have to be visible", but then you run into problems at other zoom 
levels... It seems this is not a trivial task to solve.

There are two possible "workarounds":
1) You can double-click on the page number in the status bar to set a 
page number. Please note that the "current" page number will jump back 
to what it was at the slightest change. Anytime you scroll, zoom, or 
display another window on top of the PDF previewer (i.e., every time the 
previewer thinks it has to redraw at least part of the screen), the 
"current page" will revert to its automatic value.
2) resize the window such that the auto-selection algorithm outlined 
above selects the page you want as "current".

> Also, were you able to give any though to my proposal to display the 
> relevant co-ordinate in the status bar when dragging a ruler ?
>

I thought about it. It's certainly doable in principle, but I don't see 
any particularly compelling use case so far. Eye-balling it and then 
double-clicking the guideline to get accurate values seems far superior 
to me. This gives better precision, and allows you to change the units 
the value is displayed/edited in.

HTH,
Stefan


More information about the texworks mailing list.