3

I'm doing a book with LateX in spanish language and I'm having some problems with spanish accents and symbols ¿ and ¡. Here's my preamble, sorry, it's very huge:

\documentclass[10pt,a4paper,twoside=true,headinclude,footinclude,headsepline,footsepline,footlines=2,headlines=2]{scrreprt}
\usepackage{scrlayer-scrpage}
\usepackage{showframe}
\usepackage{geometry}
\geometry{tmargin=2.5cm,bmargin=2.5cm,lmargin=2cm,rmargin=2cm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-nodecimaldot]{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}
\spanishdecimal{.}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{units}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

\usepackage{scrhack}

\usepackage{nicefrac}
\usepackage{units}

\usepackage{setspace}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\doublespacing



\usepackage{enumerate}

\usepackage[osf]{mathpazo}

\usepackage{graphicx}
\usepackage{color,xcolor}

\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}

\usepackage{tikz, pgf, pgfplots}
\usetikzlibrary{arrows,backgrounds,plotmarks,shapes.geometric,calc}

%\usepgfplotslibrary{external}
%\tikzexternalize
%\tikzset{external/force remake}

\pgfplotsset{width=7cm,compat=newest}
\pgfplotsset{plot coordinates/math parser=false}

\makeatletter
\renewcommand*\l@tcolorbox{\@dottedtocline{1}{1.5em}{3.0em}}
\makeatother

\tcbset {
  teoestilo/.style={
    shadow={2mm}{-1mm}{0mm}{black!50!white},
      colback=gray!20!white,
      coltext=black,
      coltitle=white,
      enlarge top by=\baselineskip/2+1mm,
      enlarge top at break by=0mm,
      pad at break=2mm,
      fonttitle=\bfseries\large,
      fontupper=\normalsize,
      enhanced,
      colframe=black,
      boxrule=1pt,
      arc=2mm,
      breakable,
      top=2mm,
      toptitle=1mm,
      bottomtitle=1mm,
      before=\vskip18pt,
      separator sign ={\ $\blacktriangleright$}
  },
}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{teorema}%
{Teorema}{teoestilo}{th}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{definicion}%
{Definicion}{teoestilo}{def}
\newtcbtheorem[auto counter, number within=section,list inside=ej]{ejercicio}%
{Ejercicio}{teoestilo}{ejer}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{corolario}%
{Corolario}{teoestilo}{coro}
\newtcbtheorem[auto counter, number within=section,list inside=ej]{ejemplo}%
{Ejemplo}{teoestilo}{ejem}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{nota}%
{Nota}{teoestilo}{not}
\newtcbtheorem[auto counter, number within=section,list inside=thm]{propo}%
{Proposición}{teoestilo}{prop}

\definecolor{mymauve}{rgb}{0.58,0,0.82}
\definecolor{mygreen}{rgb}{0,0.6,0}

\usepackage{upquote}
\usepackage{caption}
\usepackage{listings}
\lstset{
  backgroundcolor=\color{yellow!50!white},
  basicstyle=\small\ttfamily,        % the size of the fonts that are used for the code
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  breaklines=true,                 % sets automatic line breaking
  captionpos=b,                    % sets the caption-position to bottom
  commentstyle=\color{mygreen},    % comment style
  deletekeywords={...},            % if you want to delete keywords from the given language
  escapeinside={\%*}{*)},          % if you want to add LaTeX within your code
  frame=single,
  framerule=0pt,
  aboveskip=1cm,
  framextopmargin=0pt,
  framexbottommargin=0pt,
  framexleftmargin=0pt,
  framexrightmargin=0pt,
  framesep=0pt,
  rulesep=0pt,
  keepspaces=true,
  columns=fixed,
  keywordstyle=\bfseries\color{blue},       % keyword style
  language=Python,                 % the language of the code
  morekeywords={ValueError, np, empty, sign, append},
  numbers=none,                    % where to put the line-numbers; possible values are (none, left, right)
  numbersep=0pt,                   % how far the line-numbers are from the code
  numberstyle=\small\color{red}, % the style that is used for the line-numbers
  rulesepcolor=\color{red},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  numberfirstline = false,
  showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  showstringspaces=false,          % underline spaces within strings only
  showtabs=false,                  % show tabs within strings adding particular underscores
  stepnumber=1,                    % the step between two line-numbers. If it's 1, each line will be numbered
  stringstyle=\ttfamily\color{mymauve},   % string literal style
  tabsize=4,                       % sets default tabsize to 2 spaces
}

