左バーを含む引用エリア

左バーを含む引用エリア

最終的に、私はそれを使って独自の引用スタイルを作成することができました。

\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}}

ここに画像の説明を入力してください

しかし、私は新しいスタイルの使用を楽しみにしています。私は、左側に灰色のバーがあり、引用領域が角張った形状である引用スタイルを好みます。領域には、上記の私のアプローチのように、ソースも含める必要があります。 ここに画像の説明を入力してください

どなたかアプローチ方法をお持ちの方はいらっしゃいますか?ご協力ありがとうございます。

答え1

私は元のzitat tcolorbox環境を使用し、それを少し拡張して、タイトルを上のボックスから切り離し、太字フォントを使用し、\largeフォント サイズ宣言として使用しました。

オプションを使用して垂直線を生成することができborderline west=...、スクリーンショットに示すように、ボックスは破壊可能です。

\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}

ここに画像の説明を入力してください

答え2

以前、TikZ でこのようなボックスを実現しましたが、ここで使用したコード (あまりよく設計されていません) は次のとおりです。

\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} 

このソリューションはページ区切りで中断されないことに注意してください...

ここに画像の説明を入力してください

ただし、コメントで示唆されているように、tcolorboxここでの方が適切と思われます (誰かがこれに返信を送信したい場合は、遠慮なく送信してください)。

いずれにせよ、それがお役に立てれば幸いです。

関連情報