LyXnumbering (sub(sub))sections in minipage independently

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Stef Pillaert
Posts: 51
Joined: Sat Oct 22, 2016 3:43 pm

numbering (sub(sub))sections in minipage independently

Post by Stef Pillaert »

In a tutorial, I want to make a box/minipage, where I "show" to my students how (sub(sub))sections should be numbered. In the minipage, I have a small example of text, including a few (sub(sub))section headings.
Of course, I don't want the numbering of the example to have any influence on the actual numering of my tutorial itself.
I managed to do this using the first solution mentioned here: https://tex.stackexchange.com/questions ... ber/316497.
This works fine for the final pdf I produce, but unfortunately my numbering within LyX is not fooled by this trick. This makes my TOC and numbering in LyX very confusing...
Is there an easy way to make my LYX-version also have the desired effect?
Thanks,
Stef

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stef Pillaert
Posts: 51
Joined: Sat Oct 22, 2016 3:43 pm

numbering (sub(sub))sections in minipage independently

Post by Stef Pillaert »

OK, probably not possible too achieve this ...
Stef
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

numbering (sub(sub))sections in minipage independently

Post by Ijon Tichy »

Using a KOMA-Script class you could define completely independent sectioning commands using \DeclareNewSectionCommand. In LyX you can do so adding suitable code to your preamble. But LyX will not know such commands, so you have to put them into your box using ERT.

Another suggestion would be to use an external document for those code/result and include them using package listings and graphicx. There is even a package on CTAN for LaTeX example code and resulting images side by side.

So the main problem is using LyX. But it is possible with LyX too, if only you know enough about LaTeX to use ERT.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply