Skip to content

Instantly share code, notes, and snippets.

@aminophen
Created September 10, 2016 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminophen/72c4e27f30877bd09bd146386632e35d to your computer and use it in GitHub Desktop.
Save aminophen/72c4e27f30877bd09bd146386632e35d to your computer and use it in GitHub Desktop.
lltjext.sty が array.sty の機能を壊す & plextarray.sty で [t] の高さが変
\ifdefined\directlua
\documentclass{ltjsarticle}
\usepackage{lltjext}
\usepackage{array}
\else
\documentclass{jsarticle}
\usepackage{plext}
\usepackage{array}
\usepackage{plextarray}
\fi
\makeatletter
\def\@arrayleft{\left(}
\def\@arrayright{\right)}
\makeatother
\begin{document}
\[
\begin{array}[t]{c}
3 \\ 4 \\ 5
\end{array}
\begin{array}[c]{c}
2 \\ 3 \\ 4
\end{array}
\begin{array}[b]{c}
1 \\ 2 \\ 3
\end{array}
\]
\end{document}
@aminophen
Copy link
Author

LuaTeX-ja の場合

上のソースを lualatex で処理すると、エラーが出る。

! Missing \right. inserted.
<inserted text> 
\right .
l.19   \end{array}

これは、"Compatibility with array package" の節の \ltj@lltjext@patch@array の定義中

  \def\endarray{\crcr\egroup\egroup\@end@alignbox}

の最後に \@arrayright を足す必要がある。

pLaTeX の場合

plextarray.sty を読み込んだ場合、[t] の場合の高さが非読み込み時と比べて小さくなる。要調査。

array-leftright-20160910-01

@aminophen
Copy link
Author

LuaTeX-ja のほうは 64f3f68 で修正していただきました。

@aminophen
Copy link
Author

pLaTeX のほうで [t] のときに高さが縮むのは

     \def\@begin@alignbox{\raise\cdp\vtop}%

となっていることが原因。なぜ \raise\cdp しているのかさっぱりわからないが、結局 forum:1355 と同じコードが原因。やはり plext_test にあるように、plext.sty 本体のコードを再検討する必要がある。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment