friendly-snippets icon indicating copy to clipboard operation
friendly-snippets copied to clipboard

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

Open andrasbarany opened this issue 1 year ago • 2 comments

\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?

andrasbarany avatar Feb 19 '24 17:02 andrasbarany

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.

  • iirc the package ulem has \emph result in underlined text

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!

OkelleyDevelopment avatar Feb 25 '24 05:02 OkelleyDevelopment

Hey @OkelleyDevelopment,

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

andrasbarany avatar Mar 20 '24 17:03 andrasbarany