Graphics, Figures & TablesSection headers - graphic with rounded borders..

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BinaryBen
Posts: 15
Joined: Mon Feb 18, 2013 8:54 pm

Section headers - graphic with rounded borders..

Post by BinaryBen »

Season greetings everyone,
I've been thinking about doing a section header - or even some macro or easy package to create a formatting like the one shown in the figure:
howinlatex.jpg
howinlatex.jpg (106.92 KiB) Viewed 2395 times
Any ideas on how to specify an image then have it formatted this way? Without me having to open up a drawing program and customize it each time?

Many thanx,

Ben

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Section headers - graphic with rounded borders..

Post by Johannes_B »

This looks like a brochure, so i guess you won't need numbering or entries to a table of contents or cross-referencing.
If so, you can define a simple macro that takes two arguments, one for the picture/graphic, one for the text. Have a look at the following (remember, you can click on open in writelatex to test the output):

Code: Select all

\documentclass{article}
\usepackage{xcolor}
\usepackage{mwe}
\newcommand{\goalfont}{\sffamily\large}
\newcommand{\goalcolor}{red}
\newcommand{\goal}[2]{\bigbreak\noindent
	\llap{\raisebox{-.3\baselineskip}{\includegraphics[height=1.2\baselineskip]{#1}}}
	{{\goalfont\color{\goalcolor}#2}}\par\medbreak}
\begin{document}
\goal{example-image-a}{To grow our academic reputation, we will:}
\blindtext
\goal{example-image-b}{To deliver an excellent personalized
student experience, we will:}
\blindtext
\end{document}

Well, this looks ugly, i know, but the basic functionality is there. How to make it more pleasing to the eye? You can use TikZ for it.
Unfortunately, my TikZ foo is too limited to be of any help here. The manual (it is juge, because tikz can do sooo many things) has a nice and easy to understand tutorial. This can be a good starting point for you.

You can find nice examples at TeXample, a partner site of ours.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Section headers - graphic with rounded borders..

Post by Stefan Kottwitz »

Hi Ben,

this is not so difficult to do. I would do it in TikZ, and it would not cost me much time. I just did not read an answer of you to Johannes, so I don't know if you would look again into this topic. If not, it may be wasted time. :-)

Let us know if you still need it, and it would be great if you would add here a small code example with content to start, so we have something where we can insert the new headings. Also, simple graphics for the pictograms would be good as attachments. The can be normal rectangular images, I can use TikZ to make them round like a circle. Otherwise I would take the CTAN lion or a photo of my dog. 8-)

Stefan
LaTeX.org admin
Post Reply