1

I am working with this template over here. Here is the code of it:

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage[margin=0.5cm,bottom=2cm]{geometry}
\usepackage{kpfonts}
\usepackage{eso-pic}                
\usepackage{tcolorbox}

\tcbuselibrary{skins}

\tcbset{
    pccstyle/.style={
        enhanced,flushright upper,
        boxrule=1.4pt,
        colback=white,colframe=black!50!yellow,
        drop fuzzy midday shadow=black!50!yellow
    }
}

\AddToShipoutPicture{% from package eso-pic: put something to the background
    \AtPageCenter{% start the bar at the bottom right of the page
        \put(-\LenToUnit{.465\paperwidth},-\LenToUnit{.4\paperheight}){% move it to the middle
            %{\transparent{.5}{\includegraphics[width=20cm]{50th_mathematicsproof}}}
            \begin{tcolorbox}[pccstyle,left=0mm,top=0mm,bottom=0mm]
                \includegraphics[width=20cm]{50th_mathematicsproof}
            \end{tcolorbox}
        }%
    }%
    \AtPageLowerLeft{% start the bar at the bottom right of the page
        \put(\LenToUnit{\dimexpr\paperwidth-3cm},0){% move it to the top right
            \color{blue}\rule{3cm}{\LenToUnit\paperheight}%
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{17cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\sum$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.5cm},\LenToUnit{12.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\int$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.3cm},\LenToUnit{8.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$e$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{5.0cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\pi$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.2cm},\LenToUnit{1.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$i$}
        }%
    }%
}

\pagestyle{empty}
\begin{document}

\vspace*{1cm}
\mbox{}\hfill\scalebox{2}{
    \begin{tcolorbox}[pccstyle,width=6.8cm]
        {\bfseries\LARGE {Program Review} \par}
        {\large \itshape Mathematics \par}
        {\large Portland Community College }
    \end{tcolorbox}
}

\vfill
\centering

\scalebox{2}{%
    \begin{tcolorbox}[pccstyle,width=4.8cm]
        {\scshape Fall 2008--Spring 2013}
    \end{tcolorbox}
}
\end{document}

and while compiling I get the following error

Illegal unit of measure (pt inserted). \end{document} on line 72

I don't understand why this is happening. It's supposed to work. The PDF is generated and it looks like its expected. Any clues?

Tolaso
  • 1,555

1 Answers1

2

The error is

    \put(\LenToUnit{\dimexpr\paperwidth-3cm},0){% move it to the top right
        \color{blue}\rule{3cm}{\LenToUnit\paperheight}%
    }%

precisely \LenToUnit within \rule{3cm} -- \LenToUnit is not meant for anything other than the \put macro. For regular macros that expect length values just use the length macro, i.e. \rule{3cm}{\paperheight}.

\documentclass[demo]{article}

\usepackage[margin=0.5cm,bottom=2cm]{geometry}
\usepackage{kpfonts}
\usepackage{eso-pic}                
\usepackage{tcolorbox}


\tcbuselibrary{skins}

\tcbset{
    pccstyle/.style={
        enhanced,flushright upper,
        boxrule=1.4pt,
        colback=white,colframe=black!50!yellow,
        drop fuzzy midday shadow=black!50!yellow
    }
}


\pagestyle{empty}

\AddToShipoutPicture{% from package eso-pic: put something to the background
    \AtPageCenter{% start the bar at the bottom right of the page
        \put(-\LenToUnit{.465\paperwidth},-\LenToUnit{.4\paperheight}){% move it to the middle
            %{\transparent{.5}{\includegraphics[width=20cm]{50th_mathematicsproof}}}
            \begin{tcolorbox}[pccstyle,left=0mm,top=0mm,bottom=0mm]
                \includegraphics[width=20cm]{50th_mathematicsproof}
            \end{tcolorbox}
        }%
    }%
    \AtPageLowerLeft{% start the bar at the bottom right of the page
      \put(\LenToUnit{\dimexpr\paperwidth-3cm},0){% move it to the top right
        \color{blue}\rule{3cm}{\paperheight}%
      }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{17cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\sum$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.5cm},\LenToUnit{12.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\int$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.3cm},\LenToUnit{8.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$e$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{5.0cm}){% move it to the top right
            \color{gray}\scalebox{8}{$\pi$}
        }%
        \put(\LenToUnit{\dimexpr\paperwidth-2.2cm},\LenToUnit{1.5cm}){% move it to the top right
            \color{gray}\scalebox{8}{$i$}
        }%
    }%
}


\begin{document}


\vspace*{1cm}
\mbox{}\hfill\scalebox{2}{%
  \begin{tcolorbox}[pccstyle,width=6.8cm]
    {\bfseries\LARGE {Program Review} \par}
    {\large \itshape Mathematics \par}
    {\large Portland Community College }
  \end{tcolorbox}
}

\vfill
\begingroup
\centering

\scalebox{2}{%
    \begin{tcolorbox}[pccstyle,width=4.8cm]
        {\scshape Fall 2008--Spring 2013}
    \end{tcolorbox}
}

\endgroup
\end{document}

enter image description here