TransWikia.com

Error when inserting figure ! Use of @xnext doesn't match its definition

TeX - LaTeX Asked by Tiim on May 21, 2021

I am trying to insert a figure in my latex document. This unfortunately gives me the error

! Use of @xnext doesn't match its definition.
@freelist ->,
              bx@E ,,bx@F ,,bx@G ,,bx@H ,,bx@I ,,bx@J ,,bx@K ,,bx@L ...
l.20   t
        estfigure
?

This is my reduced latex file

%% ----------------------------------------------------------------
%% test.tex -- main
%% ---------------------------------------------------------------- 

documentclass[a4paper, 10pt, oneside]{memoir}
usepackage[citeauthor]{basilea}


title                  {title}
thesistype         {thesis}

department         {department}
faculty                {Faculty }
research           {research}

examiner           {examiner}
supervisor         {supervisor}

authors            {authors}
email                {email}
immatriculnr       {matr}

date                       {today}

ulogo              {example-image-a} 


begin{document}

selectlanguage{english}
thesisfront
maketitle
pagestyle{thesis}
thesistoc
thesismain
begin{figure}
  
end{figure}
thesisappendix
thesisbib
thesisback
end{document}

And the package ‘basilea.sty’, which is a template for theses from my university.

%%
%%  This file is originally based on 'ECSthesis.cls' by Steve R. Gunn
%%  and 'phdthesis.sty' by Jamie Stevens. In this new version many parts
%%  have been replaced by calls to the memoir package. Many existing
%%  templates using the memoir served as model.
%%
%%  v.2.0
%%
%%  2014, Ivan Giangreco
%%

NeedsTeXFormat{LaTeX2e}
ProvidesPackage{basilea}[2014]

newcommand*{basileaBibStyle}{thesis}

%%
%% Provides the option to use citet to get the authors name
%% Internally, this changes the bibliographystyle from thesis to plainnat
%%
DeclareOption{citeauthor}{
    renewcommand*{basileaBibStyle}{plainnat}
}
%%
%% Provides the default option to not use citet to get the authors name
%% Internally, this sets the bibliographystyle to thesis
%%
DeclareOption{citenumber}{
    renewcommand*{basileaBibStyle}{thesis}
}

ExecuteOptions{citenumber}

ProcessOptionsrelax

usepackage[ngerman, english]{babel}
%makeatletterAtBeginDocument{let@eltrelax}makeatother
usepackage[utf8]{inputenc}

