2

How can I reproduce this in Latex?
enter image description here

David Carlisle
  • 757,742
elsa
  • 31
  • 1
  • 10
    Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing what you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – egreg Oct 14 '13 at 21:31
  • 5
    To any close voters: our site is filled with such questions- if you close this, lots of others should also be closed. Also, elsa is new to the site- let's give him/her time to update their question – cmhughes Oct 15 '13 at 03:13
  • Thanks egreg! Can you help with MWE? I want to begin with something simple. Only one such box with shade on white background... but I haven't found anything similar. I found questions about shaded box like

    http://tex.stackexchange.com/questions/38354/make-an-example-and-shaded-box-like-in-the-book

    but it isn't what I need.

    – elsa Oct 15 '13 at 04:04
  • 1
    If you wish to create a poster, perhaps you might have a look to tikzfancyposter – Claudio Fiandrino Oct 15 '13 at 06:55

1 Answers1

4

While this is not a poster, perhaps this can help you get started on something approaching what you want. Not all the details are flushed out here. In fact, there are a few things that aren't as clean as in the image you posted (such as the alignment of color names above their descriptions). Also I'm colorblind; so my choice of color settings is probably quite a bit off.

\documentclass{article}
%% packages used for this MWE
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{shadings}
%%----------------------------------------
\makeatletter
%% four macros to hold content material including the position.
\def\elsa@emo@title{}
\def\elsa@emo@attributes{}
\def\elsa@emo@research{}
\def\elsa@emo@position{(0,0)}
%% setting up keys:
\pgfkeys{/elsa/colorful/presentation/.cd,
  position/.code=\elsa@emo@position@code{#1},
  %%------------------------------
  color for background/.initial=black,
  color for title/.initial=black,
  color for attributes/.initial=black,
  color for research/.initial=black,
  %%------------------------------
  title/.store in=\elsa@emo@title,
  attributes/.store in=\elsa@emo@attributes,
  research/.store in=\elsa@emo@research,
}
%% a macro to access key values
\def\elsa@get#1{%%
  \pgfkeysvalueof{/elsa/colorful/presentation/#1}}

%% a boolean to control alignment of content in boxes
\newif\ifelsa@left@
%% a macro to examine the placement of the "card"
%% and accordingly set the alignment of the text 
%% which is in the "card"                        
\def\emo@extract@coordinates(#1,#2){%%
  \def\emo@x{#1}%%
  \def\emo@y{#2}}
%% determine the alignment of card content and position
%% of the node for the card.                           
\def\elsa@emo@position@code#1{%%
  \emo@extract@coordinates#1%%
  \ifnum\emo@x>0\relax
    \elsa@left@false
  \else
    \elsa@left@true
  \fi
  \def\elsa@emo@position{#1}%%
}

%% various paramenters to control placement
\newlength{\elsa@width}         \setlength{\elsa@width}{7.5cm}  
\newlength{\elsa@height}        \setlength{\elsa@height}{4cm} 
\newlength{\elsa@shadow@leg}    \setlength{\elsa@shadow@leg}{2.5cm}   
\newlength{\elsa@shadow@vertex} \setlength{\elsa@shadow@vertex}{.15cm}
\newlength{\elsa@hoffset}       \setlength{\elsa@hoffset}{2.0em}
\newlength{\elsa@voffset}       \setlength{\elsa@voffset}{1em}  

\def\emo@build@card@content{%%
  \def\emo@content{%%
    \begin{minipage}[t]{\dimexpr\elsa@width-\elsa@hoffset-1em}%%
      \ifelsa@left@
        \flushleft
      \else
        \flushright
      \fi
      \sffamily
      %% title
      \bgroup
        \color{\elsa@get{color for title}}%%
        \bfseries
        \scalebox{3.5}{\expandafter\uppercase\expandafter{\elsa@emo@title}}%%
      \egroup
      \par
      %% short
      \bgroup
        \color{\elsa@get{color for attributes}}%%
        \bfseries
        \expandafter\uppercase\expandafter{\elsa@emo@attributes}%%
      \egroup
      \par
      %% long
      \bgroup
        \color{\elsa@get{color for research}}%%
        \slshape\elsa@emo@research
      \egroup
    \end{minipage}}}

\def\emo@place@card@within@node{%%
  \node[inner sep=0pt,anchor=north west] at \elsa@emo@position {\emo@color@card};}

%%
\def\emo@color@card{%%
  \begin{tikzpicture}[anchor=center]
    \coordinate (lower left)  at (0,0);
    \coordinate (upper right) at (\elsa@width,\elsa@height);
    \useasboundingbox (lower left) rectangle (upper right);

    \coordinate (upper left)  at (lower left|-upper right);
    \coordinate (lower right) at (lower left-|upper right);

    \coordinate (up turned corner) at (\ifelsa@left@  \dimexpr\elsa@width-\elsa@shadow@vertex\relax  \else  \elsa@shadow@vertex  \fi, \elsa@shadow@vertex); 
    \coordinate (content anchor)   at (\ifelsa@left@  \dimexpr\elsa@hoffset\relax                    \else  \dimexpr\elsa@width-\elsa@hoffset\relax  \fi, \dimexpr\elsa@height-\elsa@voffset\relax);

    \coordinate (shadow base a)    at (\ifelsa@left@  \dimexpr\elsa@width-\elsa@shadow@leg\relax \else  \elsa@shadow@leg  \fi, 0);
    \coordinate (shadow base b)    at (\ifelsa@left@  \elsa@width \else 0 \fi, \elsa@shadow@leg);
    \coordinate (shadow vertex)    at (\ifelsa@left@  \dimexpr\elsa@width+\elsa@shadow@vertex\relax \else -\elsa@shadow@vertex\fi, -\elsa@shadow@vertex);
    \shadedraw[line width=-2pt,
               inner sep=0pt,
               outer sep=0pt,
               color=white,
               shading=bilinear interpolation,
               lower left=\ifelsa@left@  gray!90\else gray!05\fi,
               lower right=\ifelsa@left@ gray!05\else gray!90\fi,
               upper left=gray!90,
               upper right=gray!90,
               ] (shadow base a) -- (shadow base b) -- (shadow vertex) -- cycle;
    \fill[fill=\elsa@get{color for background}] (lower left) rectangle (upper right);
    \node[inner sep=0pt,
          anchor=\ifelsa@left@ north west\else north east\fi
         ] at (content anchor) {\emo@content};
  \end{tikzpicture}}

%%--------------------------------------------------------------------------------
%% macros for user interface:                                                     
%%--------------------------------------------------------------------------------
%% macro for placing individual color with attributes and research statement.     
\newcommand\emocard[1]{%%
  \pgfkeys{/elsa/colorful/presentation/.cd,#1}%%
  \emo@build@card@content
  \emo@place@card@within@node}

%% an environment to wrap all content.
\newenvironment{emofield}
  {%%'
    \begin{tikzpicture}[x=\dimexpr\elsa@width+0.5cm\relax,
                        y=\dimexpr\elsa@height+0.5cm\relax]
  }{%%'
    \end{tikzpicture}
  }

\makeatother
\setlength{\parindent}{0pt}
\pagestyle{empty}
\begin{document}

\begin{emofield}

  \emocard{%%
    position={(0,0)},
    color for background=red,
    color for title=red!50!black,
    color for attributes=red!60!black,
    color for research=red!70!black,
    title=red,
    attributes={Exciting, demands attention},
    research={Studies show that this color actually raises heart rate.},
    }

  \emocard{%%
    position={(1,0)},
    color for background=orange!70,
    color for title=orange!80!black,
    color for attributes=orange!60!black,
    color for research=orange!70!black,
    title=orange,
    attributes={Fun, ambition},
    research={Also an attention getter, this color is perfect for calls to action.},
    }

  \emocard{%%
    position={(0,-1)},
    color for background=yellow!60,
    color for title=yellow!90!black,
    color for attributes=yellow!60!black,
    color for research=yellow!70!black,
    title=yellow,
    attributes={happiness, optimism},
    research={Causes the release of serotonin.}
    }

  \emocard{%%
    position={(1,-1)},
    color for background=green,
    color for title=green!80!black,
    color for attributes=green!60!black,
    color for research=green!70!black,
    title=green,
    attributes={growth, nature},
    research={Also associated with money, this color is the easiest for the eye to process.}
    }

\end{emofield}

\end{document}

enter image description here

A.Ellett
  • 50,533