TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This LaTeX code:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}

\begin{figure}[ht]
\begin{tikzcd}[row sep=3cm, column sep=0.9cm]
& \text{binary relations}
\arrow[rd, shift left]
\arrow[ld, shift left] \\
\text{pointfree funcoids between powersets}
\arrow[ru, shift left]
\arrow[rr, shift left]
& & \text{antitone Galois connections between powersets}
\arrow[lu, shift left]
\arrow[ll, shift left]
\end{tikzcd}
\end{figure}

\end{document}

produces a too wide diagram:

enter image description here

I want to split text in the nodes multiline, like:

antitone Galois connections\\between powersets

Please explain how to do it.

share|improve this question
up vote 4 down vote accepted

You can for example use a \parbox or tabular for the long labels:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}
\begin{tikzcd}[row sep=3cm, column sep=0.9cm]
& \parbox{2cm}{\centering binary relations}
\arrow[rd, shift left]
\arrow[ld, shift left] \\
\parbox{3cm}{\centering pointfree funcoids between powersets}
\arrow[ru, shift left]
\arrow[rr, shift left]
& & \parbox{3cm}{\centering antitone Galois connections between powersets}
\arrow[lu, shift left]
\arrow[ll, shift left]
\end{tikzcd}

\begin{tikzcd}[row sep=3cm, column sep=0.9cm,every cell/.append style={align=center}]
& \text{binary relations}
\arrow[rd, shift left]
\arrow[ld, shift left] \\
\begin{tabular}{c}
pointfree funcoids \\
between powersets
\end{tabular}
\arrow[ru, shift left]
\arrow[rr, shift left]
& & \begin{tabular}{c}
antitone Galois connections \\
between powersets
\end{tabular}
\arrow[lu, shift left]
\arrow[ll, shift left]
\end{tikzcd}
\end{document}

enter image description here

share|improve this answer

Here's a solution:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}
\newcommand\mlnode[1]{\fbox{\begin{tabular}{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{figure}[ht]
  \begin{tikzcd}[row sep=3cm, column sep=0.9cm]
    & \fbox{binary relations}
    \arrow[rd, shift left]
    \arrow[ld, shift left] \\
    \mlnode{pointfree funcoids\\ between powersets}
    \arrow[ru, shift left]
    \arrow[rr, shift left]
    & & \mlnode{antitone Galois\\ connections\\ between powersets}
    \arrow[lu, shift left]
    \arrow[ll, shift left]
  \end{tikzcd}
\end{figure}

\end{document} 

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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