I’m a law student and I would like to be able to have a hotkey to highlight certain text and turn it small-caps as it is an important part of legal formatting.
With a bit of googling I found this plugin, it seems like their “custom wrapper” function may be what you’re looking for.
You could use a snippet like the one above (which is more portable if you’ll be transferring these markdown files by themselves and want them to retain their formatting), so a custom wrapper with <span style="font-variation:small-caps;"></span>
If you care about the brevity of your markdown over its portability (i.e. it’ll only render small caps with following css setup), consider adding the following CSS snippet; with it, you could create a custom wrapper <span data-sc></span> that I think would do what you want:
Set the name, the start and end tag, give it a hotkey if you’d like, and restart Obsidian. Any text you select will be wrapped in the tags when you run the command / hotkey.
Rather than <span style="font-variation:small-caps;"> I suggest using a class name that indicates the nature of the text, like <span class="definition">. Then in a CSS snippet put .definition {font-variation:small-caps;}. This is more semantic and makes the text less cluttered, plus it lets you restyle every definition at once if needed. (That can get nasty when you use ad-hoc styles.)