我怎样才能在“baposter”模板中使用两种语言?

我怎样才能在“baposter”模板中使用两种语言?

我找到了这个模板并希望能够在两种语言之间切换。

poster.tex我在和文件中分别使用了以下命令baposter.cls,但是出现了一些奇怪的字母。

[KJO 编辑以说明问题]使用此类文件https://github.com/anriseth/baposter/blob/master/baposter.clsOP 得到了意想不到的结果

在此处输入图片描述

poster.tex文件中:

\documentclass[a0paper,portrait]{baposter}
\usepackage{mwe}
\usepackage{graphicx}
\usepackage{relsize}        % For \smaller
\usepackage{url}            % For \url
% \usepackage{epstopdf} % Included EPS files automatically converted to PDF to include with pdflatex

%%% Global Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\graphicspath{{pix/}}   % Root directory of the pictures 
% \tracingstats=2           % Enabled LaTeX logging with conditionals

%% My code
\usepackage[english,greek]{babel}
\newcommand{\gr}{\selectlanguage{greek}}
\newcommand{\en}{\selectlanguage{english}}

%%% Color Definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definecolor{bordercol}{RGB}{40,40,40}
\definecolor{headercol1}{RGB}{186,215,230}
\definecolor{headercol2}{RGB}{80,80,80}
\definecolor{headerfontcol}{RGB}{0,0,0}
\definecolor{boxcolor}{RGB}{186,215,230}
%%% Utility functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Save space in lists. Use this after the opening of the list %%%%%%%%%%%%%%%%
\newcommand{\compresslist}{
   \setlength{\itemsep}{1pt}
   \setlength{\parskip}{0pt}
   \setlength{\parsep}{0pt}
}


%%% Document Start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}
\typeout{Poster rendering started}

%%% Setting Background Image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\background{
   \begin{tikzpicture}[remember picture,overlay]%
    \draw (current page.north west)+(-2em,2em) node[anchor=north west]
    {\includegraphics[height=1.1\textheight]{background}};
    \end{tikzpicture}
}

%%% General Poster Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% Eye Catcher, Title, Authors and University Images %%%%%%%%%%%%%%%%%%%%%%
\begin{poster}{
      grid=false,
      % Option is left on true though the eyecatcher is not used. The reason is
      % that we have a bit nicer looking title and author formatting in the 
%headercol
% this way
%eyecatcher=false, 
borderColor=bordercol,
headerColorOne=headercol1,
headerColorTwo=headercol2,
headerFontColor=headerfontcol,
% Only simple background color used, no shading, so boxColorTwo isn't necessary
boxColorOne=boxcolor,
headershape=roundedright,
headerfont=\Large\sf\bf,
textborder=rectangle,
background=user,
headerborder=open,
boxshade=plain
}
%%% Eye Cacther %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
     Eye Catcher, empty if option eyecatcher=false - unused
}
%%% Title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\sf\bf
    \gr  Αλγεβρική Θεωρία Γράφων
}
%%% Authors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
      \vspace{1em} {\en Richard O. Legendi, Laszlo Gulyas, George Kampis}\\
      {\en \smaller [email protected], [email protected], [email protected]}
}
%%% Logo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 {
% The logos are compressed a bit into a simple box to make them smaller on the result
% (Wasn't able to find any bigger of them.)
\setlength\fboxsep{0pt}
\setlength\fboxrule{0.5pt}
\fbox{
    \begin{minipage}{14em}
        \includegraphics[width=10em,height=4em]{example-image-a}
        \includegraphics[width=4em,height=4em]{example-image-b} \\
        \includegraphics[width=10em,height=4em]{example-image-c}
        \includegraphics[width=4em,height=4em]{example-image}
    \end{minipage}
     }
  }

 \headerbox{\en Problem}{name=problem,column=0,row=0}{\en
  Sampling networks always involves the act of aggregation (e.g., when collecting longitudinal samples of networks). We sutdy how the cumulation window length effects the properties of the aggregated network.
 %%% change to greek language 
 {\gr Αλγεβρική Θεωρία Γράφων}


}


 \end{poster}
 \end{document}

有人知道要达到这种效果我需要什么命令以及必须将它们放在哪个文件中?

答案1

为了能够使用希腊字符,您应该使用 inputenc 包:

\usepackage[utf8]{输入框}

此外,babel 包参数中的语言顺序也很重要。最后一种语言必须是文档的主要语言。

相关内容