rafamadriz / friendly-snippets

Set of preconfigured snippets for different languages.
MIT License
1.99k stars 450 forks source link

LaTeX: Using * as a snippet for emphasis rather than italics #405

Open andrasbarany opened 7 months ago

andrasbarany commented 7 months ago

\textit and \emph give the same output in many contexts in LaTeX. But \emph is a semantic markup command which can be used recursively, that is if a first call of \emph makes text italic, a second call of \emph inside it will make the text upright again. \textit simply outputs italic text in every context.

In the logic of LaTeX, \emph is preferable in many contexts. Given this, would it be an option to change the snippet * to expand to \emph rather than \textit?

OkelleyDevelopment commented 7 months ago

Hey @andrasbarany :wave:

While I see your reasoning, I don't think we should modify that snippet to use \emph because some packages would cause a different behavior and not the usual italics that \textit would provide.

That said, the \emph snippet could have it's prefix updated so that when * is typed two options are presented. Thus allowing for a quick selection of the snippet you'd like.

Let me know your thoughts and feel free to open a PR if you have other ideas!

andrasbarany commented 6 months ago

Hey @OkelleyDevelopment,

thanks for the quick reply. I see your point, I think showing two options for * would be a good solution, too!