4
$\begingroup$

Is there a way to italicise part of a work? I wanted to write *un*sure, but this doesn't work because the "un" is part of the word. However, un-sure works. Is there a better way?

EDIT: I wanted to use it in a comment. So something which works in a comment would be useful.

$\endgroup$
  • $\begingroup$ Related meta.SO post: Allow Italics Mid-Word. It is marked status-completed, but it is mentioned there that it does not work in comments. $\endgroup$ – Martin Sleziak Nov 5 '13 at 12:56
  • 1
    $\begingroup$ All the hacks with Mathjax are gratuitously inaccessible. $\endgroup$ – dfeuer Nov 5 '13 at 17:26
  • $\begingroup$ Back in 2009, Atwood described the creation of "mini-Markdown" (how he calls the subset of Markdown implemented in comments here) on his blog, with a focus on when to turn asterisks into italics. $\endgroup$ – user103254 Nov 6 '13 at 1:34
1
$\begingroup$

Using MathJax is a solution, which works both in question/answer bodies and in comments. However, it gives you another font, but it might be a decent hack nevertheless.

$un$sure: $un$sure

$\endgroup$
  • $\begingroup$ \$un\textrm{sure}\$ -> $un\textrm{sure}$ $\endgroup$ – user7530 Nov 5 '13 at 15:10
  • 1
    $\begingroup$ That also works, but then it's more obvious that $the$ $\textrm{font has changed}$. $\endgroup$ – Daniel R Nov 5 '13 at 15:14
  • $\begingroup$ Ahh, good point $\endgroup$ – user7530 Nov 5 '13 at 15:22
  • $\begingroup$ Also, unfortunately mathjax doesn't support that much text manipulation. So something like $\rtextnormal{\emph{un}sure}$ doesn't work. $\endgroup$ – user1729 Nov 5 '13 at 15:35
  • 2
    $\begingroup$ The solution $un$sure also has the disadvantage that, if you're unlucky, a line break might occur between "un" and "sure". $\endgroup$ – Will Orrick Nov 5 '13 at 21:46
  • $\begingroup$ I accepted this one on the basis that it is the only option which works in the comments. $\endgroup$ – user1729 Nov 6 '13 at 10:23
4
$\begingroup$

Use the <i> HTML tag:

<i>un</i>sure: unsure


NB. Does not work in comments.

Edit by dfeuer: Even better, use <em>un</em>sure unsure, which expresses the semantic intent and should thus be better for users who use custom stylesheets, unless Markdown screws it up.

$\endgroup$
  • $\begingroup$ <i>un</i>sure. Does not work in comments. $\endgroup$ – Lord_Farin Nov 5 '13 at 11:51
  • $\begingroup$ Or cheating with MathJax: $un$sure: $un$sure $\endgroup$ – Daniel R Nov 5 '13 at 11:54
  • $\begingroup$ Yeah, I wanted to use it in a comment. Using $un$sure works, but it gives you a different font. It is a decent hack though - and you (@DanielR) should post it as answer. $\endgroup$ – user1729 Nov 5 '13 at 11:58
  • $\begingroup$ @user1729 Done! $\endgroup$ – Daniel R Nov 5 '13 at 12:13
  • $\begingroup$ This is by far the best solution as it is by far the least likely to trip up a system like emacspeaks, which will likely voice the other proposals completely incorrectly. $\endgroup$ – dfeuer Nov 6 '13 at 2:26
3
$\begingroup$

You need to separate two "words" without having visible space. There's a way to do that: a zero-width space. *un*&#8203;sure gives un​sure.

Edit: unfortunately, empirically this doesn't work in comments, even if you copy-paste the ZWS rather than using an HTML entity.

To save other people trying, I've also tested *un*$$sure (renders all of those characters) and *un*${}$sure (renders the asterisks, and if you then edit the comment also renders the dollars and braces).

$\endgroup$
  • 1
    $\begingroup$ And just to check that it works in comments too: *un*&#8203;sure. $\endgroup$ – Peter Taylor Nov 5 '13 at 14:32
  • $\begingroup$ Ok, copy-pasting: *un*​sure. $\endgroup$ – Peter Taylor Nov 5 '13 at 14:33
  • $\begingroup$ How about *un*$$sure or *un*${}$sure? $\endgroup$ – Peter Taylor Nov 5 '13 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .