LaTeX forum ⇒ Generaloverlapping boxes

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

overlapping boxes

Postby tresfresh » Thu Oct 09, 2008 12:34 pm

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 8262
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Oct 09, 2008 3:20 pm

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
Site admin

tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

Postby tresfresh » Thu Oct 09, 2008 3:41 pm

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 6291 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8262
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Oct 09, 2008 10:34 pm

Hi Chris,

try this compilable example:
  1. \documentclass[a4paper,10pt]{book}
  2. \usepackage[absolute]{textpos}
  3. \setlength{\TPHorizModule}{\paperwidth}
  4. \usepackage{color}
  5. \usepackage{courier}
  6. \pagestyle{empty}
  7. \usepackage{tikz}
  8. \begin{document}
  9.  
  10. \begin{textblock}{0.3}(0.45,.9)
  11. \begin{tikzpicture}
  12. \node[rectangle,draw,rounded corners=15pt,fill=black]
  13. {\rule[-5pt]{0pt}{24pt}\color{white}\ttfamily\Huge\bfseries\,TABLE OF CONTENTS\,};
  14. \end{tikzpicture}
  15. \end{textblock}
  16.  
  17. \textblockcolor{gray}
  18. \begin{textblock}{1}(0,0)
  19. \rule{0pt}{2.5cm}
  20. \end{textblock}
  21.  
  22. \end{document}

Stefan
Site admin

tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

Postby tresfresh » Fri Oct 10, 2008 10:23 am

Stefan,
you are just so wonderful!
Stay blessed, Chris

User avatar
Stefan Kottwitz
Site Admin
Posts: 8262
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Oct 12, 2008 3:24 am

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
Site admin

tresfresh
Posts: 11
Joined: Wed Oct 08, 2008 2:37 pm

Postby tresfresh » Mon Oct 13, 2008 10:18 pm

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


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests