4

There are times when using a fixed-width font adds significantly to the readability of the text. It would be nice if we could mark a block of text as using a fixed-width font. I know this can be done with the Code Sample markdown, but that syntax colors it and prevents other markdowns, like bold and italic, from working. Sometimes I just want a fixed-width font.

Okay, this works:

bold italic strike

Just have to use HTML instead of markdown.

5 Answers 5

11

Or you can use pre

Some fixed width text with formatting 

was created with:

<pre>
Some fixed width text <em>with formatting</em> 
</pre>

See the help file for all the editor details.

2
  • Cool. That takes care of italics, but the <b> tag doesn't seem to work. However, the <strike> tag does.
    – raven
    Commented Jul 16, 2009 at 0:14
  • 1
    Try <strong> instead of <b>.
    – Joel
    Commented Jul 16, 2009 at 0:21
4
<pre> tags seem to do the trick

following text does not have to be fixed width

The Markdown looks like:

<pre>&lt;pre&gt; tags seem to <b>do</b> the <i>trick</i></pre>

following text does not have to be fixed width
3
  • But then all the code following it is fixed width as well. Put a closing tag on it and that italic won't be italic anymore.
    – raven
    Commented Jul 16, 2009 at 0:07
  • See my edit: this is not the case.
    – Nick
    Commented Jul 16, 2009 at 0:10
  • 4
    It shows up okay for me; my fixed-width font is Consolas but I know some other fonts don't distinguish bold very well. Maybe thats the problem?
    – Nick
    Commented Jul 16, 2009 at 0:29
2

As others note, <pre> works. But i wouldn't mind seeing <tt> supported, for those occasions where you want to publish console output in an appropriate fixed-width font.

0

Isn't <code>code</code> fixed-width?

asdfoao2 23r0 qBWEFwja
ao293f8S w345 AESFQ2er

1
  • 2
    You can't bold/italicize items in a code block. Also it may try to apply syntax highlighting on certain words.
    – TheTXI
    Commented Jul 15, 2009 at 23:45
0

It seems to work fine for me:

<code><b> Bold    multiple spaces with &nbsp; </b></code>

<code>&lt;code&gt;<b>&lt;b&gt; Bold&nbsp;&nbsp;&nbsp;&nbsp;multiple spaces with &amp;nbsp; &lt;/b&gt;</b>&lt;/code&gt;</code>

You must log in to answer this question.

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