Each of the two answers that have already been given addresses a different aspect of the problem, but both fail to solve all issues.
The hyperref package can generate names for the \pdfdest nodes (“destination anchors”) in the document in several ways; the one it uses by default is to assign names that are built up from a name of a sectional unit, e.g., section, or of a document element, e.g., page, and the textual representation of an associated counter, e.g., \thesection or \thepage. You can see this if you trace down the contents of the boxes that pdfTeX builds: for instance, if you say
\tracingoutput = 1
in your document, you will find, in your transcript files, lines looking like this
....\pdfdest name{section.1} xyz
for anchors tied to a section heading, or like this
...\pdfdest name{page.1} xyz
for an anchor tied to a page (note that, in order to see anchors bound to a page, you need to trace down the “complete box[es] being shipped out”, that is, to use \tracingoutput, as we did above). To access the textual representation of a counter used for this purpose, however, the hyperref package does not use directly its associated macro of the form \the<countername>, e.g., \thesection, but a macro named after the pattern \theH<countername>, e.g., \theHsection; the default definition of a macro like \theHsection is set up by the package itself, and makes \theHsection simply an alias for \thesection, but you are free to change this default definition in order to change the representation of the counter which is used for building anchors, without affecting the representation that will be used for printed text. Christian’s solution is based on this approach. Let me review it and briefly discuss its pros and cons:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
% Christian's answer:
\newcounter{papernum}
\renewcommand*{\theHsection}{\arabic{papernum}.\arabic{section}}
\renewcommand*{\theHfigure} {\arabic{papernum}.\arabic{figure}}
\renewcommand*{\theHtable} {\arabic{papernum}.\arabic{table}}
% ... and so on for subsection, subsubsection, etc., if you use them
% E.g., for the subsection counter:
% \renewcommand*{\theHsubsection}{\arabic{papernum}.\arabic{subsection}}
\newcommand{\inserttitlepage}
{
\stepcounter{papernum}
\setcounter{table}{0} % reset counters
\setcounter{figure}{0}
\setcounter{section}{0}
\begin{titlepage}
bla
\end{titlepage}
}
% \showboxbreadth = 1000
% \showboxdepth = 10
% \tracingoutput = 1
\begin{document}
\inserttitlepage
% Paper 1
\section{Introduction}
\label{S:1-Intro}
Intro~1. See also Section~\ref{S:1-Concl}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\section{Conclusion}
\label{S:1-Concl}
Concl~1. See also Section~\ref{S:1-Intro}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\inserttitlepage
% Paper 2
\section{Introduction}
\label{S:2-Intro}
Intro~2. See also Section~\ref{S:2-Concl}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\section{Conclusion}
\label{S:2-Concl}
Concl~2. See also Section~\ref{S:2-Intro}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\bigskip
Go to page~\hyperpage{1}, \hyperpage{2}, \hyperpage{3},
or~\hyperpage{4} (the latter should be this same page).
\end{document}
Pros:
it gets rid of the warnings about doubly-defined
“section-type” anchors;
it makes cross references to section titles work correctly
even across different papers;
the labels it writes into auxiliary files can readily be linked
with the relevant sectional unit;
Cons:
the warning about doubly-defined “page-type” anchors are still there;
\hyperpage commands do not work correctly;
in particular, it is not possible to have an Index.
Note that the \theH... trick cannot be applied to the page counter, because the hyperref package treats this special counter in a different way than the others (since it is actually TeX’s primitive register \count0).
Let us consider, next, @egreg’s answer, which simply suggests to turn off generation of “page-type” anchors altogether. Of course, this doesn’t address at all the problem with other types of anchor, and indeed, you still get several warnings if you compile the following (otherwise) MWE:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
% egreg's answer:
\usepackage[pageanchor=false]{hyperref}
\newcommand{\inserttitlepage}
{
\setcounter{table}{0} % reset counters
\setcounter{figure}{0}
\setcounter{section}{0}
\begin{titlepage}
bla
\end{titlepage}
}
% \showboxbreadth = 1000
% \showboxdepth = 10
% \tracingoutput = 1
\begin{document}
\inserttitlepage
% Paper 1
\section{Introduction}
\label{S:1-Intro}
Intro~1. See also Section~\ref{S:1-Concl}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\section{Conclusion}
\label{S:1-Concl}
Concl~1. See also Section~\ref{S:1-Intro}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\inserttitlepage
% Paper 2
\section{Introduction}
\label{S:2-Intro}
Intro~2. See also Section~\ref{S:2-Concl}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\section{Conclusion}
\label{S:2-Concl}
Concl~2. See also Section~\ref{S:2-Intro}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\bigskip
Go to page~\hyperpage{1}, \hyperpage{2}, \hyperpage{3},
or~\hyperpage{4} (the latter should be this same page).
\end{document}
Moreover, both cross-references among sections and \hyperpage commands remain broken in this case. Note, however, that @egreg is—of course! :-) —perfectly aware of this, and explicitly suggests to “use the H trick” for “the other counters”.
However, a third solution is possible: the hypertex package can be asked to disregard completely the value of, say, the section counter for generating “section-type” anchors, and use an internally generated label instead. This behavior does apply to “page-type” anchors as well; to request it, you specify hypertexnames=false either as an option or in the argument of \hypersetup:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
% Another possible solution:
\usepackage[hypertexnames=false]{hyperref}
\newcommand{\inserttitlepage}
{
\setcounter{table}{0} % reset counters
\setcounter{figure}{0}
\setcounter{section}{0}
\begin{titlepage}
bla
\end{titlepage}
}
% \showboxbreadth = 1000
% \showboxdepth = 10
% \tracingoutput = 1
\begin{document}
\inserttitlepage
% Paper 1
\section{Introduction}
\label{S:1-Intro}
Intro~1. See also Section~\ref{S:1-Concl}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\section{Conclusion}
\label{S:1-Concl}
Concl~1. See also Section~\ref{S:1-Intro}, and, from the second paper,
Sections \ref{S:2-Intro} and~\ref{S:2-Concl}.
\inserttitlepage
% Paper 2
\section{Introduction}
\label{S:2-Intro}
Intro~2. See also Section~\ref{S:2-Concl}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\section{Conclusion}
\label{S:2-Concl}
Concl~2. See also Section~\ref{S:2-Intro}, and, from the first paper,
Sections \ref{S:1-Intro} and~\ref{S:1-Concl}.
\bigskip
Go to page~\hyperpage{1}, \hyperpage{2}, \hyperpage{3},
or~\hyperpage{4} (the latter should be this same page).
\end{document}
If you compile this example, you will notice that all warnings disappear, and that all cross-references, included those provided by \hyperpage, work correctly. Drawback: the names of the anchors which are written into auxiliary files is now unrelated to the numbering of the relevant sectional unit.
In all the examples posted above, you can uncomment the diagnostic commands
% \showboxbreadth = 1000
% \showboxdepth = 10
% \tracingoutput = 1
in order to check exactly what anchor names are generated in each case.
page.<n>is used for several purposes; you avoid the issue of duplicate page anchor by adding thepageanchor=falseoption. – egreg Mar 10 '16 at 23:09