6

It is traditional in Physics to use a lowercase gamma that looks like a Y. Without going into the question of whether that tradition is wrong, how do I differentiate in math mode Latex markup between a Gamma that looks like a Y and a Gamma with a loop?

No, I do not mean either capital or upright.

I'd prefer avoiding Unicode unless ArXiV now supports xetex.

I don't know how to insert the PDF as an image, but http://mason.gmu.edu/~smetz3/humor/dirac.pdf is generated from

\documentclass{article}
\usepackage{bm}
\usepackage[paperheight=10in,paperwidth=10in,top=0.75in, bottom=0in,   left=0in, right=0in]{geometry}
\usepackage{graphicx}
\begin{document}
\pagestyle{empty}

\vspace{.5in}

\begin{center}
{\Huge \bfseries Which part of}
\end{center}

\vspace{1.75in}

{\Huge
  \[
    \bm{(\gamma^{\mu } (i\hbar \partial _{\mu } - {\frac {e}{c}}A_{\mu })-mc) \psi =0}
  \]
}

\vspace{1.75in}

\begin{center}
{\Huge \bfseries don't you understand?}
\end{center}
\end{document}
shmuel
  • 1,449

2 Answers2

8

Please choose one of these.

\documentclass[a4paper]{article}
\usepackage{tipa}
\usepackage{upgreek}
\begin{document}

\begin{tabular}{rl}
tipa:    & \textbabygamma\\
upgreek: & $\upgamma$\\
tipa:    & \textgamma\\
tipa:    & \textramshorns\\
default: & $\gamma$\\
\end{tabular}

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
4

In the Modern Toolchain

\usepackage{unicode-math}, then check the list of Unicode-math symbols for a font specimen of all the math symbols in a half-dozen Unicode math fonts. Pick a font you like.

If you want to change only the Greek letters to another Unicode font, including any of the fonts on your desktop, add \setmathfont{Latin Modern Math}, as your default, then \setmathfont[range=it/{Greek,greek}, Scale=MatchLowercase]{Artemisia} (for example).

In general, write your new documents for the new toolchain if you can, and the legacy toolchain if you have to.

With Legacy Math Fonts

Load isomath and pick one of the Greek alphabets it supports. This package and mathalfa give you the closest thing the NFSS ecosystem has to a standard interface for selecting the math alphabets of your choice.

With Legacy Greek Text Fonts

You can use LGR-encoded legacy NFSS fonts in math mode through mathastext. This example loads GFS Bodoni:

\usepackage[LGR,T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
%\usepackage{amsmath}
\usepackage{alphabeta}
\usepackage{gfsbodoni}
\usepackage[italic, LGRgreek, itgreek]{mathastext} % or upgreek, or upGreek.

If you want to write actual Greek words, also load babel.

If You Really Want Just that One Letter

Look up the encoding of the legacy font whose symbol you want, and declare it as a symbol alphabet. This example typesets the Euler-Mascheroni constant with the γ from the font AMS Euler, in ISO style. The constant is unslanted, not italic, and I give it the de facto standard name \upgamma. The other symbols are taken from newpx, a clone of Palatino, another font by Hermann Zapf that goes well with his AMS Euler.

\documentclass[varwidth]{standalone}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} % The default since 2018.
\usepackage{newpxtext, newpxmath}

\DeclareSymbolFont{eulerup}{U}{zeur}{m}{n}
\DeclareMathSymbol{\upgamma}{\mathord}{eulerup}{"0D}

\begin{document}
\begin{minipage}{10cm}
\[ \upgamma = \lim_{n \to \infty} \left(
      - \ln n + \sum_{k=1}^n \frac{1}{k}
   \right) \]
\end{minipage}
\end{document}

The Euler Constant

By the way, if you like this setup, here is how you get it with the modern toolchain (after downloading Khaled Hosny’s font Neo Euler from GitHub):

\documentclass[varwidth]{standalone}
\usepackage[math-style=ISO]{unicode-math}

\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[
  Scale = 1.0 ,
  Ligatures = {Common, TeX} ]
\setmonofont{Inconsolata}
% A good matching sans serif, should you want one, is Optima.  A free clone
% is URW Classico.
\setmathfont{TeX Gyre Pagella Math}
% Neo Euler by Khaled Hosny, based on AMS Euler by Hermann Zapf:
% https://github.com/khaledhosny/euler-otf
\setmathfont[range=up/{latin,Latin,greek,Greek},
             script-style={},
             sscript-style={}]{Neo Euler}

\begin{document}
\begin{minipage}{10cm}
\[ \upgamma = \lim_{n \to \infty} \left(
      - \ln n + \sum_{k=1}^n \frac{1}{k}
   \right) \]
\end{minipage}
\end{document}
JPi
  • 13,595
Davislor
  • 44,045
  • No, I do not mean capital Gamma; I mean lower case Gamma in Math mode, with one of two styles: the more correct form with a loop and the more traditional form (in Physics) with a tail. I'm trying to avoid Unicode because ArXiV doesn't support XeTeX and I don't want to get into the habit of doing anything that won't work with pdfLaTeX. – shmuel Dec 27 '18 at 20:12
  • @shmuel: You can get a good help from the community here if you post an image. – AboAmmar Dec 27 '18 at 21:35
  • @shmuel That makes sense. All of those solutions work for a lowercase gamma in math mode, and all but the first work in PDFLaTeX. – Davislor Dec 27 '18 at 21:49
  • @AboAmmar What is the markup to render a block of TeX, and can I do it within a comment or only in the base message or an answer? – shmuel Dec 28 '18 at 20:57
  • @Davislor I thought that symbols beginning with text were only for use in text mode. I only mentioned capital Gamma because of a comment by Stefan Schroeder; what I want is a lower case slanted Gamma. – shmuel Dec 28 '18 at 21:06
  • @shmuel Right, \textfoo commands are, by convention, text-mode. I don’t use them in those examples, but you can use any text-mode command in math mode by wrapping it in \mbox or \text from amsmath. – Davislor Dec 29 '18 at 00:27
  • @shmuel All those methods will produce a slanted gamma if you use them with a slanted font. The Euler example was just the least-contrived one I could think of to use the letter gamma from a non-OML, non-LGR, NFSS font. And it was the Euler constant. – Davislor Dec 29 '18 at 00:29
  • @shmuel To get syntax highlighting: https://tex.stackexchange.com/editing-help#syntax-highlighting However, the code will normally autodetect what language you’re writing in, based on the tags of your question. – Davislor Dec 29 '18 at 00:32
  • @Davislor I wasn't looking for syntax highlighting. There are some environments where I can include LaTeX code in a message and it will be rendered as LaTeX rather than just prettyprinted. I suspect that the answer is to convert it to PNG and include that. – shmuel Jan 03 '19 at 21:09
  • @shmuel Oh, you mean MathJax? Very similar to LaTeX, but not exactly the same. Some other sites on StackExchange support it. I generally try to insert the Unicode math characters. – Davislor Jan 03 '19 at 22:50