0

enter image description hereenter image description hereI have been trying to change the font size in the entire forest environment to footnote size but it doesn't seem to work. I have read the previous, related posts but the answers offered there did not work either, like encapsulating the entire tree with \fontsize, declaring a new font size+family, or changing it for each node separately. Here is my code >>>

\begin{figure}[H] % Set the entire figure in footnote size
    \centering
    \footnotesize
    \begin{forest}
    for tree={
        align=left, % Aligns all nodes to the left
        edge+={thick, -{Stealth[]}},
        l sep'+=10pt,
        fork sep'=10pt, 
        % Set the font size of the nodes to footnote size
    },
    forked edges,
    if level=0{
        inner xsep=0pt,
        tikz={\draw [thick] (.children first) -- (.children last);}
    }{},
    before typesetting nodes={
        if level=3{
            content={
                \begin{description}[labelindent=1em, labelwidth=0pt, leftmargin=1em, itemsep=0pt, parsep=0pt, font=\footnotesize] % Set the level 3 nodes' content in footnote size
                    \item[\textbullet] #1
                \end{description}
            }
        }{}
    }
    [Types of relations
        [Expansion
            [Elaboration
                [- Explanation\\- Exemplification\\- Specification\\- Identification]
            ]
            [Extension
                [- Collection\\- Variation\\- Sequence\\- Response\\- Alternation]
            ]
            [Enhancement
                [- Spatio-temporal\\- Manner\\- Cause\\- Effect\\- Condition\\- Means\\- Purpose\\- Justification\\- Concession\\- Motivation\\- Enablement\\- Restatements\\- Summary]
            ]
        ]
        [Projection
            [Speech]
            [Thought]
        ]
        [Decoration
            [Various forms\\and types]
        ]
    ]
    \end{forest}
    \caption{Logico-semantic relations between words and images according to \textcite{kong2006taxonomy}}
    \label{fig:Figures}
\end{figure}

Loaded packages>

\documentclass[12pt]{report}
\usepackage[a4paper,left=2cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}

\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{pdfpages}
\usepackage{hyperref}



%------LAYOUT--------------------------------------------------------------------
\geometry{
 left=25mm,
 right=25mm,
 top=35mm,
 bottom=35mm
}
\usepackage{float}

%------PARAGRAPHS---------------------------------------------------------------
\usepackage{parskip}
\usepackage{blindtext}

%------GRAPHICS-----------------------------------------------------------------
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[percent]{overpic}

%------ENUMERATION--------------------------------------------------------------
\usepackage{enumitem}
\newlist{researchquestions}{enumerate}{1}
\setlist[researchquestions]{label*={RQ\arabic*}}
\setlist{nosep}

%------SPACING-----------------------------------------------------------------
\usepackage{setspace}
\singlespacing

%------FOOT_HEAD---------------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\fancyhead[RE]{\small\upshape\color{gray!70}\nouppercase{\leftmark}}
\fancyhead[LO]{\small\upshape\color{gray!70}\nouppercase{\leftmark}}

\fancyfoot[C]{\thepage}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ / #1}{}}
\renewcommand{\headrule}{}

%------TABLES_FIGURES-------------------------------------------------------------------
\usepackage{threeparttable}
\usepackage{tabularx}
\usepackage{caption}
\captionsetup{font=footnotesize}
\usepackage{etoolbox}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage[edges]{forest}
\usepackage{forest}
\usetikzlibrary{arrows.meta}

%------COLOR-------------------------------------------------------------------
\definecolor{lightgray}{RGB}{100, 220, 220}
\definecolor{kuleuven}{RGB}{29,141,176}
\definecolor{kuleuven1}{RGB}{82,189,236}
\definecolor{mygray}{gray}{0.6}


%------REFERENCES---------------------------------------------------------------
\usepackage{url}
\usepackage[style=apa, backend=biber]{biblatex}
\usepackage{csquotes}
\addbibresource{references.bib}
\hypersetup{
    colorlinks,
    linkcolor={black},
    citecolor={blue!50!black},
    urlcolor={black}
}
8
  • If I load \usepackage[edges]{forest}\usetikzlibrary{arrows.meta} and biblatex, the tree is typeset in footnote size.
    – egreg
    Jun 14, 2023 at 22:02
  • @egreg Thank you for your suggestion. I had the same packages, and the issue persists. I should maybe add that I use overleaf. It is possible that there is some conflict of packages? %------TABLES_FIGURES------------------------------------------------------------------- \usepackage{threeparttable} \usepackage{tabularx} \usepackage{caption} \captionsetup{font=footnotesize} \usepackage{etoolbox} \usepackage{colortbl} \usepackage{xcolor} \usepackage[edges]{forest} \usepackage{forest} \usetikzlibrary{arrows.meta} \usepackage{enumitem} %--------------------------
    – Barnabus
    Jun 15, 2023 at 8:04
  • Please, add to the question, not in comments
    – egreg
    Jun 15, 2023 at 8:45
  • Will do, thanks!
    – Barnabus
    Jun 15, 2023 at 9:05
  • You do get \footnotesize: indeed the font in the tree is the same as in the caption, namely 10 point size. If you want a smaller font in the tree, declare \scriptsize instead of \footnotesize.
    – egreg
    Jun 15, 2023 at 9:11

2 Answers 2

1

