How to make cross-references between parts?
\documentclass[english]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%\setcounter{secnumdepth}{5} % fünf Ebenen
\usepackage{zref-user,zref-counter}
\usepackage{expl3}
\makeatletter
\zref@newprop{chapter}[1]{\the\c@chapter}
\zref@newprop{part}[1]{\the\c@part}
\zref@newprop{section}[1]{\the\c@section}
\zref@newprop{subsection}[1]{\the\c@subsection}
\zref@addprop{main}{chapter}
\zref@addprop{main}{part}
\zref@addprop{main}{section}
\zref@addprop{main}{subsection}
\ExplSyntaxOn
\newcommand\myref[1]{%
%\hyperref[#1]{
\int_compare:nTF
{
\zref@extractdefault {#1} {part} {0} = \the\c@part
}
{
%ref is from current section
\int_compare:nTF
{\zref@extractdefault {#1} {part} {0} = 0 }
{Was~nun?}
{
[Please\ see\ page\ \pageref{#1}]
}
}
{
%ref is from other section
[please\ see\ Part\ \int_to_Roman:n {\zref@extractdefault {#1} {part} {0}}\
Chapter\ \int_to_Roman:n {\zref@extractdefault {#1} {chapter} {0}}\
Section\ \int_to_Roman:n {\zref@extractdefault {#1} {section} {0}}\ page\ \pageref{#1}]
}}%}
\ExplSyntaxOff
\makeatother
\newcommand\Label[1]{\zlabel{#1}\label{#1}}
\begin{document}
\part{ONE}
\chapter{One}
\Label{part:a}
\section{1-One}
\myref{part:secondofsecond}
\myref{part:a}
\newpage\setcounter{page}{1}
\part{TWO}
\chapter{One}
\Label{part:e}
\section{1-One}
\myref{part:a}
\section{First}
\myref{part:e}
\section{Second}
\subsection{Firstofsecond}
\myref{part:a}
\subsection{Secondofsecond}
\Label{part:secondofsecond}
\end{document}
I changed this example a little, https://tex.stackexchange.com/a/325319/3307h5. But there is extra space as shown in the pictures below:
I have no problem other than this problem. This code works for me. Of course I changed Ulrike Fischer's solution. I can't imagine what will happen in the future.