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

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Font
Click For Summary
The discussion revolves around a LaTeX code issue where scaling images also reduces the font size within those images. The original poster, Josh, seeks a solution to maintain consistent font size while resizing graphics. The response highlights that the observed behavior is logical, as the contents are rendered first and then scaled down, resulting in smaller text. A suggested solution involves creating a new environment that allows for adjusting the font size before applying the scaling, which could enhance understanding and proficiency in LaTeX.
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
2K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
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