4

I need to make changes in my article and want to use any package to highlight the changes, therefore I use \usepackage{color,soul} and it resulted in errors.

I use Texmaker and compile with XeLaTeX. The file contains over a hundred pages with math formulas therefore to change something is a bit of work. I found that the error occur when \setcounter{secnumdepth} value is other than 0. I found in forum that there probably is a syntax error in \titleformat*{\section}{\normalsize\bfseries\MakeUppercase}.

\documentclass[11pt,twoside]{extarticle}

\usepackage{polyglossia}
\setdefaultlanguage{lithuanian}
\setotherlanguage{english}

\usepackage{titlesec}
\titleformat*{\section}{\normalsize\bfseries\MakeUppercase}

\usepackage{color,soul}

\begin{document}
\setcounter{secnumdepth}{4} 

\section{LITERATŪROS APŽVALGA}\label{sec1}

  This is \hl{\mbox{ŠŠŠŠŠŠŠėėėųųųaujas tekstųųųųų  text}}.

\end{document}
Stefan Pinnow
  • 29,535
Rasa
  • 71

1 Answers1

4

The \titleformat command comes into two forms: easy (with *) and advanced (without *). Only in the “advanced” form you can end the last argument with a one parameter macro that will be handed the section title.

This has nothing to do with soul.

\documentclass[11pt,twoside]{extarticle}

\usepackage{polyglossia}
\usepackage{titlesec}
\usepackage{color,soul}

\setdefaultlanguage{lithuanian}
\setotherlanguage{english}

\titleformat{\section}
  {\normalsize\bfseries}
  {\thesection}
  {1em}
  {\MakeUppercase}

\setcounter{secnumdepth}{4}

\begin{document}

\section{Literatūros Apžvalga}\label{sec1}

This is \hl{\mbox{ŠŠŠŠŠŠŠėėėųųųaujas tekstųųųųų  text}}.

\end{document}

enter image description here

egreg
  • 1,121,712