Generaloverlapping boxes

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

overlapping boxes

Post by tresfresh »

Hi all,
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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Stefan Kottwitz
Site Admin
Posts: 10283
Joined: Mon Mar 10, 2008 9:44 pm

overlapping boxes

Post by Stefan Kottwitz »

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
LaTeX.org admin
tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

overlapping boxes

Post by tresfresh »

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
Hi 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
sample.JPG (81.12 KiB) Viewed 12314 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10283
Joined: Mon Mar 10, 2008 9:44 pm

overlapping boxes

Post by Stefan Kottwitz »

Hi Chris,

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}
Stefan
LaTeX.org admin
tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

Re: overlapping boxes

Post by tresfresh »

Stefan,
you are just so wonderful!
Stay blessed, Chris
User avatar
Stefan Kottwitz
Site Admin
Posts: 10283
Joined: Mon Mar 10, 2008 9:44 pm

overlapping boxes

Post by Stefan Kottwitz »

Hi Chris,

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
LaTeX.org admin
tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

Re: overlapping boxes

Post by tresfresh »

Hi Stefan,
the example is perfect! just tried it. Thanks!
Regards, Chris
Post Reply