28

I've tried looking in the site for this but I couldn't find anything (rather surprising).

I want a package (or even a TikZ drawing) to accomplish a note on a sticky note. I just need one note, so I don't mind a complex solution or a very specific solution to this problem.

Here are 2 possible examples of what I want: enter image description here

Here is something better, but I don't own those images so I'll just put a link.

I have no MWE since I want to know if there is a package. If there's not, I'll try with TikZ, though I'm not very good at it.

2
  • Where do you want to place these sticky notes? In the margin, or on the page? Does it need to overlap the text? You should creae a MWE showing the usage. Just define \newcommand{\StickyNote}[1]{}. Feb 10, 2014 at 18:59
  • @PeterGrill It will be on a beamer slide. I don't mind making a pdf with standalone and then insert the pdf as an image.
    – Nico
    Feb 10, 2014 at 19:01

1 Answer 1

34

One basic possibility using TikZ (process using xelatex):

\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}
\setmainfont{Humor Sans}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usepackage{lipsum}

\definecolor{myyellow}{RGB}{242,226,149}

\NewDocumentCommand\StickyNote{O{6cm}mO{6cm}}{%
\begin{tikzpicture}
\node[
drop shadow={
  shadow xshift=2pt,
  shadow yshift=-4pt
},
inner xsep=7pt,
fill=myyellow,
xslant=-0.1,
yslant=0.1,
inner ysep=10pt
] {\parbox[t][#1][c]{#3}{#2}};
\end{tikzpicture}%
}

\begin{document}

\StickyNote{some text here\hfill\\\vfill And some more text \\\vfill And a third line}

\StickyNote[2.5cm]{\LARGE As \underline{who}, I want\\[4ex]\underline{what} so that \underline{why}}[6.5cm]

\end{document}

enter image description here

The basic command has the following syntax:

\MyStickyNote[<height>]{<text>}[<width>]

The font is Humor-Sans, which can be obtained in https://github.com/shreyankg/xkcd-desktop/blob/master/Humor-Sans.ttf.

Some other options using the fancypar package:

\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}
\setmainfont{Humor Sans}
\usepackage{fancypar}
\usetikzlibrary{calc,shadows}
\usepackage{lipsum}

\definecolor{myyellow}{RGB}{242,226,149}

\NewDocumentCommand\StickyNoteP{O{6cm}mO{6cm}}{%
\begin{tikzpicture}
\node[
drop shadow={
  shadow xshift=3pt,
},
inner xsep=0pt,
xslant=-0.1,
yslant=0.1,
inner ysep=0pt,
text depth=\the\dimexpr#1+2.5ex\relax
] {\parbox[t][#1][c]{#3}{#2}};
\end{tikzpicture}%
}

\NewDocumentCommand\StickyNotePi{O{6cm}mO{6cm}}{%
\begin{tikzpicture}
\node[
draw,
fill=myyellow,
inner xsep=10pt,
xslant=-0.1,
yslant=0.1,
inner ysep=0pt,
text depth=\the\dimexpr#1+2.5ex\relax
] {\parbox[t][#1][c]{#3}{#2}};
\end{tikzpicture}%
}

\begin{document}

\StickyNoteP[2.5cm]{%
\NotebookPar[spiral=false]{
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\StickyNoteP[2.5cm]{%
\NotebookPar[spiral=false,intercolor=black,linecolor=white]{
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\StickyNotePi[2.5cm]{%
\UnderlinedPar[rulecolor=green]{%
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\StickyNotePi[2.5cm]{%
\MarkedPar{%
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\StickyNotePi[2.5cm]{%
\DashedPar{%
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\end{document}

enter image description here

And with a bent corner:

\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}
\setmainfont{Humor Sans}
\usepackage{fancypar}
\usetikzlibrary{shadows}
\usepackage{lipsum}

\definecolor{myyellow}{RGB}{242,226,149}

\makeatletter
\pgfdeclareshape{document}{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
% ... and possibly more
\backgroundpath{% this is new
% store lower right in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% compute corner of ‘‘flipped page’’
\pgf@xc=\pgf@xb \advance\pgf@xc by-10pt % this should be a parameter
\pgf@yc=\pgf@yb \advance\pgf@yc by-10pt
% construct main path
\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
% add little corner
\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
}
}
\makeatother

\NewDocumentCommand\StickyNote{O{6cm}mO{6cm}}{%
\begin{tikzpicture}
\node[
document,
draw,
drop shadow={
  shadow xshift=2pt,
  shadow yshift=-4pt
},
inner xsep=7pt,
fill=myyellow,
xslant=-0.1,
yslant=0.1,
inner ysep=10pt
] {\parbox[t][#1][c]{#3}{#2}};
\end{tikzpicture}%
}

\NewDocumentCommand\StickyNotePi{O{6cm}mO{6cm}}{%
\begin{tikzpicture}
\node[
document,
draw,
fill=myyellow,
inner xsep=10pt,
xslant=-0.1,
yslant=0.1,
inner ysep=0pt,
text depth=\the\dimexpr#1+2.5ex\relax
] {\parbox[t][#1][c]{#3}{#2}};
\end{tikzpicture}%
}


\begin{document}

\StickyNote{some text here\hfill\\\vfill And some more text \\\vfill And a third line}

\StickyNote[2.5cm]{\LARGE As \underline{who}, I want\\[4ex]\underline{what} so that \underline{why}}[6.5cm]

\StickyNotePi[2.5cm]{%
\UnderlinedPar[rulecolor=black]{%
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]

\StickyNotePi[2.5cm]{%
\DashedPar{%
\LARGE As \underline{who}, I want\\ \underline{what} so that \underline{why}}}[6.5cm]


\end{document}

enter image description here

13
  • Interesting. I'll try adding some lines like the second link.
    – Nico
    Feb 10, 2014 at 19:04
  • 1
    @azetina the corners have been bent! :-) Feb 10, 2014 at 20:37
  • 2
    @GonzaloMedina You are really good at this. I always inspired by you and egreg just to mention a few.
    – azetina
    Feb 10, 2014 at 20:46
  • 2
    +1 for not using the font which you surely know I'm referring to.
    – egreg
    Feb 10, 2014 at 21:13
  • 2
    @GonzaloMedina now you are ready to make it a package. \usepackage{StickyNotes} =)
    – Nico
    Feb 11, 2014 at 13:54

You must log in to answer this question.

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