% minimizar fragmentado de listados
\lstnewenvironment{listing}[1][]
{\lstset{#1}\pagebreak[0]}{\pagebreak[0]}

\newlength\figureheight
\newlength\figurewidth

\usepackage{icomma}
\usepackage{endnotes}
\usepackage{fancyvrb}
\date {}

\addtokomafont{pageheadfoot}{\slshape}
\addtokomafont{pagehead}{\small}
\addtokomafont{pagefoot}{\small}
\chead{\MakeUppercase{\chaptername} \ \thechapter}
\ihead{\thepage}
\ifoot{RESOLUCIÓN ECUACIONES}

\usepackage{helvet}
%Helvética
\newcommand{\helv}{\fontfamily{phv}\fontsize{9}{11}\selectfont}

% Referencias - Enlaces
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue, urlcolor=blue, unicode=true]{hyperref}

\captionsetup{font=small,format=plain,parskip=1pt,justification=centering}
\captionsetup[figure]{font=small,format=plain,parskip=1pt,justification=centering}
\renewcommand{\thefigure}{\arabic {figure}}

\renewcommand\thefootnote{\textcolor{blue}{\arabic{footnote}}}

\usepackage[super,sort]{natbib}

\usepackage{Capitulo}
\usepackage{TituloSeccionesSubsecciones}

\def\max{\mathop{\mbox{\rm máx}}} % máximo
\def\min{\mathop{\mbox{\rm mín}}} % mínimo

\newcommand{\resol}{\fcolorbox{blue!80!white}{blue!30!white}}

%\usepackage[spanish,es-nodecimaldot,activeacute]{babel}

\title{Resolución De Ecuaciones Con Python 3}
\titlehead{RESOLUCIÓN DE ECUACIONES}
\subtitle{Métodos Iterativos}
\author{Cristóbal López Silla - Licenciado en Matemáticas.}
\dedication{A mis padres y mi hermano.}
\begin{document}
\maketitle
\tableofcontents{}
\listoffigures{}
\newpage{}
\tcblistof[\section*]{thm}{Listado de Teoremas, Proposiciones, Corolarios Y Definiciones}
\newpage{}
\tcblistof[\section*]{ej}{Listado Ejercicios y Ejemplos}

I'm compiling with LuaLatex. Here's an image of my pdf, the errors are marked with yellow color: enter image description here

EDIT Ok, accents in bookmarks solved thanks to someone comments below. But in the text follows appearing strange symbols when I type ¿¡ in my code. With LualateX I obtain this warning message:

W: d:/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty:0 inputenc package ignored with utf8 based engines.

Please view the image above.

6
  • 3
    You have a long piece of code, but nothing that could reproduce the issue. Please, try making a minimal example.
    – egreg
    Feb 20, 2016 at 20:59
  • 2
    Try loading hyperref with the unicode option. Feb 21, 2016 at 9:20
  • @HenriMenke Thanks, it's fixed. Any idea why doesn't appear ¿¡ correctly in my document and appears strange symbols instead of?
    – Tobal
    Feb 21, 2016 at 9:55
  • @Tobal You seem to be a bit confused by the working of LuaTeX in contrast to pdfTeX. With LuaTeX, you have to load fontspec instead of inputenc, but then you can't use packages such as mathpazo or helvet which are present in your “example”. I suggest, you typeset your document using pdfTeX, i.e. choosing the pdfLaTeX option in your editor. Feb 21, 2016 at 10:06
  • @HenriMenke ok is there some fonts similar to mathpazo and helvet for LuaTeX? Thanks for your patience.
    – Tobal
    Feb 22, 2016 at 7:23

2 Answers 2

3

Disclaimer: I cannot reproduce the problem at all. The example of the question is way too large and does not even show the output of the image in the slightest. Even worse, it loads private unavailable packages.
The question is tagged with , but there is no hint in the example file, that this engine is used at all. In contrary, the packages fontenc with encoding T1 and inputenc with utf8 are strong hints, that another 8-bit engine is used, for example, pdfTeX. Both packages are deprecated for LuaLaTeX.

Here an example with accented letters with or without LuaTeX. Also the special symbols ¿ and ¡ are supported in hyperref, either input as UTF-8 or via the ligature forms ?` and !`. Ligatures are usually not supported in bookmarks, because the font machinery of the TeX engine is not available there. Therefore, there is code in the bookmark processing in hyperref to support some few ligatures, including ¿ and ¡.

\documentclass{article}
\usepackage{ifluatex}
\ifluatex
  \usepackage{fontspec}
\else
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
\fi
\usepackage[spanish]{babel}
\usepackage[
  pdfencoding=auto,
  colorlinks,
  pdfusetitle, % copy \title{...} and \author{...} to PDF information entries
]{hyperref}[2011/02/05]% provides option `addcolors`
\hypersetup{
  allcolors=blue,
}
\usepackage{bookmark}
\bookmarksetup{numbered}

\begin{document}
\title{Resolución De Ecuaciones Con Python 3}
\author{Cristóbal López Silla - Licenciado en Matemáticas.}
\maketitle
\section{RESOLUCIÓN ECUACIONES}
\section{Helvética}
\section{UTF-8: ¿ ¡, ligatures: ?` !`}
\end{document}

Result

1

Ok, I've solved the problem with ¿ and ¡ using LuateX and fonts as Mathpazo and Helvet. The solution is very easy: For ¿ symbol:

\textquestiondown

For ¡ symbol:

\textexclamdown

And that's all

You must log in to answer this question.

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