I'm new to tikz
and I guess this is a very easy problem. Still I couldn't find the solution.
I want to use tikz
to draw a background for my headlines. Therefore I created the following command:
\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}
\usetikzlibrary{calc}
\newcommand{\headline}[1]{%
\begin{tikzpicture}
\fill[gray] (0,2mm) -- (5mm-2mm,2mm) -- (5mm,0) -- (2mm,0) -- (0,2mm);
\node (A) at (12mm,1mm) {\Large\textsc{#1}};
\fill[gray] (A.east|-0,2mm) -- (\textwidth-2mm,2mm) -- (\textwidth,0) -- (A.east|-0,0) -- (A.east|-0,0);
\end{tikzpicture}%
}
\begin{document}
\headline{test}
\end{document}
But I want the left bottom corner of the second line behind the text also to be cut off. Like in this image:
I tried to somehow add the missing 2mm but I didn't find a solution. I tried ([xshift=2mm]A.east|-0,2mm)
, (A.east|-0+2mm,2mm)
, \fill[gray] let \p{A}=(A) in (A.east|-0,2mm) -- (\textwidth-2mm,2mm) -- (\textwidth,0) -- (\x{A}+2mm,0) -- (A.east|-0,0);
and many other things I came across when searching. But I didn't get it to work.
How do I add the missing 2mm relative to the end of the node?