便签图像

便签图像

我尝试在网站上寻找这个,但没有找到任何东西(相当令人惊讶)。

我想要一个包(甚至是 TikZ 绘图)来完成便签上的注释。我只需要一个注释,所以我不介意对这个问题有一个复杂的解决方案或非常具体的解决方案。

以下是我想要的两个可能的例子: 在此处输入图片描述

这里有一些更好的东西,但我并不拥有这些图像,所以我只放一个链接。

我没有 MWE,因为我想知道是否有包。如果没有,我会尝试使用 TikZ,尽管我不太擅长。

答案1

一种基本的可能性是使用TikZ(使用过程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}

在此处输入图片描述

基本命令的语法如下:

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

字体是 Humor-Sans,可以在https://github.com/shreyankg/xkcd-desktop/blob/master/Humor-Sans.ttf

使用一些其他选项fancypar包裹:

\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}

在此处输入图片描述

并且有一个弯曲的角:

\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}

在此处输入图片描述

相关内容