5

Finally, I managed to create a own quote style with that:

\usepackage[most]{tcolorbox} 
\definecolor{block-gray}{gray}{0.95}

\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
  \hbox{}\nobreak\hfil(#1)%
  \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}

\newtcolorbox{zitat}{
    colback=block-gray,
    grow to right by=-10mm,
    grow to left by=-10mm, 
    boxrule=0pt,
    boxsep=0pt,
    breakable
}

\newsavebox\mybox
\newenvironment{aquote}[1]
  {\savebox\mybox{#1}\begin{zitat}}
  {\signed{\usebox\mybox}\end{zitat}}

enter image description here

But i looking forward using a new style. I like to have a quote style that has a gray bar on th left site and the quote area should be angular shaped. The area should include he source like in my approach above as well. enter image description here

Does anyone of you have an approach? Thank you for your help.

1
  • 1
    Why is this tagged as examples? It's clearly a tcolorbox - related question. And please add the working document, not just fragments
    – user31729
    Mar 25, 2016 at 15:54

2 Answers 2

6

I've used the original zitat tcolorbox environment and extended it a little bit, detaching a title to the upper box, with bold font, and \large as fontsize declaration.

The vertical line can be generated with the borderline west=... option, the box is breakable,as is shown in the screenshot.

\documentclass{article}



\usepackage{blindtext}
\usepackage[most]{tcolorbox} 
\definecolor{block-gray}{gray}{0.95}


\newtcolorbox{zitat}[2][]{%
    colback=block-gray,
    grow to right by=-10mm,
    grow to left by=-10mm, 
    boxrule=0pt,
    boxsep=0pt,
    breakable,
    enhanced jigsaw,
    borderline west={4pt}{0pt}{gray},
    title={#2\par},
    colbacktitle={block-gray},
    coltitle={black},
    fonttitle={\large\bfseries},
    attach title to upper={},
    #1,
}



\begin{document}
\begin{zitat}{Minimal working document}
A document that contains the relevant documentclass, the packages, a document-environment and the code that produces the issue.

\blindtext[5] 
\end{zitat}
\end{document}

enter image description here

3

I realized such a box a few times ago with TikZ, and here was the (not really well designed) code used.

\documentclass[a4paper, 11pt]{article}

%% Global libraries
\usepackage[textwidth=18cm,bottom=2cm,top=2cm]{geometry}

%% Libraries for graphics and colours
\usepackage{xcolor}
\usepackage{tikz}
\usepackage[skins]{tcolorbox} 

\definecolor{mygray}{RGB}{195,195,195}

\newcommand\todoFrame[2]{\vspace{.3cm}\noindent\tikz{
\node (contentnode) [draw, color = #1!25, fill=#1!15, text=black, rectangle, outer sep = 0, rounded corners = 1mm, minimum width=\linewidth-1, text width=\linewidth, align=justify, below right] at (0,0) {\noindent #2};
\draw[fill opacity = 1, color=#1, fill=#1] (0,0) rectangle ([xshift=5]contentnode.south west);}
\par}

\newcommand\todoEnv[3]{\par\todoFrame{#1}{\noindent\hspace*{.3cm}\textbf{\textcolor{#1}{\Large{#2}}}\vspace*{.2cm}\newline\noindent\hspace*{.3cm}\begin{minipage}{\dimexpr\linewidth-.3cm\relax}#3\end{minipage}}\ignorespaces}

\begin{document}
\todoEnv{mygray}{Fragment}{A \textbf{fragment} is a piece of an activity whice enable more modular activity design. It will not be wrong if we say, a fragment is a kind of \textbf{sub-activity}.}

\end{document} 

Please note that this solution will not break at page break...

enter image description here

Although, as suggested in the comments, tcolorbox seems more appropriate here (if anyone want to submit a response with it, feel free to do so!).

In any case, I hope it may help you.

1
  • It could be possible with borderline settings, as far as I know, that would be breakable!
    – user31729
    Mar 25, 2016 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .