0
$\begingroup$

What are the ways to use a monospaced font in a Puzzling StackExchange question? If there are multiple ways, is there a preferred way?

$\endgroup$

1 Answer 1

2
$\begingroup$

Code block font is monospaced and probably the most common form across the network.

You can add it with a ` before and after your text.

You can also prefomat text
by adding 4 spaces before it

There is also the less common $\mathtt{mathjax}\ \mathtt{typewriter}\ \mathtt{font}$ which is also monospaced, but a bit of a hassle to implement. You can add this with $\mathtt{}$ and add your text in between the curly brackets, but this won't add spaces.

Overall, I would recommend the code block option, as this is most common


(In reply to comment:)

ABCDE
X Y Z

or

ABCDE
X Y Z

$\endgroup$
6
  • $\begingroup$ Thanks. The code block font gives me a monospaced font but it won’t work well for multiple lines of text. I want to have the i-th character of each line to be lined up vertically. As an example, if I have ABCDE on the first line and X Y Z on the second line, I want the C&Y to be aligned as well as the E&Z. $\endgroup$ Commented Sep 12, 2022 at 20:11
  • $\begingroup$ @WillOctagonGibson you can still do that, edited it in! $\endgroup$ Commented Sep 12, 2022 at 20:23
  • $\begingroup$ Your revised answer works for me. $\endgroup$ Commented Sep 12, 2022 at 21:01
  • 1
    $\begingroup$ Note: standard screen readers will struggle to read either code or MathJax, so please do not use this font as simple decoration - it causes accessibility problems. $\endgroup$
    – bobble
    Commented Sep 12, 2022 at 23:41
  • 1
    $\begingroup$ @bobble Who said I was going to use this information for simple decoration? You seem so quick to judge people. $\endgroup$ Commented Sep 13, 2022 at 10:09
  • 4
    $\begingroup$ @WillOctagonGibson I never said that - just that if it's going to be simple decoration, don't do it. The comment is addressed at anyone who generally stumbles across this answer. If what you're doing is not simple decoration my comment doesn't apply. Please don't interpret things as personal attacks when they were not aimed at you. $\endgroup$
    – bobble
    Commented Sep 13, 2022 at 13:45

You must log in to answer this question.

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