Graphics, Figures & TablesCaption inside of tikz node

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bidski
Posts: 5
Joined: Fri Sep 24, 2021 1:30 am

Caption inside of tikz node

Post by bidski »

I have a large tikzpicture inside of a figure environment. The tikzpicture takes up an entire page apart from a small blank section in the bottom right corner. I have attached an image showing the layout I am trying to achieve

The caption is going to be quite lengthy and scaling the image content down to allow the caption to fit below the image is going to make some of the content unreadable.

What I would like to do is place the caption inside the small blank section in the image, perhaps inside a tikz node.

Is it possible to have

Code: Select all

\node[options] at (position) {\caption{\label{....}......}};
inside a tikzpicture? If not, is it possible to have plain text in the node that is formatted the way caption text is usually formatted (including the "Figure X.Y: " with the correct numbering for the current place in the document)?
Attachments
page layout schematic
page layout schematic
page_layout.png (5.27 KiB) Viewed 6897 times

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

bidski
Posts: 5
Joined: Fri Sep 24, 2021 1:30 am

Caption inside of tikz node

Post by bidski »

After some more extensive googling I finally managed to find an answer! The following code snippet achieves the effect that I am looking for.

Code: Select all

\node [options] at (position) {
    \parbox{\linewidth}{
        \caption{\label{demo}Figure caption}
}};
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Caption inside of tikz node

Post by Bartman »

You can use the text width option instead.
bidski
Posts: 5
Joined: Fri Sep 24, 2021 1:30 am

Caption inside of tikz node

Post by bidski »

While the posted solution does put the caption inside of a tikz node, doing this will not increment the figure counter correctly and will also do bad things with the list of figures.
Post Reply