I am trying to cross-reference the unnumbered chapters and sections in a book. But I found out \nameref is not working for unnumbered sections due to the packages latexbangla and \titlesec.
Here is the MWE:
\documentclass[12pt, oneside]{book}
% Kalpurush font: https://www.omicronlab.com/bangla-fonts.html
\usepackage[banglamainfont=Kalpurush, banglattfont=Kalpurush]{latexbangla}
\setdefaultlanguage[numerals=Bengali,
changecounternumbering=true]{bengali}
\setcounter{secnumdepth}{5}
\setotherlanguage{english}
\usepackage{titling}
\setlength{\droptitle}{-5em}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\raggedright\normalfont\Huge\bfseries}{{\uccoff\fontfamily{lmr}\selectfont\Huge§,\uccon}\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
\begin{document}
\chapter{Unnumbered Chapter} \label{chap:1}
\section{Unnumbered Section} \label{sec:1}
Check \nameref{sec:2} in \nameref{chap:2}.
\chapter{Numbered Chapter} \label{chap:2}
\section{Numbered Section} \label{sec:2}
Check \nameref{sec:1} in \nameref{chap:1}. % Here, \nameref{sec:1} isn't appearing
\end{document}
And an error is showing up:
Package hyperref Warning: Suppressing empty link on input line 28.
How can I fix this problem?
\phantomsectioncommand? – raf Jul 01 '21 at 17:19