I have an article class document with a structure like this.
- Part A
- Section 1
- Section 2
- Part B
- Section 1
- Section 2
I want to reference Section 1 in part A from Section 2 in part B.
When I reference a section in another part using \ref, \vref or \cref I get
As seen in Section 1.
Since that appears in Part B, the reader would assume I'm talking about section 1 in part B, but I mean section 1 in part A.
Desired output:
As seen in Section 1 in Part A.
Now comes the tricky part. Most of my references are for within the same section. If I'm in Part B and I'm referencing something in Part B, I just want to say
As seen in Section 1
Not
As seen in Section 1 in Part B
Is there some combination of varioref,hyperref, cleveref and whatever else which can do that with a single command? (Bonus points if it is hyperlinked and can include smart page numbers like \vref)
I suppose redefining section numbers to be of the form A.1 would work. Is there a way of doing it without that?
MWE
\documentclass[a4paper]{article}
\usepackage[english]{babel} %do I need this? Gummi throws an error if I leave it out. I dunno.
\usepackage{varioref}
\usepackage[hidelinks]{hyperref}
\usepackage[nameinlink, capitalise, noabbrev]{cleveref}
\begin{document}
\part{First Part}\label{sec:first part}
\section{section in first part}\label{sec:in first part}
\part{Second Part}\label{sec:second part}
\section{section in second part}\label{sec:in second part}
\Cref{sec:in first part} is cool
%desired output: Section 1 in Part A is cool.
\Cref{sec:in second part} is also cool.
%desired output: Section 1 is also cool.
\end{document}
Edit: The penultimate line is supposed to say 'this part' not 'another part'. Disambiguated the reference sentences.

