von vinc14 » Di 8. Jul 2025, 19:00
Hallo
mit diesem Code den ich gefunden habe bekomme ich eine Fehlermeldung.
! Illegal unit of measure (pt inserted).
hier im Beispiel aber geht es ohne Fehler.
\documentclass[10pt]{scrbook}
\usepackage{titlesec}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{textpos}
\usepackage{calc}
\DeclareFixedFont{\chapternumberfont}{T1}{ppl}{}{}{1.5in}
\titleformat{\chapter}[display]{\Huge\bfseries\sffamily\color{white}}{
\thispagestyle{empty}
\begin{tikzpicture}[overlay, remember picture]
\path let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=5cm, rectangle, fill=cyan, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {
\begin{textblock*}{5in}(\dimexpr\x2-4.5in,\dimexpr0.25\headheight-1in)
\tikz \node [white,text width=2in, align=right, font=\sffamily] {{\normalsize DIGITAL MEDIA PRIMER}\\[12pt] \raisebox{50pt}{{\large \chaptertitlename}} \raisebox{-12pt}{\chapternumberfont \thechapter}};
\end{textblock*}
};
\path let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=0.8in, rectangle, fill=cyan!50, anchor=south west, align=left, text width=\x2-\x1] at ($(current page.south west)$) {};
\end{tikzpicture}
}{-1.75in}{}[\vspace*{1in}]
\begin{document}
\chapter{Background}
\end{document}
Hallo
mit diesem Code den ich gefunden habe bekomme ich eine Fehlermeldung.
! Illegal unit of measure (pt inserted).
hier im Beispiel aber geht es ohne Fehler.
[code]
\documentclass[10pt]{scrbook}
\usepackage{titlesec}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{textpos}
\usepackage{calc}
\DeclareFixedFont{\chapternumberfont}{T1}{ppl}{}{}{1.5in}
\titleformat{\chapter}[display]{\Huge\bfseries\sffamily\color{white}}{
\thispagestyle{empty}
\begin{tikzpicture}[overlay, remember picture]
\path let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=5cm, rectangle, fill=cyan, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {
\begin{textblock*}{5in}(\dimexpr\x2-4.5in,\dimexpr0.25\headheight-1in)
\tikz \node [white,text width=2in, align=right, font=\sffamily] {{\normalsize DIGITAL MEDIA PRIMER}\\[12pt] \raisebox{50pt}{{\large \chaptertitlename}} \raisebox{-12pt}{\chapternumberfont \thechapter}};
\end{textblock*}
};
\path let \p1 = (current page.west), \p2 = (current page.east) in
node[minimum width=\x2-\x1, minimum height=0.8in, rectangle, fill=cyan!50, anchor=south west, align=left, text width=\x2-\x1] at ($(current page.south west)$) {};
\end{tikzpicture}
}{-1.75in}{}[\vspace*{1in}]
\begin{document}
\chapter{Background}
\end{document}
[/code]