Use counters value after it appears in the code
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
Is there a way to use a counters value at one point in the code, but with the counters state of a line, that comes somewhat after the corresponding use of the counters value?
E.g.
Define the counter in line 10, use it in line 15 with valuecnt
and keep increasing the value for three lines one after another.
So in line 18, the counters value holds 3
.
I want to use this value (3
) in line 15!
So valuecnt
in line 15 should return 3
.
Below find my MWE:
% MWE
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
begindocument
newcounterlinecnt
begintable
begintabular[tbh]p4.2cm p0.68textwidth
textbfField & textbfEntrys \
hline
% This works fine:
multirow4 %------------------------------------------------------
4cmThis Field & Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
% But it would be great if a didn't have to write the amount of lines everytime.
% Is there a way to use a counters value AFTER it's 'use' in the code. Somethining like:
multirowvaluelinecnt %------------------------------------------------------
4cmAnother Field & Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
% I would like to use the value of 'linecnt' NOW but in the beginning of the multirow-environment
endtabular
endtable
enddocument
I appreciate your help.
Kind regards.
counters multicol multirow
add a comment |Â
up vote
4
down vote
favorite
Is there a way to use a counters value at one point in the code, but with the counters state of a line, that comes somewhat after the corresponding use of the counters value?
E.g.
Define the counter in line 10, use it in line 15 with valuecnt
and keep increasing the value for three lines one after another.
So in line 18, the counters value holds 3
.
I want to use this value (3
) in line 15!
So valuecnt
in line 15 should return 3
.
Below find my MWE:
% MWE
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
begindocument
newcounterlinecnt
begintable
begintabular[tbh]p4.2cm p0.68textwidth
textbfField & textbfEntrys \
hline
% This works fine:
multirow4 %------------------------------------------------------
4cmThis Field & Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
% But it would be great if a didn't have to write the amount of lines everytime.
% Is there a way to use a counters value AFTER it's 'use' in the code. Somethining like:
multirowvaluelinecnt %------------------------------------------------------
4cmAnother Field & Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
% I would like to use the value of 'linecnt' NOW but in the beginning of the multirow-environment
endtabular
endtable
enddocument
I appreciate your help.
Kind regards.
counters multicol multirow
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Is there a way to use a counters value at one point in the code, but with the counters state of a line, that comes somewhat after the corresponding use of the counters value?
E.g.
Define the counter in line 10, use it in line 15 with valuecnt
and keep increasing the value for three lines one after another.
So in line 18, the counters value holds 3
.
I want to use this value (3
) in line 15!
So valuecnt
in line 15 should return 3
.
Below find my MWE:
% MWE
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
begindocument
newcounterlinecnt
begintable
begintabular[tbh]p4.2cm p0.68textwidth
textbfField & textbfEntrys \
hline
% This works fine:
multirow4 %------------------------------------------------------
4cmThis Field & Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
% But it would be great if a didn't have to write the amount of lines everytime.
% Is there a way to use a counters value AFTER it's 'use' in the code. Somethining like:
multirowvaluelinecnt %------------------------------------------------------
4cmAnother Field & Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
% I would like to use the value of 'linecnt' NOW but in the beginning of the multirow-environment
endtabular
endtable
enddocument
I appreciate your help.
Kind regards.
counters multicol multirow
Is there a way to use a counters value at one point in the code, but with the counters state of a line, that comes somewhat after the corresponding use of the counters value?
E.g.
Define the counter in line 10, use it in line 15 with valuecnt
and keep increasing the value for three lines one after another.
So in line 18, the counters value holds 3
.
I want to use this value (3
) in line 15!
So valuecnt
in line 15 should return 3
.
Below find my MWE:
% MWE
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
begindocument
newcounterlinecnt
begintable
begintabular[tbh]p4.2cm p0.68textwidth
textbfField & textbfEntrys \
hline
% This works fine:
multirow4 %------------------------------------------------------
4cmThis Field & Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
% But it would be great if a didn't have to write the amount of lines everytime.
% Is there a way to use a counters value AFTER it's 'use' in the code. Somethining like:
multirowvaluelinecnt %------------------------------------------------------
4cmAnother Field & Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
% I would like to use the value of 'linecnt' NOW but in the beginning of the multirow-environment
endtabular
endtable
enddocument
I appreciate your help.
Kind regards.
counters multicol multirow
counters multicol multirow
asked 1 hour ago
Michael Schmid
1637
1637
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago
add a comment |Â
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
By the time you know the final number of the counter, the multirow
is already typeset, so you can't do much about it.
The usual approach in these cases is a two-pass compilation, writing the value of the counter to the .aux
file.
First, in the preamble, we define an initial value for the counter:
defsavedthelinecnt0
then, when we know the final value of the counter, we write it to the .aux
file, so in the next compilation, at the begindocument
this counter is updated to the correct value:
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
then after two passes the value is correct:
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
makeatletter
defsavedthelinecnt0
makeatother
begindocument
newcounterlinecnt
begintable[tbh]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowsavedthelinecnt4cmAnother Field savedthelinecnt
& Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
endtabular
makeatletter
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
endtable
enddocument
By the way, the [tbh]
optional argument you passed to tabular
is (kind of) invalid. If you meant the float positions t
op, b
ottom and h
ere, then you need to pass the arguments to begintable
. If you meant the vertical position of the baseline of the table, then the valid options are t
for t
op, b
for b
ottom, and c
(anything else, actually) for c
entered. But only one character is passed here.
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
add a comment |Â
up vote
2
down vote
Use refcount
; note refstepcounter
instead of stepcounter
. Watch out for spaces: Automatic Entry 1 refstepcounterlinecnt
would have a trailing space.
Note that [tbh]
makes no sense for tabular
or tabularx
. The table
environment takes a positioning argument.
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagemultirow
usepackagerefcount
newcounterlinecnt
begindocument
begintable[htp]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
% This works fine:
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowgetrefnumberstep14cmAnother Field
& Automatic Entry 1refstepcounterlinecnt \
& Automatic Entry 2refstepcounterlinecnt \
& Automatic Entry 3refstepcounterlinecnt \
& Automatic Entry 4refstepcounterlinecntlabelstep1 \
endtabular
endtable
enddocument
On the other hand, the following table is more readable:
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagetabularx
usepackagebooktabs
begindocument
begintable
begintabularxtextwidthlX
toprule
textbfField & textbfEntries \
midrule
This Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \
midrule
Another Field
& Automatic Entry 1 \
& Automatic Entry 2 \
& Automatic Entry 3 \
& Automatic Entry 4 \
bottomrule
endtabularx
endtable
enddocument
There is no need to center the field name, which may actually become ambiguous.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
By the time you know the final number of the counter, the multirow
is already typeset, so you can't do much about it.
The usual approach in these cases is a two-pass compilation, writing the value of the counter to the .aux
file.
First, in the preamble, we define an initial value for the counter:
defsavedthelinecnt0
then, when we know the final value of the counter, we write it to the .aux
file, so in the next compilation, at the begindocument
this counter is updated to the correct value:
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
then after two passes the value is correct:
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
makeatletter
defsavedthelinecnt0
makeatother
begindocument
newcounterlinecnt
begintable[tbh]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowsavedthelinecnt4cmAnother Field savedthelinecnt
& Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
endtabular
makeatletter
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
endtable
enddocument
By the way, the [tbh]
optional argument you passed to tabular
is (kind of) invalid. If you meant the float positions t
op, b
ottom and h
ere, then you need to pass the arguments to begintable
. If you meant the vertical position of the baseline of the table, then the valid options are t
for t
op, b
for b
ottom, and c
(anything else, actually) for c
entered. But only one character is passed here.
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
add a comment |Â
up vote
5
down vote
By the time you know the final number of the counter, the multirow
is already typeset, so you can't do much about it.
The usual approach in these cases is a two-pass compilation, writing the value of the counter to the .aux
file.
First, in the preamble, we define an initial value for the counter:
defsavedthelinecnt0
then, when we know the final value of the counter, we write it to the .aux
file, so in the next compilation, at the begindocument
this counter is updated to the correct value:
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
then after two passes the value is correct:
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
makeatletter
defsavedthelinecnt0
makeatother
begindocument
newcounterlinecnt
begintable[tbh]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowsavedthelinecnt4cmAnother Field savedthelinecnt
& Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
endtabular
makeatletter
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
endtable
enddocument
By the way, the [tbh]
optional argument you passed to tabular
is (kind of) invalid. If you meant the float positions t
op, b
ottom and h
ere, then you need to pass the arguments to begintable
. If you meant the vertical position of the baseline of the table, then the valid options are t
for t
op, b
for b
ottom, and c
(anything else, actually) for c
entered. But only one character is passed here.
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
add a comment |Â
up vote
5
down vote
up vote
5
down vote
By the time you know the final number of the counter, the multirow
is already typeset, so you can't do much about it.
The usual approach in these cases is a two-pass compilation, writing the value of the counter to the .aux
file.
First, in the preamble, we define an initial value for the counter:
defsavedthelinecnt0
then, when we know the final value of the counter, we write it to the .aux
file, so in the next compilation, at the begindocument
this counter is updated to the correct value:
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
then after two passes the value is correct:
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
makeatletter
defsavedthelinecnt0
makeatother
begindocument
newcounterlinecnt
begintable[tbh]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowsavedthelinecnt4cmAnother Field savedthelinecnt
& Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
endtabular
makeatletter
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
endtable
enddocument
By the way, the [tbh]
optional argument you passed to tabular
is (kind of) invalid. If you meant the float positions t
op, b
ottom and h
ere, then you need to pass the arguments to begintable
. If you meant the vertical position of the baseline of the table, then the valid options are t
for t
op, b
for b
ottom, and c
(anything else, actually) for c
entered. But only one character is passed here.
By the time you know the final number of the counter, the multirow
is already typeset, so you can't do much about it.
The usual approach in these cases is a two-pass compilation, writing the value of the counter to the .aux
file.
First, in the preamble, we define an initial value for the counter:
defsavedthelinecnt0
then, when we know the final value of the counter, we write it to the .aux
file, so in the next compilation, at the begindocument
this counter is updated to the correct value:
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
then after two passes the value is correct:
documentclassscrbook
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagetabularx
usepackagemultirow
makeatletter
defsavedthelinecnt0
makeatother
begindocument
newcounterlinecnt
begintable[tbh]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowsavedthelinecnt4cmAnother Field savedthelinecnt
& Automatic Entry 1 stepcounterlinecnt \
& Automatic Entry 2 stepcounterlinecnt \
& Automatic Entry 3 stepcounterlinecnt \
& Automatic Entry 4 stepcounterlinecnt \
endtabular
makeatletter
immediateprotected@write@auxout
gdefprotectsavedthelinecntthelinecnt
endtable
enddocument
By the way, the [tbh]
optional argument you passed to tabular
is (kind of) invalid. If you meant the float positions t
op, b
ottom and h
ere, then you need to pass the arguments to begintable
. If you meant the vertical position of the baseline of the table, then the valid options are t
for t
op, b
for b
ottom, and c
(anything else, actually) for c
entered. But only one character is passed here.
edited 35 mins ago
answered 42 mins ago


