Compatibility of subfigure with subfig package The Next CEO of Stack OverflowTwo figures side by side with text wrappingcentering figure, containing a subfigure with customized includegraphics3 subfigures in a row, different sizes. How to manually adjust the spaces in beween?I cannot add pictures to my document using latex and texstudioChange subcaption label formatTwo tables side by side with independent and global captionsCreating a header design with a logo with LaTeXResponsive collage of picturesPosition image with 6 smaller images on the sideSubcaption environment failed. All figures containing a subfigure crashing all of a sudden

Was a professor correct to chastise me for writing "Prof. X" rather than "Professor X"?

How to write the block matrix in LaTex?

What makes a siege story/plot interesting?

Rotate a column

Apart from "berlinern", do any other German dialects have a corresponding verb?

Increase performance creating Mandelbrot set in python

When did Lisp start using symbols for arithmetic?

Is it okay to store user locations?

Fastest way to shutdown Ubuntu Mate 18.10

Implement the Thanos sorting algorithm

Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables

What does this shorthand mean?

What does "Its cash flow is deeply negative" mean?

How to count occurrences of text in a file?

Describing a person. What needs to be mentioned?

Science fiction (dystopian) short story set after WWIII

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

How do I get the green key off the shelf in the Dobby level of Lego Harry Potter 2?

Does it take more energy to get to Venus or to Mars?

Why is there a PLL in CPU?

How to make a variable always equal to the result of some calculations?

Text adventure game code

How to get regions to plot as graphics

How do scammers retract money, while you can’t?



Compatibility of subfigure with subfig package



The Next CEO of Stack OverflowTwo figures side by side with text wrappingcentering figure, containing a subfigure with customized includegraphics3 subfigures in a row, different sizes. How to manually adjust the spaces in beween?I cannot add pictures to my document using latex and texstudioChange subcaption label formatTwo tables side by side with independent and global captionsCreating a header design with a logo with LaTeXResponsive collage of picturesPosition image with 6 smaller images on the sideSubcaption environment failed. All figures containing a subfigure crashing all of a sudden










1















Suppose, I have the grouping of images as specified below.



My problem is that I want to include this kind of image grouping in an environment that uses the subfig package and that subcaption and subfig do not go well together. My question is therefore: How do I replicate the image grouping below in a subfig environment --> e.g. How do I obtain the same result as you shown below but with the subfloat macro from subfig package?



The goal really is to have a big image in the middle, and 8 images around it.



documentclassarticle
usepackagecaption,subcaption
usepackage[demo]graphicx % demo is just for the example

begindocument
beginfigure
centering

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad
beginsubfigure[].4textwidth
includegraphics[width=textwidth,height=5cm]x
captionA tall figure
endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

captionThe full caption
endfigure
enddocument


enter image description here










share|improve this question
























  • welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

    – Zarko
    yesterday











  • Yes that is exactly what I want - sorry for not having been specific enough.

    – BeSeLuFri
    yesterday











  • If you are interested, I have written a version of subfloat that uses only the subcaption package.

    – John Kormylo
    22 hours ago











  • Yes, of course I would be interested! Where can I find it? @JohnKormylo

    – BeSeLuFri
    18 hours ago












  • I'll submit it as an answer here.

    – John Kormylo
    12 hours ago















1















Suppose, I have the grouping of images as specified below.



My problem is that I want to include this kind of image grouping in an environment that uses the subfig package and that subcaption and subfig do not go well together. My question is therefore: How do I replicate the image grouping below in a subfig environment --> e.g. How do I obtain the same result as you shown below but with the subfloat macro from subfig package?



The goal really is to have a big image in the middle, and 8 images around it.



documentclassarticle
usepackagecaption,subcaption
usepackage[demo]graphicx % demo is just for the example

begindocument
beginfigure
centering

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad
beginsubfigure[].4textwidth
includegraphics[width=textwidth,height=5cm]x
captionA tall figure
endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

captionThe full caption
endfigure
enddocument


enter image description here










