I'm forced to work with latex, and want to make use of unicode chars in math. So I write:
\documentclass{article}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{B7}{\cdot}
\usepackage[mathletters]{ucs}
\begin{document}
$a · b$
\end{document}
But it gives:
aΔb
Is there a way to DeclareUnicodeChars after ucs?
The ucs manual has something to say about DeclareUnicodeChars:
Several options have a special hardcoded meaning:
...
Every character you define in your document using \DeclareUnicodeCharacter
has the option document. This option is activated per
default having the priority 1000, therefore manually declared characters take
precedence over all other characters, unless some other option has explicitly
gotten a higher priority.
...
So I tried the way I understood it:
\DeclareUnicodeCharacter[document]{B7}{\cdot}
and
\DeclareUnicodeCharacter{B7}[document]{\cdot}
but it doesn't work.
Also tried:
\DeclareUnicodeOption{document}
and it also doesn't work.
Edit:
\documentclass{article}
\usepackage[mathletters]{ucs}
\usepackage[utf8x]{inputenc}
\begin{document}
\DeclareUnicodeCharacter{00B7}{\cdot} % U+00B7 = cdot
$a · b$
\end{document}
Gives:
! Missing = inserted for \ifnum.
<to be read again>
B
l.10 \DeclareUnicodeCharacter{00B7}{\cdot}
% U+00B7 = cdot
Also after reading ucs sources I tried:
\documentclass{article}
\usepackage[mathletters]{ucs}
\usepackage[utf8x]{inputenc}
\uc@dclc{183}{mathletters}{\ensuremath{\cdot}}%·
\begin{document}
$a · b$
\end{document}
but it gives:
! Undefined control sequence.
l.7 \uc
@dclc{183}{mathletters}{\ensuremath{\cdot}}%·
utf8xrather thanutf8in order to useucs. Moreover the call ofucswith explicit options such asmathlettersshould precede the call toinputenc. – egreg Aug 13 '13 at 09:34\uc@dclcwith\makeatletterand\makeatother. – Jasper Habicht Oct 26 '21 at 11:09