TransWikia.com

A mistake - "!Package scrlayer Error: cannot define 'newpagestyle'

TeX - LaTeX Asked on January 18, 2021

Once I run my latex I receive the following mistake – !Package scrlayer Error: cannot define ‘newpagestyle’.Can anyone please help me to resolve it? I use the following package associated with scrlayer (Before I was using scrpage2, but it became obsolete)

usepackage[automark]{scrlayer-scrpage}

Below I include the code that can not be compiled:

documentclass[12pt]{article}
usepackage[english]{babel}
usepackage[mincitenames=1,maxcitenames=2,authordate,giveninits=true, 
 backend=biber, natbib,bibencoding=utf8]{biblatex-chicago}


usepackage{calc}
usepackage{appendix}
usepackage{multirow}
usepackage{amsmath}
usepackage{cellspace}
usepackage{mathtools}
usepackage{lipsum}
% package for including graphics with figure-environment
usepackage{graphicx}
usepackage[normalem]{ulem}
%usepackage{hyperref}
usepackage{multirow}
usepackage{setspace}
usepackage{breqn}
%usepackage{fontspec}
%setmainfont{Times New Roman}
 usepackage{float}
 usepackage{rotating}
 usepackage[flushleft]{threeparttable}
 usepackage{array}
 usepackage{booktabs}
 usepackage{adjustbox}
 usepackage{tabularx}
 usepackage{titlesec}
 usepackage[colorlinks=true,citecolor=blue]{hyperref}
 addbibresource{Reference.bib}
 usepackage{bm}
 usepackage{blindtext}
 usepackage{multicol}
 usepackage{ragged2e}
 usepackage{mathtools}
 usepackage{fancyvrb}
 usepackage{subcaption}
 usepackage{supertabular}
 usepackage[labelfont=bf]{caption}
 captionsetup{justification   = raggedright,
          singlelinecheck = false}

 usepackage{makecell}
  usepackage{tikz}
   
 usetikzlibrary{arrows,positioning,decorations.pathreplacing}
 %usepackage[colorlinks=true,linkcolor=blue]{hyperref}
  usepackage[left=2.54cm,top=2.54cm,right=2.54cm,bottom=2.54cm]{geometry}
  pagestyle{myheadings}
  usepackage[automark]{scrlayer-scrpage}

  cfoot[]{pagemark} 
  setheadsepline[122mm]{0.3mm}
  setlength{parindent}{0pt}

  newcommand{mc}[1]{multicolumn{2}{> 
 {centeringarraybackslash}p{widthof{0.000}}}{#1}}    
  %
 doublespacing
 makeatletter
def@xfootnote[#1]{%
 protected@xdef@thefnmark{#1}%
 @footnotemark@footnotetext}
 makeatother
 begin{document}

end{titlepage}









 end{document}

One Answer

I reduced your example to make it really minimal. Other packages are not material to the issue.

The culprit was titlesec. Removing it solves the problem.

documentclass[12pt]{article}

 %usepackage{titlesec}





usepackage[left=2.54cm,top=2.54cm,right=2.54cm,bottom=2.54cm]{geometry}
  pagestyle{myheadings}
  usepackage[automark]
  {scrlayer-scrpage}

  cfoot[]{pagemark} 
  setheadsepline[122mm]{0.3mm}
  setlength{parindent}{0pt}


 begin{document}

asdfasdf


 end{document}

Correct answer by BlackBird on January 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP