I always refer to org mode when I want to document anything, but what I am struggling with right now is how to make folding mechanism work when my headers contain source code blocks under a list element. Consider the MWE below:
* Main Subject
** Fonts
*** \definefont
- ~\definefont [TitleFont] [Serif sa 2.4]~
- ~\definefont [TitleFont] [Serif]~ means ~\definefont [TitleFont] [Serif sa *]~ which in turn expands into the current actual font size, after the application of size corrections for super and subscripts
- this creates a macro name for a font switch, =\TitleFont= in this example ~{\TitleFont anytext}~
*** \definedfont
- ~\definedfont [...]~ inherits from \definefont
*** \definebodyfont
- ~\definebodyfont [10pt] [rm] [tf=tir at 10pt]~ This single line actually defines two font switches =\tf= for use after a =\rm= command, and =\rmtf= for direct access
- End
- Example-1: of using different font sizes for Computer Modern Roman font
#+BEGIN_SRC tex
\definebodyfont [12pt] [rm]
[tf=cmr12,
tfa=cmr12 scaled \magstep1,
tfb=cmr12 scaled \magstep2,
tfc=cmr12 scaled \magstep3,
tfd=cmr12 scaled \magstep4,
bf=cmbx12,
it=cmti12,
sl=cmsl12,
bi=cmbxti10 at 12pt,
bs=cmbxsl10 at 12pt,
sc=cmcsc10 at 12pt]
#+END_SRC
- Example-2: for Helvetica Type 1 font
#+BEGIN_SRC tex
\definebodyfont [12pt] [ss]
[tf=hv sa 1.000,
bf=hvb sa 1.000,
it=hvo sa 1.000,
sl=hvo sa 1.000,
tfa=hv sa 1.200,
tfb=hv sa 1.440,
tfc=hv sa 1.728,
tfd=hv sa 2.074,
sc=hv sa 1.000]
#+END_SRC
My struggle is to hide the visibility or folding of the header Example-1
and Example-2
in org. What is the best strategy in org-mode to document such code chunks? May be I am using it the wrong way. Please note I want to stick with the way org mode writes code blocks because of its ease and breeze, I just type <s
and then TAB and this will extend nicely to a source block template. I would like to continue using this nice feature in org mode, yet with the folding mechanism inherent of Org-mode document structures also in place.
Note
Org mode version 9.1.13