0
\documentclass{article}
\usepackage{xcolor} 
\definecolor{darkgrey}{HTML}{333333}
\usepackage{xcoffins}

\begin{document}

\SetHorizontalCoffin\OutputCoffin{}
\SetHorizontalCoffin\RedCoffin
            {\color{red!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[vc,hc]\RedCoffin[vc,hc]
\SetHorizontalCoffin\BlueCoffin
            {\color{blue!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\RedCoffin-vc,\RedCoffin-hc]
            \BlueCoffin[b,l]
\SetHorizontalCoffin\GreenCoffin
            {\color{green!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\BlueCoffin-vc,\BlueCoffin-hc]
            \GreenCoffin[b,l]
\SetHorizontalCoffin\YellowCoffin
            {\color{yellow!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\GreenCoffin-vc,\GreenCoffin-hc]
            \YellowCoffin[b,l]
\SetHorizontalCoffin \OrangeCoffin
            {\color{orange!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\BlueCoffin-t,\BlueCoffin-l]
            \OrangeCoffin[b,r]
\TypesetCoffin\OutputCoffin
\end{document}

Based on the documentation of coffins I was trying to compile the above code--how do i complete it??

output is as under enter image description here

courtesy @FrankMittelbach for his answer @https://tex.stackexchange.com/a/44159/197451

1
\documentclass{article}
\usepackage{xcolor} 
\definecolor{darkgrey}{HTML}{333333}
\usepackage{xcoffins}

\NewCoffin \RedCoffin
\NewCoffin \BlueCoffin
\NewCoffin \GreenCoffin
\NewCoffin \YellowCoffin
\NewCoffin \OrangeCoffin
\NewCoffin \OutputCoffin

\begin{document}

\SetHorizontalCoffin\OutputCoffin{}
\SetHorizontalCoffin\RedCoffin
            {\color{red!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[vc,hc]\RedCoffin[vc,hc]
\SetHorizontalCoffin\BlueCoffin
            {\color{blue!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\RedCoffin-vc,\RedCoffin-hc]
            \BlueCoffin[b,l]
\SetHorizontalCoffin\GreenCoffin
            {\color{green!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\BlueCoffin-vc,\BlueCoffin-hc]
            \GreenCoffin[b,l]
\SetHorizontalCoffin\YellowCoffin
            {\color{yellow!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\GreenCoffin-vc,\GreenCoffin-hc]
            \YellowCoffin[b,l]
\SetHorizontalCoffin \OrangeCoffin
            {\color{orange!20!white}\rule{0.2 in}{0.2 in}}
                \JoinCoffins\OutputCoffin[\BlueCoffin-t,\BlueCoffin-l]
            \OrangeCoffin[b,r]
\TypesetCoffin\OutputCoffin
\end{document}

got it !!!

also deleted the white color to get deeper colored squares 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.