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

6
  • 6
    Does this answer your question? Math mode accents Commented Sep 8, 2021 at 0:21
  • you should always make a small but complete example. That makes it much easier to test your issue. Commented Sep 8, 2021 at 6:56
  • @O'Neil No, it doesn't. Try with dif\acute{i}cil and you'll see why. Please, vote for reopening. Commented Sep 8, 2021 at 8:48
  • Unfortunately no, this will change the font when I try to use it. Commented Sep 8, 2021 at 11:52
  • And I updated the example. Commented Sep 8, 2021 at 12:07

1 Answer 1

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.