Оригинальное решение

Оригинальное решение

Мне нужно сделать статью на двух языках. Этот код

\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?

Добавление. Спасибо за комментарии! Я последовал совету Джона и использовал пакет 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. В противном случае символы могут стать разными. (Например, если \thanksв английском названии отсутствует, символ сноски для Author1 становится *). Чтобы иметь возможность справиться с этой проблемой, я определил команду \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​​.

Связанный контент