[Tex/LaTex] Issue with inserting a custom cover page

coverslyx

I am a beginner of latex and I use lyx as my tool. I finished my document with Lyx and found a cover page template from here(the first template in the page)

I copied the code into my lyx file in the beginning of the page. As instructions says I copied the title page code and then the \titleGP code snippet. But it says it is wrong in compile time. Why is that?

Best Answer

As long as you copy-paste to the correct place, this should work fine.

First, go to Document --> Settings --> LaTeX preamble and paste in everything from the preamble of that template. That means everything between, but not including, \documentclass{book} and \begin{document}. (Lines 29 to 64 in the template)

Second, exit the document settings, add an ERT (Insert --> TeX code, or Ctrl + L) at the start of your document, and type \thispagestyle{empty}\titleGP in this.