Line numbers and title in code blocks

What I’m trying to do

I’m documenting steps on how to setup some hardware on my computer. Since this includes writing many script, I want to be able to show

  1. Line numbers (to reference and explain parts of the code in the footnotes)
  2. The script name.

What I tried

As for (1), I’m happy with the plugin “Code Block Enhancer”. However, it doesn’t work well together with the possible plugins I found to solve (2): the plugin “Admonition” or “Embedded Code Title”. Here is the code and the preview for both those combinations:


As you can see, in both cases, the numbering is broken (and with the “Embedded Code Title” plugin even the title itself). How would you go about it? So far, I always write the script name before the code block. However, in my eyes, especially the Admonition box makes it much more obvious at first glance, that title and code belong together.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.