3

I'm using lualatex 0.95 and up-to-date bm package. Before updating lualatex, I could always use \bm{} but I can't use it any longer.

Compile seems to go with no problem.

Here is the code.

\documentclass{ltjarticle}
\usepackage{luatexja}
\usepackage{bm}

\begin{document}

\bm{a}

\end{document}

How can I solve this problem?


Other people have the same problem.

Japanese Forum http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1947

StackExchange Lualatex and bm package

StackExchange Problems with \bm and LuaLaTeX


Thank you in advance.

ynn
  • 243
  • 1
    \bm has to be used in math mode. – David Carlisle Jul 07 '16 at 06:48
  • 2
    in math mode you get no error but get Missing character: There is no ա (U+0561) in font cmmi10! this is luatex breakage, I thought I'd adapted bm for that case, but either luatex changed again or the bm patch didn't get distributed, I'll check... – David Carlisle Jul 07 '16 at 07:53

1 Answers1

3

Sorry I fixed this earlier but it seems I never pushed the fix to the public distribution. You can extend the testing to be luatex aware as shown below.

enter image description here

\documentclass{ltjarticle}
\usepackage{luatexja}
\usepackage{bm}

\makeatletter
\def\bm@test@token#1{%
  \let\bm@next\@empty
  \ifx#1\@@end
  \else\ifx#1\mathchoice
    \let\bm@next\bm@mathchoice
  \else\ifx#1\mathchar
    \afterassignment\bm@mathchar\count@
  \else\ifx#1\mathaccent
    \afterassignment\bm@mathaccent\count@
  \else\ifx#1\delimiter
    \afterassignment\bm@delimiter\count@
  \else\ifx#1\radical
    \afterassignment\bm@radical\count@
  \else\ifx#1\mkern
    \bm@register#1{\muskip\z@}%
  \else\ifx#1\kern
    \bm@register#1\skip@
  \else\ifx#1\penalty
    \bm@register#1\count@
  \else\ifx#1\unvcopy
    \let\bm@next\bm@add
  \else\ifcat\noexpand#1\relax
    \xdef\meaning@{\meaning#1}%
    \expandafter\bm@mchar@test\meaning@""""\@nil#1%
  \else\ifcat.\ifcat a#1.\else#1\fi
    \count@\mathcode`#1\relax
    \ifnum\count@=\mathcode`\'%
      \begingroup\uccode`\~`#1\uppercase{\endgroup
        \def\bm@next{\bm@expand~}}%
    \else
      \ifx\bm@previous\left
        \count@\delcode`#1\relax
        \bm@delimiter
      \else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        \ifnum\count@>"8000
\Umathcharnumdef\@tempa\count@
\xdef\meaning@{\meaning\@tempa}%
\expandafter\bm@mchar@test\meaning@""""\@nil\@tempa
\else
        \bm@mathchar
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      \fi
    \fi
  \else
    \bm@add{#1}%
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \bm@next}
\makeatother

\begin{document}

$a+\bm{a}$

\end{document}
David Carlisle
  • 757,742
  • oh this is exactly the code I posted to http://tex.stackexchange.com/questions/314863/lualatex-and-bm-package so I'll vote to close this as duplicate. – David Carlisle Jul 07 '16 at 08:01