Does anybody know how I can get exactly that symbol for the set of real numbers in LaTeX?
Additional image:
In this picture you have the symbol for the set of integers, real numbers and complex numbers. I think this must be a package.
symbols
Does anybody know how I can get exactly that symbol for the set of real numbers in LaTeX?
Additional image:
In this picture you have the symbol for the set of integers, real numbers and complex numbers. I think this must be a package.
While the fonts and the respective packages are being built, as pragmatic as it can be, one can get away with the following inline TikZ drawings
\documentclass{article}
\usepackage{tikz}
\newcommand{\dflat}{\tikz[baseline=-1.2mm] \node {\reflectbox{$\flat$}};}
\newcommand{\sflat}{\tikz[baseline=-1.2mm] \node {\reflectbox{$\flat$}$\flat$};}
\newcommand{\dsharp}{\hskip3pt \tikz[baseline=-1.2mm] {%
\clip (-2pt,-6pt) rectangle (-.2pt,6pt); \node at (0,0) {$\sharp$};}\hskip3pt
}
\newcommand{\ssharp}{\tikz[baseline=-1.2mm] {%
\node[inner sep=0mm] at (0,0) {$\sharp$};\node at (1.7pt,0.55pt) {$\sharp$};}
}
\begin{document}
\parbox{5cm}{
This is some random text to use the symbols \dflat, \sflat,\dsharp and \ssharp inline.
It can be improved by assigning some input parameters and adjusting the kerning as
C~{\hskip-7pt\dflat}, A~{\hskip-6pt\dsharp} or D~{\hskip-6pt\ssharp}
}
\end{document}
I will not attempt to make stupid comments since I know almost nothing about typography and kerning but this can be automated at will. Also I am not sure if these commands I have defined are robust. Please consider this as a proof of concept.
Addition by Jake:
By using \tikz [baseline] \node [anchor=base, inner sep=0pt]
, the nodes will automatically be positioned on the text line like a character would, so the vertical position doesn't have to be adjusted manually.
When defining TikZ commands to be used in text lines, it is usually a good idea to specify lengths in terms of ex
and em
, since these depend on the surrounding font size. That way, the symbols will scale with the text.
\documentclass{article}
\usepackage{tikz}
\newcommand{\dflat}{\tikz [baseline] \node [anchor=base, inner sep=0pt] {\reflectbox{$\flat$}};}
\newcommand{\sflat}{\tikz [baseline] \node [anchor=base, inner sep=0pt] {\reflectbox{$\flat$}$\flat$};}
\newcommand{\dsharp}{\tikz [baseline] {%
\clip (-0.2em,-1ex) rectangle (-0.01em,2ex);
\node[anchor=base, inner sep=0pt] {$\sharp$};}
}
\newcommand{\ssharp}{\tikz[baseline] {%
\node[anchor=base,inner sep=0pt,name=leftsharp] at (0,0) {$\sharp$};
\node at (leftsharp.east) [xshift=-0.25em, yshift=0.1ex, inner sep=0pt,anchor=west] {$\sharp$};}
}
\begin{document}
\parbox{5cm}{
This is some random text to use the symbols \dflat, \sflat, \dsharp and \ssharp inline.
It can be improved by assigning some input parameters and adjusting the kerning as
C\dflat, A\dsharp or D\ssharp
}
\parbox{5cm}{\Large
The symbols scale with the text:
C\dflat, A\dsharp or D\ssharp
}
\end{document}
You've indicated in a comment that you use Times (New) Roman as your text font. Most Times Roman-like fonts do not provide a "swashy" ampersand character, but the newtx
font package does. :-) The following MWE shows both the italic and "normal" form of the character that's produced by this font family:
\documentclass{article}
\usepackage{newtxtext,newtxmath}
\begin{document}
\textit{\&} vs.\ \&
\end{document}
Addendum If the character shown above is not "swashy" enough for your taste you could try a font such as Palatino
or Caslon
. (The screenshot you provided in your posting would seem to come from the font Adobe Caslon Pro
.) Note that some of the swashy ampersands employ a fancy combination of an uppercase E
and a lowercase t
, whereas others consist of an equally fancy combination of a lowercase e
and a lowercase t
.
% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{Latin Modern Roman} \textit{\&}
\setmainfont{Palatino nova} \textit{\&}
\setmainfont{TeX Gyre Pagella} \textit{\&} % a Palatino clone
\setmainfont{Adobe Caslon Pro} \textit{\&}
\setmainfont{EB Garamond} \textit{\&}
\setmainfont{Garamond Premier Pro} \textit{\&}
\setmainfont{ITC Galliard Std} \textit{\&}
\setmainfont{Junicode} \textit{\&}
\end{document}
(To compile the preceding MWE use either XeLaTeX or LuaLaTeX; pdfLaTeX won't work. Of course, you'll also have to have the various fonts installed on your system.)
And, if you have access to Zapfino
you can choose from seven [7!] different variants of &
:
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Zapfino}
\begin{document}
\addfontfeature{Variant=1} \&
\addfontfeature{Variant=2} \&
\addfontfeature{Variant=3} \&
\addfontfeature{Variant=4} \&
\addfontfeature{Variant=5} \&
\addfontfeature{Variant=6} \&
\addfontfeature{Variant=7} \&
\end{document}
Best Answer
An exact font for the symbols does not exist, because the symbols are composed from letters. The image clearly shows, that especially the Z- and C-symbols are poor man's versions of the symbol. All the three symbols are generated by two shifted letters:
Alternatives for comparison
Package
amssymb
Package
fourier
Package
dsfont
Sans serif version of
dsfont
Font "Segoe UI Symbol" (LuaTeX/XeTeX)
Font "FreeSans" (LuaTeX/XeTeX)