Colleagues made me realize that this setup is too complex for collaborative work. There, simplicity is king and a simple \toappendix macro is simple enough to make multiple versions possible.

While working on a paper we usually need different versions. We can manage versions using primitives like the following.

% \longversionfalse

    Text shown only in the long version.
    Not-long version

Today I made a setup that allows for a more nuanced control. The classic text is showed always. By toggling we may display texts that are exclusive only to short or long version. Also, we may toggle appendix which is useful conference proceeding submissions. (Note that the \toappendix takes the enclosed text and moves it to the appendix.)

My goal was to make writing easier, by toggling draft we get parts of the appendix displayed in the place where they were defined. Toggling color colors linenumbers at affected paragraphs so that one can see which parts of the text fall exclusively into some version.

%==== VERSIONS: macros for various paper variants; requires \usepackage{etoolbox} ==================
%---- typically we need many versions; named toggles should have \toggletrue, others \togglefalse --
% * conference submission version - short & appendix
% * conference final version - short
% * journal full version - long (& appendix)
% during writing you may find the following useful
\togglefalse{color} % requires \linenumbers; colors numbrs depending on whether their lines fall into only one version
\togglefalse{draft} % displays text deferred to appendix where they are defined -- this is useful for seeing short proof sketch and long proof next to each other
%---- use the following commands to mark parts of the text -----------------------------------------
% \shortversion{} - show only in short version -- texts shown only in the short version
% \longversion{} - show only in long version -- texts to be entirely omitted from short version
% \longversionproof{} - move to app only in short version -- long proofs deferred to appendix for reviews
% \appversion{} - show here only if appendix is active -- notes that point to the appendix
% \toappendix{} - shown in appendix if it is active -- text between 
% note that conference & journal requirements usually want these kind of commands removed
%==== END OF VERSIONS ==============================================================================

Setup appendix as follows.


I wrote this code and I put into public domain, use at your own risk ;)