-
Notifications
You must be signed in to change notification settings - Fork 139
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
fix: revise the heading's margins and line height #78
base: master
Are you sure you want to change the base?
Conversation
- Use `em`, relative to heading title font units, for section headings (top and bottom, for `h2`-`h6`) - Use `<number>` units to specify the line height of section headings (for `h2`-`h6`) - Make null the top margin for paragraphs after a section heading (so the bottom margin size of the heading is always used, relative to its font size) - Make null the bottom margin for heading `hn` with a next-sibling `hn+1`, n= 2,..6 (to avoid unpredictable margin collapses) - Use a linear application to compute the margin size for next-sibling headings: `m(s) = alpha * (s - (1 - epsilon) * h6)`. - Explicitly indicate the `margin-top` for abstract heading, to keep the same dimensions, because it uses a custom font size. - Add the following (auto-descriptive) variables: - `--h2-font-size` - `--h3-font-size` - `--h4-font-size` - `--h5-font-size` - `--h6-font-size` - `--h2-line-height` - `--h3-h6-line-height` - `--h2-margin-top` (`em` units) - `--h3-h6-margin-top` (`em` units) - `--h2-margin-bottom` (`em` units) - `--h3-h6-margin-bottom` (`em` units) - Add the following variables to control next-sibling heading margins (`m(s)` parameters): - `--h3-h6-sibling-alpha` - `--h3-h6-sibling-epsilon`
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This closes #67 I really didn't know the best way to deal with this issue (in a simple way). A brief summary about how I see the situation:
My proposal:
Formula for sibling margins rationaleWe want a linear application with respect to the heading font size:where the variable And if we take where Let's see also that we can use the same formula for all the headings, if we change the variable which does not depends on About the selected values:
This is the general idea, I'm open to any suggestion (including going back to the easy way method, adjust the values used, simplify the "tricky part" ...). |
Vercel deployment has failed!! 😱 |
Thanks for cleaning up the typography and making it very methodological. I like the usage of
Apologies about the failed Vercel deployments (wouldn’t build anymore due to old Node version). I have fixed it and it shouldn’t happen anymore. |
Well, the main goal of this PR (using a typo in a margin size as a pretext) was only to try to unify a bit the margin styles for LaTeX.css and LaTeX; considering also the possibility of a heading font size customization by the author. I hope it brings some improvement.
Sorry, I forgot that I didn't need it anymore. I was testing other calculations, and I had problems with the units in that moment, so I thought that not using units would give me more freedom for my operations. But, I finally opted for the simplest of the methods, and there was no problem with the units from the variables used in "next-sibling" headings (I was testing a more complex formulas to calculate automatically the I have already committed the fix; the original commit message should also be modified to reflect these changes. Also, I don't know if I have chosen the best names for the variables, feel free to modify them if you consider it appropriate.
I tried to follow LaTeX.css original margin sizes.
Considering also that I thought
if I haven't made any mistake. As an average value I finally chose Some final comments: for next-sibling headings, again, I wanted to try to follow the LaTeX style ("one constant size" in I was playing a little at the time with the function h2 + h3 {
margin-top: 0.7em;
}
h3 + h4 {
margin-top: 0.63em;
}
h4 + h5 {
margin-top: 0.53em;
}
h5 + h6 {
margin-top: 0;
} But for me, the linear function method is better founded, brings a quasi-constant |
em
, relative to heading title font units, for section headings (top and bottom, forh2
-h6
)<number>
units to specify the line height of section headings (forh2
-h6
)hn
with a next-siblinghn+1
, n= 2,..6 (to avoid unpredictable margin collapses)m(s) = alpha * (s - (1 - epsilon) * h6)
.margin-top
for abstract heading, to keep the same dimensions, because it uses a custom font size.--h2-font-size
--h3-font-size
--h4-font-size
--h5-font-size
--h6-font-size
--h2-line-height
--h3-h6-line-height
--h2-margin-top
(em
units)--h3-h6-margin-top
(em
units)--h2-margin-bottom
(em
units)--h3-h6-margin-bottom
(em
units)m(s)
parameters):--h3-h6-sibling-alpha
--h3-h6-sibling-epsilon