0

I am making a work that's mainly written in portuguese but has some biblical hebrew words and phrases. I am using ABNTeX2 and XeLaTeX (this issue does not happens when compiling with LuaLaTeX), but everytime I load hebrew language with \setotherlanguage{hebrew}, the sections numeration goes mental and the abstract title fonts change.

\documentclass[
    article,
    12pt,
    oneside,
    a4paper,
    ]{abntex2}

% Pacotes fundamentais 
\usepackage{indentfirst}        % Indenta o primeiro parágrafo de cada seção.
\usepackage{nomencl}            % Lista de simbolos
\usepackage{color}              % Controle das cores
\usepackage{graphicx}           % Inclusão de gráficos
\usepackage{microtype}          % para melhorias de justificação
\usepackage{fontspec}
\usepackage{enumitem}
\usepackage{polyglossia}

% Usar Arial conforme manual do UNASP
\setmainfont{Arial}

% Pacotes adicionais, usados apenas no âmbito do Modelo Canônico do abnteX2
\usepackage{lipsum}             % para geração de dummy text
        
% Pacotes de citações
\usepackage[alf]{abntex2cite}   % Citações padrão ABNT

% Define tamanho de títulos e subtítuos
\renewcommand{\ABNTEXsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsectionfontsize}{\normalsize}

\renewcommand{\ABNTEXsubsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsubsectionfontsize}{\normalsize}

\renewcommand{\ABNTEXsubsubsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsubsubsubsectionfont}{\fontseries{b}\selectfont}

