LaTeX forum ⇒ LyXnumbering (sub(sub))sections in minipage independently

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

numbering (sub(sub))sections in minipage independently

Postby Stef Pillaert » Wed Apr 03, 2019 2:53 pm

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/316494/how-can-i-make-a-fake-subsection-number/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

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

Postby Stef Pillaert » Tue May 21, 2019 9:19 am

OK, probably not possible too achieve this ...
Stef

User avatar
Ijon Tichy
Posts: 60
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Tue May 21, 2019 10:20 am

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.


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 2 guests