为了完成我的论文,我需要用希腊语写摘要,用英语写其余的正文。我知道这个问题有几种答案,但我相当困惑。
您可以在下面找到我的乳胶手稿和应该出现希腊文的部分:
\documentclass[12pt,journal,onecolumn]{IEEEtran}
\usepackage{cite}
\usepackage[pdftex]{graphicx}
\usepackage{amsmath,amssymb,amsfonts}
%=========================
\let\subparagraph\paragraph
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\Large\bfseries}
{\makebox[40pt][l]{\thesection}}
{0pt}
{}
\titleformat{\subsection}
{\normalfont\large\bfseries}
{\makebox[40pt][l]{\thesubsection}}
{0pt}
{}
\titleformat{\subsubsection}
{\normalfont\large\bfseries}
{\makebox[40pt][l]{\thesubsubsection}}
{0pt}
{}
\titlespacing{\subsubsection}
{0pt}
{1ex plus 0.3ex minus 0.1ex}
{0.5ex plus 0.1ex minus 0.1ex}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
%=========================
%-----------------------------
\titlespacing*{\section}
{0pt}{15pt}{15pt}%{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}
{0pt}{15pt}{15pt}
\titlespacing*{\subsubsection}
{0pt}{15pt}{15pt}
%-----------------------------
\usepackage{parskip}
%\usepackage[english,greek]{babel}
\begin{document}
\title{Bare Demo of IEEEtran.cls\\ for IEEE Journals}
% make the title area
\maketitle
\section*{Abstract in greek language}
This text should be in greek
\section*{Abstract}
% https://www.andy-roberts.net/latex/contents/
\addcontentsline{toc}{section}{Abstract} % Adding lines to tables of contents
The abstract goes here.
\section*{List of Publications}
% https://www.andy-roberts.net/latex/contents/
\addcontentsline{toc}{section}{List of Publications} % Adding lines to tables of contents
The results of this thesis appeared in the following publications:\\
\underline{\textbf{Journals}}:
\begin{enumerate}
\item[$1$.] Items are numbered automatically.
\item[$2$.] The numbers start at 1 with each use of the \texttt{enumerate} environment.
\item[$3$.] Another entry in the list
\end{enumerate}
\underline{\textbf{Conferences}}:
\begin{enumerate}
\item[$1$.] Items are numbered automatically.
\item[$2$.] The numbers start at 1 with each use of the \texttt{enumerate} environment.
\item[$3$.] Another entry in the list
\end{enumerate}
%--------------
\newpage
\thispagestyle{empty}
\mbox{}
\newpage
%-------------
\tableofcontents
\IEEEpeerreviewmaketitle
\newpage
\section{Introduction}
This demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8b and later
\subsection{Subsection Heading Here}
Subsection text here.
\subsubsection{Subsubsection Heading Here}
Subsubsection text here.
\section{Conclusion}
The conclusion goes here.
\appendices
\section{Proof of the First Zonklar Equation}
Appendix one text goes here.
% you can choose not to have a title for an appendix
% if you want by leaving the argument blank
\section{}
Appendix two text goes here.
%\bibliographystyle{IEEEtran}
%\bibliography{References.bib}
% that's all folks
\end{document}
我尝试使用 \usepackage[english,greek]{babel} babel 包,但 pdfLatex 编译返回错误。
答案1
通过反复试验,我终于找到了一个似乎有效的解决方案。\usepackage[english,greek]{babel}
我没有将 babel 包导入为 ,而是将其导入为\usepackage[greek,american]{babel}
。然后,我将所需的部分用希腊语编写为
\section*{\foreignlanguage{greek}{Περίληψη}}
\foreignlanguage{greek}{Γεια σου καλημέρα, γεια σου καλησπέρα, γεια σου καλή νότσες!}
答案2
你需要采取三个行动:
- 将默认语言设为英语(您使用希腊语作为主要语言);
- 使用
otherlanguage*
环境; - 用希腊字体替换字体,因为使用的标准字体
IEEEtran
不支持希腊字体;您可以改用 Tempora。
第一个动作是通过
\usepackage[main=english,greek]{babel}
第三个动作
\DeclareFontFamilySubstitution{LGR}{\familydefault}{Tempora-TLF}
请参阅下面的示例otherlanguage*
\documentclass[12pt,journal,onecolumn]{IEEEtran}
\usepackage[main=english,greek]{babel}
\usepackage{cite}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{parskip}
\let\subparagraph\paragraph
\usepackage{titlesec}
%=========================
\titleformat{\section}
{\normalfont\Large\bfseries}
{\makebox[40pt][l]{\thesection}}
{0pt}
{}
\titleformat{\subsection}
{\normalfont\large\bfseries}
{\makebox[40pt][l]{\thesubsection}}
{0pt}
{}
\titleformat{\subsubsection}
{\normalfont\large\bfseries}
{\makebox[40pt][l]{\thesubsubsection}}
{0pt}
{}
\titlespacing{\subsubsection}
{0pt}
{1ex plus 0.3ex minus 0.1ex}
{0.5ex plus 0.1ex minus 0.1ex}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
%=========================
%-----------------------------
\titlespacing*{\section}
{0pt}{15pt}{15pt}%{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}
{0pt}{15pt}{15pt}
\titlespacing*{\subsubsection}
{0pt}{15pt}{15pt}
%-----------------------------
\DeclareFontFamilySubstitution{LGR}{\familydefault}{Tempora-TLF}
\begin{document}
\title{Bare Demo of IEEEtran.cls\\ for IEEE Journals}
% make the title area
\maketitle
\begin{otherlanguage*}{greek}
\section*{Περίληψη}
\addcontentsline{toc}{section}{\foreignlanguage{greek}{Περίληψη}} % Adding lines to tables of contents
Γεια σου καλημέρα, γεια σου καλησπέρα, γεια σου καλή νότσες!
\end{otherlanguage*}
\section*{Abstract}
% https://www.andy-roberts.net/latex/contents/
\addcontentsline{toc}{section}{Abstract} % Adding lines to tables of contents
The abstract goes here.
\section*{List of Publications}
% https://www.andy-roberts.net/latex/contents/
\addcontentsline{toc}{section}{List of Publications} % Adding lines to tables of contents
The results of this thesis appeared in the following publications:\\
\underline{\textbf{Journals}}:
\begin{enumerate}
\item[$1$.] Items are numbered automatically.
\item[$2$.] The numbers start at 1 with each use of the \texttt{enumerate} environment.
\item[$3$.] Another entry in the list
\end{enumerate}
\underline{\textbf{Conferences}}:
\begin{enumerate}
\item[$1$.] Items are numbered automatically.
\item[$2$.] The numbers start at 1 with each use of the \texttt{enumerate} environment.
\item[$3$.] Another entry in the list
\end{enumerate}
%--------------
\newpage
\thispagestyle{empty}
\mbox{}
\newpage
%-------------
\tableofcontents
\IEEEpeerreviewmaketitle
\newpage
\section{Introduction}
This demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8b and later
\subsection{Subsection Heading Here}
Subsection text here.
\subsubsection{Subsubsection Heading Here}
Subsubsection text here.
\section{Conclusion}
The conclusion goes here.
\appendices
\section{Proof of the First Zonklar Equation}
Appendix one text goes here.
% you can choose not to have a title for an appendix
% if you want by leaving the argument blank
\section{}
Appendix two text goes here.
%\bibliographystyle{IEEEtran}
%\bibliography{References.bib}
% that's all folks
\end{document}