1

Using the following code, the spacing between words and lines inside tikz nodes are too much.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw [thick,-latex](0,0) -- (9.,0);
\draw [thick,-latex](0,0) -- (0,7);

\draw [ultra thick, blue] (4.,4.4) +(-45:1.cm) node [black, xshift=1.4cm, yshift=-.28cm] {Demand of Imports} -- +(135:3.cm)  +(30:1.cm) node [black, xshift=1.4cm, yshift=.2cm] {$Demand\ of\ Exports$} -- +(-150:4.2cm);

\draw [thick, black, densely dotted] (0,4.92) node [minimum size=4.cm, xshift=-.68cm, yshift=.28cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.24cm, yshift=-.2cm]{$1.30$} -- +(130:.5cm);}]{} node [black, xshift=-1.28cm, yshift=1.2cm, align=center] {Price\\buyers\\pay} -- ++(0:3.46);

\draw [thick, black, densely dotted] (0,4.4) node [minimum size=4.cm, xshift=-.88cm, yshift=.06cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.44cm, yshift=0cm]{$1.00$} -- +(180:.4cm);}]{} node [black, xshift=-2.cm, yshift=.06cm, align=center] {Price\\without\\tax} -- ++(0:4.);

\draw [thick, black, densely dotted] (0,4.08) node [minimum size=4.cm, xshift=-.8cm, yshift=-.16cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.38cm, yshift=0cm]{$0.80$} -- +(-130:.5cm);}]{} node [black, xshift=-1.28cm, yshift=-1.16cm, align=center] {Price\\sellers\\receive} -- ++(0:3.46);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

How to decrease these inter word/line spacing.

4

You could use another font size with smaller baseline skip for the tikz image.

Never put text in math mode, one of the bad side effects is strange inter word spacing. If you want the words to be in italic, use \textit{...}.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\fontsize{11pt}{9pt}\selectfont
\draw [thick,-latex](0,0) -- (9.,0);
\draw [thick,-latex](0,0) -- (0,7);

\draw [ultra thick, blue] (4.,4.4) +(-45:1.cm) node [black, xshift=1.4cm, yshift=-.28cm] {Demand of Imports} -- +(135:3.cm)  +(30:1.cm) node [black, xshift=1.4cm, yshift=.2cm] {\textit{Demand of Exports}} -- +(-150:4.2cm);

\draw [thick, black, densely dotted] (0,4.92) node [minimum size=4.cm, xshift=-.68cm, yshift=.28cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.24cm, yshift=-.2cm]{$1.30$} -- +(130:.5cm);}]{} node [black, xshift=-1.28cm, yshift=1.2cm, align=center,text width=1.5cm] {Price buyers pay} -- ++(0:3.46);

\draw [thick, black, densely dotted] (0,4.4) node [minimum size=4.cm, xshift=-.88cm, yshift=.06cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.44cm, yshift=0cm]{$1.00$} -- +(180:.4cm);}]{} node [black, xshift=-2.cm, yshift=.06cm, align=center,text width=1.5cm] {Price without tax} -- ++(0:4.);

\draw [thick, black, densely dotted] (0,4.08) node [minimum size=4.cm, xshift=-.8cm, yshift=-.16cm, path picture={\draw [thick, black, solid, -latex'] (0,0) node [black, xshift=.38cm, yshift=0cm]{$0.80$} -- +(-130:.5cm);}]{} node [black, xshift=-1.28cm, yshift=-1.16cm, align=center,text width=1.5cm] {Price sellers receive} -- ++(0:3.46);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

  • 2
    @Hany I don't decrease the font size, I decrease the skip and while I think this is a bad idea, you asked for less space between the lines. – samcarter is at topanswers.xyz Aug 8 '18 at 14:43
  • 2
    @Hany The incorrectly used math mode is the only extra spacing I see. All the other spaces are of normal size and should IMHO not be decreased. – samcarter is at topanswers.xyz Aug 8 '18 at 14:49
  • 2
    @Hany You could add a negative dimension after \\ , e.g. \\[-1mm], and replace spaces by thin spaces \, for instance. – user121799 Aug 8 '18 at 14:53
  • 2
    @Hany I don't think that is a great idea, but you can fiddle with the font settings: tex.stackexchange.com/q/23921/35864. Especially if this is for a presentation the reduced space does not help the legibility. – moewe Aug 8 '18 at 14:56
  • 1
    @Hany \fontdimen2 is a global value, so you should save its original value prior to redefining it and restore it later. – moewe Aug 8 '18 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.