10
`\` 

should be rendered as an escaped backslash but it actually ends up displayed as an escaped backtick.

12
  • Just to test the rendering: ``. Commented Jul 31, 2009 at 13:36
  • Looks like \` just escapes the backtick and prevents it from forming a code section. What's wrong with that? Escaping is good!
    – Welbog
    Commented Jul 31, 2009 at 13:45
  • 5
    Note, to form the output \` I needed the following sequence: backtick, backslash, backslash, backtick, backtick. Which makes sense. I'm escaping the backslash so that it doesn't escape the backtick, and enclosing both the slash and backtick in a code section.
    – Welbog
    Commented Jul 31, 2009 at 13:47
  • 3
    @Toronto: The problem is not the escaping convention. The problem is that one needs a different escaping convention in comments to that used for the body of qns&answers. Commented Oct 5, 2010 at 8:10
  • 1
    @ALLCAPS: I think this is not quite the correct explanation: In comments, the backslash doesn't need an escape (in fact, it can't be escaped), and the 2nd backslash does escape the backtick. In other words: Since a backtick needs to be escaped with a backslash, you need to type another backslash. Commented Jan 24, 2011 at 16:24
  • @Stijn Jeff posted an answer at the same time he added the status-declined tag, stating that XMLbog's reasoning meant that the current behavior is correct. He deleted his answer after Hendrik Vogt's comment. Commented Jul 3, 2014 at 9:38
  • @Gilles ah, that clears it up then. But it's still a bug, right? No matter what I try, I'm not able to get it right.
    – Stijn
    Commented Jul 3, 2014 at 9:44
  • 2
    @Stijn enjoy and when marking a bug as "by design" it's the same as declining a feature request i.e. "that's how the system works and we're not going to change it". But then of course, the team is now very different, they might change their (Jeff's :-)) mind. :) Commented Jul 3, 2014 at 10:20
  • So... to conclude... how do we write a backslash with code tags in a comment?
    – Dan
    Commented Sep 18, 2014 at 6:42
  • 2
    @Dan If the backslash is not the last character in the code span, you don't have to do anything special. If it is the last character, enclose the span with double backticks like this: ``\`` Commented Nov 2, 2014 at 0:11
  • Testing double backticks: \ — Edit: works! :)
    – myrdd
    Commented Dec 4, 2018 at 16:30
  • On MSO: Backslash inside backquotes in a comment. Commented Sep 19, 2020 at 9:07

2 Answers 2

5

But it is a pain and not obvious for the tex.stackexchange.com

Since the same sequence is rendered differently in the question/answer vs comment.

Please see

Backslash in ticks in comments

with transcripts on tests in question vs comments.

How come it is bydesign that questions and comments are treated differently with the same syntax?

1
  • "How come it is bydesign that questions and comments are treated differently with the same syntax?" Because comments only support a subset of Markdown syntax. They don't support images, either, and for good reason. Commented Nov 2, 2014 at 18:35
0

workaround using double backticks — (already mentioned by @ThisSuitIsBlackNot)

Write

``\``

and you will get \.

You must log in to answer this question.

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