# How to typeset polynomial ring notation nicely

When I typeset a polynomial ring (for instance on integers) with \mathbb{Z}[x],

the result is not very satisfactory (actually the result shown above looks even worse when it is small). It feels a little different from those found on beautifully typeset textbooks: the brackets are too tall (taller than Z and much taller than x), and they also seem a little too close to x (I don't know whether or not that's an illusion due to the tall brackets). Is there any way to get a more satisfactory result? Thanks.

Update:

Sorry for not making clear what I want. I actually want something like this:

Please neglect the different font for x.

• I don't find the image shows particularly good typesetting; I'm asking what would happen when t or 2 is used instead of x. Or, better yet, \sqrt{-5}, which will protrude above the brackets. – egreg Nov 12 '13 at 7:55
• @egreg Yes, \sqrt{-5} does protrude above the brackets. But with standard \mathbb{Z}[\sqrt{-5}] the bar in the square root sign is also above the brackets, only less significantly. Also note that \sqrt{-5} more or less protrudes above parentheses when you have something like (2 + \sqrt{-5}) unless you use \left(\right). So that isn't really a big problem I suppose. (Yeah I admit that my problem isn't a big deal either.) I don't think there is one particular way that fits all situations perfectly. Upon that assumption, I am happier with the one I chose. – 4ae1e1 Nov 12 '13 at 8:15
• And Z[x] is in some sense more common than Z[\sqrt{5}] I suppose. – 4ae1e1 Nov 12 '13 at 8:17

You can scale the brackets [ and ] vertically using graphicx's \scalebox{<h-scale>}[<v-scale>]{<stuff>}:

\documentclass{article}
\usepackage{amssymb,graphicx}% http://ctan.org/pkg/{amssymb,graphicx}
\newcommand{\polyring}[2][Z]{\mathbb{#1}\scalebox{1}[.95]{[}#2\scalebox{1}[.95]{]}}
\begin{document}

$\mathbb{Z}[x]\ \polyring{x}$

\end{document}


You can adjust the vertical scaling factor .95 to suit your needs.

• Thanks for the answer, the right one certainly looks better. (I wonder if most people feel just okay with the left one; it looks awful to me.) Anyway, I will the leave the question open to see if there are better ideas. – 4ae1e1 Nov 12 '13 at 5:38
• @KevinSayHi which looks better depends on what you are looking at. If you only use the brackets with lowercase letters having smaller brackets is probably an improvement, but then if you also use them with uppercase they probably look cramped, and if you use both, having different size brackets is probably distracting. The font designer has to make a choice, he doesn't know what the usage will be so is bound to make someone unhappy. You in this case:-) – David Carlisle Nov 12 '13 at 9:42
• @DavidCarlisle Look, sometimes I don't know how stupid my question is before I ask and get my ass kicked :) – 4ae1e1 Nov 12 '13 at 16:45
• @KevinSayHi actually I think it's a sensible question (I even voted for it:-) just doesn't have an answer that can work in all cases. – David Carlisle Nov 12 '13 at 19:59

If you really dislike standard TeX results, some variation on the 2nd or 3rd example might be useful. I am assuming that only glyphs as small as x need a correction.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

$\mathbb{Z}[x]$
$\mathbb{Z}{\scriptstyle[}x{\scriptstyle]}$
$\mathbb{Z}{\scriptstyle[\mkern1mu}x{\scriptstyle\mkern1mu]}$

\end{document}


Second version (after updating by OP)

The style you are expecting is probably either the following or some similar modification with non Computer Modern-like fonts.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[utopia]{mathdesign}

\begin{document}

$\mathbb{Z}[x]$

\end{document}


• Wow this is amazing, I didn't expect another font would give a nice result. Anyway, I guess I will stick with the standard font (and put up with the bad polynomial rings. – 4ae1e1 Nov 12 '13 at 5:44

Here, I use the \hstretch feature of the scalerel package to stretch the braces to 1.7 times their original width. In the MWE, I show before and after.

\documentclass{article}
\usepackage{amssymb}
\usepackage{scalerel}
\def\wlb{\hstretch{1.7}{[}}
\def\wrb{\hstretch{1.7}{]}}
\begin{document}
$\mathbb{Z}[x] \mathbb{Z}\wlb x\wrb$
\end{document}