# How to define new math delimiters with «»?

I want to use special math brackets with the symbols «» (french guillemots). But the problem is that when I define them using \mbox or \text, they become italicized with the surrounding text.

\documentclass[12pt,a4paper]{letter}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\begin{document}
\newcommand{\fopen}{\mathopen\text{\guillemotleft}}
\newcommand{\fclose}{\mathclose\text{\guillemotright}}
\newcommand{\ff}[1]{\fopen #1\fclose}

\textbf{What I have}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic $\ff{O:P:Q}$ } (guillemots in italic)

\textbf{What it should be}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic}  $\ff{O:P:Q}$
\end{document}


• You could replace \text with \textup – GuM Jun 30 '17 at 23:40
• It should be \mathopen{\textnormal{<<}} (or \guillemotleft instead of <<). – egreg Jun 30 '17 at 23:42
• …but maybe what you are truly after are \llangle and \rrangle from the MnSymbol package. – GuM Jun 30 '17 at 23:52
• Both \textup and \textnormal solve the problem. @GustavoMezzetti I'm already using \llangle and \rrangle for other things. – sf rajaona Jul 1 '17 at 0:26
• @egreg is right, \textnormal is (obviously) better, since it will reset all font characteristics, and not just the shape, to their “normal” setting. Of course, with either definition the delimiters you get cannot be used as variable-sized delimiters; but, if you load the amsmath package (actually, the amstext package would suffice), they will scale down correctly when used in (first or higher order) sub-/superscript. – GuM Jul 1 '17 at 0:36

The font used for \text is the one which was in force when the math formula was started, so it will be italic in italic context.

Use \textnormal, instead:

\newcommand{\fopen}{\mathopen{\textnormal{\guillemotleft}}}
\newcommand{\fclose}{\mathclose{\textnormal{\guillemotright}}}


Note also the additional braces; it's only because of the implementation that you don't get an error message. In the example below I also add a way to make the commands respect \boldmath.

\documentclass[12pt,a4paper]{letter}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{pdftexcmds}

\makeatletter
\newcommand{\normalorbold}{%
\ifnum\pdf@strcmp{\math@version}{bold}=\z@\bfseries\fi
}
\makeatother

\newcommand{\fopen}{\mathopen{\textnormal{\normalorbold\guillemotleft}}}
\newcommand{\fclose}{\mathclose{\textnormal{\normalorbold\guillemotright}}}
\newcommand{\ff}[1]{\fopen #1\fclose}

\begin{document}

\textbf{What I have}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic $\ff{O:P:Q}$}

\textbf{What it should be}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic}  $\ff{O:P:Q}$

{\boldmath $\ff{O:P:Q}$}

\end{document}


If you're not short of symbol fonts, you can define one:

\documentclass[12pt,a4paper]{letter}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\DeclareSymbolFont{supplsymbols}{T1}{\familydefault}{m}{n}
\SetSymbolFont{supplsymbols}{bold}{T1}{\familydefault}{bx}{n}

\DeclareMathSymbol{\fopen}{\mathopen}{supplsymbols}{19}
\DeclareMathSymbol{\fclose}{\mathclose}{supplsymbols}{20}
\newcommand{\ff}[1]{\fopen #1\fclose}

\begin{document}

\textbf{What I have}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic $\ff{O:P:Q}$}

\textbf{What it should be}

With normal text $\ff{O:P:Q}$

{\itshape With text in italic}  $\ff{O:P:Q}$

{\boldmath $\ff{O:P:Q}$}

\end{document}