1

I'd like to have a macro that lets me say something like \vector{lambda} and get an upright and bold lambda. I would like to say something like \matrix{Lambda} to get a capital, upright, and bold lambda, but not to say \bm{\Uplambda} each time (using the bm and the upgreek packages). Also, most of the time I'd like all of my greek letters to be upright, but also to have a way to get back to italic greek if needed. I'd like to use \renenewcommand as: \renewcommand{\lambda}{\ensuremath\uplambda}, to turn \lambda into my preferred default in math of upright, but also reserve the option to have an italic letter at times. As it turns out, I'll only have an italic greek letter if I also have a hat, dot, bar, or tilde over it). I'm not sure if such a bit of code would do that. (I'm approaching this from a statistics perspective, in which a parameter is upright but an estimate of a parameter would be italic, but would also have a hat or tilde, for example).

One thing I tried was to get the original alpha into an italic, but that doesn't seem to work: \newcommand{\ialpha}{\alpha} \renewcommand{\alpha}{\ensuremath{\upalpha}} as when I use \ialpha I still get an upright, presumably because it is "pulling" from the newly defined alpha (even though it happens afterward).

Thanks for any thoughts. I've been running in circles trying to find ways to do all of this!

3
  • 1
    Sorry, why you redefined, you can use standard tag \alpha whereever you need italic and use \upalpha for roman.
    – GowriSaro
    Feb 6 at 4:29
  • 1
    For Bold, you can use as \boldsymbol{\alpha} and \boldsymbol{\upalpha}
    – GowriSaro
    Feb 6 at 4:50
  • 1
    for bold use the bm package and its \bm{\alpha} command.
    – daleif
    Feb 6 at 8:49

1 Answer 1

1

To add to the comments:

If you use Unicode (unicode-math package plus an OpenType maths font), there are various out-of-the-box symbols that might help with what you need:

lambda

Note that the math-style= package option (ISO, TeX, french, etc) has final say in some contexts on whether Greek is upright or italic. See the manual.

The symbol names are in unicode-math-table.tex.

For the \sym... commands, you can also use the traditional macro name: $\symbfsfit{\Lambda}$

MWE

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella Math} % for demo of non-text direct input
\setmathfont{TeX Gyre Pagella Math}

\newcommand\msym[4]{%
#1 $\mapsto #1$ & % direct input
\textbackslash#2 $\mapsto \csname #2\endcsname$ & % symbolname
\textbackslash#3\{#4\} $\mapsto \csname #3\endcsname{#4}$ \\ % sym macro
 }
\begin{document}


\rowcolors{2}{blue!15}{blue!5}
\begin{tabular}{lll}
\rowcolor{yellow!15}%
Direct Input & Symbol Name & \textbackslash sym macro \\
& & \\ %
\msym{Λ}{mupLambda}{symup}{Λ}
\msym{λ}{muplambda}{symup}{λ}
\msym{𝚲}{mbfLambda}{symbfup}{Λ}
\msym{𝛌}{mbflambda}{symbfup}{λ}
& & \\ %
\msym{𝛬}{mitLambda}{symit}{Λ}
\msym{𝜆}{mitlambda}{symit}{λ}
\msym{𝜦}{mbfitLambda}{symbfit}{Λ}
\msym{𝛌}{mbfitlambda}{symbfit}{λ}
& & \\ %
\msym{𝝠}{mbfsansLambda}{symbfsfup}{Λ}
\msym{𝝺}{mbfsanslambda}{symbfsfup}{λ}
\msym{𝞚}{mbfitsansLambda}{symbfsfit}{Λ}
\msym{𝞴}{mbfitsanslambda}{symbfsfit}{λ}
\end{tabular}

\end{document}

3
  • Thanks for all of this. I'm using TexShop on a Mac and I've been unable to get this to work. I've never used XeTeX before, even though I've been using LaTeX for 20+ years! I use LaTeX in a simple way and your suggestions here have me reading more about what I need to do and more modern developments. So, functionally, the whole idea of \usepackage{unicode-math} and XeLaTeX is taking me down some rabbit holes I didn't expect! So, let me sort some of this out on my system. To an
    – user54858
    Feb 7 at 0:10
  • Use LuaLaTeX, it is more flexible and powerful. Also, there are code examples around on this site.
    – Cicada
    Feb 7 at 2:12
  • A visual on how and where the symbols are in an .otf font (like here) might be of help. It's not just a case of "a font" and doing a text italic say, in that calligraphic or fraktur or italic bold and all of the other math alphabets are all in the same font file, in their own glyph slots (996 symbols, plus other things).
    – Cicada
    Feb 7 at 2:20

You must log in to answer this question.

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