Here is a working example
\documentclass{book}
\usepackage[utf8]{inputenc}
\linewidth 150mm
\usepackage[spanish]{babel}
\usepackage{soul}
\sodef\secso{\scshape}{.125bp}{0.33em plus.1em minus.1em}{0.33em plus.1em minus.1em}
\let\secso\scshape
\usepackage{titlesec}
\newcommand{\secformat}[1]{\parbox[t]{\linewidth}{%
\Large\selectfont
\filright{{\secso{#1}}}}}
\titleformat{\section}[hang]{\filright}{}{}{\secformat}
\titlespacing*{\section}{0pt}{26pt}{13pt}
\def\thesection {\relax}
\setcounter{secnumdepth}{0}
\begin{document}
\pagestyle{plain}
\selectlanguage{spanish}
\noindent Test text.
\section{Observation}
\noindent Test text 2.
\section{Observación}
\noindent Test text 3.
\end{document}
It works well. But when I take out the command \let\secso\scshape with the aim to use the soul definition of \secso , the second title does not work. The letter ó leads to an error:
! Argument of \UTFviii@two@octets has an extra }.
\par
l.34 \section{Observación}
What is the best/simplest solution to this problem?
Thank you very much in advance for any help. It is for the Spanish translation of my free Motion Mountain Physics book, and the issue is holding up the translation.
P.S. The file is stored as UTF-8. The latest version of soul is used.
soul, try thesoulutf8package, or consider using themicrotypeinterface instead as that works on the font level where assoulis on a macro level. – daleif Apr 01 '20 at 14:08\linewidththis way doesn't seem right. Thegeometrypackage is usually fine for these things. – frougon Apr 01 '20 at 14:13