Solução original

Solução original

Preciso fazer um artigo em dois idiomas. Este código

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

faz o trabalho no que diz respeito à parte russa do artigo em questão. Como posso fazer o resto (até o resumo e palavras-chave em inglês) considerando que não posso repetir comandos \author, \titlee \maketitle?

Adição. Obrigado pelos comentários! Segui o conselho de Jon e usei o titlingpacote. Agora o código fica assim:

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

Este código funcionou. No entanto, por alguma razão, a última página tem a mesma nota de rodapé da primeira, ou seja, o texto que coloquei após \thankso comando no título em russo. Existe alguma maneira de removê-lo da última página?

Responder1

Solução original

Usando o titlingpacote, o seguinte deve funcionar:

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

A ideia por trás é salvar a forma original (vazia) \@thankse usá-la para reinicialização.

Isso funciona bem se houver o mesmo número \thankspara as versões em inglês e russo. Caso contrário, os símbolos poderão ficar diferentes. (Por exemplo, se \thanksfaltar no título em inglês, o símbolo de nota de rodapé para Autor1 torna-se *). Para poder lidar com este problema defini o comando \nothankspara ajustar os símbolos das notas de rodapé.

Solução melhorada

Para obter um arquivo tex mais fácil de entender, pode-se usar os princípios descritos acima, para definir os comandos \doubleauthor,,,, e . O MWE passa a ser:\doubletitle\doubledate\doublemaketitle

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

Os comandos recém-definidos podem ser usados ​​da seguinte forma:

  • \doubleauthor{Author for both versions of titling}
  • \doubleauthor{Author for first version}{Author for second version}
  • \doubletitlee \doubledatese comportar como\doubleauthor
  • \doublemaketitle{i}com i=1 ou i=2 imprime a versão especificada do título.

Observação: Os comandos \thankse \nothankspodem ser usados ​​em ambos os argumentos de \doubleauthore \doubletitle.

informação relacionada