# Including section multiple times

I have a few sections of content I want repeated in multiple chapters. When I include it twice it looks fine in the document but references within that section always go to the section that is included last. This makes sense because the labels are being redefined. Is there anyway to change this behavior or perhaps a better way to add a section to multiple chapters. For example, allowing only references to come from the chapter the section resides in.

-
So this "repeated section" contains both \labels and \refs? And using \label{<lab>} more than once with the same <lab> is a problem (of course). For this repeated section you could turn off the meaning of \label while still keeping \ref. However, this doesn't make sense in terms of your last comment: "allowing only references to come from the chapter the section resides in." References will come from the first place the section was included. Please clarify. –  Werner Feb 4 '13 at 18:47

Define special commands for labels and references to the elements of the common section.

### Main file

\documentclass{book}

\usepackage{hyperref}

\newcommand{\mlabel}[1]{\label{\thechapter@@#1}}
\DeclareRobustCommand{\mref}[1]{\ref{\thechapter@@#1}}

\begin{document}
\mainmatter
\chapter{First}
\input{common}

\section{A section}

This is a reference to the common section: \mref{commonsection}

\chapter{Second}
\input{common}

\section{A section}

This is a reference to the common section: \mref{commonsection}

\end{document}


### File to be included multiple times common.tex

\section{Common section}\mlabel{commonsection}

This is the text that goes in all chapters.


### Second chapter

-
Very clever. Didn't work for me at first but doing \newcommand{\mlabel}[1]{\label{\thechapter_#1}} \DeclareRobustCommand{\mref}[1]{\ref{\thechapter_#1}} did the trick. Didn't like something about the @@. Thanks! –  zlalanne Feb 4 '13 at 19:51