1

I'd like to give a minimal working sample first.

\documentclass[zihao=-4,b5paper,twoside]{ctexbook}
\usepackage{lipsum}

\usepackage{newtxmath}
\usepackage{baskervald}
\usepackage[T1]{fontenc}
\usepackage{cabin} % sans serif
\usepackage[cal=cm,bb=ams,frak=euler,scr=rsfs]{mathalfa}%4 kinds of math symbol fonts

\begin{document}

\chapter{万里长城}
\section{The GRW and Four SOV}
\[\alpha+\beta=\gamma,\quad \omega=\phi+\psi,\quad\Omega+\Gamma=\Sigma.\]
\par So we have the \emph{most important and mixed} thing. \emph{Thanks very much!}
\[\mathbf{BOSS}, \mathit{abc}.\]

\end{document}

Compiling them by XeLatex, we can get not only a PDF but also warnings as follows:

enter image description here enter image description here

As we seen, mathbf and mathit can't work since they are not defined as what warning information tells us.

So my QUESTION is how to define TU/ybv/bx/n and TU/ybv/m/it, or solve these problems?.

Any help would be appreciated.

8
  • 4
    \mathbf and \mathit are defined, but the font shape to which they lead isn't defined/known.
    – Skillmon
    Jan 14, 2018 at 11:32
  • @Skillmon, but in these packages, they are not defined and so replaced.
    – M. Logic
    Jan 14, 2018 at 11:36
  • 1
    My point is that there are macros named \mathbf and \mathit (else there would be an "undefined control sequence" error) so they are defined. The font shapes were not available which would've been used by those two switches (as the last warning you show concludes).
    – Skillmon
    Jan 14, 2018 at 12:52
  • Such a document is supposed to be run with pdflatex, not with LuaLaTeX or XeLaTeX.
    – egreg
    Jan 14, 2018 at 14:03
  • @egreg pdflatex can't work; using Lualatex has the same problem as using XeLatex.
    – M. Logic
    Jan 14, 2018 at 14:08

2 Answers 2

1

I included \usepackage{eulervm} as the last line of prelude. Works for me (TeXLive 2016). It would probably work also with less arcane math fonts, such as fourier (bold math might be a problem) or mathdesign.

enter image description here


Update: But this put Euler font everywhere in math, notice Omega in my first screenshot. Here is a further hack.

\documentclass[zihao=-4,b5paper,twoside]{ctexbook}
\usepackage{lipsum}

\usepackage{Baskervaldx}
\usepackage[T1]{fontenc}
\usepackage{cabin} % sans serif

\usepackage{eulervm}
\usepackage[baskervaldx]{newtxmath}

\usepackage[cal=cm,bb=ams,frak=euler,scr=rsfs]{mathalfa}%4 kinds of math symbol fonts

\begin{document}

\chapter{万里长城}
\section{The GRW and Four SOV}
\[\alpha+\beta=\gamma,\quad \omega=\phi+\psi,\quad\Omega+\Gamma=\Sigma.\]
\par So we have the \emph{most important and mixed} thing. \emph{Thanks very much!}
\[\mathbf{BOSS}, \mathit{abc}.\]

\end{document}

It is possible to beat newtxmath into loading the proper variant of BaskervaldX. And after some logic-defining loading of eulervm before, it also produces bold and italic maths. There is still a font replacement warning, but it's for some special symbols or something. You get a more sane Omega and bold and italic maths from newtxmath.

enter image description here

5
  • It still doesn't solve my problems!
    – M. Logic
    Jan 14, 2018 at 13:19
  • There is bold math and italic math, but in a different font. I'd try something different next and 'll report if it works. Jan 14, 2018 at 13:21
  • Is it better now? Jan 14, 2018 at 13:32
  • I don't want to use \usepackage{eulervm} or make equation symbol font be [baskervaldx], and so the problem still exists.
    – M. Logic
    Jan 14, 2018 at 13:48
  • See my second answer, it makes sense to switch to fontspec completely. Jan 14, 2018 at 15:54
0

Here is an alternative, completely dismissing font packages from "normal" LaTeX and switching to xelatex's fontspec. I picked a different Asian font, but adjustment should be straightforward, as also for main body fonts.

enter image description here

\documentclass{book}
\thispagestyle{empty}

\usepackage{fontspec}
\setmainfont{Baskervald ADF Std}
\setmathrm{Baskervald ADF Std}
\newfontfamily{\eastern}{Adobe Kaiti Std}

\begin{document}

\chapter{\eastern 万里长城}
\section{The GRW and Four SOV}
\[\alpha+\beta=\gamma,\quad \omega=\phi+\psi,\quad\Omega+\Gamma=\Sigma.\]
\par So we have the \emph{most important and mixed}
thing. \emph{Thanks very much!}
Test \textbf{bold}.
\[\mathbf{BOSS}, \mathit{abc}.\]

\end{document}
2
  • Thanks although It still doesn't give what I want.
    – M. Logic
    Jan 15, 2018 at 4:52
  • I don't quite understand what you want then. Jan 15, 2018 at 10:01

You must log in to answer this question.

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