PDF 书签中没有重音符号和 ¿ ¡

PDF 书签中没有重音符号和 ¿ ¡

我正在用 LateX 写一本西班牙语的书,但在处理西班牙语重音符号 ¿ 和 ¡ 时遇到了一些问题。这是我的序言,抱歉,它很长:

\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}

我正在使用 LuaLatex 进行编译。这是我的 pdf 的图像,错误用黄色标记: 在此处输入图片描述

编辑 好的,书签中的重音问题解决了,这要感谢下面有人的评论。但是当我在代码中输入¿¡时,下面的文本中出现了奇怪的符号。使用 LualateX 我收到此警告消息:

W:d:/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty:0 inputenc 包被基于 utf8 的引擎忽略。

请查看上面的图片。

答案1

免责声明:我根本无法重现这个问题。问题的示例太大了,甚至没有显示图像的输出。更糟糕的是,它会加载私有的不可用包。
这个问题被标记为,但示例文件中根本没有提示使用了这个引擎。相反,fontenc带有 encodingT1inputencwith 的包utf8强烈暗示使用了另一个 8 位引擎,例如 pdfTeX。这两个包对于 LuaLaTeX 来说都是弃用的。

这里有一个带重音字母的示例,有或没有 LuaTeX。此外,特殊符号¿¡在 中也受支持hyperref,可以以 UTF-8 输入,也可以通过连字形式?`!`输入。书签通常不支持连字,因为 TeX 引擎的字体机制在那里不可用。因此,在 的书签处理中有代码来hyperref支持一些连字,包括¿¡

\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}

结果

答案2

好的,我已经使用 LuateX 和 Mathpazo 和 Helvet 字体解决了 ¿ 和 ¡ 的问题。解决方案非常简单: 对于 ¿ 符号:

\textquestiondown

对于 ¡ 符号:

\textexclamdown

就这样

相关内容