LaTeX forum ⇒ Graphics, Figures & TablesHow to anchor a box to place text in it

Information and discussion about graphics, figures & tables in LaTeX documents.
Phooey
Posts: 5
Joined: Sun Sep 29, 2019 4:18 pm

How to anchor a box to place text in it

Postby Phooey » Mon Sep 30, 2019 7:18 pm

Could someone kindly explain to me how the coordinates in this code works?

I am using this:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{tikzpicture}
  2. \draw (-3,0) rectangle (4,2)
  3. node at (0, 1.5){UWE registration number};
  4. \draw (4.25, 0) rectangle (7,2)
  5. node at (5.5, 1.5){Mark \%};
  6. \end{tikzpicture}


This giving me two boxes side by side with the text in and is correctly placed.

I need another larger box directly underneath

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{tikzpicture}
  2. \draw (-3,0) rectangle (7,12)
  3. node at (0, 1.5){lots ox text required in here};
  4. \end{tikzpicture}


The box appears correctly until I try to place the text into it. Then the box moves all over the place. It is a lot of text and with every line I get a complete movement of the box.

If I could understand how to anchor the box while placing the text I think it would help.

Cheers

Phooey
Posts: 5
Joined: Sun Sep 29, 2019 4:18 pm

Postby Phooey » Mon Sep 30, 2019 8:03 pm

I've just discovered \fbox{}

That might solve the immediate problem.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 9 guests