Tradução paralela em 2 colunas, com matemática exibida compartilhada entre colunas, dentro de teoremas?

Tradução paralela em 2 colunas, com matemática exibida compartilhada entre colunas, dentro de teoremas?

Estou tentando compor uma tradução paralela de um texto matemático, com o texto original e a tradução frente a frente em duas colunas.

Na maior parte, o paracolpacote oferece isso de maneira excelente (e parece que reledmac/ reledpartambém funcionaria bem) - ele fornece vários recursos muito interessantes, como sincronização suave da numeração de teoremas e assim por diante.

Mas eu também gostaria, se possível, de ter equações (e ambientes similares) exibidas compartilhadas entre as duas versões, ou seja, não duplicadas em cada coluna, mas aparecendo uma vez, e com largura de texto completa. Isso não parece ser fornecido por paracolou reledpar. A solução simples é encerrar o ambiente de 2 colunas, fornecer a equação exibida e reiniciar as 2 colunas depois. Isso não é ótimo, mas é bom o suficiente para continuar, especialmente com alguns ajustes manuais no espaçamento.

O que eu realmente não consigo encontrar nenhuma maneira decente de fazer éequações exibidas, compartilhadas entre as colunas, dentro de teoremas ou ambientes semelhantes- o truque acima não funciona, porque para encerrar temporariamente o ambiente de duas colunas, é necessário encerrar o ambiente do teorema. O resultado desejado é que cada coluna se pareça com um teorema comum contendo uma equação exibida, exceto com a equação compartilhada, e espaço vertical extra conforme necessário se o texto que precede a equação for mais longo em uma coluna do que na outra.

Uma solução baseada em princípios seria ótima, se alguém conhecesse uma, mas eu ficaria feliz em encontrar uma solução razoável que funcionasse tanto para o caso dentro do teorema quanto para o caso simples.

Meu MWE usa paracol, mas eu ficaria muito feliz também com soluções usando reledpar, ou qualquer outro pacote que forneça uma configuração comparável para textos paralelos.

Saída MWE:

captura de tela da saída do MWE

Fonte MWE:

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\end{sats}
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\end{theorem}
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\end{paracol}
\[a + b = b + a; \]
\begin{paracol}{2}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\end{sats}
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\end{theorem}
\end{paracol}
\[a + b + c + d = c + d + a + b; \]
\begin{paracol}{2}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{paracol}
\end{document}

Responder1

Isso mostra como fazer o truque de sobreposição.

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\newcommand{\singlecol}[2][0]% #1 = column (0=left) to wind up in (optional), #2 = text to appear as if in a signel column
  {\switchcolumn[0]*
  \noindent\rlap{\parbox{\textwidth}{#2}}
  \switchcolumn[#1]*}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\end{sats}
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\end{theorem}
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\singlecol{\[a + b = b + a; \]}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\end{sats}
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\end{theorem}
\singlecol{\[a + b + c + d = c + d + a + b; \]}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{paracol}
\end{document}

Acontece que se você iniciar um ambiente em uma coluna, isso afetará ambas as colunas até terminar. OTOH, os ambientes de teorema podem ser aninhados e cada coluna usa contadores independentes.

Nota: você só pode alternar colunas entre parágrafos.

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\newcommand{\singlecol}[2][0]% #1 = column (0=left) to wind up in (optional), #2 = text to appear as if in a signel column
  {\switchcolumn[0]*
  \noindent\rlap{\parbox[b]{\textwidth}{#2}}
  \switchcolumn[#1]*}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\singlecol{\[a + b = b + a; \]}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\end{theorem}\end{sats}% note order of nesting
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\singlecol{\[a + b + c + d = c + d + a + b; \]}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{theorem}\end{sats}% note order of nesting
\end{paracol}
\end{document}

informação relacionada