Skip to content

Instantly share code, notes, and snippets.

@jnothman
Last active November 17, 2021 05:08
Show Gist options
  • Select an option

  • Save jnothman/0729018fc39b2c30f082 to your computer and use it in GitHub Desktop.

Select an option

Save jnothman/0729018fc39b2c30f082 to your computer and use it in GitHub Desktop.
"Fork me on GitHub" ribbon in LaTeX/TikZ vector graphic
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\node[rotate=45, shift={(0, -12em)}] at (current page.north west) {
\begin{tikzpicture}[remember picture, overlay]
\node[draw, fill=red!60, text centered, minimum width=50em, minimum height=3.0em, blur shadow, shadow yshift=0pt, shadow xshift=0pt, shadow blur radius=.4em, shadow opacity=50](fmogh) at (0pt, 0pt) { \fontfamily{phv}\selectfont\bfseries Fork me on GitHub};
\draw[gray, dashed, line width=.08em, dash pattern=on .5em off 1.5\pgflinewidth] (-25em,1.2em) rectangle (25em,-1.2em);
\end{tikzpicture}
};
\end{tikzpicture}
Variables include:
\begin{itemize}
\item \texttt{west} and \texttt{rotate=45} or \texttt{east} and \texttt{rotate=-45}
\item shift offset
\item node fill color
\item line color
\end{itemize}
\end{document}
@faustomilletari
Copy link

It is possible to add the link changing
\node[fill=forkmebg, text centered, minimum width=50em, minimum height=3.0em, blur shadow, shadow yshift=0pt, shadow xshift=0pt, shadow blur radius=.4em, shadow opacity=50, text=forkmefg](fmogh) at (0pt, 0pt) { \fontfamily{phv}\selectfont\bfseries Fork me on GitHub};

to

\node[fill=forkmebg, text centered, minimum width=50em, minimum height=3.0em, blur shadow, shadow yshift=0pt, shadow xshift=0pt, shadow blur radius=.4em, shadow opacity=50, text=forkmefg](fmogh) at (0pt, 0pt) { \fontfamily{phv}\selectfont\bfseries \href{https://url.com}{Fork me on GitHub} };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment