オリジナルの解決策

オリジナルの解決策

2つの言語で記事を作成する必要があります。このコード

\begin{document}

\author{Author Name 1}
\author{Author Name 2}

\affil[1]{Affiliation of the Author 1}
\affil[2]{Affiliation of the Author 2}

\title{Title in Russian}
\date{}

\maketitle
\thispagestyle{firststyle}

\renewcommand{\abstractname}{}
\begin{abstract}
\label{firstpage}
\noindent \textbf{Аннотация:} Abstract in Russian.\par
\vspace{10pt}
\noindent \textbf{Ключевые слова:} keywords in Russian.
\end{abstract}

\section{First section}
Text of the article
\end{document}

記事のロシア語部分に関しては、これで十分です。、、コマンド\authorを繰り返すことができないことを考慮すると、残りの部分(英語の要約とキーワードまで)はどのようにすればよいでしょうか?\title\maketitle

追加コメントありがとうございます! Jon のアドバイスに従ってtitlingパッケージを使用しました。コードは次のようになります。

\documentclass[12pt,a4paper]{article}
\usepackage{cmap}                   
\usepackage{mathtext}               
\usepackage[T2A]{fontenc}           
\usepackage[utf8]{inputenc}         
\usepackage[english,russian]{babel} 
\usepackage{indentfirst}
\frenchspacing
\usepackage{authblk} 
\usepackage{titling} 
\begin{document}
\preauthor{\large}
\DeclareRobustCommand{\authoring}{
    \begin{center}
        Автор1\textsuperscript{i}, Автор2\textsuperscript{ii} \par
        \vspace{20pt}
        \textsuperscript{i}Место работы Автора1 \\
        \textsuperscript{ii}Место работы Автора1 \\
    \end{center}}
    \author{\authoring}
    \postauthor{\par}

\title{Название\thanks{ссылка на грант}}
\date{}
\maketitle

\renewcommand{\abstractname}{}
\begin{abstract}
\label{firstpage}
    \noindent \textbf{Аннотация:} Abstract in Russian.\par
    \vspace{10pt}
    \noindent \textbf{Ключевые слова:} keywords in Russian.
\end{abstract}

    \section{Первый раздел} Text of the article

\preauthor{\large}
\DeclareRobustCommand{\authoring}{
    \begin{center}
        Author1\textsuperscript{i}, Author2\textsuperscript{ii} \par
        \vspace{20pt}
        \textsuperscript{i}Affiliation of Author1 \\
        \textsuperscript{ii}Affiliation of Author2 \\
    \end{center}}
    \author{\authoring}
    \postauthor{\par}

\title{Title in English}
\date{}

\maketitle

\renewcommand{\abstractname}{}  
\begin{abstract}
    \noindent \textbf{Abstract:} Abstract in English.\par
    \vspace{10pt}
    \noindent \textbf{Keywords:} keyword1, keyword2, \dots.
\end{abstract}
\end{document}

このコードでうまくいきました。しかし、何らかの理由で、最後のページには最初のページと同じ脚注、つまりロシア語のタイトルのコマンドの後に置いたテキストがあります\thanks。最後のページからそれを削除する方法はありますか?

答え1

オリジナルの解決策

パッケージを使用すると、titling次のものが機能するはずです。

\documentclass[12pt,a4paper]{article}

% Needed for cyrillic
\usepackage[T2A]{fontenc}           
\usepackage[utf8]{inputenc}         
\usepackage[english,russian]{babel} 

\usepackage{titling} 

\newcommand{\nothanks}{\protect\stepcounter{footnote}}

\begin{document}

% Save initial \@thanks
\makeatletter
\let\@initialthanks\@thanks
\makeatother

\title{Название\thanks{ссылка на грант}}
\author{Автор1\thanks{Место работы Автора1} \and Автор2\thanks{Место работы Автора2}}
\date{}

\maketitle

\renewcommand{\abstractname}{}
\begin{abstract}
\label{firstpage}
    \noindent \textbf{Аннотация:} Abstract in Russian.\par
    \vspace{10pt}
    \noindent \textbf{Ключевые слова:} keywords in Russian.
\end{abstract}


\section{Первый раздел} Text of the article

% Reinitialize \@thanks
\makeatletter
\let\@thanks\@initialthanks
\makeatother

\title{Title in English \nothanks}
\author{Author1\thanks{Affilation of Author1} \and Author2\thanks{Affilation of Author2}}
\date{}

\maketitle

\renewcommand{\abstractname}{}  
\begin{abstract}
    \noindent \textbf{Abstract:} Abstract in English.\par
    \vspace{10pt}
    \noindent \textbf{Keywords:} keyword1, keyword2, \dots.
\end{abstract}
\end{document}

背後にある考え方は、 の元の(空の)形式を保存し\@thanks、それを再初期化に使用することです。

\thanksこれは、英語版とロシア語版の番号が同じであれば正常に動作します。そうでない場合は、記号が異なる場合があります。(たとえば、英語のタイトルに がない場合、Author1 の脚注記号は * になります)。この問題に対処できるように、脚注記号を調整する\thanksコマンドを定義しました。\nothanks

改善されたソリューション

より理解しやすい tex ファイルを作成するには、上記の原則を使用して、コマンド\doubleauthor\doubletitle\doubledate、を定義します\doublemaketitle。MWE は次のようになります。

\documentclass[12pt,a4paper]{article}

% Packages
\usepackage[T2A]{fontenc}           
\usepackage[utf8]{inputenc}         
\usepackage[english,russian]{babel} 

\usepackage{titling} % Control over the typesetting of the \maketitle command
\usepackage{xparse} % A generic document command parser

% New commands
\NewDocumentCommand{\doubleauthor}{mg}{%
    \newcommand{\authorA}{#1}
    \IfNoValueTF{#2}{\newcommand{\authorB}{#1}}{\newcommand{\authorB}{#2}}
}
\NewDocumentCommand{\doubletitle}{mg}{%
    \newcommand{\titleA}{#1}
    \IfNoValueTF{#2}{\newcommand{\titleB}{#1}}{\newcommand{\titleB}{#2}}
}
\NewDocumentCommand{\doubledate}{mg}{%
    \newcommand{\dateA}{#1}
    \IfNoValueTF{#2}{\newcommand{\dateB}{#1}}{\newcommand{\dateB}{#2}}
}

\makeatletter
\let\@initialthanks\@thanks
\newcommand{\doublemaketitle}[1]{%
    \let\@thanks\@initialthanks
    \ifcase#1\relax\or
        \title{\titleA}
        \author{\authorA}
        \date{\dateA}
    \or
        \title{\titleB}
        \author{\authorB}
        \date{\dateB}
    \fi
    \maketitle
}
\makeatother

\newcommand{\nothanks}{\protect\stepcounter{footnote}}

% Title info
\doubletitle{азвание\thanks{ссылка на грант}}{Title in English \nothanks}
\doubleauthor{втор1\thanks{Место работы Автора1} \and Автор2\thanks{Место работы Автора2}}{Author1\thanks{Affilation of Author1} \and Author2\thanks{Affilation of Author2}}
\doubledate{}

\begin{document}

\doublemaketitle{1}
Russian content.

\doublemaketitle{2}
English content.

\end{document}

新しく定義されたコマンドは次のように使用できます。

  • \doubleauthor{Author for both versions of titling}
  • \doubleauthor{Author for first version}{Author for second version}
  • \doubletitleそして\doubledate行動する\doubleauthor
  • \doublemaketitle{i}i=1 または i=2 の場合、タイトルの指定されたバージョンが出力されます。

注: コマンド\thanksと は、と\nothanksの両方の引数で使用できます。\doubleauthor\doubletitle

関連情報