0

I have a document containing lots of texts and figures. You see in the following MWE:

\documentclass[a4paper,11pt,twoside]{memoir}

\usepackage{lipsum} \usepackage{tikz} \usetikzlibrary{tikzmark} \usetikzlibrary{decorations.text,decorations.pathmorphing} \usetikzlibrary{positioning, shadows, shapes.geometric} \begin{document}

\lipsum[1]

\large [ \tikzmarknode{A}{2} \tikzmarknode{B}{3} \times \tikzmarknode{C}{5}\tikzmarknode{D}{5} ]

\begin{tikzpicture}[remember picture,overlay] \tikzset{ every node/.style={outer sep=2pt}, lab/.style={font=\tiny,inner sep=0pt}} \draw[blue] (A) to[out=90,in=90,looseness=1.4] node[lab,midway,above]{multiply} (D) ; \draw[red] (B) to[out=90,in=90] node[lab,midway,above]{multiply} (C) ;
\draw[cyan] (A) to[out=-70,in=-110] node[lab,midway,below left]{multiply} (C) ; \draw[cyan] (B) to[out=-70,in=-110] node[lab,midway,below right]{multiply} (D) ;
\end{tikzpicture}

\lipsum[1]

\begin{center} \begin{tikzpicture}[every text node part/.style={align=center}] \node (a) [rectangle,draw=none,fill=blue!25,rounded corners=0.1cm] at (0,0) {\Large 5 \ {} \ 3}; \node (b) [rectangle,draw=none,fill=blue!25] at (1,0) { \Large 7 \ {} \ 6}; \node (c) [rectangle,draw=none,fill=blue!25] at (2,0) {\Large 8 \ {} \ 2}; \node (d) [rectangle,draw=none,fill=blue!25] at (3,0) {\Large 9 \ {} \ 8}; \node (fol1) [rectangle,draw=none,fill=blue!25] at (0,-1.5) {\Large 8}; \node (fol2) [rectangle,draw=none,fill=blue!25] at (1,-1.5) {\Large 13}; \node (fol3) [rectangle,draw=none,fill=blue!25] at (2,-1.5) {\Large 6}; \node (fol4) [rectangle,draw=none,fill=blue!25] at (3,-1.5) {\Large 17}; \node (fol) [rectangle,draw=none,fill=blue!25] at (2,-2.5) {\Large 9377}; \end{tikzpicture} \end{center}

\lipsum[1]

\begin{center} \begin{tikzpicture}[mycirc/.style={circle,fill=blue!20, minimum size=0.5cm}] \node[mycirc] (n1) at (-3,0) {116}; \node[mycirc,label=above:{Middle number}] (n2) at (0,0) {120}; \node[mycirc] (n3) at (3,0) {124}; \node[rectangle,label=below:{Product},draw,minimum size=0.7cm] (n4) [below=0.7cm of n2] {\Large $120^2-2^2$}; \draw[-to] (n1) -- node [midway,above] {less} (n2); \draw[-to] (n3) -- node [midway,above] {more} (n2); \draw[-to] (n2) -- (n4); \end{tikzpicture} \end{center}

\lipsum[1]

\end{document}

You may notice all numbers inside tikzpicture are in large font. I have to do it manually for every numbers writing each time the command \Large. Is there any way to set globally the font size to \Large for all tikzpicture?

Related:

Also how to set all the tikzpicture to be centered that I made using \begin{center}...\end{center}?

mmr
  • 2,249
  • 5
  • 22

1 Answers1

3

Put

\tikzset{font=\Large}

before the first tikzpicture, for example

\documentclass{article}
\usepackage{tikz}
\tikzset{font=\Large}
\begin{document}
    \begin{tikzpicture}
        \node  {Test};
    \end{tikzpicture}
\end{document}

For just a single tikzpicture you can do it as an optional argument to the environment:

\documentclass{article}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}[font = \Large]
        \node  {Test};
    \end{tikzpicture}
\end{document}

To centre all tikzpictures use

\documentclass{article}
\usepackage{etoolbox}
\usepackage{tikz}
\BeforeBeginEnvironment{tikzpicture}{\begin{center}}
\AfterEndEnvironment{tikzpicture}{\end{center}}
\begin{document}
    \begin{tikzpicture}[font = \Large]
        \node  {Test};
    \end{tikzpicture}
\end{document}

which, as the command names suggest, appends \begin{center} before starting a tikzpicture environment, and \end{center} after ending a tikzpicture environment. See the etoolbox documentation for more details.

Willoughby
  • 3,649