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

Space after number in section title #25

Closed
davidfarmer opened this issue Aug 6, 2014 · 10 comments
Closed

Space after number in section title #25

davidfarmer opened this issue Aug 6, 2014 · 10 comments

Comments

@davidfarmer
Copy link
Contributor

There should be a space added after the .codenumber span in (sub)section titles and theorem/definiiton-like environments. These were in the add-on.css at one point.

MBX seems to insert the space in some cases, but SL2X leaves no space between the spans,
so CSS has to add it.

Note that if you put class="heading" in the h tag of a title, then the .type span is hidden.
(I.e. it says "2.2 The Division Algorithm" not "Section 2.2 The Division Algorithm).
But I want the word "Section" to appear, so I don;t add a class to the h tag.

@mxdubois
Copy link
Contributor

mxdubois commented Aug 6, 2014

Ah, okay. This kind of stuff will only work if you add the class="heading" part. I need that to target the heading. But it sounds like we need to come up with a good way to provide options for hiding or not hiding section/environment types. Let's discuss that in #27.

I found a bug in my styles that caused my :after elements on type/codenumber/title to not show up sometimes. You'll see the commit in develop shortly. Let me know if it does/doesn't fix this particular issue.

@davidfarmer
Copy link
Contributor Author

What is wrong with a selector like

.theorem-like > h1 .type:after

That seems to avoid the need to put a class on the h5.

@mxdubois
Copy link
Contributor

mxdubois commented Aug 7, 2014

I opted for class="heading" for two reasons:

  1. We couldn't agree about h1 vs h5
  2. In most cases it's good if the CSS does not depend on the exact HTML element, so that the CSS is more robust to changes in the markup. Initially I was not as concerned about this because it seemed like maybe we were going to use the CSS to enforce proper HTML markup, but lately I've been trending towards the best practice since it seems like you and Rob want to do things slightly differently at times and I want the CSS to be as low maintenance as possible.

@davidfarmer
Copy link
Contributor Author

Yes, we need to support both h1 and h5 (and nothing else) for the title of a Theorem.

But right now (actually, when I looked a couple hours ago), putting class="heading" made
the word Theorem disappear.

I don't understand the argument against allowing a classless h1 or h5 for the title of a theorem.
In particular, I don't see the value of supporting someone marking up the theorem title
with a different type of element.

@mxdubois
Copy link
Contributor

mxdubois commented Aug 7, 2014

The goal is to decouple the CSS from the HTML. The CSS should not have to know what HTML element is being used. Instead, the CSS should provide a contract to you and Rob. If you use these classes, you will get these styles.

Theory aside, I think the fact that we couldn't agree on the correct hX element to use is a good concrete example of why decoupling the two is important. And if we were to follow the old HTML model for headings, instead of the new model (h1s within <section> or <article> contexts) or the arbitrary model (h5s regardless), then the hX element would vary depending on the nesting level of the section/environment.

By providing a separate contract that requires class="heading", I've allowed you to decide what element works for you.

@davidfarmer
Copy link
Contributor Author

Okay, I'll add the class="title" and Rob will have to add a hide-title
class.

On Wed, 6 Aug 2014, Michael DuBois wrote:

The goal is to decouple the CSS from the HTML. The CSS should not have to know what HTML element is being used. Instead,
the CSS should provide a contract to you and Rob. If you use these classes, you will get these styles.

Theory aside, I think the fact that we couldn't agree on the correct hX element to use is a good concrete example of why
decoupling the two is important. And if we were to follow the old HTML model for headings, instead of the new model (h1s
within

or contexts) or the arbitrary model (h5s regardless), then the hX element would vary depending
on the nesting level of the section/environment.

By providing a separate contract that requires the class heading, I've allowed you to decide what element works for you.


Reply to this email directly or view it onGitHub.[211500__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMjk5MjgzMSwiZGF0YSI6eyJpZCI6MzkwMjIxMzl9fQ==--aed158
dd17f9782f904949109b0dd13ff33d456c.gif]

@davidfarmer davidfarmer changed the title Space after number in seciton title Space after number in section title Aug 7, 2014
@mxdubois
Copy link
Contributor

Actually, looks like this is still an issue. Sorry guys. It was working before... :-/

@mxdubois mxdubois reopened this Aug 12, 2014
@mxdubois
Copy link
Contributor

Here's an example where it's broken:
http://sl2x.aimath.org/development/collectedworks/htmlpaper/3094497/section2.html

One catch is that sometimes the class counter shows up where it should be codenumber. Lemma 2.2.1 exemplifies this. Switching it to codenumber does not fix it, though.

@mxdubois
Copy link
Contributor

This is in develop now. If you're still having trouble with it, double check that codenumbers are given the codenumber class instead of the older counter class.

@davidfarmer
Copy link
Contributor Author

Seems to work for me, but the "type" still seems to be hidden by default.

On Wed, 13 Aug 2014, Michael DuBois wrote:

This is in develop now. If you're still having trouble with it, double check that codenumbers are given the codenumber
class instead of the older counter class.


Reply to this email directly or view it onGitHub.[211500__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMzU5MjgxNCwiZGF0YSI6eyJpZCI6MzkwMjIxMzl9fQ==--21015f
ce1a2a8167ebbe9e6401be5b4456dc6007.gif]

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