\setsecnumformat{\csname the#1\endcsname\space} % Define espaçamento entre número e título de seção como sendo um espaço único

% Define o espaçamento entre títulos e subtítulos e texto
\setbeforesecskip{2\onelineskip}
\setaftersecskip{2\onelineskip}
\setbeforesubsecskip{2\onelineskip}
\setaftersubsecskip{2\onelineskip}
\setbeforesubsubsecskip{2\onelineskip}
\setaftersubsubsecskip{2\onelineskip}

% Definir estilos para paginação
\aliaspagestyle{plain}{empty}
\makeevenhead{simple}{\footnotesize\thepage}{}{}
\makeoddhead{simple}{}{}{\footnotesize\thepage}

% Redefinir citação para usar tamanho UNASP
\let\oldCitacao\citacao
\let\oldEndCitacao\endcitacao

\renewenvironment{citacao}
    {
    \oldCitacao
    \small
    }
    {\oldEndCitacao}
    
% Configuração do pacote polyglossia
\setdefaultlanguage{brazil}
\setotherlanguage{english}
\setotherlanguage{hebrew}

% Informações de dados para CAPA e FOLHA DE ROSTO
\titulo{Lorem ipsum dolor sit amet}
\tituloestrangeiro{Lorem ipsum dolor sit amet}

\autor{
Lorem ipsum\thanks{\lipsum[1] E-mail: \mbox{\href{mailto:lorem@ipsum.com}{lorem@ipsum.com}.}}}

\local{Brasil}
\data{2022}

% Configurações de aparência do PDF final
\makeatletter
\hypersetup{
        pagebackref=true,
    pdftitle={\@title}, 
    pdfauthor={\@author},
        pdfsubject={Modelo de artigo científico com abnTeX2},
    pdfcreator={LaTeX with abnTeX2},
    pdfkeywords={abnt}{latex}{abntex}{abntex2}{atigo científico}, 
    colorlinks=true,            % false: boxed links; true: colored links
        linkcolor=black,            % color of internal links
        citecolor=black,                % color of links to bibliography
        filecolor=black,            % color of file links
    urlcolor=black,
    bookmarksdepth=4
}
\makeatother

% Altera as margens padrões
\setlrmarginsandblock{3cm}{2cm}{*}
\setulmarginsandblock{3cm}{2cm}{*}
\checkandfixthelayout

% O tamanho do parágrafo é dado por:
\setlength{\parindent}{1.25cm}

% Controle do espaçamento entre um parágrafo e outro:
\setlength{\parskip}{0cm} 

\DoubleSpacing

% Espaçamento entre notas de rodapé e texto
\setlength{\skip\footins}{\baselineskip}

% ----
% Início do documento
% ----
\begin{document}

% Retira espaço extra obsoleto entre as frases.
\frenchspacing 

% ----------------------------------------------------------
% ELEMENTOS PRÉ-TEXTUAIS
% ----------------------------------------------------------

% página de titulo principal (obrigatório)
\maketitle

% titulo em outro idioma (opcional)

% resumo em português
\begin{resumoumacoluna}
\lipsum[1]
 
 \vspace{\onelineskip}
 
 \noindent
 \textbf{Palavras-chave}: lorem. ipsum. dolor.
\end{resumoumacoluna}

% resumo em inglês
\renewcommand{\resumoname}{Abstract}
\begin{resumoumacoluna}
 \begin{otherlanguage*}{english}
   \lipsum[1]

   \vspace{\onelineskip}
 
   \noindent
   \textbf{Keywords}: lorem. ipsum. dolor.
 \end{otherlanguage*}  
\end{resumoumacoluna}

% ----------------------------------------------------------
% ELEMENTOS TEXTUAIS
% ----------------------------------------------------------
\textual
\pagestyle{simple}

% ----------------------------------------------------------
% Introdução
% ----------------------------------------------------------
\section{Introdução}

\lipsum[3]

\section{Lorem ipsum}

\lipsum[6]


% Finaliza a parte no bookmark do PDF, para que se inicie o bookmark na raiz
\bookmarksetup{startatroot}% 

% ---
% Conclusão
% ---
\section{Considerações finais}

\lipsum[1]

\begin{citacao}

\lipsum[2]

\end{citacao}

\lipsum[3]

% ----------------------------------------------------------
% ELEMENTOS PÓS-TEXTUAIS
% ----------------------------------------------------------
\postextual

% ----------------------------------------------------------
% Referências bibliográficas
% ----------------------------------------------------------
\bibliography{Artigo}

\end{document}

I also made an Overleaf project. Uncommenting the line 66 will reproduce the problem.

https://www.overleaf.com/8472821766fcfkjtzpktjw

I've tried for hours to find a solution online and reading the polyglossia manual, but didn't manage to solve this problem. THe problem also does not happen when adding other languages that I am going to use, like English.

With hebrew language disabled: enter image description here

With hebrew language enabled: enter image description here

Note the differences on the Abstract title and on the section numeration.

8
  • Please add here the minimal example, not as a link to Overleaf.
    – egreg
    Dec 6, 2022 at 23:11
  • please make an example as a code block here not an external link. That link is not world readable, and even if it was, if the code there changes this question would not be understandable. Dec 6, 2022 at 23:13
  • hebrew loads the bidi package, and the bidi package changes lots of things. If you adapt e.g. counters and similar, better do if after hebrew has been load, so that you have a fighting chance that your changes win. Dec 6, 2022 at 23:20
  • Sorry, I included the source in the question too. Dec 7, 2022 at 0:00
  • @UlrikeFischer Yeah, I though this could be the case, but I've tried moving the set language command to both before and after all other configurations, but this didn't change anything. Dec 7, 2022 at 0:02

1 Answer 1

0

Expanding imnothere's comment into an answer, and removing the extraneous material:

\documentclass[
    article,
    12pt,
    oneside,
    a4paper,
    ]{abntex2}

\usepackage{fontspec}

\babelprovide{english}
\babelprovide{hebrew}

% Usar Arial conforme manual do UNASP
\setmainfont{Arial}

% Pacotes adicionais, usados apenas no âmbito do Modelo Canônico do abnteX2
\usepackage{lipsum}             % para geração de dummy text
        
% Pacotes de citações
\usepackage[alf]{abntex2cite}   % Citações padrão ABNT

% Define tamanho de títulos e subtítuos
\renewcommand{\ABNTEXsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsectionfontsize}{\normalsize}

\renewcommand{\ABNTEXsubsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsubsectionfontsize}{\normalsize}

\renewcommand{\ABNTEXsubsubsectionfont}{\fontseries{b}\selectfont}
\renewcommand{\ABNTEXsubsubsubsectionfont}{\fontseries{b}\selectfont}


% Informações de dados para CAPA e FOLHA DE ROSTO
\titulo{Lorem ipsum dolor sit amet}
\tituloestrangeiro{Lorem ipsum dolor sit amet}

\autor{
Lorem ipsum\thanks{\lipsum[1] E-mail: \mbox{\href{mailto:lorem@ipsum.com}{lorem@ipsum.com}.}}}

\local{Brasil}
\data{2022}


\begin{document}


% ----------------------------------------------------------
% ELEMENTOS PRÉ-TEXTUAIS
% ----------------------------------------------------------

% página de titulo principal (obrigatório)
\maketitle

% titulo em outro idioma (opcional)

% resumo em português
\begin{resumoumacoluna}
\lipsum[1]
 
 \vspace{\onelineskip}
 
 \noindent
 \textbf{Palavras-chave}: lorem. ipsum. dolor.
\end{resumoumacoluna}

% resumo em inglês
\renewcommand{\resumoname}{Abstract}
\begin{resumoumacoluna}
 \begin{otherlanguage*}{english}
   \lipsum[1]

   \vspace{\onelineskip}
 
   \noindent
   \textbf{Keywords}: lorem. ipsum. dolor.
 \end{otherlanguage*}  
\end{resumoumacoluna}

% ----------------------------------------------------------
% ELEMENTOS TEXTUAIS
% ----------------------------------------------------------
\textual
% ----------------------------------------------------------
\section{Introdução - שלום }

שלום 

\lipsum[3]

\section{Lorem ipsum}

\lipsum[6]


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .