Graphics, Figures & TablesColored oval Box with Text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Sylvie_H
Posts: 3
Joined: Tue Apr 09, 2013 6:01 pm

Colored oval Box with Text

Post by Sylvie_H »

Hello,

I would like to create an oval color box with text in it. I have found the bclogo package but I can't set the width or the length of the box (I want to create a box with {minipage} environments in it, and besides I don't need a logo).

Thanks for your help !

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Colored oval Box with Text

Post by cgnieder »

Hi Sylvie,

Welcome to the LaTeX community!

If I understand correctly what you want should be easily doable with TikZ/pgf (pgfmanual).

Regards
site moderator & package author
Sylvie_H
Posts: 3
Joined: Tue Apr 09, 2013 6:01 pm

Re: Colored oval Box with Text

Post by Sylvie_H »

Thanks - I'm not a very talented LaTeX user but I'll try to find my answer in there...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Colored oval Box with Text

Post by Stefan Kottwitz »

Hi Sylvie,

welcome to the forum!

For inspiration, perhaps have a look at the TikZ example gallery. If you have further questions, let us know.

Stefan
LaTeX.org admin
Sylvie_H
Posts: 3
Joined: Tue Apr 09, 2013 6:01 pm

Colored oval Box with Text

Post by Sylvie_H »

Hello again - my problem is that I would like to put a whole text page in my oval box, not just one or two words...

I have a picture background and on that, I would like to put a white oval box with text in it.

Here is my code : I would like to replace \fcolorbox{black}{white}{...} by something doing the same job but with round corners...

Code: Select all

\AddToShipoutPicture{\BackgroundPict}
\setlength{\fboxsep}{10pt}
\fcolorbox{black}{white}{
\begin{minipage}[t]{12cm}
\hskip 2cm\noindent
\includegraphics[scale=0.7 ]{Logo}
\begin{center}
{\bf (a few lines of text)
 \end{center}
\vskip 0.8cm
\framebox[12cm]{
\begin{minipage}[t]{11cm}\color[rgb]{.2,.4,.5}{\begin{center}\Large
 (a few lines of text)
\end{minipage}}
\vskip 0.8cm
\begin{center}
{\bf \Large  Some more text}
 \end{center}
\end{minipage}
}
Last edited by cgnieder on Tue Apr 09, 2013 11:55 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Colored oval Box with Text

Post by cgnieder »

Can you please extend your code into a Infominimal working example (MWE)? (If you're uncertain what that is just follow the link.)

By the way: \bf (and also \it and \sc) are obsolete in LaTeX2e (which is what we're all using and has been released in 1992). The correct font switches are \bfseries, \itshape and \scshape. As to why they are obsolete let's quote l2tabu:
Obsolete commands do not support LaTeX2e's new font selection scheme, or NFSS. {\bf foo}, for example, resets all font attributes which had been set earlier before it prints foo in bold face. This is why you cannot simply define a bold-italics style by {\it \bf Test} only. (This definition will produce: Test.) On the other hand, the new commands \textbf{\textit{Test}} will behave as expected producing: Test.

Apart from that, with the former commands there is no ‘italic correction’, cf. for instance halfhearted ({\it half}hearted) to halfhearted (\textit{half}hearted).
Regards
site moderator & package author
Post Reply