share|improve this question
























  • welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

    – Zarko
    yesterday











  • Yes that is exactly what I want - sorry for not having been specific enough.

    – BeSeLuFri
    yesterday











  • If you are interested, I have written a version of subfloat that uses only the subcaption package.

    – John Kormylo
    22 hours ago











  • Yes, of course I would be interested! Where can I find it? @JohnKormylo

    – BeSeLuFri
    18 hours ago












  • I'll submit it as an answer here.

    – John Kormylo
    12 hours ago













1












1








1








Suppose, I have the grouping of images as specified below.



My problem is that I want to include this kind of image grouping in an environment that uses the subfig package and that subcaption and subfig do not go well together. My question is therefore: How do I replicate the image grouping below in a subfig environment --> e.g. How do I obtain the same result as you shown below but with the subfloat macro from subfig package?



The goal really is to have a big image in the middle, and 8 images around it.



documentclassarticle
usepackagecaption,subcaption
usepackage[demo]graphicx % demo is just for the example

begindocument
beginfigure
centering

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad
beginsubfigure[].4textwidth
includegraphics[width=textwidth,height=5cm]x
captionA tall figure
endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

captionThe full caption
endfigure
enddocument


enter image description here










share|improve this question
















Suppose, I have the grouping of images as specified below.



My problem is that I want to include this kind of image grouping in an environment that uses the subfig package and that subcaption and subfig do not go well together. My question is therefore: How do I replicate the image grouping below in a subfig environment --> e.g. How do I obtain the same result as you shown below but with the subfloat macro from subfig package?



The goal really is to have a big image in the middle, and 8 images around it.



documentclassarticle
usepackagecaption,subcaption
usepackage[demo]graphicx % demo is just for the example

begindocument
beginfigure
centering

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad
beginsubfigure[].4textwidth
includegraphics[width=textwidth,height=5cm]x
captionA tall figure
endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

vspace2ex

includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure

endsubfigureqquad
beginsubfigure[].2textwidth
includegraphics[width=textwidth,height=2cm]x
captionA short figure
endsubfigureqquad

captionThe full caption
endfigure
enddocument


enter image description here







graphics subcaption subfig






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







BeSeLuFri

















asked yesterday









BeSeLuFriBeSeLuFri

84




84












  • welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

    – Zarko
    yesterday











  • Yes that is exactly what I want - sorry for not having been specific enough.

    – BeSeLuFri
    yesterday











  • If you are interested, I have written a version of subfloat that uses only the subcaption package.

    – John Kormylo
    22 hours ago











  • Yes, of course I would be interested! Where can I find it? @JohnKormylo

    – BeSeLuFri
    18 hours ago












  • I'll submit it as an answer here.

    – John Kormylo
    12 hours ago

















  • welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

    – Zarko
    yesterday











  • Yes that is exactly what I want - sorry for not having been specific enough.

    – BeSeLuFri
    yesterday











  • If you are interested, I have written a version of subfloat that uses only the subcaption package.

    – John Kormylo
    22 hours ago











  • Yes, of course I would be interested! Where can I find it? @JohnKormylo

    – BeSeLuFri
    18 hours ago












  • I'll submit it as an answer here.

    – John Kormylo
    12 hours ago
















welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

– Zarko
yesterday





welcome to tex.se! do i understood you correct that you like to obtain the same result as you shown in question, with use of the subfloat macro from subfig package?

– Zarko
yesterday













Yes that is exactly what I want - sorry for not having been specific enough.

– BeSeLuFri
yesterday





Yes that is exactly what I want - sorry for not having been specific enough.

– BeSeLuFri
yesterday













If you are interested, I have written a version of subfloat that uses only the subcaption package.

– John Kormylo
22 hours ago





If you are interested, I have written a version of subfloat that uses only the subcaption package.

– John Kormylo
22 hours ago













Yes, of course I would be interested! Where can I find it? @JohnKormylo

– BeSeLuFri
18 hours ago






Yes, of course I would be interested! Where can I find it? @JohnKormylo

– BeSeLuFri
18 hours ago














I'll submit it as an answer here.

– John Kormylo
12 hours ago





I'll submit it as an answer here.

– John Kormylo
12 hours ago










2 Answers
2






active

oldest

votes


















0














see, if the following solution can help you.



