使用 polyglossia 下的词汇表包,我调整了呈现英语和法语词典的示例文件 示例语言.tex我对这 3 种语言的使用。结果就是我想要的,没有一些细节。我想以双列模式打印我的词汇表,但这三种模式都无法实现。我可以使用选项 twocolumn... \documentclass[twocolumn]{article} 和命令 \LTRdblcolumn 为拉丁语(英语和法语)执行此操作。请注意,主要语言是阿拉伯语。对于阿拉伯语词汇表,我使用 multicol 包。我给出获得的 3 个词汇表:
我给出了生成这些词汇表的 tex 文件:
\documentclass[twocolumn]{article}
%\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{multicol}
\usepackage{geometry}
\geometry{paperwidth=165mm, paperheight=235mm}
\geometry{hmargin=2.5cm,vmargin=2.5cm,headheight=14pt,includefoot}
\usepackage[nomain,nonumberlist]{glossaries}
%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}
% Define the 3 glossaries glg: english order, flg: french order, alg: arabic order
\newglossary[glg]{english}{gls}{glo}{English Entries}
\newglossary[flg]{french}{flx}{flo}{{\selectlanguage{french}Termes Français}}
\newglossary[alg]{arabic}{alx}{alo}{\RL{المفردات العربية}\vspace*{3mm}}
%Activate glossary commands
\makeglossaries
%These commands sort the 3 lists in command prompt
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.alg -o filename.alx filename.alo
%makeindex -s filename.ist -t filename.flg -o filename.flx filename.flo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Packages of the languages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\setotherlanguage{french}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\newfontfamily\englishfont[Scale=1]{Times New Roman}
\newfontfamily\frenchfont[Scale=1]{Times New Roman}
\setmonofont{Courier New}
\let\arabicfonttt\ttfamily
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ORGANIZATION OF ENTRIES FOR GLOSSARIES
%% GLOSSARY WORDS IN 6 ENTRIES
%% THE FIRST ONE #1 IS ARABIC USED FOR SORTING THE ARABIC ENTRIES
%% THE SECOND ONE #2 IS ARABIC AND CONTAINS THE ARABIC ENTRY
%% THE THIRD ONE #3 IS ENGLISH USED FOR SORTING THE ENGLISH ENTRIES
%% THE FOURTH ONE #4 IS ENGLISH AND CONTAINS THE ENGLISH ENTRY
%% THE FIFTH ONE #5 IS FRENCH USED FOR SORTING THE FRENCH ENTRIES
%% THE SIXTH ONE #6 IS FRENCH AND CONTAINS THE FRENCH ENTRY
%%% THE OPTION name={} SUPPRESSES THE ENTRY IN THE GLOSSARY...INCLUDED BY HAND IN THE TABULAR
\newcommand*{\newword}[6]{%
\newglossaryentry{en-#3}{type=english,name={},sort={#3},
description={%
\begin{tabular}{p{5 cm}}
\hline
\\ \vspace*{-5mm}
\textbf{#4}
\\ \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6}
\\ \vspace*{-5mm}
{\selectlanguage{arabic}
\aemph{عربي}:
#2}
\end{tabular}
\vspace*{-5mm}
}}%
\newglossaryentry{fr-#3}{type=french,name={},text={#6},sort={#5},
description={%
\begin{tabular}{p{5 cm}}
\hline
\\ \vspace*{-5mm}
{\selectlanguage{french} \textbf{#6}}
\\ \vspace*{-5mm}
{\selectlanguage{english}\textit{Eng:} #4}
\\ \vspace*{-5mm}
{\selectlanguage{arabic}
\RL{
\aemph{عربي}:
#2}
\vspace*{-5mm}
}
\end{tabular}
\vspace*{-5mm}
}
}%
\newglossaryentry{ar-#3}{type=arabic,name={},text={#2},sort={#1},
description={
\vspace*{-5mm}
\begin{tabular}{p{5.2 cm}}
\hline
\\ \vspace*{-5mm}
\textbf{#2}
\\ \vspace*{-5mm}
{\selectlanguage{english}\textit{Eng:} #4}
\\ \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6}
\end{tabular}
}}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END GLOSSARIES
%%%%%%%%%%%%% ENTRIES
\newword{دالةمتصلة}{دالة متصلة}{ContinuousFunction}{Continuous Function}{FonctionContinue}{Fonction Continue}
\newword{متباينةبوول}{متباينة بوول}{BoolesInequality}{Boole's Inequality}{InegalitedeBoole}{Inégalité de Boole}
\newword{فراغعينة}{فراغ العيّنة}{SampleSpace}{Sample Space}{Universdeprobabilite}{Univers de probabilit\'e}
\begin{document}
\gls{en-ContinuousFunction} \gls{fr-ContinuousFunction} \gls{ar-ContinuousFunction}
\gls{en-BoolesInequality} \gls{fr-BoolesInequality} \gls{ar-BoolesInequality}
\gls{en-SampleSpace} \gls{fr-SampleSpace} \gls{ar-SampleSpace}
\selectlanguage{english}
\LTRdblcol
\printglossary[type=english]
%%\newpage
\selectlanguage{french}
\LTRdblcol
\printglossary[type=french]
\newpage
\RTLdblcol
\selectlanguage{arabic}
\begin{multicols}{2}[]
\printglossary[type=arabic]
\end{multicols}
\end{document}
现在,我的问题是:
1/ 我该如何解决同一文件中英语和阿拉伯语词汇表的两列问题?
2/ 我使用的命令是否适合我的目的? 有没有更“优雅”且更强大的方法?
答案1
我给出了一个用来生成可接受解决方案的 .tex 文件:
\documentclass{book}
\usepackage{amsmath,amssymb}
\usepackage{titleps}
\usepackage{multicol}
\usepackage{geometry}
\geometry{paperwidth=165mm, paperheight=235mm}
\geometry{hmargin=2.5cm,vmargin=2.5cm,headheight=14pt,includefoot}
\usepackage[nomain,nonumberlist]{glossaries}
%%\usepackage[entrycounter,nomain,nonumberlist]{glossaries}
%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}
% Define the 3 glossaries glg: english order, flg: french order, alg: arabic order
\newglossary[glg]{english}{gls}{glo}{English Entries}
\newglossary[flg]{french}{flx}{flo}{{\selectlanguage{french}Termes Français}}
\newglossary[alg]{arabic}{alx}{alo}{\RL{المفردات العربية}\vspace*{10mm}}
%Activate glossary commands
\makeglossaries
%These commands sort the 3 lists, on command prompt
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.alg -o filename.alx filename.alo
%makeindex -s filename.ist -t filename.flg -o filename.flx filename.flo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Commands used for the languages
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\setotherlanguage{french}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}
\newfontfamily\englishfont[Scale=1]{Times New Roman}
\newfontfamily\frenchfont[Scale=1]{Times New Roman}
\setmonofont{Courier New}
%%%\setmonofont{DejaVu Sans Mono}
\let\arabicfonttt\ttfamily
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ORGANIZE ENTRIES AND GLOSSARIES
\newcommand*{\newword}[6]{%
\newglossaryentry{en-#3}{type=english,name={},sort={#3},
description={%
\begin{tabular}{p{5 cm}}
\hline
\\ \vspace*{-5mm}
\textbf{#4}
\\ \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6}
\\ \vspace*{-5mm}
{\selectlanguage{arabic}
\aemph{عربي}:
#2}
\end{tabular}
\vspace*{-5mm}
}
}%
\newglossaryentry{fr-#3}{type=french,name={},text={#6},sort={#5},
description={%
\begin{tabular}{p{5 cm}}
\hline
\\ \vspace*{-5mm}
{\selectlanguage{french} \textbf{#6}}
\\ \vspace*{-5mm}
{\selectlanguage{english}\textit{Eng:} #4}
\\ \vspace*{-5mm}
{\selectlanguage{arabic}
\RL{
\aemph{عربي}:
#2
}
\vspace*{-5mm}
}
\end{tabular}
\vspace*{-5mm}
}
}%
\newglossaryentry{ar-#3}{type=arabic,name={},text={#2},sort={#1},
description={
\vspace*{-5mm}
\begin{tabular}{p{5.2 cm}}
\hline
\\ \vspace*{-5mm}
\textbf{#2}
\\ \vspace*{-5mm}
{\selectlanguage{english}\textit{Eng:} #4}
\\ \vspace*{-5mm}
{\selectlanguage{french}\textit{Fr:} #6
}
\end{tabular}
}
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END GLOSSARIES
%% Here is the file of data entries
\input{Entries_Dic_AEF.tex}
\newpagestyle{Dictionary}{
\setheadrule{0pt}% Header rule
% \setfootrule{0.4pt}% Header rule
\renewcommand{\makefootrule}{\rule[\baselineskip]{\linewidth}{0.4pt}}
\setfoot[]% even left
[\thepage]% even centre
[]% even right
{}% odd left
{\thepage}% odd centre
{}% odd right
}
\begin{document}
\pagestyle{Dictionary}
%% Here is the file of glossary data entries
\input{Entries_GLS_Dic_AEF}
%% The english dictionnary
%\selectlanguage{english}
%\title{Dictionary of mathematical terms}
%\author{English-French-Arabic}
%\date{}
%%%\maketitle
% \LTRdblcol
%\printglossary[type=english]
%% The french dictionnary
%\selectlanguage{french}
%\title{Lexique des termes mathématiques}
%\author{Français-Anglais-Arabe}
%\date{}
%%%\maketitle
%\LTRdblcol
%\printglossary[type=french]
%% The arabic dictionnary
\newpage
\title{معجم مصطلحات الرياضيات}
\author{عربي-انجليزي-فرنسي}
\date{}
%%%\maketitle
\RTLdblcol
\selectlanguage{arabic}
\begin{multicols}{2}[]
\printglossary[type=arabic]
\end{multicols}
\end{document}
它使用以下数据条目文件Entries_Dic_AEF.tex
:
\newword{دالةمتصلة}{دالة متصلة}{continuousFunction}{continuous function}{fonctionContinue}{fonction continue}
\newword{متباينةبوول}{متباينة بوول}{boolesInequality}{Boole's inequality}{inegalitedeBoole}{inégalité de Boole}
\newword{متباينة}{متباينة}{inequality}{inequality}{inegalite}{inégalité}
\newword{قانونإحتواءالإبعاد}{قانون الإحتواء-الإبعاد}{inclusionExclusionIdentity}{inclusion-exclusion Identity}{inclusionExclusionEgalite}{inclusion-Exclusion, Egalité}
以及以下词汇表数据条目文件Entries_GLS_Dic_AEF.tex
:
\gls{en-continuousFunction}\gls{en-boolesInequality}\gls{en-inequality}\gls{en-inclusionExclusionIdentity}
\gls{fr-continuousFunction}\gls{fr-boolesInequality}\gls{fr-inequality}\gls{fr-inclusionExclusionIdentity}
\gls{ar-continuousFunction}\gls{ar-boolesInequality}\gls{ar-inequality}\gls{ar-inclusionExclusionIdentity}
请注意,我的文件包含更多条目,如果有的话,我可以发布它!
现在我使用此文件分别生成三种语言的词典,方法是在每种语言中注释其他两种命令语言。(在此 .tex 文件中,我生成了阿拉伯语词典)...