I would like to insert/embed symbols/images behind a heading.
Do you know, if that can be done?
I would like to insert/embed symbols/images behind a heading.
Do you know, if that can be done?
A possible solution using titlesec and tcolorbox (make the adjustments that best suit your needs):
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage[explicit]{titlesec}
\usepackage{lipsum}
\tcbset{
bgtable/.style={
freelance,
frame code={}
center title,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
watermark graphics=bricks.jpeg,
watermark stretch=1.00,
watermark opacity=0.7,
arc=0pt,
outer arc=0pt,
nobeforeafter}
}
\titleformat{\section}
{\normalfont\Large\bfseries}{}{0em}
{%
\setbox0=\hbox{\Large\bfseries\thesection\hspace{1em}}%
\begin{tcolorbox}[bgtable]
\thesection\hspace{1em}\hangindent\wd0\strut#1\strut%
\end{tcolorbox}%
}
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries}{}{0em}
{%
\begin{tcolorbox}[bgtable]
\strut#1\strut
\end{tcolorbox}%
}
\titlespacing*{\section}
{0pt}{4.5ex plus 1ex minus .2ex}{1ex plus .2ex}
\begin{document}
\section{Test numbered section}
\lipsum[4]
\section*{Test unnumbered section}
\lipsum[4]
\section{Test numbered section with a long title; in fact, it spans two lines}
\lipsum[4]
\end{document}

My example only deals with \section and \section*, but the same idea can be easily adapted to other sectional units.
In the comments, it has been required to add an image to the left of the titles; in this case, there's no need for the tcolorbox package and one can use \llap and some boxes:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{graphicx}
\usepackage{lipsum}
\newcommand\SecImage{%
\llap{\makebox[3em][l]{%
\raisebox{-.65\totalheight}[0pt][0pt]{%
\includegraphics[width=2em]{example-grid-100x100pt}%
}%
}%
}%
}
\titleformat{\section}
{\normalfont\Large\bfseries}{}{0em}
{%
\setbox0=\hbox{\Large\bfseries\thesection\hspace{1em}}%
\SecImage\thesection\hspace{1em}\hangindent\wd0\strut#1\strut%
}
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries}{}{0em}
{\SecImage#1}
\begin{document}
\section{Test numbered section}
\lipsum[4]
\section*{Test unnumbered section}
\lipsum[4]
\section{Test numbered section with a long title; in fact, it spans two lines}
\lipsum[4]
\end{document}

bricks.jpeg with one of your own images) Do you get errors? If not, what exactly is the error message you get when incorporating my code into your document?
– Gonzalo Medina
Aug 16 '13 at 16:42
tcolorboxto put a picture behind a tabular environment. I am not sure how you would extrapolate this to section headings (that is get an image behind the heading). http://tex.stackexchange.com/questions/128231/textures-or-pictures-as-background-for-a-table – dustin Aug 15 '13 at 20:36