Is there a possibility to make the `ref` command return `part` numbers in addition to `chapter`, `section` and `subsection` numbering?
up vote
6
down vote
favorite
As a default documentclass book
numbers chapters consecutively regardless of the division into parts, and I suppose the ref
command had been designed with this in mind, returning as it does chapter
, section
and subsection
numbering. The clause @addtoresetchapterpart
will cause chapters to be numbered starting with 1 for each part. Is there a way of paramatrizing ref
to return part
numbers?
documentclassbook
% RN. 10 Nov 2018
%=======================
%usepackagehyperref
makeatletter
@addtoresetchapterpart
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:\
refA1, page pagerefA1\
refB1, page pagerefB1\
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
cross-referencing
add a comment |
up vote
6
down vote
favorite
As a default documentclass book
numbers chapters consecutively regardless of the division into parts, and I suppose the ref
command had been designed with this in mind, returning as it does chapter
, section
and subsection
numbering. The clause @addtoresetchapterpart
will cause chapters to be numbered starting with 1 for each part. Is there a way of paramatrizing ref
to return part
numbers?
documentclassbook
% RN. 10 Nov 2018
%=======================
%usepackagehyperref
makeatletter
@addtoresetchapterpart
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:\
refA1, page pagerefA1\
refB1, page pagerefB1\
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
cross-referencing
4
Something likerenewcommand*p@sectionthepart.
(withinmakeatletter...makeatother
)?
– moewe
Nov 10 at 7:33
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
1
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
To complete @moewe 's answer I now userenewcommand*p@chapterthepart.
,renewcommand*p@sectionthepart.
andrenewcommand*p@subsectionthepart.
, sandwiched beweenmakeatletter
andmakeatother
, and haveref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.
– Reinhard Neuwirth
Nov 10 at 9:27
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
As a default documentclass book
numbers chapters consecutively regardless of the division into parts, and I suppose the ref
command had been designed with this in mind, returning as it does chapter
, section
and subsection
numbering. The clause @addtoresetchapterpart
will cause chapters to be numbered starting with 1 for each part. Is there a way of paramatrizing ref
to return part
numbers?
documentclassbook
% RN. 10 Nov 2018
%=======================
%usepackagehyperref
makeatletter
@addtoresetchapterpart
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:\
refA1, page pagerefA1\
refB1, page pagerefB1\
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
cross-referencing
As a default documentclass book
numbers chapters consecutively regardless of the division into parts, and I suppose the ref
command had been designed with this in mind, returning as it does chapter
, section
and subsection
numbering. The clause @addtoresetchapterpart
will cause chapters to be numbered starting with 1 for each part. Is there a way of paramatrizing ref
to return part
numbers?
documentclassbook
% RN. 10 Nov 2018
%=======================
%usepackagehyperref
makeatletter
@addtoresetchapterpart
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:\
refA1, page pagerefA1\
refB1, page pagerefB1\
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
cross-referencing
cross-referencing
edited Nov 10 at 7:36
moewe
84.1k9107322
84.1k9107322
asked Nov 10 at 7:32
Reinhard Neuwirth
1,49511322
1,49511322
4
Something likerenewcommand*p@sectionthepart.
(withinmakeatletter...makeatother
)?
– moewe
Nov 10 at 7:33
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
1
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
To complete @moewe 's answer I now userenewcommand*p@chapterthepart.
,renewcommand*p@sectionthepart.
andrenewcommand*p@subsectionthepart.
, sandwiched beweenmakeatletter
andmakeatother
, and haveref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.
– Reinhard Neuwirth
Nov 10 at 9:27
add a comment |
4
Something likerenewcommand*p@sectionthepart.
(withinmakeatletter...makeatother
)?
– moewe
Nov 10 at 7:33
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
1
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
To complete @moewe 's answer I now userenewcommand*p@chapterthepart.
,renewcommand*p@sectionthepart.
andrenewcommand*p@subsectionthepart.
, sandwiched beweenmakeatletter
andmakeatother
, and haveref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.
– Reinhard Neuwirth
Nov 10 at 9:27
4
4
Something like
renewcommand*p@sectionthepart.
(within makeatletter...makeatother
)?– moewe
Nov 10 at 7:33
Something like
renewcommand*p@sectionthepart.
(within makeatletter...makeatother
)?– moewe
Nov 10 at 7:33
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
1
1
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
To complete @moewe 's answer I now use
renewcommand*p@chapterthepart.
, renewcommand*p@sectionthepart.
and renewcommand*p@subsectionthepart.
, sandwiched beween makeatletter
and makeatother
, and have ref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.– Reinhard Neuwirth
Nov 10 at 9:27
To complete @moewe 's answer I now use
renewcommand*p@chapterthepart.
, renewcommand*p@sectionthepart.
and renewcommand*p@subsectionthepart.
, sandwiched beween makeatletter
and makeatother
, and have ref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.– Reinhard Neuwirth
Nov 10 at 9:27
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
You can redefine p@<counter>
to modify the output of ref
without changing the actual representation of <counter>
elsewhere. You might try something like renewcommand*p@sectionthepart.
or similar.
documentclassbook
makeatletter
@addtoresetchapterpart
renewcommand*p@chapterthepart.
renewcommand*p@sectionthepart.
renewcommand*p@subsectionthepart.
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:
refA1, page pagerefA1
refB1, page pagerefB1
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
You can redefine p@<counter>
to modify the output of ref
without changing the actual representation of <counter>
elsewhere. You might try something like renewcommand*p@sectionthepart.
or similar.
documentclassbook
makeatletter
@addtoresetchapterpart
renewcommand*p@chapterthepart.
renewcommand*p@sectionthepart.
renewcommand*p@subsectionthepart.
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:
refA1, page pagerefA1
refB1, page pagerefB1
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
add a comment |
up vote
6
down vote
accepted
You can redefine p@<counter>
to modify the output of ref
without changing the actual representation of <counter>
elsewhere. You might try something like renewcommand*p@sectionthepart.
or similar.
documentclassbook
makeatletter
@addtoresetchapterpart
renewcommand*p@chapterthepart.
renewcommand*p@sectionthepart.
renewcommand*p@subsectionthepart.
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:
refA1, page pagerefA1
refB1, page pagerefB1
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
You can redefine p@<counter>
to modify the output of ref
without changing the actual representation of <counter>
elsewhere. You might try something like renewcommand*p@sectionthepart.
or similar.
documentclassbook
makeatletter
@addtoresetchapterpart
renewcommand*p@chapterthepart.
renewcommand*p@sectionthepart.
renewcommand*p@subsectionthepart.
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:
refA1, page pagerefA1
refB1, page pagerefB1
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
You can redefine p@<counter>
to modify the output of ref
without changing the actual representation of <counter>
elsewhere. You might try something like renewcommand*p@sectionthepart.
or similar.
documentclassbook
makeatletter
@addtoresetchapterpart
renewcommand*p@chapterthepart.
renewcommand*p@sectionthepart.
renewcommand*p@subsectionthepart.
makeatother
begindocument
chapter*Preface
Referencing both sections produce identical numbering. It would be helpful to distinguish parts:
refA1, page pagerefA1
refB1, page pagerefB1
partFIRST
chapterA
sectionA1labelA1
partSECOND
chapterB
sectionB1labelB1
enddocument
answered Nov 10 at 10:59
moewe
84.1k9107322
84.1k9107322
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459272%2fis-there-a-possibility-to-make-the-ref-command-return-part-numbers-in-addi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
Something like
renewcommand*p@sectionthepart.
(withinmakeatletter...makeatother
)?– moewe
Nov 10 at 7:33
Works like a charm. How do I mark this as the answer?
– Reinhard Neuwirth
Nov 10 at 9:01
1
You need to ping @moewe and ask that the text be re-posted as an answer, you can't mark comments as accepted answers.
– David Carlisle
Nov 10 at 9:07
To complete @moewe 's answer I now use
renewcommand*p@chapterthepart.
,renewcommand*p@sectionthepart.
andrenewcommand*p@subsectionthepart.
, sandwiched beweenmakeatletter
andmakeatother
, and haveref
return numbering for all `part/chapter/section/subsection' as required. Please repost your comment as an answer so I can tick it off.– Reinhard Neuwirth
Nov 10 at 9:27