I am making a template and trying to customize several things in it, and one of them is the section style. I created a command that makes a hexagon on the left side of the screen, as shown in the image below along with the code:
I am using more packages than this, but I think the essential ones for this problem are these.
\RequirePackage[%
top = 2.5cm,
bottom = 3.8cm,
left = 2cm,
right = 2cm,
]{geometry}
\RequirePackage[most]{tcolorbox}
\RequirePackage{pgfplots}
\RequirePackage{graphicx}
\RequirePackage{xcolor}
\RequirePackage{tikz}
\RequirePackage{titletoc}
\RequirePackage{lmodern}
\usetikzlibrary{
decorations.pathreplacing,
decorations.pathmorphing,
decorations.markings,
shapes.multipart,
shapes.geometric,
arrows.meta,
fadings,
arrows,
angles,
quotes,
calc,
3d,
}
\pgfplotsset{compat=1.18}
\definecolor{ChapterBackground}{HTML}{101010} % PERSONAL BLACK
\definecolor{ChapterForeground}{HTML}{e93820} % PERSONAL ORANGE I
\newcommand{\polygonSection}{%
\begin{tikzpicture}[remember picture, overlay]
\foreach \i in {0.5,...,5}{%
\node[%
ChapterBackground,
regular polygon sides = 6,
regular polygon,
rounded corners,
minimum size = \i cm,
ultra thick,
draw,
] at ($(current page.north west |- current page text area.west)+(0,0)$) {};
}
\node[%
regular polygon sides = 6,
rounded corners,
regular polygon,
minimum size = 1.58 cm,
ultra thick,
inner sep = 0,
fill = ChapterForeground!85,
text = ChapterForeground!5,
] at ($(current page.north west |- current page text area.west)+(0,0)$) {};
\end{tikzpicture}}
Well, with this command I tried to use \titleformat{} from the titlesec package to style my section as follows:
\titleformat{\section}[display]
{\normalfont\bfseries\color{ChapterBackground}}{}{1em}
{\llap{
\polygonSection\hspace{-6pt}}\huge\textsc}[]
However, I would like to align the title with the hexagon and add a small space between the two, but I have not found any way to do this, and I am getting the following error message:
Package pgf Error: No shape named `current page text area' is known.
However, if I take this part out of the code, it doesn't look the way I want. Also, using the tikzpagenodes package, the polygons are no longer separated by sections, but by pages, which is not what I want.
That's it, if anyone can help me, that would be great.
geometry
?