Text Formatting ⇒ Floating text in a book
Floating text in a book
I am working on a book using \documentclass[a4paper,12pt]{book}. I'd like to create some informational text boxes and 'float' them on the outside side of the page similar to an \includegraphics{} or an alertbox. These would be used at least once in each chapter to include important fyi type information that would complement the text. Any ideas on the best way to do this?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Floating text in a book
Hi and welcome,
you can use package tocbasic to define a new float-environment. Package tcolorbox may come in handy to draw a nice box.
you can use package tocbasic to define a new float-environment. Package tcolorbox may come in handy to draw a nice box.
Code: Select all
\documentclass{book}
\usepackage{blindtext}
\usepackage{tcolorbox}
\usepackage{tocbasic}
\DeclareNewTOC[
float,
type=FYI
]{fyi}
\begin{document}
\chapter{lambada leguan}
\blindtext[12][10]
\begin{FYI}\begin{tcolorbox}[title=For Your
Information,colframe=red!50]
\blindtext\end{tcolorbox}
\end{FYI}
\blindtext[12][10]
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.