I'm not sure about this answer but please try it. I have a feeling that this might have been asked before. The normal answer is to run LaTeX a second time. Please let me know if that works and if you are able to remind me why that is supposed to work. Thank you, GOM

0

You seem to be a victim of an optical illusion. The text in the tree labels may appear to be slightly bigger than the text in the caption, but this is due to the missing context.

Visual experiment:

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}

{\centering\footnotesize Expansion\par}

\bigskip

\footnotesize\noindent
Logico-semantic relations between words and images according to
some article that I don't know about.

\end{document}

enter image description here

If you fix your eye to “Expansion” it will appear larger than the text in the caption. But they're exactly the same. Further example

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}

{\centering\footnotesize \fontname\font\par}

\bigskip

\footnotesize\noindent
Logico-semantic relations between words and images according to
some article that I don't know about. \fontname\font

\end{document}

enter image description here

You see that \fontname\font prints exactly the same. Try with your code by adding \fontname\font in one of the labels and at the end of the caption. You will see “ec-lmr10” in both instances.

If you want a distinctly smaller font for the tree, you can declare \scriptsize.

I take the opportunity to suggest some changes in your preamble, separating package loading from setup.

\documentclass[12pt,a4paper]{report}
\usepackage{geometry}

\usepackage{lmodern}
%\usepackage{textcomp} % <--- no longer needed
\usepackage[T1]{fontenc}
\usepackage{pdfpages}
%\usepackage{float} % don't

%------PARAGRAPHS---------------------------------------------------------------
\usepackage{parskip}
\usepackage{blindtext}

%------GRAPHICS-----------------------------------------------------------------
\usepackage{graphicx}
\usepackage[percent]{overpic}

%------ENUMERATION--------------------------------------------------------------
\usepackage{enumitem}

% spacing
\usepackage{setspace}

%------FOOT_HEAD---------------------------------------------------------------
\usepackage{fancyhdr}

%------TABLES_FIGURES-------------------------------------------------------------------
\usepackage{threeparttable}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{etoolbox}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}


% references
\usepackage[style=apa, backend=biber]{biblatex}
\usepackage{csquotes}

% hyperlinks
\usepackage{url}
\usepackage{hyperref}

%%% settings

% layout
\geometry{
 left=25mm,
 right=25mm,
 top=35mm,
 bottom=35mm,
 headheight=13.6pt, % <--- as suggested by fancyhdr
}

% lists
\newlist{researchquestions}{enumerate}{1}
\setlist[researchquestions]{label*={RQ\arabic*}}
\setlist{nosep}

% spacing
\singlespacing

% header and footer
\pagestyle{fancy}
\fancyhf{}

\fancyhead[RE]{\small\upshape\color{gray!70}\nouppercase{\leftmark}}
\fancyhead[LO]{\small\upshape\color{gray!70}\nouppercase{\leftmark}}

\fancyfoot[C]{\thepage}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ / #1}{}}
\renewcommand{\headrule}{}

% captions
\captionsetup{font=footnotesize}

% hyperref

\hypersetup{
    colorlinks,
    linkcolor={black},
    citecolor={blue!50!black},
    urlcolor={black}
}

% colors
\definecolor{lightgray}{RGB}{100, 220, 220}
\definecolor{kuleuven}{RGB}{29,141,176}
\definecolor{kuleuven1}{RGB}{82,189,236}
\definecolor{mygray}{gray}{0.6}

% resources
\addbibresource{references.bib}
\graphicspath{{images/}}

\begin{document}

\begin{figure}[htp]
\centering
\scriptsize

    \begin{forest}
    for tree={
        align=left, % Aligns all nodes to the left
        edge+={thick, -{Stealth[]}},
        l sep'+=10pt,
        fork sep'=10pt, 
        % Set the font size of the nodes to footnote size
    },
    forked edges,
    if level=0{
        inner xsep=0pt,
        tikz={\draw [thick] (.children first) -- (.children last);}
    }{},
    before typesetting nodes={
        if level=3{
            content={
                \begin{description}[labelindent=1em, labelwidth=0pt, leftmargin=1em, itemsep=0pt, parsep=0pt, font=\footnotesize] % Set the level 3 nodes' content in footnote size
                    \item[\textbullet] #1
                \end{description}
            }
        }{}
    }
    [Types of relations
        [Expansion
            [Elaboration
                [- Explanation\\- Exemplification\\- Specification\\- Identification]
            ]
            [Extension
                [- Collection\\- Variation\\- Sequence\\- Response\\- Alternation]
            ]
            [Enhancement
                [- Spatio-temporal\\- Manner\\- Cause\\- Effect\\- Condition\\- Means\\- Purpose\\- Justification\\- Concession\\- Motivation\\- Enablement\\- Restatements\\- Summary]
            ]
        ]
        [Projection
            [Speech]
            [Thought]
        ]
        [Decoration
            [Various forms\\and types]
        ]
    ]
    \end{forest}

\caption{Logico-semantic relations between words and images according 
  to \textcite{kong2006taxonomy}}
\label{fig:Figures}

\end{figure}

\end{document}

enter image description here

1
  • Thanks for an extensive explanation. I followed the suggestions (\fontname\font). The font in caption is indeed 10pt, whereas at the 3rd level nodes it showed 10.95pt for whatever reason.
    – Barnabus
    Jun 15, 2023 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .