0

I am having a problem with the normal math fonts which is not appearing as italic.

abc&&\mathit{abc} \\% problem here: non-mathit (abc) not italic!!!!

enter image description here

I want to use \RequirePackage[math-style=literal]{unicode-math} to get all variants of the Greek characters (for example: \upPhi, \Phi, \mathbf{\upPhi}, \mathbf{\Phi}) appear right.

There is also a problem with mathalfa package in which some of the fonts are not appearing properly. My torture file (MWE) is given below.

    \documentclass[a4paper]{article}

    \usepackage[bb=px,cal=boondox,frak=boondox,scr=euler]{mathalfa}

    \RequirePackage[margin=2cm]{geometry}
    \RequirePackage{longtable,xspace}
    \RequirePackage{mathspec}

    \RequirePackage[math-style=literal]{unicode-math}

    \def\alphabets{a\ {quick}\ {brown}\ {fox}\ {jumps}\ {over}\ {the}\ {lazy}\ {dog.}}
    \def\Alphabets{A\ {QUICK}\ {BROWN}\ {FOX}\ {JUMPS}\ {OVER}\ {THE}\ {LAZY}\ {DOG.}}
    \def\digits{0123456789}
    \def\Symbols{;:\#@\$!+\%-(\&)[*]\{\}.?|}
    \makeatletter
    \def\test[#1]{&%
     \expandafter\@tfor\expandafter\xx\expandafter:\expandafter=\alphabets\do{%
       \ensuremath{\expandafter\csname #1\endcsname{\xx}}\xspace%
     }&%
     \expandafter\@tfor\expandafter\xx\expandafter:\expandafter=\Alphabets\do{%
       \ensuremath{\expandafter\csname #1\endcsname{\xx}}\xspace%
     }&%
     \expandafter\@tfor\expandafter\xx\expandafter:\expandafter=\digits\do{%
       \ensuremath{\expandafter\csname #1\endcsname{\xx}}\xspace%
     }&%
     \expandafter\@tfor\expandafter\xx\expandafter:\expandafter=\Symbols\do{%
       \ensuremath{\expandafter\csname #1\endcsname{\xx}}\xspace%
     }
    }
    \makeatother
    \parindent=0pt
    \begin{document}

    \pagestyle{empty}

    \begin{center}
    \underline{Testing Greek characters.}\\
    \begin{tabular}{ll}
    Upright &\ensuremath{\upPhi}\\
    Italic &\ensuremath{\Phi}\\
    Bold Upright &\ensuremath{\mathbf{\upPhi}}\\
    Bold Italic & \ensuremath{\mathbf{\Phi}}\\
    \end{tabular}
    \end{center}

    \begin{eqnarray*}\label{eqn1}
    \mbox{text}&&\text{text}\ \mathrm{text}\\% upright text
    abc&&\mathit{abc} \\% problem here: non-mathit not working!!!!
    (a+b)^2&=&a^2+2ab+b^2\\
    E&=&mc^2
    \end{eqnarray*}
    \begin{longtable}{lp{12pc}p{12pc}p{4pc}p{6pc}}
    mathbb \test[mathbb]\\
    mathbbb \test[mathbbb]\\
    mathcal \test[mathcal]\\
    mathbcal \test[mathbcal]\\
    mathfrak \test[mathfrak]\\
    mathbfrak \test[mathbfrak]\\
    mathscr \test[mathscr]\\
    mathbscr \test[mathbscr]\\
    mathrm \test[mathrm]\\
    mathit \test[mathit]\\
    mathbf \test[mathbf]\\
    mathbfit \test[mathbfit]\\
    mathsf \test[mathsf]\\
    mathsfit \test[mathsfit]\\
    mathbfsf \test[mathbfsf]\\
    mathtt \test[mathtt]\\
    %mathttit \test[mathttit]\\
    %mathbftt \test[mathbftt]
    \end{longtable}

    \end{document}

Could someone help me in sorting normal alphabets to italic without breaking the Greek characters?

Note: I am using xelatex on TL2015.

  • Please post a minimal example. – Henri Menke Jul 2 '18 at 6:02
  • @HenriMenke, MWE is there. – Jagath Jul 2 '18 at 6:44
  • Yes, an example is there but it's far from minimal. – Henri Menke Jul 2 '18 at 6:46
  • 2
    Do you know about the \symbf and \symup and \symit (etc.) commands? You don't need math-style=literal to get both upright and italic greek unless you want to use unicode glyphs. – Will Robertson Jul 2 '18 at 7:10
  • 5
    mathspec and unicode-math are not compatible; not to speak about mathalfa. – egreg Jul 2 '18 at 8:36
7

I'm not absolutely certain what you're asking, especially because your example is not compilable nor does it make a lot of sense. unicode-math doesn't work with mathspec or mathalfa. All those packages are mutually exclusive.

That said, I think what you want to achieve can already be done in the default settings of unicode-math.

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$abc, \mathit{abc}$

$\Phi, \symit{\Phi}, \symup{\Phi}, \symbf{\Phi}, \symbfit{\Phi}$
\end{document}

enter image description here

  • How can we make the bold italic version of Greek? – Jagath Jul 2 '18 at 9:38
  • Got it! \symbfit{\Phi} will do that. Please update the answer. I will accept that. The problem is that my TL version is 2015 and these features are only available after that. – Jagath Jul 2 '18 at 9:41
  • @Jagath I've added \symbfit{\Phi}. – Henri Menke Jul 2 '18 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.