I have a single file containing appendix and manuscript. For the submission, I'd have to split both parts into two separate files. However, there are few hundreds of references from appendix to manuscript and back, as in the simplified MWE, which would create undefined references if I just split them and compile independently:
\documentclass[reqno, a4paper,11pt]{amsart}
\usepackage{xcolor}
\title{Manuscript and appendix}
\usepackage[bookmarks=false]{hyperref}
\hypersetup{
colorlinks = true,
citecolor =green!70!black,
linkcolor=green!70!black
}
\begin{document}
\maketitle
\section{Some important section}\label{sec:Important}
Because of eq. \eqref{didntfit} in Appendix \ref{sec:Unimportant}...
\appendix
\section{Some formulae}\label{sec:Unimportant}
We prove here
\begin{align}
a^2+b^2= c^2 \label{didntfit}
\end{align}
which was the main tool in Sec. \ref{sec:Important}
\end{document}
and I wish two files as follows, without manually giving the number/letter assigned to referred equations and sections, keeping the hyperlinks inside each part (manuscript-manuscript and appendix-appendix hyperlinks kept) but only printing the number/letter of a cross-reference appendix<->manuscript.



\input{file-name}. It literally inserts a part of a code into the current file. – Celdor Sep 12 '22 at 08:44xris what you are up to (See the FAQ) – Celdor Sep 12 '22 at 08:50\includeto generate the whole thing, and than do two runs with different\includeonly(and maybe changed title). Or just usepdfjamorpdftkor a PDF editing tool to split the PDF into two parts. – cabohah Jun 09 '23 at 13:29