0

I would like to have a text on multiple lines within the TikZ baseline framework. I try to make myself clear. This is the example:

\documentclass{beamer}

\usepackage[utf8]{inputenc} \usetheme{default}

\usepackage{tikz}

\usetikzlibrary{arrows,shapes,mindmap,trees,backgrounds} \tikzstyle{every picture}+=[remember picture] \tikzstyle{na} = [baseline=-.5ex] \tikzset{ invisible/.style={opacity=0,text opacity=0}, visible on/.style={alt=#1{}{invisible}}, alt/.code args={<#1>#2#3}{% \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} }, }

\tikzset{ background fill/.style={fill=#1}, background fill/.default={white}, fill on/.style={alt=#1{}{background fill}}, }

\tikzset{ background draw/.style={draw=#1}, background draw/.default={white}, draw on/.style={alt=#1{}{background draw}}, } % \tikzset{ background filldraw/.style 2 args={draw=#1, fill=#2}, background filldraw/.default={white}{white}, filldraw on/.style={alt=#1{}{background filldraw}}, }

\newcommand{\tikzmark}[1]{\tikz[remember picture] \node[coordinate] (#1) {#1};}

\setbeamerfont{caption}{size=\tiny} \setlength\abovecaptionskip{0pt} \setbeamertemplate{caption}[numbered]

\usetikzlibrary{positioning, shapes.arrows,shadows.blur} \usetikzlibrary{arrows,shapes,backgrounds} \usepackage{verbatim}

\begin{document}

\begin{frame}

\tikz[baseline]{ \node[background filldraw={green}{white!10},filldraw on=<1->,anchor=base,rounded corners,visible on=<1->] (t1) { Test Test \newline Test Test Test Test Test Test Test Test};}

\end{frame} \end{document}

This is what I get:

enter image description here

However, I would like to have the text on multiple lines. I have tried with \newline or \\ but nothing seems to work.

I would like to use \tikz[baseline] because I have to link the text to an equation.

Ingmar
  • 6,690
  • 5
  • 26
  • 47
diedro
  • 179

1 Answers1

2

Use \\ with align option in the node.

\documentclass{beamer}
\usepackage{tikz}

\begin{document} \begin{frame}
\tikz[baseline]{ \node[draw=black, align=center] (t1) { Test Test \ Test Test Test Test Test Test Test Test};}
\end{frame} \end{document}

enter image description here

Reference: https://tex.stackexchange.com/a/124114/133968

Zxcvasdf
  • 1,735