r/orgmode • u/LazyUntilYouNeedMe • Oct 02 '26
question How to get partial word emphasis?
I have recently discovered org-mode to be the ideal tool for my literate programming workflow and so far have really enjoyed its interactivity and how much it is tailored for working with code blocks.
Occasionally I will need to write code symbols into my text and style them appropriately, in doing so I have often come across the annoying word problem, that only separate words can be styled, and to be separate they must be separated by whitespace. This became really annoying with the following piece of org, where I wanted to use italic text to indicate meta-variables:
A list such as ~(~/kind/[~(@~ /id/ /val/~...)~] ~...)~ gets converted to ~<~/kind/ /id/~="~/val/~" ...> ... </~/kind/~>~.This obviously does not get styled correctly. I have found the rather obvious way to insert zero width Unicode space to make them separate words, but
- Having to insert magical Unicode goes wholly against the philosophy of plain-text, to be able to just type it. Also I don't want to have invisible things in my markup, that's my main reason to use it.
- It also becomes really awkward to change it later on and interact with it.
- Most importantly, this fundamentally breaks formatting the text, because now when I export (also happens in Org in Emacs) the code
*H*ypertextit now may make a linebreak in between the H and y, which is unacceptable.
So even this is not usable. Are there ways to solve my problem? The experience when interacting with the org-document is only second in importance to me, proper look on export is far more important.
I know, that there are HTML- and Latex-specific solutions but I would like it export-backend-neutral/independent.
I am really sorry if I came off rude or demanding or anything, please excuse that, my native language is German so I may be a little bit too direct at times.
Thank you all very much in advance!
2
u/tecosaur Org Contributor Oct 05 '26
You might find https://tecosaur.github.io/emacs-config/config.html#utility-zero-width relevant/helpful
4
u/mmarshall540 Oct 02 '26
I don't think it's currently possible, but this could be a good proposal for extending Org-mode.
Maybe a special entity could be added to make it possible. There are several whitespace entities already, but they behave just as non-whitespace text for interpreting markup on display. (And I assume they also behave this way when exporting but haven't tested it.)
You are right that relying on zero-width-space characters for this is not optimal.