I would like to create an excerpt from a script that I have TeX'ed as a compendium of the most important statements (theorems & definitions).
The question \input only part of a file has an answer by Will Robertson that supposes the usage of catchfilebetweentags. I did that and it is working just fine, but ...
How do you keep the original numbering?
The above mentioned method using the catchfilebetweentags package allows me to make corrections of errors in the main file and the summary at the same time. For the sake of comparability, I would prefer to have the same numbering also. Though the numbering is reset.
Note:
I could imagine a solution by putting a \setcounter{counter}{value} in front of each statement but inside the tags. However, this is a very inconvenient way as it is inelegant and involves much more work.
Edit (MWE):
Taken from this site (by Giacomo Drago)
File that contains tags which should be included
% Equations dictionary
\documentclass[11pt]{article}
\usepackage{amssymb,amsmath}
% Begin document
\begin{document}
%<*eq001>
\begin{equation}
F\left (x_1,\dots,x_n,\frac{\partial u}{\partial x_1},\dots,\frac{\partial u}{\partial x_n},\frac{\partial^2 u}{\partial x_1\partial x_1},\dots,\frac{\partial^2 u}{\partial x_n\partial x_n},\dots
\right)
\end{equation}
%</eq001>
\begin{equation}
a = b + c
\end{equation}
%<*eq002>
\begin{equation}
u_x=\frac{\partial u}{\partial x}, \quad\quad\quad
u_{xy}=\frac{\partial^2 u}{\partial y \partial x}=\frac{\partial u}{\partial y}\left( \frac{\partial u}{\partial x} \right).
\end{equation}
%</eq002>
% A bunch of other equations...
\end{document}
File that includes
% http://yatb.giacomodrago.com/en/post/3/latex-loading-equations-from-an-external-file.html
\documentclass[a4, 11pt, twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{catchfilebetweentags}
\usepackage{blindtext}
\newcommand{\loadeq}[1]{%
\ExecuteMetaData[equ.tex]{eq#1}%
}
\begin{document}
\blindtext
\loadeq{001}
\blindtext
\loadeq{002}
\blindtext
\end{document}

xassoccntpackage and it's\BackupCounterValuesand\RestoreCounterValuefeatures please, as I have shown in my answer to this question: http://tex.stackexchange.com/questions/245680/how-to-use-several-sectioning-trees-chapter-section-in-parallel-and-in-th -- please download the bugfixed version (v.0.5a) ofxassoccntfrom my website. – Feb 29 '16 at 04:43\write18: I am not familiar with that option, though on first sight it seems like quite some work to set up. I would prefer some out of the box solution with some package. – BadAtLaTeX Feb 29 '16 at 15:34a+b=cwill be numbered? – touhami Feb 29 '16 at 16:011.03etc. but you could use the set counter approach directly then – Feb 29 '16 at 16:17\BackupCounterValueswithin your imported file? That should be possible – Feb 29 '16 at 19:57