2
documentclass{article}

\usepackage{textgreek}
%\usepackage[notext,noamsmath,notextcomp]{kpfonts}
%\usepackage{lmodern}

\begin{document}
\textit{\textGamma\textgamma}

\textbf{\textGamma\textgamma}

\textit{\textbf{\textGamma\textgamma}}

\textbf{\textit{\textGamma\textgamma}}
\end{document}

Compiling the above MWE as written, I get four Gamma,gamma pairs in (respectively) italic, bold, and (2x) italic+bold, which is what I both expect and want. I have need (elsewhere in the document being written) for each of the two packages that are commented out. The good news is that if I uncomment the lmodern package (but leave kpfonts inactive), the output remains unchanged.

If I uncomment only the kpfonts package (leaving lmodern inactive), the responses are italic then (3x) bold, the effects of the last two \textit are eliminated. When I uncomment both simultaneously, I get italic followed by (3x) upright+medium weight; no application of \textit in the last two, no application of \textbf anywhere.

In addition to these variants, I've

  • experimented with using \itshape and \bfseries,

  • tried changing the order in which the packages were loaded, and

  • applied \let (and \LetLtxMacro) to the letter macros, to the font modifiers, and to both simultaneously.

The questions: Is there a way to load all of these packages and still allow both \textit and \textbf to act on the text Greek letters from textgreek? Alternatively, is there one or more better (e.g., more recent) packages to use instead of one (or more) of those I've described? I realize the latter question is vague, as I haven't specified why I need those packages. The reality is that I'm only one author among five, and I don't know what all the others are doing.

2

The textgreek package by default uses Computer Modern (the Greek fonts by C. Beccari). But kpfonts sets \bfdefault to b rather than the standard bx, and there are no b/it fonts defined among the Greek cmr fonts.

LaTeX Font Warning: Font shape `LGR/cmr/b/it' undefined
(Font)              using `LGR/cmr/b/n' instead on input line 17.

This explains why you don't get bold italic.

You can fix it by defining the desired font substitutions.

\documentclass{article}

\usepackage{textgreek}
\usepackage[notext,noamsmath,notextcomp]{kpfonts}

\AtBeginDocument{%
  \DeclareFontShape{\encodingdefault}{cmr}{b}{it}{<->ssub*cmr/bx/it}{}%
  \DeclareFontShape{LGR}{cmr}{b}{it}{<->ssub*cmr/bx/it}{}%
}

\begin{document}

\textit{\textGamma\textgamma} (it)

\textbf{\textGamma\textgamma} (bf)

\textit{\textbf{\textGamma\textgamma}} (it,bf)

\textbf{\textit{\textGamma\textgamma}} (bf,it)

\end{document}

enter image description here

|improve this answer|||||
  • Works great ... so long as lmodern is not invoked. Loading that package (AFAIK) changes Computer Modern to Latin Modern. I tried modifying your answer with "lmr" replacing "cmr" (and consulted the lgrlmr.fd file as a sanity check, and added lines for the missing {b}{n}<->{bx}{n} combo), but I get a Font Family `LGR+lmr' unknown error upon compiling. – John McVey May 14 '19 at 19:43
  • @JohnMcVey With Latin Modern you need no adjustment, as far as I can see. Of course it doesn't make any sense to load both kpfonts and lmodern. – egreg May 14 '19 at 20:45
  • One reason for both packages is that kpfonts changes the lowercase greek letters to something I can't stand. Loading lmodern converts it back. But the actual reason goes back to my original statement regarding multiple authors: they each want what they want. – John McVey May 14 '19 at 21:08
  • @JohnMcVey No, there's no good reason for doing that. – egreg May 14 '19 at 21:16
0

As egreg points out in his answer, the problem stems from \bfdefault being set differently than is the norm. A simple work around is \fontseries{bx}\selectfont. I wrote the macro

\newcommand{\textbx}[1]{\fontseries{bx}\selectfont #1}

which is then used instead of \textbf.

|improve this answer|||||

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.