As per the SO question here (if you want to know how they did something there, take a look at the source, as per the hack documented here), I suggest that this (CW) question be used for testing purposes. Feel free to edit this question, add answers, experiment with deletion or markdown or what-have you.

Use this Markdown Editing Help reference as a guide, or this tome if you want to know every detail.

I'll take this question down if the community thinks that it is inappropriate, but if it is appropriate, we could have something like it pointed to in the FAQ and in the markdown manual.

  • Not a duplicate of this LaTeX sandbox proposal Commented Jul 30, 2010 at 19:53
  • See this page for information on comment markup. Commented Jul 30, 2010 at 19:59
  • Has nothing to do with LaTeX sandbox porposal...but if this is confusing I'll edit to make it clear. Commented Jul 31, 2010 at 1:17
  • Testing backslashes in comments: \ ~ <bt><bt>\<bt><bt>; \\ ~ <bt>bt>\\<bt><bt>; \ ~ <bt><bt>\ <bt><bt>. Here <bt>=`.
    – Werner Mod
    Commented Jan 3, 2013 at 0:31
  • @Werner -- i think one of those bracketed bts has a left angle missing. (thanks for the pointer.) Commented Mar 26, 2013 at 19:31
  • Single quote comment (with leading spaces): ` code`
    – Werner Mod
    Commented Apr 11, 2022 at 18:49
  • Double quote comment (with leading spaces): `` code``
    – Werner Mod
    Commented Apr 11, 2022 at 18:49

9 Answers 9


Typesetting backslashes, backticks and spaces:

  2. \
  3. \
  4. \\
  5. `
  6. ``
  7. `
  8. ``` ``
  9. ``
  10. ``` `
  11. \`
  12. \`

Use HTML formatting mixed with markdown for spaces.

1. &nbsp;
2. \\
3. `\`
4. `\\`
5. <code>\&nbsp;</code>
6. `
7. ``
8. <code>`</code>
9. ``` ``
10. <code>``</code>
11. ``` `
12. <code>\\`</code>
13. ``\` ``
14. <code>&nbsp;</code>

Link testing:

Taken from In comments - how do I highlight with back-ticks when the last character is a backslash:

Here are the rules for inline code in posts and comments.

POSTS: If you want backticks inside an inline code snippet, surround them with any amount of backticks not used in the code. Examples:

  • ``this is a `backtick` thing`` renders as this is a `backtick` thing
  • ````here are one ` two `` three ``` backticks```` renders as here are one ` two `` three ``` backticks
  • Use spaces if backticks are at beginning or end - `` $` `` renders as $`
  • `testing testing\`123`testing` renders as testing testing\123testing

COMMENTS: Simply use \ to escape backticks. Limitation: you can't escape backslashes, so you can't have a backslash at the end of an inline code snippet. Also, `test`123`test` doesn't work.

  • `this is a \`backtick\` thing` renders as this is a `backtick` thing
  • etc.
  • `testing testing\ `123 `testing` renders as testing testing\ 123 testing

Here's an answer which can be used as sandbox answer. Feel free to edit if you wish to try markdown. Below the line would be good. So, the question doesn't remain unanswered.

Here's a funny formatting trap: code after a list item doesn't format: Why do code snippets not work after lists? The solution is to insert an HTML comment between the list item and the code:

  • A list item


  • Another list item with <!> after it and some following code: (needs to be separated by blank lines):



