General ⇒ overlapping boxes
overlapping boxes
could someone please tell me how to create 2 overlapping boxes? the second box should cover about 50% of the first box with the rest stretching out.
Thanks, Chris
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
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
overlapping boxes
what kind of boxes do you mean? Framed boxes, colors, just LaTeX/TeX boxes containing text, or what?
For instance you could print a box, use negative space like \hspace{-2cm} and put the next box there. Or use the textpos package to place boxes at arbitrary positions.
Stefan
overlapping boxes
Hi Stefan,Stefan_K wrote:Hi Chris,
what kind of boxes do you mean? Framed boxes, colors, just LaTeX/TeX boxes containing text, or what?
For instance you could print a box, use negative space like \hspace{-2cm} and put the next box there. Or use the textpos package to place boxes at arbitrary positions.
Stefan
basically, am trying to realize the gray box at the top with and oval box partly overlapping it with some text ("Contents" )like in the included file.
Thanks , Chris
- Attachments
-
- sample.JPG (81.12 KiB) Viewed 13008 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
overlapping boxes
try this compilable example:
Code: Select all
\documentclass[a4paper,10pt]{book}
\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{\paperwidth}
\usepackage{color}
\usepackage{courier}
\pagestyle{empty}
\usepackage{tikz}
\begin{document}
\begin{textblock}{0.3}(0.45,.9)
\begin{tikzpicture}
\node[rectangle,draw,rounded corners=15pt,fill=black]
{\rule[-5pt]{0pt}{24pt}\color{white}\ttfamily\Huge\bfseries\,TABLE OF CONTENTS\,};
\end{tikzpicture}
\end{textblock}
\textblockcolor{gray}
\begin{textblock}{1}(0,0)
\rule{0pt}{2.5cm}
\end{textblock}
\end{document}
Re: overlapping boxes
you are just so wonderful!
Stay blessed, Chris
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
overlapping boxes
I've just made a test using TikZ and titlesec together to produce chapter headings like the one above, see: Fancy chapter headings with TikZ. I've used kpfonts instead of courier/monospaced, but that's not important.
Stefan
Re: overlapping boxes
the example is perfect! just tried it. Thanks!
Regards, Chris