This is a variation on the theme of How to <mark> code fragments in org-export.
Here the question is about making portions of src
and example
blocks stand out (preferably without breaking the syntax highlighting in the source blocks) in the org mode buffer itself, rather than during export.
Once again,
- the highlighting should appear without the reader's intervention
- fragments of lines should be highligtable.
Is there some not too painful way of doing this?
Edit to clarify:
The portions to be highlighted should be explicitly specified by the author, by some kind of markup (or perhaps by specifying the regions which should be highlighted in some annotation of the block), analogously to the way it was done in the linked question.
This markup could be the standard org =...=
, /.../
and *...*
, but I would be perfectly happy with other possibilities such as {{...}}
or even <mark>...</mark>
, appearing within the src
and example
blocks, but being treated as markup rather than being rendered verbatim. Just like <mark>...</mark>
and {{{...}}}
were used in the linked question and the accepted answer therein.
As for the appearance of the highlighting, I was thinking along the lines one of
- a different face or overlay for the highlighted portions,
- de-emphasize everything outside the highlighted portions à la
fancy-narrow
orace-jump
.
Background
I am looking for this in the context of trying to make presentations which discuss source code and the output it generates. I want to be able to attract attention to different portions of the source code and its output at different times (on different 'slides') according to what is being discussed at any particular moment.
It would also be important to keep the absolute position of the source code and any displayed output stable on the screen as the discussion (of that particular snippet) progresses. It would be fine (perhaps even desirable) for the positions to change once the discussion moves on to a different bit of code.
It would also be interesting to take advantage of the width of the screen, by positioning at least one of the three components
- discussion
- source code
- output
further to the right, next to rather than below the others.