7

There are multiple questions on this site about redefining the real and imaginary part operators. Mine is a bit pedantic. I am quite used to the standard symbols embedded into LaTeX. However for my students, I think it would be clearer to have the second letter appear also, i.e., to have literally Re and Im.

The only problem I have is that I'm very fond of the Fraktur used for the in-build commands, and less so of the ones provided by \mathfrak:

enter image description here

Can I get a Re and Im in the same font as the \Re and \Im commands?

  • 1
    The CM provided R and I are a form of Fraktur (not so attractive, in my personal opinion). The problem in using a more complex form is that it's difficult to write by hand. I've long opted for upright Latin Re and Im. – egreg Feb 25 at 8:38
8

The font used by the \mathfrak command can be changed. An easy way to do that is to use the mathalpha package. For example, here's a comparison of the letters "Re" and "Im" in Esstix fraktur with the usual \Re and \Im symbols.

\documentclass{article}
\usepackage[frak=esstix]{mathalpha}
\begin{document}
\begin{tabular}{ll}
    \verb|\Re|           & \(\Re\)           \\
    \verb|\mathfrak{Re}| & \(\mathfrak{Re}\) \\
    \verb|\Im|           & \(\Im\)           \\
    \verb|\mathfrak{Im}| & \(\mathfrak{Im}\)
\end{tabular}
\end{document}

The symbols do not match perfectly, but certainly better than in your original example. In the documentation of the mathalpha package, many fonts are listed, maybe you will find another font you prefer. I think the Mathpi fraktur font might give the same symbols than \Re and \Im, but this font is not free.

|improve this answer|||||
  • Thanks for your answer! Where can I find out more about this Mathpi font? – Luke Collins Feb 25 at 2:01
  • @LukeCollins I'm not sure, all I know about it is in the documentation of mathalpha. In this documentation there are examples of all of the fonts that can be used with the package, and in fact, if I think the match would be better with this font it is only from the comparison with these examples. – Vincent Feb 25 at 2:10
  • I've just looked through the mathalpha documentation, and if anything, it seems the esstix fraktur is the closest (see page 5/6). Of all the frakturs listed there (I'm not sure if that list is exhaustive), it seems the in-build symbol matches none of them, which is strange. – Luke Collins Feb 25 at 2:27
  • @LukeCollins Yes, it also seemed to me that the esstix was the closest of these fonts. I think this list is exhaustive only in the sense that these are all of the fonts that can be used with mathalpha, but I'd be surprised if there was no other way to change the fraktur font and no other fonts than these. However, I must say this is the only option I know about. – Vincent Feb 25 at 2:43
  • 1
    @LukeCollins yes that is exactly the case: Re and Im are in cmsy as specific symbols not as part of a fraktur alphabet – David Carlisle Feb 25 at 8:56
5

You can compose the Computer Modern \Re and \Im with the fraktur eand m from \mathfrak

\documentclass{article}

\usepackage{amssymb}

\begin{document}

$\Re(z)$, $\Im(z)$

$\mathfrak{Re}(z)$, $\mathfrak{Im}(z)$

\let\texRe=\Re \renewcommand*{\Re}{\mathop{}\!\texRe\mathfrak{e}}
\let\texIm=\Im \renewcommand*{\Im}{\mathop{}\!\texIm\mathfrak{m}}
$\Re(z)$, $\Im(z)$

\end{document}

enter image description here

|improve this answer|||||
2

It is possible to use also the lite version of mtpro2.

enter image description here

With this example where I have used newtxtext package that it gived a clone of Times New Roman; the option eufrak for the style fraktur, and zswash as an alternative shape of z in math mode:

\documentclass[a4paper,12pt]{article}
\usepackage{newtxtext}
\usepackage[lite,eufrak,zswash]{mtpro2}
\renewcommand{\Re}{\mathfrak{R}}
\renewcommand{\Im}{\mathfrak{I}}
\begin{document}
\verb|\mathfrak{R}(z)|, output --> $\mathfrak{R}(z)$
\verb|\Re(z)|, output --> $\Re(z)$
\verb|\Im(z)|, output --> $\Im(z)$
\end{document}

For my humble opinion I will use the classic notation Re and Im in the usual mode as the example below:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\newcommand{\RE}{\mathrm{Re}}
\newcommand{\IM}{\mathrm{Im}}
\begin{document}
$z=a+ib$ where $a=\RE(z)$ and $b=\IM(z)$
\end{document}

enter image description here

|improve this answer|||||

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.