documentclassarticle
usepackagecaption
usepackage[demo, % demo is just for the example
export]adjustbox
usepackagesubfig
usepackagemultirow, tabularx

begindocument
beginfigure
setkeysGinwidth=linewidth, keepaspectratio

begintabularxlinewidth@ *4X @
& subfloat[A short image]includegraphics[valign=t]x
& subfloat[A short image]includegraphics[valign=t]x
& \
subfloat[A short image]includegraphics[valign=t]x
& multicolumn2>hsize=dimexpr2hsize+2tabcolsepX
multirow[t]2=subfloat[A tall image]includegraphics[height=78mm,valign=t]x

& subfloat[A short image]includegraphics[valign=t]x \
subfloat[A short image]includegraphics[valign=t]x
& & & subfloat[A short image]includegraphics[valign=t]x \
& subfloat[A short image]includegraphics[valign=t]x
& subfloat[A short image]includegraphics[valign=t]x
& \
endtabularx
captionThe full caption
endfigure
enddocument


enter image description here






share|improve this answer























  • yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

    – BeSeLuFri
    yesterday












  • I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

    – BeSeLuFri
    yesterday












  • with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

    – Zarko
    yesterday


















0














As requested, here is a version of subfloat which is compatible with subcaption.



Adding sufloatbox is probably overkill, but it is conceivable that #2 could contain code using, for example, box0. I noticed that both subfloat and caption use @tempboxa, albeit for different purposes.



documentclassarticle
usepackagegraphicx
usepackagesubcaption
usepackageblindtext

newsaveboxsubfloatbox

newcommandsubfloat[2][empty]% #1 = caption (optional), #2 = image
bgroup
captionsetup[subfigure]font=footnotesize%
saveboxsubfloatbox#2%
beginsubfigure[t]wdsubfloatbox
useboxsubfloatbox
ifxempty#1relax
stepcountersubfigure%
else
caption#1%
fi
endsubfigure%
egroup

begindocument
beginfigure[htp]
noindentrlapruletextwidth0.5pt% show baseline
subfloat[]includegraphics[scale=0.3]example-image-ahfill
subfloat[blindtext]includegraphics[scale=0.3]example-image-bhfill
subfloatincludegraphics[scale=0.3]example-image-c
endfigure
enddocument





