tikz 绘图为 xwatermark - 分号问题

tikz 绘图为 xwatermark - 分号问题

我有一个g-brief文档,其中包含一个xwatermark。从以下错误可以看出,它似乎xwatermark不喜欢水印描述中的分号:

TeX 控制台错误 (我似乎无法从 MacTeX 中的控制台复制?!)

相关部分似乎是Enclode your toke ';' in braces:

\newwatermark*[allpages,color=red!50,angle=90,scale=3,xpos=0,ypos=0]{
  \begin{tikzpicture}[opacity=.05]
   % \clip (-2,-5) rectangle (10,5);
    \foreach \x in {0,0.05,...,2}{
      \draw (0,\x) .. controls (4-\x,-4-3*\x) and (11-2*\x,4-3*\x) .. (12,-5+3*\x);
      \draw (0,\x-1) .. controls (4-\x,\x-2) and (11-2*\x,-4-3*\x) .. (12,-3+3*\x);
      \draw (0,\x-3) .. controls (4-\x,\x-2) and (11-4*\x,-1-4*\x) .. (12,-5+3.5*\x);
    }
  \end{tikzpicture}
  }

但是,将分号放在括号中似乎不起作用。有没有什么办法可以安全地将tikz绘图集成到 中xwatermark


编辑 1:正如 Ulrike 所说,这是完全正确的,这里有一个完整的、拥挤的标准 G 型内裤示例,其中包含许多多年来获得的小窍门,我希望其中没有留下任何令人尴尬的东西。

% !TEX encoding = UTF-8 Unicode
\documentclass[11pt]{g-brief}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{enumerate}
\usepackage{eurosym}
\usepackage{todonotes}
\usepackage{nicefrac}
\usepackage{lineno}
\usepackage{blindtext}
\usepackage{lmodern}
\usepackage{paralist}
\usepackage{units}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage[arrow, matrix, curve]{xy}
\usepackage[output-decimal-marker={,},group-separator = {.},group-four-digits]{siunitx}
\usepackage{pgfkeys,pgfcalendar}
\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage{rechnung}
\usepackage{color,calc,ngerman,mathptmx}
\usepackage[printwatermark]{xwatermark}
\usepackage{graphicx,type1cm,eso-pic,color}


\makeatletter
\AddToShipoutPictureBG{
    \setlength{\@tempdimb}{.5\paperwidth}
    \setlength{\@tempdimc}{.5\paperheight}
    \setlength{\unitlength}{1pt}
    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
    \makebox(0,0){\rotatebox{55}{\textcolor[gray]{0.85}
    {\fontsize{4cm}{4cm}\selectfont{  }}}}}
}

\AddToShipoutPicture*{
    \setlength{\@tempdimb}{.2\paperwidth}
    \setlength{\@tempdimc}{.81\paperheight}
    \setlength{\unitlength}{1pt}
    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
    \makebox(0,0){\rotatebox{55}{\textcolor[gray]{0.65}
    {\fontsize{1cm}{1cm}\selectfont{  }}}}}
}

\newcommand\watermark[1]{%
    #1%
    \sbox0{#1}%
    \llap{%
    \makebox[\wd0][c]{%  hor. centering
    \raisebox{.5\ht0}{%  approx. vert. centering
    \csname Gin@isotrue\endcsname% = "keepaspectratio"
    \resizebox*{.8\ht0}{.8\ht0}{% Scale down (the height is also used for the width to avoid the surrounding spaces)
    \parbox{10em}{% Allow line breaks
            \color{black!90}%  
            c me 2018
        }%
    }}}}%
}


\newcount\julianday
\newcount\daycount
\newcount\weekday

\newcommand*{\holiday}[2]{%
  \pgfcalendardatetojulian{#1}{\julianday}%
  \csdef{holiday-\number\julianday}{#2}%
}

\newcommand*{\adddays}[2]{%
  \pgfcalendardatetojulian{#1}{\julianday}%
  \daycount=#2\relax
  \loop
    \advance\julianday by 1\relax
    \pgfcalendarjuliantoweekday{\julianday}{\weekday}%
    \ifnum\weekday<5\relax
      % It's a weekday (Mon-Fri)
      \ifcsdef{holiday-\number\julianday}%
      {% It's a holiday
      }%
      {% Not a holiday
        \advance\daycount by -1\relax
      }%
    \fi
  \ifnum\daycount > 0
  \repeat
  \pgfcalendarjuliantodate{\julianday}{\thisyear}{\thismonth}{\thisday}%
  \thisday.\thismonth.\thisyear
}

\newwatermark*[allpages,color=red!50,angle=90,scale=3,xpos=0,ypos=0]{
  \begin{tikzpicture}[opacity=.1]
   % \clip (-2,-5) rectangle (10,5);
    \foreach \x in {0,0.05,...,2}{
      \draw (0,\x) .. controls (4-\x,-4-3*\x) and (11-2*\x,4-3*\x) .. (12,-5+3*\x);
      \draw (0,\x-1) .. controls (4-\x,\x-2) and (11-2*\x,-4-3*\x) .. (12,-3+3*\x);
      \draw (0,\x-3) .. controls (4-\x,\x-2) and (11-4*\x,-1-4*\x) .. (12,-5+3.5*\x);
    }
  \end{tikzpicture}
  }


\holiday{2015-04-21}{Oster Montag}
\holiday{2015-10-03}{Tag der deutschen Einheit}
\holiday{2015-05-25}{Pfingstmontag}

\renewcommand{\blztext}{\footnotesize BIC}
\renewcommand{\kontotext}{\footnotesize IBAN}
\newcommand{\areaval}[1]{\EUR{#1}\si{\per\Square\meter}}


%\lochermarke
\faltmarken
%\fenstermarken
\trennlinien


\Name                {me}
\Strasse             {here 1}
\Zusatz              {}
\RetourAdresse       {}
\Ort                 {12345 city}
\Land                {}

\Telefon             {5551212}
%\Telefax             {5551313}
%\EMail               {[email protected]}

%\Bank                {Bank}
%\BLZ                 {ABCD}
%\Konto               {DE12 3456 7890}

\Unterschrift        {My T\watermark. name}

\Postvermerk         {persönlich/vertraulich}
\Adresse             {abc\\def\\xxx\\12345 abc}

\Betreff             {abc }

\Datum               {\today}
\IhrZeichen          {} 
\IhrSchreiben        {}
%\MeinZeichen         {}

\Anrede              {Sehr geehrte Damen und Herren,}
\Gruss               {Mit freundlichem Gruss,}{1cm}

%\Anlagen             {\emph{Anlagen:\\ xxx }}

%\Verteiler           {\it Verteiler:\\ xxx}
%\klassisch %-> altes Kopfzeilenformat, Betr.: vor Betreff und Unterschrift kursiv und in Klammern
%\unserzeichen %-> "Unser Zeichen" statt "Mein Zeichen"
\newcommand{\FristinWerktagen}{10}

\begin{document}
\begin{g-brief}
\shorthandoff{"} 
\begin{linenumbers}


\Blindtext[4]
%\blindlistlist{enumerate}[12]
%\blindmathpaper



\end{linenumbers}
\end{g-brief}
\end{document}


\endinput

相关内容