# Make easier to use $\C$ for complex numbers: clashes with T2A, mismath, and babel

My strong preference is to use $\C$ to denote the set of complex numbers, just as I use $\R$ to denote the real numbers — whether with \mathbb or \mathbf.

Several other packages use their own definitions of \C: t2aenc.def (called from \usepackage[T2A,T1]{fontenc}); mismath.sty; and either hyperref.sty or some package it calls.

My workaround for this shown in the MWE below.

Question: Is there a simpler method to accomplish this — without repeatedly redefining \C?

Notes:

• It is very unlikely I'll ever need the \C from babel's use of T2A. I'm unsure of how hyperref uses \C. (It's for a double-grave accent in Serbo-Croatian and Slovenian.)
• I am using pdflatex and not xelatex or lualatex!

Source MWE:

\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[russian,french,german,polish,main=english]{babel}

% Avoid \lll clash with def in amssymb.sty:
\makeatletter
\let\polish@l=\ll
\let\polish@L=\LLL
\let\lll\relax \let\LLL\relax % undefine them
\def\plll{\polish@l}
\def\pLLL{\polish@L}
\makeatother
\usepackage{amsmath,amssymb}

% Choose ONE of the following two defs:
%\newcommand{\numsys}{\mathbb{#1}}
\newcommand{\numsys}{\mathbf{#1}}

% First
\makeatletter
\def\my@textormath{%
\ifmmode
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi}
\ifcsname C\endcsname
\let\oldC\C
\def\C{\my@textormath{\oldC}{\numsys{C}}}
\fi
\makeatother

\usepackage{mismath} % defines \Z, \Z, \Q, \R, \C with mathbf

\usepackage[pdftex]{hyperref}
\makeatletter
\def\my@textormath{%
\ifmmode
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi}
{}
\makeatother

\renewcommand{\N}{\numsys{N}}
\renewcommand{\Z}{\numsys{Z}}
\renewcommand{\Q}{\numsys{Q}}
\renewcommand{\R}{\numsys{R}}

\begin{document}

$\N \subset \Z \subset \Q \subset \R \subset \C$

\end{document}

• If you want your definition to win do as late as possible \AtBeginDocument{\def\C{\numsys{C}}}. – Ulrike Fischer Aug 5 '19 at 21:00
• I do want mine to win, and this works! Please make as an answer. (Do you happen to know how/where the \C is used by hypreref, just in case I'm overlooking something I might actually need there?) – murray Aug 5 '19 at 21:07
• hyperref adds a definition for the accent command for the bookmarks. if you don't need the command in this sense, it shouldn't matter. – Ulrike Fischer Aug 5 '19 at 21:13

  \AtBeginDocument{\def\C{\numsys{C}}}