9

The square brackets [x] in math mode get typeset quite different from the floor and ceiling delimiters \lfloor etc.

enter image description here

For the square brackets, there is less spacing to the inner characters, and also the top and bottom horizontal lines are shorter.

Question: Is there some way to make these look more similar? I prefer the style of the floor/ceiling delimiters.

For the beginning, I would be glad if there were a character which I can use instead of [, which looks like \lfloor and \lceil combined. If there is no character like this, how can I build one?

Note: I really really like my current math font (it seems to be "Latin Modern"), and therefore do not want to change it if I can avoid it.

  • Note that the horizontal portions of [ and \lfloor (or \lceil) are not equally long. Similarly, the horizontal portions of ] and \rfloor (or \rceil) are not equally long. Hence, what you claim to be "less spacing to the inner characters" with [...] appears to be an apples-to-oranges comparison. If you look really closely, you'll notice that horizontal distance between the right-hand-most part of either [ or \lfloor and x is actually exactly the same. The impression of "less spacing" with [ is entirely due to the fact that [ has much less of a horizontal component. – Mico Mar 21 '18 at 17:35
  • Would you please clarify the following points: (a) Do you want your customized brackets to be usable with \left, \right, \bigl, \bigr, ..., \Biggl, \Biggr? (b) Are you loading the lmodern package? – GuM Mar 21 '18 at 21:16
  • @GuM I haven't thought about this, but of course, this would be favorable. It would also be nice if it works with \left and \right. And No, I am not using lmodern. – M. Winter Mar 21 '18 at 21:28
  • How do you set your math font to Latin Modern, then? – GuM Mar 21 '18 at 21:33
  • @GuM I don't. I googled math fonts. The one named "Latin Modern" looked like the one which was used in my documents (by default). I don't know what is the actual font. – M. Winter Mar 21 '18 at 21:36
4

The appearance of your brackets eventually depends on your fonts, so you might want to look at some different math fonts. That said, you can superimpose \lfloor and \lceil without any additional packages using \ooalign:

\documentclass{article}

\usepackage{amsmath}

\renewcommand\lbrack[1][]{\ooalign{\ensuremath{#1\lfloor}\cr\ensuremath{#1\lceil}}}
\renewcommand\rbrack[1][]{\ooalign{\ensuremath{#1\rfloor}\cr\ensuremath{#1\rceil}}}

\begin{document}

\(\lbrack x \rbrack\)

\end{document}

I added an optional argument, so you can scale the commands, e.g. \lbrack[\Big]. Note that you cannot use \left or \right with these commands.

That said, I would recommend not to alter the appearance of brackets like this and rather look for fonts that you like better.

7
\documentclass{article}
\usepackage{amssymb,stackengine}
\newcommand\lbr{%
  \ensurestackMath{\stackengine{0pt}{\lfloor}{\lceil}{O}{c}{F}{F}{L}}}
\newcommand\rbr{%
  \ensurestackMath{\stackengine{0pt}{\rfloor}{\rceil}{O}{c}{F}{F}{L}}}
\begin{document}
\begin{equation}
\lbr a \rbr
\end{equation}
\end{document}

enter image description here

4

Those are font decisions so you should switch to another font.

Cambria Math, TeX Gyre Pagella Math, DejaVu Math TeX Gyre and Neo Euler might do the trick.

If you want to stick to your current font, you will have to construct your own symbol by soperposing lfloor and lceil. You will find many examples of such things on this homepage. Personally, I would not touch the spacing of square brackets but I leave this to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.