7

Im trying to load both mtpro2 (full version) and txfontsb packages in the same document but i get this error:

Command \Bbbk already defined. \newcommand{\Bbbk}{\mathbb{k}}

If I place the txfontsb pachage after mtpro2 I get weird symbols instead of + or =

\documentclass[a4paper,11pt]{article}
 \usepackage{psfrag}
 \usepackage[english,greek]{babel}
 \usepackage[iso-8859-7]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage{mtpro2}
 \usepackage{txfontsb}
 \usepackage[left=2.00cm, right=2.00cm, top=3.00cm, bottom=3.00cm]{geometry}
 \usepackage{tikz}
 \usepackage{tkz-euclide,tkz-fct}
 \usepackage{wrapfig}
 \usepackage{calc}

 \begin{document}
 $ a+\beta=1 $
 \end{document}

How can I make them work together?

TeXnician
  • 33,589
mac
  • 1,479

2 Answers2

9

It is because both the packages define the command \Bbbk. mtpro2 does this:

\newcommand{\Bbbk}{\mathbb{k}}

while txfontsb the following:

\re@DeclareMathSymbol{\Bbbk}{\mathord}{AMSb}{"7C}

You can get rid of this by either undefining one of them like:

 \usepackage{txfontsb}
 \let\Bbbk\relax
 \usepackage[lite]{mtpro2}

In case if you want to use both of them, then you can copy the definition of one of them

 \usepackage{txfontsb}
 \let\myBbbk\Bbbk
 \let\Bbbk\relax
 \usepackage[lite]{mtpro2}

Then the Bbbk defined by txfontsb will be available as \myBbbk.

This is untested as I don't have mtpro2.

1

The txfontsb package loads txfonts, which I wouldn't recommend to.

Here's what txfontsb does (with some improvements):

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % or iso-8859-7
\usepackage[english,greek]{babel}

\usepackage{newtxtext}% for text fonts
\usepackage[lite]{mtpro2}

\DeclareRobustCommand{\scshape}{%
  \iflanguage{greek}{\fontfamily{txrc}}{}\fontshape{sc}\selectfont
}
\DeclareTextFontCommand{\textsc}{\scshape}
\DeclareRobustCommand{\scslshape}{%
  \fontfamily{txrc}\fontseries{m}\fontshape{sco}\selectfont
}
\DeclareTextFontCommand{\textscsl}{\scslshape}
\makeatletter
\@ifpackagewith{inputenc}{iso-8859-7}{%
      \DeclareInputText{242}{c}
}{}                 
\DeclareTextCommand{\Digamma}{LGR}{\char"C3\relax}
\DeclareTextCommand{\ddigamma}{LGR}{\char"93\relax}
\DeclareTextCommand{\tao}{LGR}{\char"01\relax}
\DeclareTextCommand{\Qoppa}{LGR}{\char"14\relax}
\DeclareTextCommand{\varqoppa}{LGR}{\char"13\relax}
\DeclareTextCommand{\Sampi}{LGR}{\char"13\relax}
\DeclareTextCommand{\sampi}{LGR}{\char"13\relax}
\DeclareTextCommand{\vardigamma}{LGR}{\char"07\relax}
\DeclareTextCommand{\Stigma}{LGR}{\textlatin{\char"43\relax}}
\DeclareTextCommand{\VarQoppa}{LGR}{\textlatin{\char"47\relax}}   
\DeclareTextCommand{\euro}{LGR}{\char"18\relax}
\DeclareTextCommand{\Euro}{LGR}{\char"18\relax}

\begin{document}

Some text and some math $\alpha+1$

\textsc{Some text}

\begin{otherlanguage*}{english}
Some text \textsc{Some text}
\end{otherlanguage*}

\end{document}

enter image description here

egreg
  • 1,121,712