1

Hello I'm using the complexity package to write a text where I would like to highlight some complexity classes.

However the text is being written in a Latin language which requires the use of accents in some words. When I try to make a newfunc using a word as an example, for example, "difícil" the "í" vanished.

enter image description here

\documentclass{article}
\usepackage[brazil]{babel}
\usepackage[T1]{fontenc}    % Support Icelandic Characters
\usepackage[utf8]{inputenc} % Support Icelandic Characters
\usepackage{type1ec}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[table, xcdraw, dvipsnames]{xcolor}
\usepackage{tkz-graph}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{float}
\captionsetup[figure]{labelfont = {bf}, labelsep = period}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}P{#1}}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\usepackage[a4paper, portuguese, bookmarks=true, bookmarksnumbered=true, linktocpage, colorlinks, citecolor=black, urlcolor=black, linkcolor=black, filecolor=black, ]{hyperref} \usepackage[square]{natbib}

\usepackage{complexity} \newfunc{\dificil}{difícil}

\begin{document} problemas $\NP\text{-}\dificil$ \end{document}

I would like to know how I make the letter "i" appear accented in the math environment.

Thanks

1 Answers1

3

All complexity does is to use a sans serif font.

\documentclass{article}
\usepackage{amsmath}
\usepackage{complexity}

\newcommand{\newtextfunc}[2]{% \newfunc{#1}{\textnormal{\sffamily#2}}% } \newtextfunc{\dificil}{difícil} \newtextfunc{\NPdificil}{NP-difícil}

\begin{document}

\dificil\ and \NPdificil

$\dificil\ne\NPdificil$

\end{document}

enter image description here

egreg
  • 1,121,712