I am making a multi-language document. With the big help of Mr. Steven B. Segletes, I am able to deal with several languages mixed document, which can only output in wanted one or several laguages. See the thread [ Parse command argument separated by comma ]

I also aliased \mulan to new commands such as \mulanp and \mulanr so that the \mulan command can be simplified when the text is seperated by \par or '/'.

Now I want it can also works in table use. I know I can not insert a multiline sentence in a tab cell. So I hope the contents explained by \mulan command can be treated as a sub-tabular. Just like the following,


will give output

  A \\
  B \\

I don't know how to define it. I tried a lot bu failed. The following is my minimal example. Though I am not sure you can compile it correctly because it includes CJK characters.

% Command \mulan usage example
% Compiled by XeLatex

% CJK character support

%Table packages
\usepackage{longtable}     %long table across multi pages

%CJK settings
\setCJKfamilyfont{zhrm}{SimSun} %Chinese
\setCJKfamilyfont{jarm}{NSimSun} %Japanese
\setCJKfamilyfont{korm}{Batang} %Korean

% \mulan comand defintion to deal with multiple language
\newif\ifen %English
\newif\iffr %French
\newif\ifru %Russian
\newif\ifjp %Japanese
\newif\ifcn %Chinese
\newif\ifkr %Korean
\def\en#1{\ifen\callsep #1\fi\langcmd}
\def\fr#1{\iffr\callsep #1\fi\langcmd}
\def\ru#1{\ifru\callsep #1\fi\langcmd}
\def\jp#1{\ifjp\callsep {\Japanese #1}\fi\langcmd}
\def\cn#1{\ifcn\callsep {\Chinese #1}\fi\langcmd}
\def\kr#1{\ifkr\callsep {\Korean #1}\fi\langcmd}

%specify the multi languge sequence variable globaly


  \expandafter\def\csname arg\romannumeral\value{mulan@args}\endcsname{relax}%

  \expandafter\def\csname arg\romannumeral\value{mulan@args}\endcsname{#1}%

  \csname\csname arg\romannumeral\value{mulan@args}\endcsname\endcsname%

%Convient alias command for \mulan
\def\mulanr{\expandafter\mulan{ \space {\textbf{/}}\space}}

% multiline in tab cell !!! problem yet !!!
%\newcommand{\mulanTL}{\begin{tabular}{l}\expandafter\mulan{\\} \end{tabular} }  
\newcommand{\mulanTL}{\expandafter\mulan{ \space {\textbf{/}}\space}}  


\entrue \jptrue \cntrue

%%%---------This command has not been finished yet------

\title{\mulanp{Multilingual Document}{多言語文書}{多语言文档}}
\author{\mulanr{Jerome}{竹本 松一}{竹本先生}}





\mulanp{This is the text.}{これは正文です。}{这是正文。}

\mulanr{This is an example of table.}{これは表の例}{这是一个表格的例子}

\mulanTL{Japanese traditional craft, it can be seen even nowadays}{日本の伝統的な芸術}{日本传统艺术}  

 \mulanr{Item}{項目}{项目} & Price(USD) & \mulanr{Repark}{注釈}{备注}\\
 \mulanr{Japanese Paper}{和紙}{日本纸}  & 15.0 & \mulanTL{Japanese traditional craft, it can be seen even nowadays}{日本の伝統的な芸術}{日本传统艺术}    \\


If the number of arguments is fixed to, e.g. 3. I can make the command as follows,



Is there any means to deal with the case with variable number of arguments? if it requires the editing of the definiton of command \mulan, that will also be O.K. Thanks in advance.

closed as unclear what you're asking by Andrew Swann, Gonzalo Medina, user13907, moewe, user31729 Jun 13 '15 at 20:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • So are the number of arguments to \mulanTL variable? Or will it always be 3? – Werner Feb 13 '15 at 1:46
  • The number of arguments to \mulan varies. It is better if you define \mulanTL with a variable number aguments too. If it is impossible to define that, you can fixed it as three. – Jilong Yin Feb 13 '15 at 2:07
  • Is there anybody help me more? – Jilong Yin Feb 15 '15 at 12:28
  • @Werner please see Jilong's comment above. Jilong, please use @-notation (as I've done here for Werner) to notify them of your reply to a comment. – Paul Gessler Mar 15 '15 at 2:20
  • If it is a variable number of arguments, what syntax do you want to use? One needs some way to know that there are no more arguments to process. – Andrew Swann Jun 13 '15 at 19:00

Browse other questions tagged or ask your own question.