sub run_command (@) {
    my $origcmdline = join(" ", grep {defined} @_);
    return if $origcmdline eq "";

    my $cmdline = $origcmdline;

description lists

penalty for page break just before a display

doesn't look very promising in preview…


Hm, would've been nice

  • A list
  •   Some code

(See LaTeX Editors/IDEs.)

Bla bla bla*.*
Bla bla bla_._
Bla bla bla.

The text is from http://el.wikipedia.org/wiki/Αθήνα foo

  • @morbusg: Interesting, description lists should work according to meta.stackexchange.com/questions/1777/….
    – doncherry
    Commented Apr 9, 2012 at 12:50
  • 2
    @doncherry They do, at least the HTML tags show up in the source code. However, as there is no CSS to format them, the result is not very pretty. See also the feature request Better style for HTML 'definition list' <dl> elements on meta.SO.
    – diabonas
    Commented Apr 9, 2012 at 13:34
  • <code>\\</code>
    – Canageek
    Commented Jul 31, 2012 at 22:58
  • 1
    \, \\... Commented Aug 1, 2012 at 7:30
  • With this setup, does the font for regular text come from the charter package or mathdesign? Switching the order of \usepackage{charter} and \usepackage[charter]{mathdesign} produces different outputs. Also, the latter setup complains about Font shape T1/bch/m/fsc undefined(Font) .. (small caps?)
    – DCh
    Commented Apr 10, 2014 at 17:15

Just testing some entities:

&#211hello; in the preview produces Óhello; What happens in the main?


Strike out works.

  • does this work \\ more text? Commented Nov 19, 2021 at 22:05
  • this should work \\​ ... Commented Nov 19, 2021 at 22:11

Shrt nswrs r k.​​​

  • cmmnt.
    – yo'
    Commented Jan 13, 2013 at 21:07

Trying to see if I can put in < and >:

$1 > 2$ while $2 < 3$.  \\
Seems to be OK with new stuff.

Code inside list is indented by more space (twice more than the usual):


This is code because four spaces go before me.
  • This is a bullet!

    I am not code even though there are four spaces before me. But, if eight spaces precede me, I'll be one.

    Like this.
  1. a list
    1. with stuff
  2. in it

Testing link prettification for https URLs: Formatting Sand-Box

Testing link prettification for http URLs: Formatting Sand-Box

Testing link prettification for protocol-less URLs: //meta.tex.stackexchange.com/q/208/21344


Made this JSFiddle script for basic markup + latex editing / printing.

Allows to:

  • Copy-paste src (original, markup with rendered math, html with rendered math) to a math question.
  • Print rendered HTML.

** EDIT: Just found out about https://hackmd.io/ which does a very good job for latex sandbox and more.


Just a sandbox post, please ignore.

The code iterates through different combinations of jot, baselineskip, lineskip, and create a normal gather environment and a array environment. Then for each item use zref-savepos to measure the vertical distance between the 2 lines, then report the result.

Replace \pretty with \tl_show if you want. (will print the log on the terminal)

rendered document

The log: (there are 2 wrong entries unfortunately...)

result log

%! TEX program = lualatex


\def \__index {0}
\clist_map_variable:nNn {
 } \__a {

 \edef\__index{\int_eval:n {\__index+1}}

 \def \__match #1/#2/#3/ {
 \expandafter \__match \__a/


%\savebox\strutbox {}

 a=b \zsavepos{a\__index} \\
 \dfrac22 \zsavepos{b\__index}


\dim_compare:nNnTF {\baselineskip} = {0sp} {
 \edef\customskip{\dim_to_decimal_in_sp:n{\dimexpr\lineskip+\jot\relax} sp}
} {
  a=b      \zsavepos{c\__index} \copy\strutbox \rule[\dimexpr-0.3\dimexpr\oldbaselineskip\relax\relax]{0pt}{\dimexpr\oldbaselineskip\relax} \\[0pt] \\[\customskip] \\[0pt]
  \dfrac22 \zsavepos{d\__index} \copy\strutbox \rule[\dimexpr-0.3\dimexpr\oldbaselineskip\relax\relax]{0pt}{\dimexpr\oldbaselineskip\relax}

 \int_eval:n{\zposy{a\__index} - \zposy{b\__index}}sp
 \int_eval:n{\zposy{c\__index} - \zposy{d\__index}}sp

 {\zposy{a\__index} - \zposy{b\__index}}
 {\zposy{c\__index} - \zposy{d\__index}}




You must log in to answer this question.

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