share|improve this answer























    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%2f481768%2fcompatibility-of-subfigure-with-subfig-package%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    see, if the following solution can help you.



    documentclassarticle
    usepackagecaption
    usepackage[demo, % demo is just for the example
    export]adjustbox
    usepackagesubfig
    usepackagemultirow, tabularx

    begindocument
    beginfigure
    setkeysGinwidth=linewidth, keepaspectratio

    begintabularxlinewidth@ *4X @
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    subfloat[A short image]includegraphics[valign=t]x
    & multicolumn2>hsize=dimexpr2hsize+2tabcolsepX
    multirow[t]2=subfloat[A tall image]includegraphics[height=78mm,valign=t]x

    & subfloat[A short image]includegraphics[valign=t]x \
    subfloat[A short image]includegraphics[valign=t]x
    & & & subfloat[A short image]includegraphics[valign=t]x \
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    endtabularx
    captionThe full caption
    endfigure
    enddocument


    enter image description here






    share|improve this answer























    • yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

      – BeSeLuFri
      yesterday












    • I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

      – BeSeLuFri
      yesterday












    • with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

      – Zarko
      yesterday















    0














    see, if the following solution can help you.



    documentclassarticle
    usepackagecaption
    usepackage[demo, % demo is just for the example
    export]adjustbox
    usepackagesubfig
    usepackagemultirow, tabularx

    begindocument
    beginfigure
    setkeysGinwidth=linewidth, keepaspectratio

    begintabularxlinewidth@ *4X @
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    subfloat[A short image]includegraphics[valign=t]x
    & multicolumn2>hsize=dimexpr2hsize+2tabcolsepX
    multirow[t]2=subfloat[A tall image]includegraphics[height=78mm,valign=t]x

    & subfloat[A short image]includegraphics[valign=t]x \
    subfloat[A short image]includegraphics[valign=t]x
    & & & subfloat[A short image]includegraphics[valign=t]x \
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    endtabularx
    captionThe full caption
    endfigure
    enddocument


    enter image description here






    share|improve this answer























    • yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

      – BeSeLuFri
      yesterday












    • I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

      – BeSeLuFri
      yesterday












    • with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

      – Zarko
      yesterday













    0












    0








    0







    see, if the following solution can help you.



    documentclassarticle
    usepackagecaption
    usepackage[demo, % demo is just for the example
    export]adjustbox
    usepackagesubfig
    usepackagemultirow, tabularx

    begindocument
    beginfigure
    setkeysGinwidth=linewidth, keepaspectratio

    begintabularxlinewidth@ *4X @
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    subfloat[A short image]includegraphics[valign=t]x
    & multicolumn2>hsize=dimexpr2hsize+2tabcolsepX
    multirow[t]2=subfloat[A tall image]includegraphics[height=78mm,valign=t]x

    & subfloat[A short image]includegraphics[valign=t]x \
    subfloat[A short image]includegraphics[valign=t]x
    & & & subfloat[A short image]includegraphics[valign=t]x \
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    endtabularx
    captionThe full caption
    endfigure
    enddocument


    enter image description here






    share|improve this answer













    see, if the following solution can help you.



    documentclassarticle
    usepackagecaption
    usepackage[demo, % demo is just for the example
    export]adjustbox
    usepackagesubfig
    usepackagemultirow, tabularx

    begindocument
    beginfigure
    setkeysGinwidth=linewidth, keepaspectratio

    begintabularxlinewidth@ *4X @
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    subfloat[A short image]includegraphics[valign=t]x
    & multicolumn2>hsize=dimexpr2hsize+2tabcolsepX
    multirow[t]2=subfloat[A tall image]includegraphics[height=78mm,valign=t]x

    & subfloat[A short image]includegraphics[valign=t]x \
    subfloat[A short image]includegraphics[valign=t]x
    & & & subfloat[A short image]includegraphics[valign=t]x \
    & subfloat[A short image]includegraphics[valign=t]x
    & subfloat[A short image]includegraphics[valign=t]x
    & \
    endtabularx
    captionThe full caption
    endfigure
    enddocument


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered yesterday









    ZarkoZarko

    128k868167




    128k868167












    • yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

      – BeSeLuFri
      yesterday












    • I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

      – BeSeLuFri
      yesterday












    • with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

      – Zarko
      yesterday

















    • yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

      – BeSeLuFri
      yesterday












    • I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

      – BeSeLuFri
      yesterday












    • with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

      – Zarko
      yesterday
















    yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

    – BeSeLuFri
    yesterday






    yes! it absolutely does. Thank you very much. I have just a small add-on question: see below

    – BeSeLuFri
    yesterday














    I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

    – BeSeLuFri
    yesterday






    I would like to know why the formatting turns out to be slightly different in my environment - see: i.stack.imgur.com/Pscrs.png

    – BeSeLuFri
    yesterday














    with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

    – Zarko
    yesterday





    with my code? if you not change anything the only reason which cross my mind is that your latex installation has older packages than mine (i test code with recent miktex suite, upgraded yesterday).

    – Zarko
    yesterday











    0














    As requested, here is a version of subfloat which is compatible with subcaption.



    Adding sufloatbox is probably overkill, but it is conceivable that #2 could contain code using, for example, box0. I noticed that both subfloat and caption use @tempboxa, albeit for different purposes.



    documentclassarticle
    usepackagegraphicx
    usepackagesubcaption
    usepackageblindtext

    newsaveboxsubfloatbox

    newcommandsubfloat[2][empty]% #1 = caption (optional), #2 = image
    bgroup
    captionsetup[subfigure]font=footnotesize%
    saveboxsubfloatbox#2%
    beginsubfigure[t]wdsubfloatbox
    useboxsubfloatbox
    ifxempty#1relax
    stepcountersubfigure%
    else
    caption#1%
    fi
    endsubfigure%
    egroup

    begindocument
    beginfigure[htp]
    noindentrlapruletextwidth0.5pt% show baseline
    subfloat[]includegraphics[scale=0.3]example-image-ahfill
    subfloat[blindtext]includegraphics[scale=0.3]example-image-bhfill
    subfloatincludegraphics[scale=0.3]example-image-c
    endfigure
    enddocument





    share|improve this answer



























      0














      As requested, here is a version of subfloat which is compatible with subcaption.



      Adding sufloatbox is probably overkill, but it is conceivable that #2 could contain code using, for example, box0. I noticed that both subfloat and caption use @tempboxa, albeit for different purposes.



      documentclassarticle
      usepackagegraphicx
      usepackagesubcaption
      usepackageblindtext

      newsaveboxsubfloatbox

      newcommandsubfloat[2][empty]% #1 = caption (optional), #2 = image
      bgroup
      captionsetup[subfigure]font=footnotesize%
      saveboxsubfloatbox#2%
      beginsubfigure[t]wdsubfloatbox
      useboxsubfloatbox
      ifxempty#1relax
      stepcountersubfigure%
      else
      caption#1%
      fi
      endsubfigure%
      egroup

      begindocument
      beginfigure[htp]
      noindentrlapruletextwidth0.5pt% show baseline
      subfloat[]includegraphics[scale=0.3]example-image-ahfill
      subfloat[blindtext]includegraphics[scale=0.3]example-image-bhfill
      subfloatincludegraphics[scale=0.3]example-image-c
      endfigure
      enddocument





      share|improve this answer

























        0












        0








        0







        As requested, here is a version of subfloat which is compatible with subcaption.



        Adding sufloatbox is probably overkill, but it is conceivable that #2 could contain code using, for example, box0. I noticed that both subfloat and caption use @tempboxa, albeit for different purposes.



        documentclassarticle
        usepackagegraphicx
        usepackagesubcaption
        usepackageblindtext

        newsaveboxsubfloatbox

        newcommandsubfloat[2][empty]% #1 = caption (optional), #2 = image
        bgroup
        captionsetup[subfigure]font=footnotesize%
        saveboxsubfloatbox#2%
        beginsubfigure[t]wdsubfloatbox
        useboxsubfloatbox
        ifxempty#1relax
        stepcountersubfigure%
        else
        caption#1%
        fi
        endsubfigure%
        egroup

        begindocument
        beginfigure[htp]
        noindentrlapruletextwidth0.5pt% show baseline
        subfloat[]includegraphics[scale=0.3]example-image-ahfill
        subfloat[blindtext]includegraphics[scale=0.3]example-image-bhfill
        subfloatincludegraphics[scale=0.3]example-image-c
        endfigure
        enddocument





        share|improve this answer













        As requested, here is a version of subfloat which is compatible with subcaption.



        Adding sufloatbox is probably overkill, but it is conceivable that #2 could contain code using, for example, box0. I noticed that both subfloat and caption use @tempboxa, albeit for different purposes.



        documentclassarticle
        usepackagegraphicx
        usepackagesubcaption
        usepackageblindtext

        newsaveboxsubfloatbox

        newcommandsubfloat[2][empty]% #1 = caption (optional), #2 = image
        bgroup
        captionsetup[subfigure]font=footnotesize%
        saveboxsubfloatbox#2%
        beginsubfigure[t]wdsubfloatbox
        useboxsubfloatbox
        ifxempty#1relax
        stepcountersubfigure%
        else
        caption#1%
        fi
        endsubfigure%
        egroup

        begindocument
        beginfigure[htp]
        noindentrlapruletextwidth0.5pt% show baseline
        subfloat[]includegraphics[scale=0.3]example-image-ahfill
        subfloat[blindtext]includegraphics[scale=0.3]example-image-bhfill
        subfloatincludegraphics[scale=0.3]example-image-c
        endfigure
        enddocument






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 12 hours ago









        John KormyloJohn Kormylo

        46.1k22672




        46.1k22672



























            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%2f481768%2fcompatibility-of-subfigure-with-subfig-package%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

            Styletc

            Tórshavn Kliima | Partnerstääden | Luke uk diar | Nawigatsjuun62° 1′ N, 6° 46′ W62° 1′ 0″ N, 6° 46′ 0″ WWMOTórshavn