3

Is there a way to write

\langle some text \rangle

where the "some text" will be written with punctuation and will not contain any math symbols ? Maybe there is a different command for this bracket for use in a general text, but I didn't find one which would work.

  • What about $\langle$ some text $\rangle$? Or better yet, depending on the use, write a macro: \newcommand{\sometext}[1]{\text{$\langle$~#1~$\rangle$}} (add \usepackage{amsmath} to your document preamble). This allows you to use \sometext{some text} in math mode or regular text mode. – Werner Dec 1 '14 at 22:49
  • 1
    \newcommand{\textinbrackets}[1]{\ensuremath{\langle}#1\ensuremath{\rangle} }% for example with \textinbrackets{Hello World!} – user31729 Dec 1 '14 at 22:49
  • Thanks, that helped, I must have had some kind of a typing error earlier, because $\langle$ some text $\rangle$ didn't work for some reason and now it does. – Glissinda Dec 1 '14 at 22:54
  • 3
    The textcomp package provides \textlangle and \textrangle. – egreg Dec 1 '14 at 23:00
  • 1
    Use amsmath and use $\left\langle\text{stuff}\right\rangle$. The proposed solutions that use $\langle$ and `$\rangle$ are not ideal because they disable LaTeX's ability to match pairs of delimiters. – user10274 Dec 2 '14 at 17:20
6

Do you want angle brackets or guillemet quotes:

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}

This $\langle$one, two three$\rangle$

or

This \guilsinglleft one, two three\guilsinglright

\end{document}
| improve this answer | |
  • I wanted angle brackets, but thanks for the guillemet quotes, I'll need them too. – Glissinda Dec 2 '14 at 0:00
8

since this wasn't specifically a latex question, here's my favorite method.

\def\<#1>{$\langle$\ignorespaces#1\unskip$\rangle$}

\<some text>  \< some text >

good for "meta" notation, if this alternate form is used (does require latex):

\def\<#1>{$\langle$\textit{\ignorespaces#1\unskip}$\rangle$}
| improve this answer | |
  • 1
    This deserves more votes.... – 1010011010 Dec 2 '14 at 20:20

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.