Here's a solution inspired by Carla's suggestion to generate an epsilon ampersand for use in text mode. It should be compiled by XeLaTeX, using the Dejavu Sans font family.
Generating from Unicode characters
I combined the Unicode characters U+03B5, U+0375 and U+02B9. Not exactly the ones that Carla suggested in the comments, but I find these to work just fine as well.
Sample image:
Code
% !TeX program = xelatex
% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{graphicx}
\setmainfont[Ligatures=TeX,Scale=MatchLowercase]{LinLibertine} % Not necessary in main document
% ----------------------------------------------------------%
\newfontfamily\myfont{DejaVu Sans Condensed}
\def\myamp{{\myfont%
\raisebox{0.4\depth}{%
{\scalebox{1}[0.81]{\char"03B5}}% epsilon
{\scalebox{1}[0.6]{\raisebox{-0.18ex}{\kern-0.69ex\rotatebox[origin=c]{180}{\char"0375}}}}% bottom stroke
{\scalebox{1}[0.6]{\raisebox{0.43ex}{\kern-0.31ex\char"02B9}}}% top stroke
}}}
% ----------------------------------------------------------%
\begin{document}
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
Some birds \myamp{} some cats are hanging out in the garden.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This \myamp{} that. Cats \myamp{} dogs. Apples \myamp{} oranges. Dollars \myamp{} Euros. Epsilon \myamp{} strokes.
In math mode: $1 \myamp{} 1 = 2$.
\bigskip
\setlength{\fboxsep}{0.1pt}%
\setlength\fboxrule{0.1pt}%
{\tiny tiny: \myamp{}, \fbox{\myamp{}}\par}
{\footnotesize footnotesize: \myamp{}, \fbox{\myamp{}}\par}
{\normalsize normal: \myamp{}, \fbox{\myamp{}}\par}
{\large large: \myamp{}, \fbox{\myamp{}}\par}
{\LARGE LARGE: \myamp{}, \fbox{\myamp{}}\par}
{\Huge Huge: \myamp{}, \fbox{\myamp{}}\par}
\end{document}
Comments:
- It was definitely a lot of trial and error, this one. It's also probably not the most efficient way to do this, as I'm not very familiar with the commands used to resize/rescale boxes. I'm welcome to suggestions.
- Note the use of the braces in
\myamp{}
, which is necessary for proper spacing without resorting to using xparse
package (see here) or hardcoding it into the macro definition. You could, if you want, if you're only ever going to use it as a standalone character.
- I set the main font in my example as Libertine. Note that you don't have to in your main document -- I just found that the ampersand looks nicer when the rest of the text body is in Libertine font.
- The units used to scale the boxes are in
ex
's (1ex is the height of the letter x in the current font), which allows the symbol to scale according to the font size of the surrounding text.
Generating in pdfLaTeX with \includegraphics
Another approach is by inserting a vector graphic, instead of generating it by yourself from unicode characters (saves all the work to optimize the heights/widths of the boxes etc.). I took the liberty to convert the .png
file from Wikipedia Commons to an .svg
file using Inkscape.
I then exported the .svg
file into a .pdf
file to include directly in a macro I call \pdfamp
. You can find the .pdf
file which I created from .svg
here. The scaling of the graphic is done with the wonderful scalerel
package, scaled to the size of an actual ampersand sign. This could probably use with some more tweaking, but this is the result:
Sample image
Code
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{libertine} % Once again, not necessary in the main document
\usepackage{graphicx,scalerel}
\def\pdfamp{\scalerel*{\includegraphics{myamp}}{\&}}
\begin{document}
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
Some birds \pdfamp{} some cats are hanging out in the garden.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This is a test of some very long message that has no meaning. Lorem ipsum dolor sit amet, consetetuer adipiscing elit.
This \pdfamp{} that. Cats \pdfamp{} dogs. Apples \pdfamp{} oranges. Dollars \pdfamp{} Euros. Epsilon \pdfamp{} strokes.
\bigskip
\setlength{\fboxsep}{0.1pt}%
\setlength\fboxrule{0.1pt}%
{\tiny tiny: \pdfamp{}, \fbox{\pdfamp{}}\par}
{\footnotesize footnotesize: \pdfamp{}, \fbox{\pdfamp{}}\par}
{\normalsize normal: \pdfamp{}, \fbox{\pdfamp{}}\par}
{\large large: \pdfamp{}, \fbox{\pdfamp{}}\par}
{\LARGE LARGE: \pdfamp{}, \fbox{\pdfamp{}}\par}
{\Huge Huge: \pdfamp{}, \fbox{\pdfamp{}}\par}
\end{document}
Comments:
- The Libertine font loaded here is once again, not required in the main font. But I tried this with Computer Modern, and it looks horrendous. But use it however you wish.
- The
.pdf
file of the epsilon ampersand converted from .svg
can be found here. If this ever gets taken down, you can attempt to convert the .png
from Wikipedia Commons to .svg
/.pdf
yourself using Inkscape -- it's fairly simple.
- Note the use of braces in
\pdfamp{}
, for proper spacing in text mode.