I am trying to build a Tikz picture in which there are two scopes. The size of the first scope is known as it only has one element (a picture). The size of the second scope is not known as it can contain an arbitrary number of nodes.
The problem occurs that I need to be able to position both of the scopes centrally on top of each other, which means that either I need to find a way to precalculate the size of the second scope, or need to move the second scope after it has been made.
Its useful to note that the solution needs also to work where the contents of the first scope is defined in the begin portion of a \newenvironment, and the second scope contents within the new environment. Furthermore the order in which the scopes are created cannot change (it would be trivial if it were possible to move the first scope into the end portion of the environment, but this cannot be done here due to other constraints).
Something along the lines of:
\newenvironment{anEnvironment}{
\begin{tikzpicture}
\begin{scope}
%... make some nodes in first scope
\end{scope}
\begin{scope}
}{
\end{scope}
%... Set centre position of secondscope to match firstscope.
\end{tikzpicture}
}
\begin{anEnvironment}
%... make nodes for second environment
\end{anEnvironment}
Is it possible to move a scope (apply shift) after it has been created?
Alternatively, is there a way to create a tikzpicture that is invsibile from which I can get the size? That way the size could be precalculated and then the scope created with the correct position.

\newcommandhere, any particular reason for using a new environment that might help understand the purpose of it? You can include these details in your question as an edit. :) Thanks. – Alenanno Oct 17 '20 at 22:53pdftagsto make an accessible PDF for our lab notes. To do that I've been making a load of wrappers (ttikzpicture = tagged tikzpicture). In order to get alt-text to work in this case, there needs to be a background image behind the tikz picture which can be tagged to display the alt text. Apologies, I accept it would have been helpful to make a demo, but it was nearing midnight at the time and I was in a rush to go to bed. – Tom Carpenter Oct 18 '20 at 17:03