3

I would like to do somethink like the following

quotation for hypothesis, this is what I want

I tried diefferent approches with colorbox and parbox, but nothing really works. Especially the padding.

What I have so far is text with qoutation marks and a light gray background. What is missing is the padding. I want the quotation marks insight the lightgray box and also some padding on top and button. Pretty much just like in the picture.

This is what I already achieved:

For the big quotation marks:

\usepackage{microtype}
%\usepackage{newtxtext, newtxmath}
\usepackage{newtxtext}
%%%%*************************************************
\usepackage{tabularx}
\usepackage{epigraph}
\setlength{\epigraphwidth}{0.7\textwidth}
\setlength{\epigraphrule}{0pt}
%%%*********************************************
\newcommand{\hypoopeningquote}{\smash{\raisebox{-0.5\height}{\llap{\scalebox{3}
          {\textcolor{gray}{``}}\,}}}}
\newcommand{\hypoclosingquote}{\raisebox{-0.66\height}{\scalebox{3}{\textcolor{gray}{”}}}}

Version 1:

\noindent\colorbox{lightgray}
{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\vspace{5pt} \hspace{5pt}\hypoopeningquote H1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.  \hypoclosingquote}}

Version 2:

\newcommand{\pb}[1]{\parbox[t][][t]{1.0\textwidth}{#1} \vspace{-5pt} \hspace{-5pt}}


\begin{tabular} {|p{1\textwidth}|}
  \hline

  \hypoopeningquote H1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.  \hypoclosingquote \\
  \hline

\end{tabular}

They both lead to the same example enter image description here

1
  • 1
    Could you provide a minimal working example of what you have been able to do so far? – Ivan Feb 25 at 13:16
3

If I understand well what you're trying to achieve, you can obtain it with a simple shaded* environment, from the framed package:

\documentclass[11pt,a4paper,]{book}
\usepackage[T1]{fontenc}
\usepackage[svgnames]{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{framed}
\colorlet{shadecolor} {WhiteSmoke}
\usepackage{newtxtext}
\newcommand{\hypoopeningquote}{\smash{\raisebox{-0.5\height}{\llap{\scalebox{3}
          {\textcolor{gray}{``}}\,}}}}
\newcommand{\hypoclosingquote}{\raisebox{-0.66\height}[0pt][0pt]{\scalebox{3}{\textcolor{gray}{”}}}}

\begin{document}

\lipsum[11]
\begin{shaded*}
  \hypoopeningquote~\textbf{H1}: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est. ~\hypoclosingquote
\end{shaded*}

\end{document} 

enter image description here

0
0

Thanks this is great!

I don't know why, but if I'm using @Bernard solution the question marks are still outside the box. So I'm using \leftskip=0.5cm and \rightskip=0.5cm and it looks fine. I dont think this is the best solution but it's working for me. But I would still be interested if somone knew how to add some padding to this framed text.

\begin{shaded*}
\leftskip=0.5cm
\rightskip=0.5cm
  \hypoopeningquote~
\textbf{H1}: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est. ~\hypoclosingquote~
\end{shaded*}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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