48

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).

67

Yes, there is:

\lbrack
\rbrack
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}

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.