Home > tikz pgf > Line spacing in TikZ multiline nodes inside tables

# Line spacing in TikZ multiline nodes inside tables

July 18Hits:0

I'm trying to typeset some multiline TikZ nodes inside a tabular environment. Somehow, the space between lines gets considerably shortened.

Here's my code:

\documentclass{article} \usepackage{tikz} \begin{document}  \begin{tikzpicture}     \node [align=center] {     \underline{$(\alpha \land \beta)$}\\     $\alpha$\\     $\beta$     }; \end{tikzpicture}  \begin{tabular}{c}     \begin{tikzpicture}         \node [align=center] {     \underline{$(\alpha \land \beta)$}\\         $\alpha$\\         $\beta$         };  \end{tikzpicture} \end{tabular}  \end{document}

Can someone explain what is happening and how can I prevent it?

You could save the tikzpicture in a box, outside of the tabular, and then use it once you're inside the tabular. What I mean is...

\documentclass{article}
\usepackage{tikz}
\begin{document}
\newsavebox\john
\sbox\john{
\begin{tikzpicture}
\node [align=center] {
\underline{$(\alpha \land \beta)$}\\
$\alpha$\\
$\beta$
};
\end{tikzpicture}
}

\begin{tabular}{c}
\usebox\john
\end{tabular}
\end{document}

By the way, if you're drawing proof trees, you might find the bussproofs or mathpartir packages helpful.

## Related Articles

• ### Line spacing in TikZ multiline nodes inside tablesJuly 18

I'm trying to typeset some multiline TikZ nodes inside a tabular environment. Somehow, the space between lines gets considerably shortened. Here's my code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [align=ce

• ### Tikz: How to do line spacing in a multiline node with different font sizes?December 21

I would like to create nodes in Tikz having multiple lines. This works fine using the "align"-option. But I also would like to use different font sizes and here my problem starts. If I create a node like in the following code all three lines hav

• ### How to increase line spacing in TikZ node? January 14

This question already has an answer here: Change line spacing inside a node in TikZ 1 answer In the code below, how can I increase line spacing in the node? \documentclass{book} \usepackage{lipsum} \usepackage{tikz} \begin{document} \begin{tikzpictur

• ### Incorrect vertical line spacing after changing font size in tableJanuary 16

I would like to change the font size of a parragraph in a table cell. If I do not put \par at the end of the parragraph it does not do the correct line spacing. However, if I put it, I get an anoying white line at the bottom of the cell. Here is an e

• ### TikZ: conditional nodes inside \foreachFebruary 26

I want to use a \foreach construct to generate several pairs of nodes, except for one of them I want to do something different. This is what I tried: \begin{tikzpicture}[dot/.style={fill,circle,inner sep=1.5pt}] \foreach \x/\nm/\lbl in {0/na1/\$\lnot

• ### Tikz multiline node with center align June 18

This question already has an answer here: Manual/automatic line breaks and text alignment in TikZ nodes 1 answer I have a problem with nodes in scheme. I need type a node where will be text "Banka melovskych filtru". Each word on a special line

• ### Uneven line spacing in two columns under a table January 18

There are quite a few questions already answered on similar topics but I couldn't find an exact scenario such as mine. I have a table on a two-column page. The table is large so when it is placed on top of the page it leaves just enough space at the

• ### How can I set single line spacing for \enumerate amd \section?April 11

I want to set \enumerate and \section to use single line spacing and small font like the table of content in this document. How can I do that? Thank you. --------------Solutions------------- I used the titlesec package to change the formatting for th

• ### Change line spacing inside a node in TikZAugust 5

Inside a TikZ node, one can force line breaks using \\ providing the align option of the node is set. I would like to increase the line spacing inside a node. This can be done in the usual way with the optional parameter of \\, e.g. \\[1em]. Doing th

• ### Line spacing and alignment issues in tables with multiline cellsJuly 31

While trying to create tables with multiline cells, I run into some line spacing and alignment issues. The following code creates two tables: \documentclass[10pt]{article} \usepackage[english]{babel} \usepackage{pbox} \usepackage{multirow} \begin{doc

• ### TikZ: Positioning of multiline nodesNovember 21

Do you know an elegant way to align multiline nodes according to first line, e.g. for use in a legend? Compare this example: \documentclass{article} \usepackage[% paperwidth=7.5cm,% paperheight=5.5cm,% margin=0.25cm,% marginparwidth=0cm,% centering,%

• ### Line spacing in wrapped table textSeptember 27

I have a document where the text is set to double spacing. I have some text inside tables, which I use the paragraphy specifier for. It wraps properly, but spacing is set to single. Is it possible to have the paragraph cells of table be double spaced

• ### Small text in table does not recalculate line spacingOctober 3

I'm using tabu to create a table that has a couple multi-line cells (the m style). However, when I set the line spacing outside the table, it seems that the space between lines is not recalculated in the table, and when I make the font small, the spa

• ### Line-spacing in a cell of tableAugust 16

I'd like to change the line space of sentence in a cell of table. It is not line-breaked, but over-flowed since the sentence is quite long in the cell. My code example is below. The line space is quite larger than cell space, which looks so bad. Is t

• ### more fun with inside-table spacing - setspaceMarch 17

vertical spacing is witchcraft, as far as I can tell. I have put in everything that I could think of that could possibly force the explain environment contents to be tightly vertically spaced. It works in the main text. The macros themselves inside t

• ### Change line spacing in nested nodesJune 25

I tried to change the line spacing in a node nested to another. I have tried to use \linepsread and \baselineskip but both doesn't work. MWE: \documentclass[]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \n

• ### Line spacing inside quote environmentSeptember 27

I use the setspace package to set double spacing throughout the document. It also sets double spacing inside the quote environment. But, I want one half space inside the quote environment. How can this be done? EDIT 1: If changing font size and font

• ### How to add line between two rows of nodes in Tikz and how to align nodes vertically?May 1

I have two questions: How can I add a horizontal line centered between two rows of nodes in Tikz? How can I change the vertical placement of a node to line up better with other nodes A picture of what I mean will make this clearer: The blue line indi

• ### Line spacing in supertabular multi lined table cellsMay 29

I have created a table using the supertabular package with table cells containing from one to four lines of text. In my document I have defined a linespread of 1.5. I also have defined following table configurations. \renewcommand{\arraystretch}{1} \

• ### Change line spacing inside the documentNovember 22

This is my code \documentclass[12pt,a4paper]{book} \renewcommand{\baselinestretch}{1.5} \begin{document} \include{Chapter1} \end{document} I have please a question: I would change the line spacing (1.5 --> 1.0) of a page inside the document and not t