Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

anyone can help me to do something like this?
for an informative section in my document enter image description here

share|improve this question
2  
A question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Try to make your question clear & simple through a minimal working example (MWE): you'll stand a greater chance of getting help. –  Werner May 21 at 4:23
2  
Dear closing voters: from the three reasons appearing in Werner's comment "off topic", "too broad", or "unclear", could I ask which one are those voting to close choosing? This is neither "off topic", "too broad", nor "unclear", in my opinion. –  Gonzalo Medina May 21 at 4:41

1 Answer 1

up vote 17 down vote accepted

Here's one possibility using the versatile tcolorbox package; adjust the settings according to your needs:

\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}% just to generate text for the example

\definecolor{color1}{RGB}{249,179,72}
\definecolor{color2}{RGB}{0,112,131}

\newtcolorbox{historical}{
sidebyside,
sidebyside align=top,
lefthand width=3cm,
sidebyside gap=14pt,
freelance,
interior code={},
frame code={},
overlay={
  \shade[top color=color2,bottom color=color2!10]
  ([xshift=6pt,yshift=8pt]frame.north west) 
    rectangle
  ([xshift=11pt,yshift=-6pt]frame.south west);
  \draw[color=color2,line width=1.5pt]
  ([yshift=4pt]title.north west) --
  ([yshift=4pt]title.north east);
  \draw[color=color2,line width=1.5pt]
  ([yshift=-2pt]frame.south west) --
  ([yshift=-2pt]frame.south east);
  },
colback=white,  
title=Historical,
center title,
title code={
  \fill[left color=color1,right color=color1!10]
  (title.north west)
    rectangle
  (title.south east);
  },
segmentation code={},
fonttitle=\large\sffamily\bfseries,
coltitle=black,
enlarge left by=-16pt,
enlarge right by=-16pt,
width=\textwidth+32pt,
left=15pt,
right=15pt,
before=\par\bigskip\noindent,  
after=\par\medskip
}

\newcommand\Name[1]{%
  \textcolor{color2}{\sffamily\bfseries #1}%
}
\newcommand\PersonInfo[1]{%
  {\par\smallskip\noindent\footnotesize\raggedright #1\par}%
}

\begin{document}

\lipsum[4]
\begin{historical}
\includegraphics[height=4.5cm,width=3cm]{example-image-a}
\PersonInfo{Some text here describing the source of the image}
\tcblower
\Name{Alessandro Antonio Volta}
\lipsum[4]
\end{historical}
\lipsum[4]

\end{document}

enter image description here

The historical information is simply provided through a historical environment and some auxiliary commands:

\begin{historical}
\includegraphics[height=4.5cm,width=3cm]{example-image-a}
\PersonInfo{Some text here describing the source of the image}
\tcblower
\Name{Alessandro Antonio Volta}
text describing the person.
\end{historical}

And here's another option, using the also versatile mdframed this time:

\documentclass{article}
\usepackage{graphicx}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}% just to generate text for the example
\usetikzlibrary{calc}

\definecolor{color1}{RGB}{249,179,72}
\definecolor{color2}{RGB}{0,112,131}

\newmdenv[
hidealllines=true,
leftmargin=-16pt,
rightmargin=-16pt,
innerleftmargin=16pt,
innerrightmargin=16pt,
skipabove=35pt,
singleextra={
  \fill[overlay,left color=color1,right color=color1!10]
  ([yshift=4pt]O|-P)
    rectangle
  ([yshift=22pt]P);
  \node[overlay,font=\large\bfseries\sffamily] 
    at ([yshift=13pt] $ (O|-P)!0.5!(P) $ )
    {Historical};
  \shade[overlay,top color=color2,bottom color=color2!10]
  ([xshift=6pt,yshift=30pt]O|-P) 
    rectangle
  ([xshift=11pt,yshift=-8pt]O);
  \draw[overlay,color=color2,line width=1.5pt]
  ([yshift=25.5pt]O|-P) --
  ([yshift=25.5pt]P);
  \draw[overlay,color=color2,line width=1.5pt]
  ([yshift=-2pt]O) --
  ([yshift=-2pt]P|-O);
  },
]{historical}

\newcommand\Name[1]{%
  \textcolor{color2}{\sffamily\bfseries #1}%
}
\newcommand\PersonInfo[1]{%
  {\par\smallskip\noindent\footnotesize\raggedright #1\par}%
}

\begin{document}

\lipsum[4]
\begin{historical}
\begin{minipage}[t]{3cm}
\raisebox{-\dimexpr\totalheight-5pt\relax}{\includegraphics[height=4.5cm,width=3cm]{example-image-a}}
\PersonInfo{Some text here describing the source of the image}
\end{minipage}\hspace{15pt}%
\begin{minipage}[t]{\dimexpr\linewidth-3cm-15pt\relax}
\Name{Alessandro Antonio Volta}
\lipsum[4]
\end{minipage}
\end{historical}
\lipsum[4]

\end{document}

enter image description here

share|improve this answer
2  
Now that's how one should be! Never say No!. Good work Gonzalo! :) –  Harish Kumar May 21 at 5:43
1  
thank you very much you helped me a lot Gonzalo –  user51976 May 21 at 7:00
    
@user51976 You're welcome. –  Gonzalo Medina May 21 at 12:45
    
@HarishKumar Thanks! And, yes, never say No :) –  Gonzalo Medina May 21 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.