LoginSignup
2
0

More than 5 years have passed since last update.

LaTeXのマクロの中でtabularxを使う

Posted at

以下のようなマクロを使うとエラーになる:

test.tex
\documentclass{jarticle}

\usepackage{tabularx}

\newenvironment{conversation}
  {\begin{tabularx}{14cm}{rX}}
  {\end{tabularx}}

\begin{document}

\begin{conversation}
 太郎 & 「あげぽよ」 \\
 次郎 & 「さげぽよ」
\end{conversation}

\end{document}
$ platex test.tex
This is e-pTeX, Version 3.1415926-p3.2-110415-2.3 (utf8.euc) (TeX Live 2011)
 restricted \write18 enabled.
entering extended mode
(./test.tex
pLaTeX2e <2006/11/10> (based on LaTeX2e <2009/09/24> patch level 0)
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, af
rikaans, arabic, basque, bulgarian, catalan, pinyin, croatian, czech, danish, d
utch, ukenglish, usenglishmax, esperanto, estonian, farsi, finnish, french, gal
ician, german, ngerman, swissgerman, hungarian, icelandic, indonesian, interlin
gua, irish, italian, kurmanji, latin, latvian, lithuanian, mongolian, mongolian
lmc, bokmal, nynorsk, polish, portuguese, romanian, russian, serbian, serbianc,
 slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian
, welsh, ancientgreek, ibycus, monogreek, greek, coptic, loaded.
(/usr/local/texlive/2011/texmf-dist/tex/platex/base/jarticle.cls
Document Class: jarticle 2006/06/27 v1.6 Standard pLaTeX class
(/usr/local/texlive/2011/texmf-dist/tex/platex/base/jsize10.clo))
(/usr/local/texlive/2011/texmf-dist/tex/latex/tools/tabularx.sty
(/usr/local/texlive/2011/texmf-dist/tex/latex/tools/array.sty)) (./test.aux))
Runaway argument?

! File ended while scanning use of \TX@get@body.
<inserted text> 
                \par 
<*> test.tex

? 

これの5章に書いてあるが、次のようにすればいいらしい。

\newenvironment{conversation}
  {\tabularx{14cm}{rX}}
  {\endtabularx}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0