Tíquete #28968

tabularx with luatexja

: 2012-07-11 02:40 Última Atualização: 2012-07-14 13:03

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
(Nenhum)
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
Nenhum

Details

(MaQiYuanさんからの報告を受けて調査しました.英語で書きます.)

A minimal example:

\documentclass{article}
\usepackage{tabularx,luatexja}
\begin{document}
\begin{tabularx}{3cm}{l}
a
\end{tabularx}
\end{document}

Error message:

! Package array Error:  Illegal pream-token (\csname): `c' used.

See the array package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.13 \end{tabularx}
                   
?

The cause of the error is at line 86 of tabularx.sty (1999/01/07 v2.07):

    \csname tabular*\expandafter\endcsname\expandafter\TX@target
      \the\toks@
    \csname endtabular*\endcsname}%
When luatexja is loaded, this \toks@ seems to be empty. Therefore, the next \csname is passed as the second argument to \tabular*.

The following code works with no errors (added $a$ before tabularx environment):

\documentclass{article}
\usepackage{tabularx,luatexja}
\begin{document}
$a$
\begin{tabularx}{3cm}{l}
a
\end{tabularx}
\end{document}
By commenting out lines 36--40 of lltjdefs.sty (definition of Japanese math font family), you can also avoid the error.

Ticket History (3/6 Histories)

2012-07-11 02:40 Updated by: kmaeda
  • New Ticket "tabularx with luatexja" created
2012-07-11 06:32 Updated by: h7k
Comentário

The cause of the error is at line 86 of tabularx.sty (1999/01/07 v2.07):
...
When luatexja is loaded, this \toks@ seems to be empty. Therefore, the next \csname is passed as the second argument to \tabular*.

\toks@ (=\toks0) was resetted by

  \edef\math@fonts{\math@fonts\ltjsetparameter{%
    jatextfont={#1,\textfont@name},%
    jascriptfont={#1,\scriptfont@name},%
    jascriptscriptfont={#1,\font@name}}}%
at the definition of \ltj@@ja@getanddefine@fonts (in lltjfont.sty). \ltjsetparameter (or \setkeys) destroys \toks@.

\ltj@@ja@getanddefine@fonts is called when new Japanese math font is needed. So, the reason that added $a$ before tabularx environment works fine is that Japanese math fonts were already defined before \begin{tabularx}, because of $a$.

2012-07-11 06:53 Updated by: h7k
Comentário

Fixed in the commit e07553c (kitagawa_test branch).

luatexja-core.sty:

\protected\def\ltj@setpar@global{%
  \ifnum\globaldefs>0\directlua{luatexja.isglobal='global'}\else\directlua{luatexja.isglobal=''}\fi
}

lltjfont.sty:

\ltj@temptoks{\ltj@@set@stackfont}
  \edef\math@fonts{\math@fonts\ltj@setpar@global%
    \the\ltj@temptoks#1,\textfont@name:{mjtext}%
    \the\ltj@temptoks#1,\scriptfont@name:{mjscr}%
    \the\ltj@temptoks#1,\font@name:{mjss}%
  }%

2012-07-11 07:06 Updated by: kmaeda
Comentário

Fixed in the commit e07553c (kitagawa_test branch).

The example code works fine now. Thanks.

2012-07-11 07:44 Updated by: h7k
  • Resolução Update from Nenhum to Fixed
  • Dono Update from (Nenhum) to h7k
2012-07-14 13:03 Updated by: h7k
  • Estado Update from Aberto to Fechado
  • Ticket Close date is changed to 2012-07-14 13:03

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login