For a long time, I've used \newcommand{\C}{\mathbb{C}}
in the preamble of my documents compiled with pdflatex to shorten the command needed to create the symbol for the complex numbers. Now I have a document where I have to use an Opentype font. For this I've switched to xelatex as engine, and replaced \usepackage[T1]{fontenc}
by \usepackage[OT1]{fontspec}
to get it to work. (I dont't unterstand things well enough to really be able to say whether or why this is necessary.) Using the OTF font works like a charm, but now I get the error messages "Command \C already defined." for the \newcommand
line and "Command \C unavailable in math mode" for every time it is used. So apparently something in the changes I did lead to \C
being a predefined command that is not to be used in math mode. But when I use \C
in normal mode, it does not produce any visible sign. What is it good for? Where is it defined? Is it safe to overwrite it with \renewcommand
?
Edit: Working on a MWE, I found out that the problem is present for documentclass beamer, but not for documentclass article. So here is my MWE:
\documentclass{beamer}
%\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\newcommand{\C}{\mathbb{C}}
\begin{document}
This $\C$ is the set of complex numbers.
\end{document}
works when compiled with pdflatex, while
\documentclass{beamer}
\usepackage{fontspec}
%\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\newcommand{\C}{\mathbb{C}}
\begin{document}
This $\C$ is the set of complex numbers.
\end{document}
produces the aforementioned errors when compiled with xelatex.
\C
is not defined if you load fonspec and unicode-math, your document is defining it\usepackage[T2A]{fontenc}
somewhere.