How to use steprefcounter correctly in attempt to implement subfigures? The Next CEO of Stack OverflowHow to remove caption of some subfigures?What is going wrong with this attempt to use global?Title and caption to all SubfiguresAlign two subfigures verticallyTikz subfigures overlap4 customized subfiguresHow to correctly use newenvironmenthow to label and refer subfigures under tabular environment?Subcaption environment failed. All figures containing a subfigure crashing all of a suddenHow to use ref Inside lstlistings

Why isn't the Mueller report being released completely and unredacted?

Powershell. How to parse gci Name?

Is it possible to replace duplicates of a character with one character using tr

A Man With a Stainless Steel Endoskeleton (like The Terminator) Fighting Cloaked Aliens Only He Can See

No sign flipping while figuring out the emf of voltaic cell?

Why do airplanes bank sharply to the right after air-to-air refueling?

Prepend last line of stdin to entire stdin

How to place nodes around a circle from some initial angle?

Axiom Schema vs Axiom

What connection does MS Office have to Netscape Navigator?

Running a General Election and the European Elections together

Where do students learn to solve polynomial equations these days?

Why this way of making earth uninhabitable in Interstellar?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Why is my new battery behaving weirdly?

Do I need to write [sic] when a number is less than 10 but isn't written out?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Chain wire methods together in Lightning Web Components

Method for adding error messages to a dictionary given a key

Is wanting to ask what to write an indication that you need to change your story?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

What steps are necessary to read a Modern SSD in Medieval Europe?

How a 64-bit process virtual address space is divided in Linux?

Does increasing your ability score affect your main stat?



How to use steprefcounter correctly in attempt to implement subfigures?



The Next CEO of Stack OverflowHow to remove caption of some subfigures?What is going wrong with this attempt to use global?Title and caption to all SubfiguresAlign two subfigures verticallyTikz subfigures overlap4 customized subfiguresHow to correctly use newenvironmenthow to label and refer subfigures under tabular environment?Subcaption environment failed. All figures containing a subfigure crashing all of a suddenHow to use ref Inside lstlistings










0















Trying to use space on a page more economically, I developed the idea to arrange graphics as a table being part of a figure. As I still wanted to refer to individual graphics, I also wanted to have captions for each such sub-graphic.



(Only after I had problems, I realized that there does exist a similar mechanism, also named subfigure and subcaption)



