TransWikia.com

Modify Floatfoot of Floatrow Package and move Rule

TeX - LaTeX Asked by Alex Povel on August 15, 2021

From the floatrow package, I am using the floatfoot command to reference sources and similar content.

This MWE produces an output that is quite acceptable:

documentclass{article}

usepackage{xcolor}
usepackage{floatrow}
        floatsetup[figure]%
        {%
            capbesideposition=right,%
            postcode=rule,%
        }%
    setlength{floatfootskip}{0pt}%remove vertical space/skip
usepackage{caption}
    DeclareCaptionFont{ftfont}{scriptsizeraggedleft}
    captionsetup[floatfoot]
        {%
            footfont=ftfont,%
        }%      
begin{document}
    begin{figure}
        ffigbox[FBwidth]
        {%
            rule{5cm}{5cm}
        }%
        {%
            caption{None}%
            floatfoot{Floatfoot}%  
        }%
    end{figure}
    begin{figure}
        fcapside[FBwidth]
        {%
            rule{5cm}{5cm}
        }%
        {%
            caption{None}%
            floatfoot{Floatfoot}%  
        }%
    end{figure}    
    begin{table}
        ttabbox
        {%
            caption{None}%
            floatfoot{Floatfoot}
        }%
        {%
            begin{tabular}{ll}
                hline
                Number & Name
                2 & Fred
                hline
            end{tabular}
        }%
    end{table}
end{document}

It looks like this:

enter image description here

The Table is inserted for good measure, it looks good as-is. I am concerned about the figures.

I have not been able to find information in the package doc about modifying the floatfoot. Its positional commands (default, caption, bottom) are not what I am looking for.

Additionally, the horizontal rule underneath the float is a nice touch in my mind.

  1. As a first step, is there a way to place this rule from postcode above the floatfoot?
    This cannot be that hard, however I failed. Fiddling with midcode etc. did not solve it.

  2. Secondly, a much more advanced question. It might not be reasonable. Is there a way to mold the rule and floatfoot into something like this:

enter image description here

Excuse the sketch.

One Answer

After a hiatus, I have returned to the issue and now solved it like this:

documentclass{article}
usepackage{caption}
    DeclareCaptionLabelSeparator{slash}{ / }%
    DeclareCaptionFont{ftfont}{scriptsizecolor{red}hypersetup{hidelinks}sffamilyraggedleft}
    captionsetup{%
        format=plain,%
        textformat=period,%
        font=small,%all fonts
        labelfont={sf,bf},%
        labelsep=slash,%
        labelformat=simple,%just Name/Number, no period or similar
        indention=1em,%
    }%
    captionsetup[floatfoot]%
                    {%
                        footfont=ftfont,%
                    }%
usepackage{floatrow}%
    floatsetup{footnoterule=none}%avoid drawing two rules
    floatsetup[figure]%
                    {%
                        capbesideposition=right,%
                        capbesidesep=quad,%
                    }%  
usepackage{hyperref}
newlength{floatfootruleindent}
makeatletter
    setlength{floatfootruleindent}{caption@indent}
makeatother
renewcommandfloatfootskip{2pthspace{floatfootruleindent}hrulefill}

begin{document}
    begin{figure}
        ffigbox[FBwidth]
        {%
            caption{My caption which is longer than usual so it spans more than one line}
            floatfoot{This is the float foot}
%           footnotetext[1]{A footnote.}
        }%
        {%
            rule{4cm}{4cm}%mpfootnotemark[1]
        }%
    end{figure}
    begin{figure}
    fcapside[FBwidth]
    {%
        caption{My caption which is longer than usual so it spans more than one line}
        floatfoot{This is the float foot}
        footnotetext[1]{A footnote.}
    }%
    {%
        rule{4cm}{4cm}mpfootnotemark[1]
    }%
end{figure}
end{document}

This is a misuse of floatfootskip as far as I can see, which seems to be intended to just be a length. The first input 2pt provides the length the package expects, but then also inserts all the code behind it.

It works for now. I am an absolute beginner in fiddling with .sty definitions, so I am certain this is an awful way to do it. Especially the way how floatfootskip is also used for footnotetext, which results in another hrulefill to be drawn, even if we don't want this. The default is to draw a shorter line, removed here by footrulerule=none.

Still, I hope people could be interested in this.

The results looks likeenter image description here

Answered by Alex Povel on August 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP