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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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