% text to be set for frontpage
newcommand*{supervisor}[1]{defsupervisorint{#1}}
newcommand*{examiner}[1]{defexaminerint{#1}}
newcommand*{authors}[1]{defauthorsint{#1}}
newcommand*{email}[1]{defemailint{#1}}
newcommand*{ulogo}[1]{defuniversitylogoint{#1}}
newcommand*{department}[1]{defdepartmentint{#1}}
newcommand*{faculty}[1]{deffacultyint{#1}}
newcommand*{research}[1]{defresearchgroupint{#1}}
newcommand*{thesistype}[1]{defthesistypeint{#1}}
newcommand*{immatriculnr}[1]{defimmatriculnrint{#1}}

deftitleint{@title}
defdateint{@date}

% settings for nomenclature (i.e. the abbreviations)
% - for using in text use e.g. nomenclature{LED}{Light-Emitting Diode}
% this will print the text directly as Light-Emitting Diode (LED)
% - the abbreviations for the whole document can be printed with the command thesisnomencl
% - invoke MakeIndex to create a *.nlo file (see also documentation of nomenclature package)
usepackage{nomencl}
newcommand*{nomenclint}{}
letnomenclintnomenclature
renewcommand*{nomenclature}[2]{textit{#2} (#1) nomenclint{#1}{#2}}
makenomenclature
newcommand*{thesisnomencl}{renewcommand{nomname}{iflanguage{english}{Abbreviations}{Abkürzungsverzeichnis}}printnomenclatureaddcontentsline{toc}{chapter}{iflanguage{english}{Abbreviations}{Abkürzungsverzeichnis}}}

% graphics 
% (see also floats section in this document for more options)
usepackage{eso-pic}
usepackage{everyshi}
usepackage{ifthen}
usepackage{calc}
usepackage{pdfpages}
graphicspath{{Figures/}}
newsubfloat{figure}

% definition of fonts (phv is Helvetica, pcr is Courrier)
renewcommand{sfdefault}{phv}
renewcommand{ttdefault}{pcr}
  
% definition of colors
usepackage{color,graphicx}
definecolor{chaptercolor}{rgb}{.7,.7,.7}
definecolor{emphasizecolor}{rgb}{.7,.7,.7}

% margins
setlrmarginsandblock{3.5cm}{3.5cm}{*}
setulmarginsandblock{3.5cm}{3.5cm}{*}
checkandfixthelayout

% document organization
setsecnumdepth{subsubsection}
setcounter{tocdepth}{3}
newcounter{dummy}
newcommandaddtotoc[1]{
refstepcounter{dummy}
addcontentsline{toc}{chapter}{#1}}

% definition of chapter style (i.e. large number and text)
setlength{beforechapskip}{50pt}
setlength{afterchapskip}{1pt}
newcommand*{colorchapnumber}{color{chaptercolor}}
newcommand*{fontchapnumber}{usefont{T1}{phv}{b}{n}fontsize{100}{130}selectfont}
newcommand*{fontchaptitle}{sffamilybfserieshuge}
renewcommand*{afterchapternum}{}
renewcommand*{printchaptername}{}
setlength{midchapskip}{20mm}
renewcommand*{chapternamenum}{}
renewcommand*{printchapternum}{raggedleft{colorchapnumberfontchapnumberthechapter}par}
renewcommand*{printchaptertitle}[1]{raggedleftfontchaptitle{#1}par vspace{30pt} nobreak}

% definition of (subsub)section styles
setsecheadstyle{sffamilyLarge}
setbeforesecskip{25pt}
setaftersecskip{1pt}

setsubsecheadstyle{sffamilylarge}
setbeforesubsecskip{20pt}
setaftersubsecskip{1pt}

setsubsubsecheadstyle{sffamilynormalsize}
setbeforesubsubsecskip{20pt}
setaftersubsubsecskip{1pt}

% definition of line spacing, indent of paragraph, etc.
OnehalfSpacing
setlength{parindent}{0pt}
setlength{parskip}{0pt}
raggedbottom

% header, footer
nouppercaseheads
renewcommand{chaptermark}[1]{markboth{#1}{}}
renewcommand{sectionmark}[1]{markright{#1}{}}

makepagestyle{thesis}
makeevenhead{thesis}{leftmark}{}{thepage}
makeoddhead{thesis}{leftmark}{}{thepage}
makeheadrule{thesis}{textwidth}{0.2pt}
makeevenfoot{thesis}{}{}{}
makeoddfoot{thesis}{}{}{}
copypagestyle{chapter}{empty}

% footnotes
setlength{skipfootins}{20pt}
usepackage[hang]{footmisc}
setlength{footnotemargin}{10pt}
usepackage{chngcntr} 
counterwithout{footnote}{chapter}

% add highlighting possibilities
% use hlt to highlight parts of text, e.g. hlt{this is important}
usepackage{soul}
newcommand{hlt}[1]{hl{#1}}

% various imports
usepackage{amsmath,amsfonts,amssymb,amscd,amsthm}

% clearing pages
defcleardoublepage{clearpageif@twoside ifoddc@pageelsehbox{}thispagestyle{empty}newpageif@twocolumnhbox{}newpagefififi}
newcommand*{tmpcleardoublepage}{}
lettmpcleardoublepagecleardoublepage

% floats
captionstyle{raggedright}
setfloatlocations{figure}{ht!}
setlength{intextsep}{10pt}
setlength{textfloatsep}{10pt}

% definition of table of contents (i.e. title, header text, appearance in pdf-TOC, etc.)
newcommand*{thesistoc}{cleardoublepagerenewcommand*{contentsname}{iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}} createplainmark{toc}{both}{iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}} currentpdfbookmark{iflanguage{english}{Table of Contents}{Inhaltsverzeichnis}}{toc} tableofcontents*}
% adds the word "Appendix" in front of chapters in the appendix section
renewcommand*{cftappendixname}{iflanguage{english}{Appendix}{Anhang}space}

% definition of bibliography
newcommand*{thesisbib}{cleardoublepagerenewcommand*{contentsname}{iflanguage{english}{Bibliography}{Literaturverzeichnis}} createplainmark{bib}{both}{iflanguage{english}{Bibliography}{Literaturverzeichnis}}bibliographystyle{basileaBibStyle}bibliography{thesis}}
usepackage[square, numbers, comma, sort&compress]{natbib}

% document structure
newcommand*{thesisfront}{frontmatter letcleardoublepageclearpage }
newcommand*{thesismain}{ addtocontents{toc}{vspace{2em}} mainmatter letcleardoublepagetmpcleardoublepage }
newcommand*{thesisappendix}{ addtocontents{toc}{vspace{2em}} appendix letcleardoublepageclearpage}

newcommand*{thesisback}{ addtocontents{toc}{vspace{2em}} backmatter letcleardoublepageclearpage}

% title page
renewcommandmaketitle{
  hypersetup{pdftitle={@title}}
  hypersetup{pdfauthor=authorsint}
  thispagestyle{empty}
  {raggedrightincludegraphics{universitylogoint}}par
    begin{center}
      vspace{3cm}
      {Huge sffamily bfseries @title par}
      vspace{0.5cm}
      {thesistypeint par}
      vspace{3cm}    
      {facultyint par}
      {departmentint par}
      {researchgroupint par}
      vspace{1.5cm}
      {iflanguage{english}{Examiner}{Beurteiler}: examinerint par}
      {iflanguage{english}{Supervisor}{Zweitbeurteiler}: supervisorint par}
      vspace{1.5cm}
      {authorsint par}
      {emailint par}
      {immatriculnrint par}      
      vfill
      {@date par}
   end{center}
}

% declaration
newcommand{formlabel}[2]{vspace{0.25cm}textbf{sffamily footnotesize #1 --- #2}}

% urls
usepackage{url}
urlstyle{same}

% footnotes
usepackage{chngcntr}
counterwithout{footnote}{chapter}

% math
usepackage{amsmath}
usepackage{amssymb}
usepackage{amsfonts}

% reference settings
usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
   bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
   colorlinks,linkcolor={black},citecolor={black},urlcolor={black}, filecolor={black},
   pdfstartview={FitV}, breaklinks=true, unicode]{hyperref}
usepackage[capitalize]{cleveref}
% rename here, e.g. crefname{listing}{Algorithm}{Algorithm}  



% todos
usepackage[colorinlistoftodos, textwidth=4cm]{todonotes} % add ",disable" in [] to remove all todos, missing figures and the todo list
newcommand{todoEmpty}[2][]{todo[fancyline, #1]{#2}}
newcommand{todoMissing}[2][]{todoEmpty[color=magenta!80, linecolor=magenta!80, #1]{Missing: #2}}
newcommand{todoCheck}[2][]{todoEmpty[color=red!80, linecolor=red!80, #1]{Check: #2}}
newcommand{todoRevise}[2][]{todoEmpty[color=orange!80, linecolor=orange!80, #1]{Revise: #2}}
newcommand{todoCitation}[2][]{todoEmpty[color=yellow!80, linecolor=yellow!80, #1]{Citation: #2}}
newcommand{todoLanguage}[2][]{todoEmpty[color=blue!40!white, linecolor=blue!40!white, #1]{Language: #2}}
newcommand{todoQuestion}[2][]{todoEmpty[color=green!80!white, linecolor=green!80!white, #1]{Question: #2}}
newcommand{todoNote}[2][]{todoEmpty[color=black!20!white, linecolor=black!20!white, #1]{Note: #2}}
newcommand{todoFigure}[5]{begin{figure}[#1]centeringmissingfigure[figwidth=#2]{#3}caption{#4}label{#5}end{figure}}

endinput

%% End of file 'basilea.sty'

I already found other issues with a similar problem like here but the workaround mentioned will give me the following error message:

(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1phv.fd)
! You can't use `spacefactor' in vertical mode.
@->spacefactor
                 @m {}
l.34 pagestyle
               {thesis}
?

I am on WSL2 Ubuntu version Ubuntu 20.04.1 LTS and I have updated all my packages including texlive.
pdflatex version:

pdflatex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

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