Phelype Oleinik
18.5k54173
18.5k54173
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
add a comment |Â
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
You're completely right about the tbh ;) I just came up with this MWE really quickly and didn't care a lot about anything other than the multirow-environment
– Michael Schmid
28 mins ago
add a comment |Â
up vote
2
down vote
Use refcount
; note refstepcounter
instead of stepcounter
. Watch out for spaces: Automatic Entry 1 refstepcounterlinecnt
would have a trailing space.
Note that [tbh]
makes no sense for tabular
or tabularx
. The table
environment takes a positioning argument.
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagemultirow
usepackagerefcount
newcounterlinecnt
begindocument
begintable[htp]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
% This works fine:
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowgetrefnumberstep14cmAnother Field
& Automatic Entry 1refstepcounterlinecnt \
& Automatic Entry 2refstepcounterlinecnt \
& Automatic Entry 3refstepcounterlinecnt \
& Automatic Entry 4refstepcounterlinecntlabelstep1 \
endtabular
endtable
enddocument
On the other hand, the following table is more readable:
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagetabularx
usepackagebooktabs
begindocument
begintable
begintabularxtextwidthlX
toprule
textbfField & textbfEntries \
midrule
This Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \
midrule
Another Field
& Automatic Entry 1 \
& Automatic Entry 2 \
& Automatic Entry 3 \
& Automatic Entry 4 \
bottomrule
endtabularx
endtable
enddocument
There is no need to center the field name, which may actually become ambiguous.
add a comment |Â
up vote
2
down vote
Use refcount
; note refstepcounter
instead of stepcounter
. Watch out for spaces: Automatic Entry 1 refstepcounterlinecnt
would have a trailing space.
Note that [tbh]
makes no sense for tabular
or tabularx
. The table
environment takes a positioning argument.
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagemultirow
usepackagerefcount
newcounterlinecnt
begindocument
begintable[htp]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
% This works fine:
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowgetrefnumberstep14cmAnother Field
& Automatic Entry 1refstepcounterlinecnt \
& Automatic Entry 2refstepcounterlinecnt \
& Automatic Entry 3refstepcounterlinecnt \
& Automatic Entry 4refstepcounterlinecntlabelstep1 \
endtabular
endtable
enddocument
On the other hand, the following table is more readable:
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagetabularx
usepackagebooktabs
begindocument
begintable
begintabularxtextwidthlX
toprule
textbfField & textbfEntries \
midrule
This Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \
midrule
Another Field
& Automatic Entry 1 \
& Automatic Entry 2 \
& Automatic Entry 3 \
& Automatic Entry 4 \
bottomrule
endtabularx
endtable
enddocument
There is no need to center the field name, which may actually become ambiguous.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Use refcount
; note refstepcounter
instead of stepcounter
. Watch out for spaces: Automatic Entry 1 refstepcounterlinecnt
would have a trailing space.
Note that [tbh]
makes no sense for tabular
or tabularx
. The table
environment takes a positioning argument.
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagemultirow
usepackagerefcount
newcounterlinecnt
begindocument
begintable[htp]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
% This works fine:
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowgetrefnumberstep14cmAnother Field
& Automatic Entry 1refstepcounterlinecnt \
& Automatic Entry 2refstepcounterlinecnt \
& Automatic Entry 3refstepcounterlinecnt \
& Automatic Entry 4refstepcounterlinecntlabelstep1 \
endtabular
endtable
enddocument
On the other hand, the following table is more readable:
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagetabularx
usepackagebooktabs
begindocument
begintable
begintabularxtextwidthlX
toprule
textbfField & textbfEntries \
midrule
This Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \
midrule
Another Field
& Automatic Entry 1 \
& Automatic Entry 2 \
& Automatic Entry 3 \
& Automatic Entry 4 \
bottomrule
endtabularx
endtable
enddocument
There is no need to center the field name, which may actually become ambiguous.
Use refcount
; note refstepcounter
instead of stepcounter
. Watch out for spaces: Automatic Entry 1 refstepcounterlinecnt
would have a trailing space.
Note that [tbh]
makes no sense for tabular
or tabularx
. The table
environment takes a positioning argument.
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagemultirow
usepackagerefcount
newcounterlinecnt
begindocument
begintable[htp]
begintabularp4.2cm p0.68textwidth
textbfField & textbfEntries \
hline
% This works fine:
multirow44cmThis Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \[2ex]
multirowgetrefnumberstep14cmAnother Field
& Automatic Entry 1refstepcounterlinecnt \
& Automatic Entry 2refstepcounterlinecnt \
& Automatic Entry 3refstepcounterlinecnt \
& Automatic Entry 4refstepcounterlinecntlabelstep1 \
endtabular
endtable
enddocument
On the other hand, the following table is more readable:
documentclassscrbook
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackagelmodern
usepackagetabularx
usepackagebooktabs
begindocument
begintable
begintabularxtextwidthlX
toprule
textbfField & textbfEntries \
midrule
This Field
& Entry 1 \
& Entry 2 \
& Entry 3 \
& Entry 4 \
midrule
Another Field
& Automatic Entry 1 \
& Automatic Entry 2 \
& Automatic Entry 3 \
& Automatic Entry 4 \
bottomrule
endtabularx
endtable
enddocument
There is no need to center the field name, which may actually become ambiguous.
edited 24 mins ago
answered 30 mins ago


egreg
689k8518373085
689k8518373085
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f455527%2fuse-counters-value-after-it-appears-in-the-code%23new-answer', 'question_page');
);
Post as a guest
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
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
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
you can do this with a label-ref system, e.g. with zref. It then needs two compilations.
– Ulrike Fischer
48 mins ago