Graphics, Figures & TablestikZ | Padding for Text inside the Node

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

tikZ | Padding for Text inside the Node

Post by usr345 »

How can I make a left padding for a text without making the node wider? I tried inner xsep, but the node becomes wider.
Last edited by usr345 on Mon Jul 04, 2011 6:09 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

tikZ | Padding for Text inside the Node

Post by usr345 »

I tried the recipes, given in this thread:

http://www.latex-community.org/forum/vi ... ?f=5&t=547

This code worked, giving the left indent for the whole text:

Code: Select all

\newenvironment{myindentpar}[1]%
 {\begin{list}{}%
         {\setlength{\leftmargin}{#1}}%
         \item[]%
 }
 {\end{list}}
But it also gave the top indent, that I don't need. I tried to remove it, using:

Code: Select all

{\setlength{\topsep}{0pt}}%
{\setlength{\partopsep}{0pt}}%
{\setlength{\itemsep}{0pt}}%
{\setlength{\parsep}{0pt}}%
{\setlength{\labelsep}{0pt}}%
But it didn't work.

How can I set the top margin to 0 for a list inside a tikz node?

Also this approach:

Code: Select all

  \hangindent2em
  \hangafter=0
  \blindtext

  \medskip
  \blindtext
didn't work inside tikz picture node.
dlf
Posts: 1
Joined: Mon Jul 04, 2011 2:16 pm

tikZ | Padding for Text inside the Node

Post by dlf »

Hi,
regarding TikZ, have you checked out the “inner sep” and maybe the “outer sep” attributes for nodes? Try to set the seps to zero…

Code: Select all

\node[inner sep=0cm]...
…and tell us if there is still space above the list.

By the way, when I use lists inside of diagrams, I always use the “compact”-versions from the paralist package. Its much more accurate for the use in graphics.
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

tikZ | Padding for Text inside the Node

Post by usr345 »

We solved the problem here:
http://dxdy.ru/topic47224.html

Code: Select all

\node[draw]  (p0)  {\hspace{1 cm}\parbox{2cm}{C ccccccccc cccccccccc cccccc ccccccccc cc ccccc ccccc}};
Post Reply