josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.35k stars 139 forks source link

A problem with beamer, catchfilebetween tags and commt #806

Closed ouboub closed 1 year ago

ouboub commented 1 year ago

Hi

The catchfilebetween tags allows to insert in a given mail file, text snippets from another, external file. That works also with beamer, as the first two frames in the following file shows what also works is to have a frame that contains a table and a comment, as shown in the third frame.

What however does not work is to use the

\ExecuteMetaData[external-catches.tex]{external-catches:1}

Command to include either a frame or the content of frame that contains comments

Here is the main file (for convenience also attached as a zip file

\documentclass{beamer}
\usepackage{comment}
\usepackage{catchfilebetweentags}
\begin{document}
%% Simple text
\begin{frame}
\ExecuteMetaData[external-catches.tex]{external-catches:1}
\end{frame}
\ExecuteMetaData[external-catches.tex]{external-catches:4}

\begin{frame}[fragile]

\begin{center}

    % BEGIN RECEIVE ORGTBL matlab-examen
\begin{tabular}{|l|r|r|}
\hline
Estadística & 2021 & 2022\\ \hline
Media & 4.3 & 4.41\\ \hline
Desviación & 3.1 & 2.66\\ \hline
Median & 3.7 & 4.50\\ \hline
\end{tabular}
    % END RECEIVE ORGTBL matlab-examen
\begin{comment}
#+ORGTBL: SEND matlab-examen orgtbl-to-latex  :lend "\\\\ \\hline" :environment tabular
| / | <>          |   <> |   <> |
|---+-------------+------+------|
|   | Estadística | 2021 | 2022 |
|   | Media       |  4.3 | 4.41 |
|   | Desviación  |  3.1 | 2.66 |
|   | Median      |  3.7 | 4.50 |
\end{comment}

\end{center}
\end{frame}

%% kompletes frame
\ExecuteMetaData[external-catches.tex]{external-catches:2}

\begin{frame}[fragile]
% Frame inhalt
\ExecuteMetaData[external-catches.tex]{external-catches:3}
\end{frame}

\end{document}

and here comes the external file

\documentclass{beamer}
\usepackage{comment}
\usepackage{catchfilebetweentags}
\begin{document}

%<*external-catches:1>
Simple text
%</external-catches:1>

%<*external-catches:4>

\begin{frame}
  text in frame
\end{frame}

%</external-catches:4>

Catch mit frame
%<*external-catches:2>
\begin{frame}[fragile]
\begin{center}

    % BEGIN RECEIVE ORGTBL matlab-examen
\begin{tabular}{|l|r|r|}
\hline
Estadística & 2021 & 2022\\ \hline
Media & 4.3 & 4.41\\ \hline
Desviación & 3.1 & 2.66\\ \hline
Median & 3.7 & 4.50\\ \hline
\end{tabular}
    % END RECEIVE ORGTBL matlab-examen
\begin{comment}
#+ORGTBL: SEND matlab-examen orgtbl-to-latex  :lend "\\\\ \\hline" :environment tabular
| / | <>          |   <> |   <> |
|---+-------------+------+------|
|   | Estadística | 2021 | 2022 |
|   | Media       |  4.3 | 4.41 |
|   | Desviación  |  3.1 | 2.66 |
|   | Median      |  3.7 | 4.50 |
\end{comment}

\end{center}
\end{frame}

%</external-catches:2>

Ohne frame

%<*external-catches:3>

\begin{center}

    % BEGIN RECEIVE ORGTBL matlab-examen
\begin{tabular}{|l|r|r|}
\hline
Estadística & 2021 & 2022\\ \hline
Media & 4.3 & 4.41\\ \hline
Desviación & 3.1 & 2.66\\ \hline
Median & 3.7 & 4.50\\ \hline
\end{tabular}
    % END RECEIVE ORGTBL matlab-examen
\begin{comment}
#+ORGTBL: SEND matlab-examen orgtbl-to-latex  :lend "\\\\ \\hline" :environment tabular
| / | <>          |   <> |   <> |
|---+-------------+------+------|
|   | Estadística | 2021 | 2022 |
|   | Media       |  4.3 | 4.41 |
|   | Desviación  |  3.1 | 2.66 |
|   | Median      |  3.7 | 4.50 |
\end{comment}

\end{center}
%</external-catches:3>

\end{document}

regards

Uwe Brauer beamer-catch.zip

samcarter commented 1 year ago

Could you boil down the code a bit to a minimal (non)working example we can use to reproduce the problem?

ouboub commented 1 year ago

I hope the following is short enough beamer-catch.zip

samcarter commented 1 year ago

It seems unrelated to beamer

\documentclass{article}
\usepackage{catchfilebetweentags}
\usepackage{comment}

\begin{filecontents*}[overwrite]{external-catches.tex}
%<*tag>
some text 
\begin{comment}
some more text
\end{comment}
%</tag>

\end{filecontents*}

\begin{document}

\ExecuteMetaData[external-catches.tex]{tag}

\end{document}
ouboub commented 1 year ago

ok, thanks for point this out