Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 155 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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.

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer
    
Cool. That takes care of italics, but the <b> tag doesn't seem to work. However, the <strike> tag does. – raven Jul 16 '09 at 0:14
    
Try <strong> instead of <b>. – Joel Jul 16 '09 at 0:21
<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
share|improve this answer
    
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 Jul 16 '09 at 0:07
    
See my edit: this is not the case. – Nick Jul 16 '09 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 Jul 16 '09 at 0:29

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>
share|improve this answer

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.

share|improve this answer

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

asdfoao2 23r0 qBWEFwja
ao293f8S w345 AESFQ2er

share|improve this answer
2  
You can't bold/italicize items in a code block. Also it may try to apply syntax highlighting on certain words. – TheTXI Jul 15 '09 at 23:45

You must log in to answer this question.

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