Fonts & Character SetsGetting certain characters when not in math mode [ ] for example

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
WasPentalive
Posts: 1
Joined: Mon Aug 04, 2025 6:24 am

Getting certain characters when not in math mode [ ] for example

Post by WasPentalive »

I am writing a manual for a programming language. I need to explain parts of this language that include the characters [ and ]. I am not working in math mode, just normal text. I have tried \], but that seems to work sometimes and not others.

! LaTeX Error: Bad math environment delimiter.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.613 Once an expression is closed by \]
the top of the stack is stored in
? X

P.S. I have been working with TeX / LaTeX for about 10 hours now... A little prior experience almost 30 years ago.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply