# Catchfilebetweentags not working

According to the description of catchfilebetweentags package command \ExecuteMetaData*[<file>]{tag} should do the same job as \ExecuteMetaData[<file>]{tag} but also ,,uncomment'' comment lines with single % at the beginning. File:

\documentclass{article}
\usepackage{catchfilebetweentags}
\begin{document}
\end{document}


with the following file example.tex:

%<*tag>
some text
%some more text
%</tag>


should produce output:

some text some more text

Unfortunately, in Texmaker it gives:

[example.tex]tag

while in Overleaf it compiles for 30 seconds and timeout error pops up. How can this be fixed?

• Where I can take your [example.tex]tag? – Sebastiano Mar 3 '19 at 20:42
• @Sebastiano, [example.tex]tag is precisely the output (one line with 16 characters - 13 letters, a full stop and square brackets). Is this what you mean in your question? – Tomasz23 Mar 3 '19 at 21:33

Sorry, but there's no solution. Consider the example

\begin{filecontents*}{\jobname-example}
%<*tag>
some text
%some more text
%</tag>

\end{filecontents*}

\documentclass{article}
\usepackage{catchfilebetweentags}

\begin{document}

\tracingmacros=1 % for debugging

\CatchFileBetweenTags{\foo}{\jobname-example.tex}{tag}\show\foo

\CatchFileBetweenTags*{\foo}{\jobname-example.tex}{tag}

\end{document}


The first \CatchFileBetweenTags starts with

\CatchFileBetweenTags #1#2#3->\CatchFileBetweenDelims \CatchFBT@tok {#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize ]\CatchFBT@Final {#1}
#1<-\foo
#2<-\jobname -example.tex
#3<-tag


whereas the second one has

\CatchFileBetweenTags #1#2#3->\CatchFileBetweenDelims \CatchFBT@tok {#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize ]\CatchFBT@Final {#1}
#1<-*
#2<-\foo
#3<-\jobname -example.tex


and you can clearly see that something is wrong.

Worse: the definition of \ExecuteMetaData is

% catchfilebetweentags.sty, line 53:

so there is no provision at all for distinguishing between \ExecuteMetaData and \ExecuteMetaData*.