Graphics, Figures & TablesSmaller font /Overfull hbox

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bear19952000
Posts: 3
Joined: Wed Dec 07, 2022 4:16 pm

Smaller font /Overfull hbox

Post by bear19952000 »

Hey!

Does anyone have any ideas how I can make the font smaller?
I want to write longer words into the graphic but I don't know where and which code I have to insert.

\documentclass[border=10pt,tikz]{standalone}

\usetikzlibrary{positioning,shapes.multipart,calc,arrows.meta}

\usepackage{caption}

\begin{document}
\begin{tikzpicture}
[
basic/.style={draw, text centered},
circ/.style={basic, circle, minimum size=2em, inner sep=1.5pt},
rect/.style={basic, text width=1.5em, text height=1em, text depth=.5em},
1 up 1 down/.style={basic, text width=1.5em, rectangle split, rectangle split horizontal=false, rectangle split parts=2},
>={Stealth[]}
]

\node [rect] (FLE) {$FLE$};
\node [rect, right=of FLE] (RI) {$RI$};
\node [rect, right=of RI] (PTP) {$PTP$};

\node [rect, above=of RI] (RT) {$RT$};
\node [rect, below=of RI] (PC) {$PC$};

\node [circ, left=of FLE] (SGS) {$SGS$};

\node [circ, below=of PTP.south west] (ATR) {$ATR$};
\node [circ, below=of PTP.south east] (FTP) {$FTP$};

\foreach \i/\j in {SGS/FLE,FLE/RI,ATR/PTP,FTP/PTP,PC/RI,RT/RI} \draw [->] (\i) -- (\j);

\foreach \i/\j in {PTP/RI} \draw [->] (\i) -- (\j);

\draw [white, densely dashed, shorten >=.4pt, shorten <=.4pt] (SGS) -- (FLE);
\draw [white, densely dashed, shorten >=.4pt, shorten <=.4pt] (ATR) -- (PTP);
\draw [white, densely dashed, shorten >=.4pt, shorten <=.4pt] (FTP) -- (PTP);

\end{tikzpicture}
\captionof{figure}{Flowchart of X}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

migf
Posts: 20
Joined: Mon Feb 18, 2013 2:33 pm

Smaller font /Overfull hbox

Post by migf »

Hello,

Have a look at "The node text", "Text parameters: font" in the PGF manual. In the version I have this begins in page 233.

In situations as you describe I used, for instance, "\font=\scriptsize".

Hope this helps!
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Smaller font /Overfull hbox

Post by Bartman »

Please use code tags to mark your code.

As migf already said, read section 17.4.2 "Text Parameters: Font" of the tikz manual on how to change the font size. You can find suitable commands at the end of section "2.1 Text font attributes" of the fntguide.

A suggestion to revise your example:

Code: Select all

\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{positioning,arrows.meta}

\begin{document}
\begin{tikzpicture}[
  basic/.style={draw, minimum size=2em, font=\small},
  circ/.style={basic, circle, inner sep=1.5pt},
  rect/.style={basic, text height=1em, text depth=.5em},
  <>/.style={shorten >=#1, shorten <=#1},
  >={Stealth}
]

\path [nodes=rect]
  node (FLE) {FLE}
  node [right=of FLE] (RI) {RI}
  node [right=of RI] (PTP) {PTP}
  node [above=of RI] (RT) {RT}
  node [below=of RI] (PC) {PC}
;

\path [nodes=circ]
  node [left=of FLE] (SGS) {SGS}
  node [below=of PTP.south west] (ATR) {ATR}
  node [below=of PTP.south east] (FTP) {FTP}
;

\foreach \i in {FLE,PC,PTP,RT} 
  \draw [->] (\i) -- (RI);

\path [->, densely dashed, <>=.4pt] 
  (SGS) edge (FLE)
  (ATR) edge (PTP)
  (FTP) edge (PTP)
;

\end{tikzpicture}
\end{document}
Post Reply