How to make font in subfigure of tikZ same size as document

  • Context: LaTeX 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Font
Click For Summary
SUMMARY

The forum discussion addresses the issue of font scaling in TikZ subfigures within LaTeX documents. User Josh seeks a solution to maintain consistent font size when using the \texttt{resizebox} command, which inadvertently scales down the font. The recommended approach involves creating a new environment that allows for font size adjustment prior to applying the scaling, ensuring the text remains the same size as the document. This method enhances both the visual quality and usability of LaTeX figures.

PREREQUISITES
  • Familiarity with LaTeX document preparation system
  • Understanding of TikZ for creating graphics in LaTeX
  • Knowledge of LaTeX environments and commands
  • Basic experience with font size manipulation in LaTeX
NEXT STEPS
  • Research how to create custom environments in LaTeX
  • Learn about TikZ font size settings and commands
  • Explore the \texttt{resizebox} command and its alternatives
  • Investigate best practices for maintaining consistent formatting in LaTeX figures
USEFUL FOR

This discussion is beneficial for LaTeX users, graphic designers working with TikZ, and anyone looking to enhance the presentation of figures in academic or professional documents.

member 428835
Hi PF!

I have the following code
Code:
\begin{figure}
    \isp
    \begin{subfigure}[t]{0.5\textwidth}
    \centering
    \resizebox{\linewidth}{!}{
    \begin{tikzpicture}
\draw(0,0) to (0,1);
\node at (0,1) {$z$};
\end{tikzpicture}
    }
    \caption{}
      \label{tri}
    \end{subfigure}
    \begin{subfigure}[t]{0.5\textwidth}
       \centering
        \resizebox{\linewidth}{!}{
      \begin{tikzpicture}
\draw(0,0) to (1,0);
\node at (1,0) {$x$};
     \end{tikzpicture}
   }
   \caption{}
      \label{round}
    \end{subfigure}
        \caption{Illustration of the tapered corner regime.}
        \label{tc}
\end{figure}

in LateX but for some reason when I scale the pictures, the font is also scaled. How can I control this so the font is the same size as the rest of the document?

Thanks so much!

Josh
 
Physics news on Phys.org
It's quite logical behaviour that the font is scaled down.
First the contents of the resizebox etc. are rendered after which they are scaled down hence the smaller font.

I would approach this by defining a new environment.
This environment would take a scaling parameter and perhaps a reference length.

In this environment you would scale up the fontsize before the rescaling is done.
This is a great exercise to become better at LaTeX.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 27 ·
Replies
27
Views
4K