Is it possible to include the whole content of the table and figure in another tex file?
Let's say we have A.tex
\documentclass{article}
\begin{document}
write something here.
\begin{table}[tbp]
\caption{a}
{
\begin{tabular}{\columnwidth}{l@{\extracolsep{\fill}}rrr}
\toprule
{test} & {test} & {test} & {test} \
\midrule
{test} & {test} & {test} & {test} \
\bottomrule
\end{tabular}
}
\label{tab:test}
\end{table}
\begin{figure}[tbp]\centering
\includegraphics[]{test_fig.pdf}
\caption{}\label{fig:test}
\end{figure}
\end{document}
And I want to include the tab:test and fig:test in B.tex with the following code:
\documentclass{article}
\usepackage{xr}
\externaldocument[A-][docA.pdf]
\begin{document}
Tab.~\ref{A-tab:test})
Fig.~\ref{A-fig:test})
\end{document}
This only get the index of the table and figure like Tab. 2 and Fig. 10. Is it able to import both the contents and the indexes of the table and fig in B.tex?
That is, the indexes should still be the same as those A.tex.
xr"[...] implements a system for eXternal References" nothing more nothing less. If you want to have the code in your document, you have to copy it in or do some gymnastics – DG' Mar 08 '23 at 08:53