Problem with using CSS counters to create numbered paragraphs

jim.cook's Avatar

jim.cook

11 Oct, 2018 01:05 PM

Hi
I'm using a CSS based on Outline Numbering to generate a document with outline numbered headings and numbered paragraphs. A segment from the CSS:

h1:before {
    content: counter(chapter) ". ";
    counter-increment: chapter; /* add 1 to chapter /
}
h1 { color: #000; counter-reset: subchapter; /
set section to 0 */ } h2:before { content: counter(chapter) "." counter(subchapter) " "; counter-increment: subchapter; } h2 { color: #111; counter-reset: section; }
This works fine during preview in the Marked 2 screen, for example a heading renders as "10.Responsibilities" and the subsequent paragraphs, prefixed by ## in the markdown, number as 10.1 and 10.2 etc. It used to work fine for PDF as well, however now when I export to PDF (continuous or paginated) the subchapter numbers don't increment, ie the above renders as 10. Responsibilities and then 10.1 and 10.1.

When I export to HTML the subchapter numbers increment correctly.

I've attached the CSS file I'm using, together with the input markdown document and the output PDF.

Thanks for your help
Regards
Jim

  1. Support Staff 1 Posted by Brett on 11 Oct, 2018 03:17 PM

    Brett's Avatar

    I'm able to replicate this issue, but not readily able to explain it. I don't have an immediate solution but will add it to my list of bugs to tackle before the next update.

  2. 2 Posted by jim.cook on 11 Oct, 2018 03:45 PM

    jim.cook's Avatar

    Hi Brett
    Thanks for your quick response, and also for a great product.
    I have to ask…
    Any ETA for next update?
    Rgds
    Jim

  3. Support Staff 3 Posted by Brett on 11 Oct, 2018 03:47 PM

    Brett's Avatar

    I try to get them out weekly, but some take longer than others...

  4. 4 Posted by jim.cook on 11 Oct, 2018 03:48 PM

    jim.cook's Avatar

    Awesome
    Thanks
    Rgds Jim

  5. 5 Posted by jim.cook on 21 Oct, 2018 07:28 AM

    jim.cook's Avatar

    Hi Brett
    Any progress on this problem?
    And I seem to have created this support request as a private thread, can you/do you want to make it public? It would be easier to check on progress that way.
    Thanks for your help
    Regards Jim

  6. Support Staff 6 Posted by Brett on 21 Oct, 2018 12:50 PM

    Brett's Avatar

    I'm afraid that thus far it's remained a mystery to me, but I am still working on it as one of the last things I'd like to solve before pushing out the next update.

    I'll go ahead and make the conversation public.

  7. 7 Posted by jim.cook on 21 Oct, 2018 04:26 PM

    jim.cook's Avatar

    That’s great, thanks for the update and good luck with the bug.

    Regards
    Jim


    www.linkedin.com/in/jimcook42

  8. 8 Posted by jim.cook on 26 Nov, 2018 10:55 AM

    jim.cook's Avatar

    Hi Brett
    I just installed Version 2.5.27 (964) but I'm afraid the numbered paragraph problem is still there.

    Were you expecting this release to fix this problem?

    Could it be a problem with the CSS?

    Regards
    Jim

  9. Support Staff 9 Posted by Brett on 26 Nov, 2018 01:26 PM

    Brett's Avatar

    This was the one bug on my list that I had to leave hanging to get the last update out. It's been a baffling issue thus far.

    It's not an issue with the CSS, something is happening at export that's causing counters to reset. It's even happening with my built-in outlining capabilities, so this is a high priority fix for me.

    -Brett

  10. 10 Posted by jim.cook on 30 Dec, 2018 01:47 PM

    jim.cook's Avatar

    Hi Brett
    I've just installed Version 2.5.28, hoping that the counter reset problem had been fixed. Regrettably as far as I can see it seems to be still broken.
    Were you expecting it to be fixed?
    This bug is preventing me using Marked 2 for any real work at the moment, which is a shame.
    Regards
    Jim

  11. 11 Posted by jim.cook on 07 Jan, 2019 09:50 AM

    jim.cook's Avatar

    Same problem with 2.5.29, still no fix.
    Any chance of an update Brett?
    Regards
    Jim

  12. Support Staff 12 Posted by Brett on 07 Jan, 2019 01:03 PM

    Brett's Avatar

    I'm aware of the failure to fix it thus far, but I am still working on it.

    - Brett

  13. 13 Posted by jim.cook on 07 Jan, 2019 05:59 PM

    jim.cook's Avatar

    Hi Brett
    Thanks for the update.
    Good luck!
    Rgds
    Jim

  14. Support Staff 14 Posted by Brett on 10 Jan, 2019 03:00 PM

    Brett's Avatar

    Actually, the issue I was seeing is in fact fixed. If you remove your counters from your custom CSS, turn on Outline Mode->Decimal from the gear menu on the preview, you'll see that the built in CSS is working and exporting fine. (I found I needed to have an h1 header and then increment the levels of all following headers, or use MMD meta for base header level: 2.

    I haven't had time to diagnose the CSS you're using, but I'm fairly certain at this point the issue you're still seeing would be in the CSS you're using. If you disagree, please let me know!

  15. Support Staff 15 Posted by Brett on 10 Jan, 2019 03:03 PM

    Brett's Avatar

    Here's the output I'm seeing (using the built-in outline mode): http://ckyp.us/cOrji4

  16. 16 Posted by jim.cook on 11 Jan, 2019 06:26 PM

    jim.cook's Avatar

    Hi Brett
    Thanks for the update.
    I've been stacked up with other tasks over the past few days but I'll
    take a look as soon as poss.
    Have a great weekend,

    Regards
    Jim

    --
    Jim Cook
    M: +44 (7785) 558432

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Dignity_At_Work_Policy-_Bullying_And_Harassment_In_The_Workplace.md 14 KB
  • Numbered_paragraphs_Jim.css 7.76 KB
  • Dignity_At_Work_Policy-_Bullying_And_Harassment_In_The_Workplace.pdf 57.5 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac