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

In a 10-point font, \drawUnitLine and \drawPoint increase the lineskip a bit #36

Open
MarcinCiura opened this issue Jun 4, 2018 · 8 comments
Assignees

Comments

@MarcinCiura
Copy link

Please compare the results of typesetting the text of any proposition with \drawUnitLine{XY} and \smash{\drawUnitLine{XY}}.

@jemmybutton
Copy link
Owner

From what i see, this is caused by a little bit too big text labels, when they are turned on. Making them smaller solves the problem (hopefully) 43d14d0#diff-729a8dc19cc1aa522f18a5cd5cda0084R2195

@jemmybutton
Copy link
Owner

@mciura or you suggest adding \smash to \drawPoint and \drawUnitLine macros? (for drawPoint that won't work, though, because point is not always on a straight line, like in prop:I.XII)

@MarcinCiura
Copy link
Author

I do not think adding \smash to the macros would be elegant. Perhaps you could ignore labels in the bounding box of a picture?

  [draw the picture without labels]
  path bb; bbmargin := 0pt; bb := bbox currentpicture;
  [add the labels]
  setbounds currentpicture to bb;

@jemmybutton
Copy link
Owner

As a generic solution for all labels i wouldn't do that, because sometimes labels take much space and if this space is ignored labels can fall too close to the surrounding text:

bb.

In general, that would work perfectly only for lines (points sometimes have sharp angles and, therefore, dangerous labels).

Maybe, instead of decreasing labels footprint, increase lineskip in the document?

@MarcinCiura
Copy link
Author

I feel that messing with lineskip without changing the text size to, say, 10.5pt (and changing the size of the lettrines etc.) would disturb the typographic harmony.
Here is yet another variation on setbounds, this time unconditionally put at the end of a picture:

setbounds currentpicture to bbox currentpicture topenlarged -0.5pt

(0.5pt is just an example as I did not measure how much the labels increased the text height.) The difference is so small that maybe this method could even be implemented in all kinds of inline pictures, not only \drawPoint and \drawUnitLine?

@jemmybutton
Copy link
Owner

In fact, there is 2pt extra space added above and below every inline picture at TeX level (otherwise taller inline pictures "scratch" neighbouring lines). What you propose looks practically identical to reducing that space a bit. I tried to kill both birds with one stone by adding a conditional which removes that extra space only for pictures that have height less than a certain threshold (e. g. \baselineskip): 326dc95#diff-6a58985423a46a2bb439cfdf26904e5fR106
(text labels are "big" again).
Is that ok, how do you think?

@jemmybutton
Copy link
Owner

@mciura alternatively, here's a hook placed after all the metapost code 3d34b01#diff-6a58985423a46a2bb439cfdf26904e5fR14
now you can simply write anything in mpPost (in addition to mpPre https://github.com/jemmybutton/byrne-euclid/blob/master/byrne_ru_context.tex#L35 ) in case the solution above doesn't suffice for some reason

@MarcinCiura
Copy link
Author

Looks great, Sergey! Please excuse that it took me so long to respond. Last week, my son appropriated my Linux box for watching Peppa Pig on YouTube.

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

No branches or pull requests

2 participants