2

Using the following code

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, text width=3cm, align=center] at (0,0) {\rotatebox{90}{Investment}};
\end{tikzpicture}
\end{frame}
\end{document}

How can I insert a 3-line text inside the trapezium without changing its dimensions.

enter image description here

Hany
  • 4,709

2 Answers2

2

Before and after:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz,stackengine}
\setstackEOL{\\}
\usepackage{pgfplots}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, 
  text width=3cm, align=center] at (0,0) {\rotatebox{90}{Investment}};
\end{tikzpicture}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, 
  text width=3cm, align=center] at (0,0) {\rotatebox{90}{%
  \color{red}\Centerstack{My\\Big\\Investment}}};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

Here is a version without addition packages, using a \parbox. However, the result is extremely sensitive to the \parbox width, here chosen precisely as 1.75cm:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, 
  text width=3cm, align=center] at (0,0) {\rotatebox{90}{Investment}};
\end{tikzpicture}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, 
  text width=3cm, align=center] at (0,0) {\rotatebox{90}{%
  \parbox{1.75cm}{\centering My\\Big\\Investment}}};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

1

I would just rotate the border instead of first rotating the full thing and then rotating the text back. (Note that one has to feed in a bit counter-intuitive values in shape border rotate when not used with shape uses incircle because there is some strange rounding going on.)

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red, rotate=-90, trapezium stretches body, text width=3cm, 
align=center] at (0,0) {\rotatebox{90}{Investment}};
\end{tikzpicture}
\quad
\begin{tikzpicture}[scale=.8, transform shape]
\node[draw, trapezium, red,minimum width=5.5cm,
shape border rotate=-135, trapezium stretches body, 
align=center] at (0,0) {Investment\\ Ducks\\ Latex};
\end{tikzpicture}

\end{frame}
\end{document}

enter image description here