5

I know in the written form, ampersands have a fair amount of variation beyond the standard &.

One I have seen and used frequently is what we will call the epsilon ampersand.

I was curious if there were any means of implementing this within LaTeX.

I have included a picture liberated from the ampersand Wikipedia entry.

enter image description here

6
  • I guess you may need to find a font for that symbol.
    – Leo Liu
    Commented Mar 25, 2017 at 7:24
  • If you know how to do it, you also may combine Unicode chars U+0301, U+0317 and U+03B5 of some font that has them, for example DejaVu Sans.
    – CarLaTeX
    Commented Mar 25, 2017 at 9:37
  • @CarLaTeX I did not realize you could overlay multiple characters on top of each other. I believe that is the path to achieving what I am looking to do. Thanks.
    – Math Fart
    Commented Mar 25, 2017 at 22:06
  • If you manage to do it, you can answer your own question; it may be useful for other users, thank you!
    – CarLaTeX
    Commented Mar 25, 2017 at 22:26
  • 3
    You will find alain.les-hurtig.org/pdf/esperluettes-total.pdf amusing.
    – Thérèse
    Commented Mar 26, 2017 at 3:08

2 Answers 2

5

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:

unicode

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

pdf

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.
1
  • That is far more expansive than my quick fix solution. The SVG solution I didn't even think about, I'll keep that in the back of my head for the next time some odd symbol comes up that I can't track down.
    – Math Fart
    Commented Apr 28, 2017 at 7:10
0

A similar question cropped up using different symbols, desired end result is the same. Overlay symbol with another However, I feel like it could still use some work, as the epsilon should probably be centered vertically.

\documentclass{article}
\def\Eamp{\mathrel{%
        \mathchoice{\eamp}{\eamp}{\scriptsize\eamp}{\tiny\eamp}%
}}
\def\eamp{{%
        \setbox0\hbox{/}%
        \rlap{\hbox to \wd0{\hss$\varepsilon$\hss}}\box0
}}

\textwidth=2cm
\begin{document}

    $ A \Eamp B $

\end{document}

Epsilon Ampersand attempt

2
  • Your symbol is not exactly like the OP desire. The line doesn't cross the epsilon in the OP's image.
    – CarLaTeX
    Commented Mar 26, 2017 at 4:15
  • Moreover, this symbol is in math mode, whereas I think the OP wants it in text mode.
    – CarLaTeX
    Commented Mar 26, 2017 at 7:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .