52

Is there a way to typeset a square bracket without using the symbols [ and ]?

What I am looking for is like \vert instead of |.

Motivation is a need for a workaround in using LaTeX formulas inside Moodle wiki pages. The latter use square brackets to start a new page (like [page-name]), and this functionality interferes with scripts processing LaTeX formulas (which otherwise are ok in Moodle HTML/wiki).

2 Answers 2

75

Yes, there is:

\lbrack
\rbrack
0
2

Or simply add the following command to your preamble.tex file in case you are on a template or if you are doing it from scratch then:

\documentclass{article}
\usepackage{mathtools}

\DeclarePairedDelimiter\Bracket{\lbrack}{\rbrack}

\newcommand*{\Value}{\frac{1}{2}x^2}%
\begin{document}
    \[\Bracket{\Value}\]
\end{document}

You must log in to answer this question.

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