7

I'm having trouble aligning some of the elements.

  1. I would like align Check Box and Cross Box to be same size so that they look nicer below is what i got so far.

  2. Also it would be great if they can change in size with respect to environment with (some ratio 60% of text or so)

  3. Have background so that it would be easer to read.(as shown in the second part of the question)

Thank you for your help in advance!

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2cm,showframe=false]{geometry}
\usepackage{graphicx}
\usepackage{pst-node}
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage{xcolor}
\newsavebox\IBox
\newenvironment{good}[2][1]
{\def\scale{#1}\begin{lrbox}{\IBox}\begin{minipage}{\dimexpr#2\linewidth-2\fboxsep-2\fboxrule\relax}\ignorespaces}
{%
    \end{minipage}\end{lrbox}%              
    \rput( \dimexpr-10\wd\IBox+\fboxsep+\fboxrule\relax,0){%               
  \scalebox{\scale}[1]{   \makebox(0,0){\put(20,0){%
 \resizebox{0.4\textwidth}{!}{\color{green!25}\Checkedbox}}}}%
        }%
    {\usebox\IBox}%
  }  
  \newenvironment{bad}[2][1]
{\def\scale{#1}\begin{lrbox}{\IBox}\begin{minipage}{\dimexpr#2\linewidth-2\fboxsep-2\fboxrule\relax}\ignorespaces}
{%
    \end{minipage}\end{lrbox}%              
    \rput( \dimexpr-10\wd\IBox+\fboxsep+\fboxrule\relax,0){%               
  \scalebox{\scale}[1]{   \makebox(0,0){\put(20,0){%
 \resizebox{0.37\textwidth}{!}{\color{red!25}\Crossedbox}}}}%
        }%
    {\usebox\IBox}%
  }

\usepackage{lipsum}

\begin{document}
\lipsum[1]

\vspace{3mm}

\begin{good}{0.49}
\lipsum[1]
\end{good}\hfill
\begin{bad}{0.49}
\lipsum[1]
\end{bad}

\vspace{3mm}

\lipsum[1]
\end{document}

[UPDATE] This is a more or less second part of the answer

I would be happy if some one can put Checked-box as the background for this one.

And again there is some aligning problems with minipage but i will ignore this one for now.

enter image description here

\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\usepackage[a4paper,margin=2cm,showframe=false]{geometry}
\usepackage{graphicx}
\usepackage{pst-node}
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage{xcolor}

\definecolor{Dkgreen}{RGB}{0,135,0}

\newmdenv[
roundcorner=10pt,
middlelinecolor=red!25,
frametitlerulecolor=red!30,
frametitlerule=true,
frametitle={Example\hfill\resizebox{12pt}{!}{\color{red}\Crossedbox}}, 
frametitlebackgroundcolor=red!25,
backgroundcolor=red!8,]{test}


\newmdenv[
roundcorner=10pt,
middlelinecolor=Dkgreen!25,
frametitlerulecolor=Dkgreen!30,
frametitlerule=true,
frametitle={Example\hfill\resizebox{12pt}{!}{\color{Dkgreen}\Checkedbox}}, 
frametitlebackgroundcolor=Dkgreen!25,
backgroundcolor=Dkgreen!8,]{test2}


\begin{document}
\begin{test}

  \lipsum[1]
\end{test}

\begin{test2}

  \lipsum[1]
\end{test2}



\begin{minipage}{.48\linewidth}
  \begin{test}

  \lipsum[1]
\end{test}
\end{minipage}
\hspace{0.3cm}
\begin{minipage}{.48\linewidth}
\begin{test2}

  \lipsum[1]
\end{test2}
\end{minipage}%



\end{document}
3
  • Do you plan to add/expect floats inside two columns below checkmarks and crossmarks or is it just text ? Commented May 21, 2013 at 7:09
  • well it's just a text and text may be longer or shorter. I was thinking to force minimum size for checkmarks such that even if there is one line of text, it would be forced to create space below.
    – vveliev
    Commented May 21, 2013 at 7:16
  • Inside minipage you can't have any pagebreaks. The background can be achieved by the option singleextra. Commented May 24, 2013 at 10:51

1 Answer 1

2

I guess your are compiling with xelatex or latex->ps->pdf, because you are loading pst-node. If you are using pdflatex there is a strange interaction between pst-node and the option opacity of TikZ.

However you can add material to the background of your environment by the options singleextra.

enter image description here

\documentclass{article}
\pagestyle{empty}
\usepackage{xcolor}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\usepackage[a4paper,margin=2cm,showframe=false]{geometry}
\usepackage{graphicx}
%\usepackage{pst-node}
\usepackage{wasysym}
\usepackage{marvosym}

\usetikzlibrary{calc}

\definecolor{Dkgreen}{RGB}{0,135,0}

\newmdenv[
roundcorner=10pt,
middlelinecolor=red!25,
frametitlerulecolor=red!30,
frametitlerule=true,
frametitle={Example\hfill\resizebox{12pt}{!}{\color{red}\Crossedbox}}, 
frametitlebackgroundcolor=red!25,
backgroundcolor=red!8,
singleextra={%
   \path let \p1=(P) in node[opacity=.2,red,scale=10] at (.5*\x1,.5*\y1) {\Crossedbox};
 },
]{test}




\newmdenv[
roundcorner=10pt,
middlelinecolor=Dkgreen!25,
frametitlerulecolor=Dkgreen!30,
frametitlerule=true,
frametitle={Example\hfill\resizebox{12pt}{!}{\color{Dkgreen}\Checkedbox}}, 
frametitlebackgroundcolor=Dkgreen!25,
backgroundcolor=Dkgreen!8,%
singleextra={%
   \path let \p1=(P) in node[opacity=.2,Dkgreen,scale=10] at (.5*\x1,.5*\y1) {\Checkedbox};
 },
]{test2}



\begin{document}
\begin{test}

  \lipsum[1]
\end{test}

\begin{test2}

  \lipsum[1]
\end{test2}



\noindent\begin{minipage}{.48\linewidth}
  \begin{test}

  \lipsum[1]
\end{test}
\end{minipage}%
\hfill%
\begin{minipage}{.48\linewidth}
\begin{test2}

  \lipsum[1]
\end{test2}
\end{minipage}%



\end{document}
3
  • thanks a lot :)...i'm only exploring potentials of Tex ... you must go over many packages ... *Note i think if you can add blended colours in to the mdframed it would be more powerful:) (I do like minimalism but sometimes slight change in light colours improves the look)
    – vveliev
    Commented May 25, 2013 at 4:32
  • What do you mean with blended colors? Something like in example 7 here: mirrors.ctan.org/macros/latex/contrib/mdframed/… Commented May 25, 2013 at 7:17
  • yes that exactly what i mean :) ...for some reasons ... i just like native commands more ... :)
    – vveliev
    Commented May 25, 2013 at 11:44

You must log in to answer this question.

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