I would like to include a chapter two times, a short version in the main part and a long version in the appendix. Everything works fine except the labels and references. Is there a way to redefine labels in a local context? I could us a \IFDEFINE statement around every label or ref but that is not very convenient.
Any suggestions welcome, Thx!!
==================== main.tex =================
\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\begin{document}
\include{kapitel}
\begin{appendix}
\newcommand*{\LONGVERSION}{}
\include{kapitel}
\end{appendix}
\end{document}
==================== kapitel.tex =================
\chapter{This is a chapter}\label{chap:mychapter}
This is a test with a reference to my chapter \ref{chap:mychapter}
\ifdefined\LONGVERSION
\section{Variant LONG}
This is a long version of the chapter, which contains a lot of
additional information. This shall be placed in the appendix.
\else
\section{Variant SHORT}
This is the short version.
\fi