アラビア語の転写の配置 - ʾ と ʿ

アラビア語の転写の配置 - ʾ と ʿ

アラビア文字の転写で言語例をタイプセットする場合ハムザそしてアイン、ʾ、ʿ をそれぞれ使用した場合、下の行の直訳との配置が不自然になります。例 (1) を参照してください。これはリストや表形式の環境にも当てはまります。表 1 の配置は見栄えがよくありません。

これを解決するには、 を使用して\llap{ʾ}この文字を左に押し出し、単語を 2 番目の文字に揃えます。これにより、(私見では) はるかに見栄えの良い例 (2) と表 2 が得られます。

さて、私の質問です。これを自動化する方法はありますか?特定の環境、主に で、 ʾ と ʿ の 2 つの文字の前にスペース (可能であればタブ文字も) がある場合に、これらの文字を および にしたい\llap{ʾ}と考えています。このソリューションは、表 1 のコードのように、項目の前にスペースを追加することで表に対して機能します。これらの文字を有効にすることは可能だと思います。 (私が理解している限りでは、使用している XeLaTeX で Unicode 文字を有効にすることは可能です。) については知っていますが、ここで必要なのは のようなものでしょう。\llap{ʿ}example\@ifnextchar\@ifprevchar

編集: 環境内の例の転写に個々の単語を配置できるソリューションが必要です\textbf{}

\documentclass{article}
\usepackage{fontspec}
%\usepackage[utf8]{inputenc}
\usepackage{array}

\usepackage{covington}


\begin{document}


\begin{example}
\gll bi-lātīk ʾanā ʾaktub ʾaḥla nuṣūṣ
with-latex I write prittyest texts
\glt `With \LaTeX{} I can write the prettiest texts.'
\glend
\end{example}

\begin{example}
\gll bi-lātīk \llap{ʾ}anā \llap{ʾ}aktub \llap{ʾ}aḥla nuṣūṣ
with-latex I write prittyest texts
\glt `With \LaTeX{} I can write the prettiest texts.'
\glend
\end{example}

\begin{table}[h!]
\centering
\caption{Ugly alignment}
\begin{tabular}{>{\itshape}ll}
 ʾanna & comp.\\
 ʾinna & `verily'\\
 lākinna & `but'\\
 laʿalla & `perhaps'\\
 layta & `if only'\\
\end{tabular}
\end{table}


\begin{table}[h!]
\centering
\caption{Nice alignment}
\begin{tabular}{>{\itshape}ll}
\llap{ʾ}anna & comp.\\
\llap{ʾ}inna & `verily'\\
lākinna & `but'\\
laʿalla & `perhaps'\\
layta & `if only'\\
\end{tabular}
\end{table}

\end{document}

ここに画像の説明を入力してください

答え1

簡単ではありませんが、少なくともtabularおよびexampleまたは については実行可能ですexamples。列テーブルでフォントの変更を指定する方法に注意してください。

\documentclass{article}
\usepackage{fontspec}

\usepackage{etoolbox,array,collcell}

\usepackage{covington}

\makeatletter
\newrobustcmd{\checkforstart}{%
  \@ifnextchar ʾ{\llap}{\checkforayn}%
}
\newcommand{\checkforayn}{%
  \@ifnextchar ʿ{\llap}{}%
}
\makeatother

\newcolumntype{H}[1]{>{#1\collectcell\docheckforstart}l<{\endcollectcell}}
\newcommand{\docheckforstart}[1]{\checkforstart #1}


\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% For technical reasons this can't go in the preamble, sorry
\catcode`\^^M=12
\patchcmd{\getwords}{\strut}{\strut\checkforstart}{}{}%
\catcode`\^^M=5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{example}
\gll bi-lātīk ʾanā ʾaktub ʾaḥla nuṣūṣ ʿTEST
with-latex I write prittyest texts TEST
\glt `With \LaTeX{} I can write the prettiest texts.'
\glend
\end{example}

\begin{example}
\gll bi-lātīk \llap{ʾ}anā \llap{ʾ}aktub \llap{ʾ}aḥla nuṣūṣ ʿTEST
with-latex I write prittyest texts TEST
\glt `With \LaTeX{} I can write the prettiest texts.'
\glend
\end{example}

\begin{tabular}{H{\itshape} l}
ʾanna & comp.\\
ʾinna & `verily'\\
lākinna & `but'\\
laʿalla & `perhaps'\\
layta & `if only'\\
\end{tabular}

\end{document}

ここに画像の説明を入力してください

関連情報