(I'm no TeX expert, I only know LaTeX a bit)



The code shown below outputs the references as Text... 1 (1.2) ... 1 ...
Text... 1 (1.3) ... 1
, so the sub-caption numbers are wrong, while the main caption number is correct. The intended output is Text... 1.2a (1.2) ... 1.2b ...
Text... 1.3a (1.3) ... 1.3b
.



The captions for the example code read (numbers are correct there):



Abbildung 1.1: Caption0

Abb. 1.2a: Caption1a Abb. 1.2b: Caption1b
Abbildung 1.2: Caption1

Abb. 1.3a: Caption2a Abb. 1.3b: Caption2b
Abbildung 1.3: Caption2


So here's the input for this example (use any placeholder graphic for Platzhalter.pdf):



documentclass[a4paper,twoside]report
usepackagegerman
usepackage[latin1]inputenc
usepackagea4
usepackagemakeidx
usepackageshowidx
usepackageamsmath
usepackageurl
usepackagegraphicx
usepackageifthen
%
newcountersubfigureX[figure]
renewcommandthesubfigureXthefigurealphsubfigureX
newcountersavefigure
newcommandgtLab
newcommandgtCap
%
newenvironmentgfxTableCapLab[4][htbp]%
ifthenelseequal#4%
renewcommandgtLab%
renewcommandgtLablabel#4%
ifthenelseequal#3%
renewcommandgtCapfLab%
renewcommandgtCapcaptiongtLab#3%
beginfigure[#1]%
setcountersavefigurevaluefigure%
stepcounterfigure%
begincenter%
begintabular#2%
endtabular%
setcounterfigurevaluesavefigure%
gtCap%
endcenter
endfigure%

%
newcommandgLab
newcommandgCap
%
newcommandgfxCapLab[4]%
ifthenelseequal#4%
renewcommandgLab%
renewcommandgLablabel#4%
ifthenelseequal#3%
renewcommandgCapgLab%
renewcommandgCapparnoindentgLabsubcaption#3%
beginminipage[t]#1textwidth%
centeringincludegraphics[width=textwidth]#2%
gCap%
endminipage%

%
newcommandgfxCap[3]gfxCapLab#1#2#3
%
newcommandsubcaption[1]%
%steprefcountersubfigureX
addtocountersubfigureX1%
small Abb.~thesubfigureX: #1%

begindocument
chapterChap
%
beginfigure
Test
captionCaption0
endfigure
begingfxTableCapLablrCaption1label1%
gfxCapLab0.4Platzhalter.pdfCaption1alabel1a
&
gfxCapLab0.4Platzhalter.pdfCaption1blabel1b
endgfxTableCapLab
%
Text...
reflabel1a (reflabel1) ... reflabel1b ...

begingfxTableCapLablrCaption2label2%
gfxCapLab0.4Platzhalter.pdfCaption2alabel2a
&
gfxCapLab0.4Platzhalter.pdfCaption2blabel2b
endgfxTableCapLab

Text...
reflabel2a (reflabel2) ... reflabel2b
enddocument


Specifically pdflatex complains if I uncomment the line %steprefcountersubfigureX (commenting addtocountersubfigureX1 instead):



! Undefined control sequence.
subcaption #1->steprefcounter
subfigureX small Abb.~thesubfigureX : #1
l.68 ...0.4Platzhalter.pdfCaption1alabel1a


(Originally I had named my counter subfigure also, but then I discovered that a counter with such a name already exists, so I appended the X).



Preferably the answer contains an explanation why my code does not work (everything that is wrong), how to do it correctly, and (as an extra) how I could achieve the same effect using the stock subfigure and subcaption mechanisms.









share






















  • I've never heard of steprefcounter. Did you mean to write refstepcounter?

    – Mico
    4 mins ago















0















Trying to use space on a page more economically, I developed the idea to arrange graphics as a table being part of a figure. As I still wanted to refer to individual graphics, I also wanted to have captions for each such sub-graphic.



(Only after I had problems, I realized that there does exist a similar mechanism, also named subfigure and subcaption)



(I'm no TeX expert, I only know LaTeX a bit)



The code shown below outputs the references as Text... 1 (1.2) ... 1 ...
Text... 1 (1.3) ... 1
, so the sub-caption numbers are wrong, while the main caption number is correct. The intended output is Text... 1.2a (1.2) ... 1.2b ...
Text... 1.3a (1.3) ... 1.3b
.



The captions for the example code read (numbers are correct there):



Abbildung 1.1: Caption0

Abb. 1.2a: Caption1a Abb. 1.2b: Caption1b
Abbildung 1.2: Caption1

Abb. 1.3a: Caption2a Abb. 1.3b: Caption2b
Abbildung 1.3: Caption2


So here's the input for this example (use any placeholder graphic for Platzhalter.pdf):



documentclass[a4paper,twoside]report
usepackagegerman
usepackage[latin1]inputenc
usepackagea4
usepackagemakeidx
usepackageshowidx
usepackageamsmath
usepackageurl
usepackagegraphicx
usepackageifthen
%
newcountersubfigureX[figure]
renewcommandthesubfigureXthefigurealphsubfigureX
newcountersavefigure
newcommandgtLab
newcommandgtCap
%
newenvironmentgfxTableCapLab[4][htbp]%
ifthenelseequal#4%
renewcommandgtLab%
renewcommandgtLablabel#4%
ifthenelseequal#3%
renewcommandgtCapfLab%
renewcommandgtCapcaptiongtLab#3%
beginfigure[#1]%
setcountersavefigurevaluefigure%
stepcounterfigure%
begincenter%
begintabular#2%
endtabular%
setcounterfigurevaluesavefigure%
gtCap%
endcenter
endfigure%

%
newcommandgLab
newcommandgCap
%
newcommandgfxCapLab[4]%
ifthenelseequal#4%
renewcommandgLab%
renewcommandgLablabel#4%
ifthenelseequal#3%
renewcommandgCapgLab%
renewcommandgCapparnoindentgLabsubcaption#3%
beginminipage[t]#1textwidth%
centeringincludegraphics[width=textwidth]#2%
gCap%
endminipage%

%
newcommandgfxCap[3]gfxCapLab#1#2#3
%
newcommandsubcaption[1]%
%steprefcountersubfigureX
addtocountersubfigureX1%
small Abb.~thesubfigureX: #1%

begindocument
chapterChap
%
beginfigure
Test
captionCaption0
endfigure
begingfxTableCapLablrCaption1label1%
gfxCapLab0.4Platzhalter.pdfCaption1alabel1a
&
gfxCapLab0.4Platzhalter.pdfCaption1blabel1b
endgfxTableCapLab
%
Text...
reflabel1a (reflabel1) ... reflabel1b ...

begingfxTableCapLablrCaption2label2%
gfxCapLab0.4Platzhalter.pdfCaption2alabel2a
&
gfxCapLab0.4Platzhalter.pdfCaption2blabel2b
endgfxTableCapLab

Text...
reflabel2a (reflabel2) ... reflabel2b
enddocument


Specifically pdflatex complains if I uncomment the line %steprefcountersubfigureX (commenting addtocountersubfigureX1 instead):



! Undefined control sequence.
subcaption #1->steprefcounter
subfigureX small Abb.~thesubfigureX : #1
l.68 ...0.4Platzhalter.pdfCaption1alabel1a


(Originally I had named my counter subfigure also, but then I discovered that a counter with such a name already exists, so I appended the X).



Preferably the answer contains an explanation why my code does not work (everything that is wrong), how to do it correctly, and (as an extra) how I could achieve the same effect using the stock subfigure and subcaption mechanisms.









share






















  • I've never heard of steprefcounter. Did you mean to write refstepcounter?

    – Mico
    4 mins ago













0












0








0








Trying to use space on a page more economically, I developed the idea to arrange graphics as a table being part of a figure. As I still wanted to refer to individual graphics, I also wanted to have captions for each such sub-graphic.



(Only after I had problems, I realized that there does exist a similar mechanism, also named subfigure and subcaption)



(I'm no TeX expert, I only know LaTeX a bit)



The code shown below outputs the references as Text... 1 (1.2) ... 1 ...
Text... 1 (1.3) ... 1
, so the sub-caption numbers are wrong, while the main caption number is correct. The intended output is Text... 1.2a (1.2) ... 1.2b ...
Text... 1.3a (1.3) ... 1.3b
.



The captions for the example code read (numbers are correct there):



Abbildung 1.1: Caption0

Abb. 1.2a: Caption1a Abb. 1.2b: Caption1b
Abbildung 1.2: Caption1

Abb. 1.3a: Caption2a Abb. 1.3b: Caption2b
Abbildung 1.3: Caption2


So here's the input for this example (use any placeholder graphic for Platzhalter.pdf):



documentclass[a4paper,twoside]report
usepackagegerman
usepackage[latin1]inputenc
usepackagea4
usepackagemakeidx
usepackageshowidx
usepackageamsmath
usepackageurl
usepackagegraphicx
usepackageifthen
%
newcountersubfigureX[figure]
renewcommandthesubfigureXthefigurealphsubfigureX
newcountersavefigure
newcommandgtLab
newcommandgtCap
%
newenvironmentgfxTableCapLab[4][htbp]%
ifthenelseequal#4%
renewcommandgtLab%
renewcommandgtLablabel#4%
ifthenelseequal#3%
renewcommandgtCapfLab%
renewcommandgtCapcaptiongtLab#3%
beginfigure[#1]%
setcountersavefigurevaluefigure%
stepcounterfigure%
begincenter%
begintabular#2%
endtabular%
setcounterfigurevaluesavefigure%
gtCap%
endcenter
endfigure%

%
newcommandgLab
newcommandgCap
%
newcommandgfxCapLab[4]%
ifthenelseequal#4%
renewcommandgLab%
renewcommandgLablabel#4%
ifthenelseequal#3%
renewcommandgCapgLab%
renewcommandgCapparnoindentgLabsubcaption#3%
beginminipage[t]#1textwidth%
centeringincludegraphics[width=textwidth]#2%
gCap%
endminipage%

%
newcommandgfxCap[3]gfxCapLab#1#2#3
%
newcommandsubcaption[1]%
%steprefcountersubfigureX
addtocountersubfigureX1%
small Abb.~thesubfigureX: #1%

begindocument
chapterChap
%
beginfigure
Test
captionCaption0
endfigure
begingfxTableCapLablrCaption1label1%
gfxCapLab0.4Platzhalter.pdfCaption1alabel1a
&
gfxCapLab0.4Platzhalter.pdfCaption1blabel1b
endgfxTableCapLab
%
Text...
reflabel1a (reflabel1) ... reflabel1b ...

begingfxTableCapLablrCaption2label2%
gfxCapLab0.4Platzhalter.pdfCaption2alabel2a
&
gfxCapLab0.4Platzhalter.pdfCaption2blabel2b
endgfxTableCapLab

Text...
reflabel2a (reflabel2) ... reflabel2b
enddocument


Specifically pdflatex complains if I uncomment the line %steprefcountersubfigureX (commenting addtocountersubfigureX1 instead):



! Undefined control sequence.
subcaption #1->steprefcounter
subfigureX small Abb.~thesubfigureX : #1
l.68 ...0.4Platzhalter.pdfCaption1alabel1a


(Originally I had named my counter subfigure also, but then I discovered that a counter with such a name already exists, so I appended the X).



Preferably the answer contains an explanation why my code does not work (everything that is wrong), how to do it correctly, and (as an extra) how I could achieve the same effect using the stock subfigure and subcaption mechanisms.









share














Trying to use space on a page more economically, I developed the idea to arrange graphics as a table being part of a figure. As I still wanted to refer to individual graphics, I also wanted to have captions for each such sub-graphic.



(Only after I had problems, I realized that there does exist a similar mechanism, also named subfigure and subcaption)



(I'm no TeX expert, I only know LaTeX a bit)



The code shown below outputs the references as Text... 1 (1.2) ... 1 ...
Text... 1 (1.3) ... 1
, so the sub-caption numbers are wrong, while the main caption number is correct. The intended output is Text... 1.2a (1.2) ... 1.2b ...
Text... 1.3a (1.3) ... 1.3b
.



The captions for the example code read (numbers are correct there):



Abbildung 1.1: Caption0

Abb. 1.2a: Caption1a Abb. 1.2b: Caption1b
Abbildung 1.2: Caption1

Abb. 1.3a: Caption2a Abb. 1.3b: Caption2b
Abbildung 1.3: Caption2


So here's the input for this example (use any placeholder graphic for Platzhalter.pdf):



documentclass[a4paper,twoside]report
usepackagegerman
usepackage[latin1]inputenc
usepackagea4
usepackagemakeidx
usepackageshowidx
usepackageamsmath
usepackageurl
usepackagegraphicx
usepackageifthen
%
newcountersubfigureX[figure]
renewcommandthesubfigureXthefigurealphsubfigureX
newcountersavefigure
newcommandgtLab
newcommandgtCap
%
newenvironmentgfxTableCapLab[4][htbp]%
ifthenelseequal#4%
renewcommandgtLab%
renewcommandgtLablabel#4%
ifthenelseequal#3%
renewcommandgtCapfLab%
renewcommandgtCapcaptiongtLab#3%
beginfigure[#1]%
setcountersavefigurevaluefigure%
stepcounterfigure%
begincenter%
begintabular#2%
endtabular%
setcounterfigurevaluesavefigure%
gtCap%
endcenter
endfigure%

%
newcommandgLab
newcommandgCap
%
newcommandgfxCapLab[4]%
ifthenelseequal#4%
renewcommandgLab%
renewcommandgLablabel#4%
ifthenelseequal#3%
renewcommandgCapgLab%
renewcommandgCapparnoindentgLabsubcaption#3%
beginminipage[t]#1textwidth%
centeringincludegraphics[width=textwidth]#2%
gCap%
endminipage%

%
newcommandgfxCap[3]gfxCapLab#1#2#3
%
newcommandsubcaption[1]%
%steprefcountersubfigureX
addtocountersubfigureX1%
small Abb.~thesubfigureX: #1%

begindocument
chapterChap
%
beginfigure
Test
captionCaption0
endfigure
begingfxTableCapLablrCaption1label1%
gfxCapLab0.4Platzhalter.pdfCaption1alabel1a
&
gfxCapLab0.4Platzhalter.pdfCaption1blabel1b
endgfxTableCapLab
%
Text...
reflabel1a (reflabel1) ... reflabel1b ...

begingfxTableCapLablrCaption2label2%
gfxCapLab0.4Platzhalter.pdfCaption2alabel2a
&
gfxCapLab0.4Platzhalter.pdfCaption2blabel2b
endgfxTableCapLab

Text...
reflabel2a (reflabel2) ... reflabel2b
enddocument


Specifically pdflatex complains if I uncomment the line %steprefcountersubfigureX (commenting addtocountersubfigureX1 instead):



! Undefined control sequence.
subcaption #1->steprefcounter
subfigureX small Abb.~thesubfigureX : #1
l.68 ...0.4Platzhalter.pdfCaption1alabel1a


(Originally I had named my counter subfigure also, but then I discovered that a counter with such a name already exists, so I appended the X).



Preferably the answer contains an explanation why my code does not work (everything that is wrong), how to do it correctly, and (as an extra) how I could achieve the same effect using the stock subfigure and subcaption mechanisms.







macros subcaption latex3 ref





share












share










share



share










asked 9 mins ago









U. WindlU. Windl

1427




1427












  • I've never heard of steprefcounter. Did you mean to write refstepcounter?

    – Mico
    4 mins ago

















  • I've never heard of steprefcounter. Did you mean to write refstepcounter?

    – Mico
    4 mins ago
















I've never heard of steprefcounter. Did you mean to write refstepcounter?

– Mico
4 mins ago





I've never heard of steprefcounter. Did you mean to write refstepcounter?

– Mico
4 mins ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482346%2fhow-to-use-steprefcounter-correctly-in-attempt-to-implement-subfigures%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482346%2fhow-to-use-steprefcounter-correctly-in-attempt-to-implement-subfigures%23new-answer', 'question_page');

);

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







Popular posts from this blog

How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"

inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX