pdfx 选项冲突 inputenc + fontenc + hyperref

pdfx 选项冲突 inputenc + fontenc + hyperref

我想编译我的.tex文件pdflatex但却出现选项冲突,因为我加载pdfx以获取符合 PDF/A-1b 的文件。

这是我的标题的一部分:

\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
\usepackage[
linktocpage=false,      % no page numbers are clickable
colorlinks=false,       % no color
breaklinks=true,        % break URLs
bookmarks,              % creates bookmarks in pdf
hyperfootnotes=true,    % clickable footnotes
pdfborder={0 0 0},      % for removing borders around links
bookmarksnumbered=true, % If Acrobat bookmarks are requested, include section numbers.
bookmarksopen=false,    % If Acrobat bookmarks are requested, show them with all the subtrees expanded.
%hidelinks=true,
%linkcolor=blue,
%citecolor=blue,
%urlcolor=blue
pdfpagemode={UseOutlines}, % show pdf bookmarks (indices) on startup; does not function all the time
pdftitle={...}, % title
pdfauthor={...}, % author
pdfkeywords={...}, % subject of the document
pdfsubject={...}, % list of keywords
pdfmenubar=true]        % make PDF viewer’s menu bar visible
{hyperref}
\usepackage{url} % Urls become clickable
\urlstyle{same}

\usepackage[a-1b]{pdfx}
\hypersetup{pdfpagelabels}

% ------
% Fonts and typesetting settings
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine} % libertine font as pbk (=Garamond font, ugm) substitution
\renewcommand{\familydefault}{pbk} % to change the headers and body texts
\usepackage{mathpazo} % palatino font as pbk (=Optima font, pbk) substitution
%\linespread{1.05}
%\usepackage{lmodern} % removes this restriction by allowing font sizes at arbitrary sizes
\usepackage{mycals}
\usepackage{ngerman} % new german spelling

\begin{document}
foobar here
\end{document}

附加问题:我没有搞清楚inputenc和的区别,fontenc但我知道我必须为这个文档插入两个包。否则我会遇到字体问题。

答案1

如果我按照正确的顺序加载包,则不会出现任何错误:

\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
% Fonts and typesetting settings
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[sc]{mathpazo} % For Palatino
%\usepackage{mycals} % What's this????

\usepackage[
  linktocpage=false,      % no page numbers are clickable
  colorlinks=false,       % no color
  breaklinks=true,        % break URLs
  bookmarks,              % creates bookmarks in pdf
  hyperfootnotes=true,    % clickable footnotes
  pdfborder={0 0 0},      % for removing borders around links
  bookmarksnumbered=true, % If Acrobat bookmarks are requested, include section numbers.
  bookmarksopen=false,    % If Acrobat bookmarks are requested, show them with all the subtrees expanded.
  %hidelinks=true,
  %linkcolor=blue,
  %citecolor=blue,
  %urlcolor=blue,
  pdfpagemode={UseOutlines}, % show pdf bookmarks (indices) on startup; does not function all the time
  pdftitle={...}, % title
  pdfauthor={...}, % author
  pdfkeywords={...}, % subject of the document
  pdfsubject={...}, % list of keywords
  pdfmenubar=true,        % make PDF viewer’s menu bar visible
  pdfpagelabels,
]{hyperref}
\usepackage[a-1b]{pdfx}

\urlstyle{same}

% ------

\begin{document}
foobar here
\end{document}

请注意,hyperref应尽可能晚地加载,但有一些例外,例如pdfxcleveref

\usepackage{ngerman}应该被替换为,如果你稍后执行 ,那么加载和执行\usepackage[ngerman]{babel}就没有意义了。无需加载,因为它已经被 加载了。libertine\renewcommand{\rmdefault}{pbk}\usepackage{mathpazo}urlhyperref

我不确定您认为这是什么pbk意思:这是 Bookman 的象征性名称。

我发表评论mycals,因为我对此一无所知。

答案2

使用 pdfx.sty (v1.5.8),以下包的顺序也有效,只要您将 更改\usepackage[..options..]{hyperref}\hypersetup{..options..}

\documentclass[twoside,a4paper,DIV15,parskip=off,9pt]{scrbook}
\usepackage[a-1b]{pdfx}
% Fonts and typesetting settings
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[sc]{mathpazo} % For Palatino
...
\hypersetup{%
  linktocpage=false,      % no page numbers are clickable
  colorlinks=false,       % no color
 ...
}

我在 中投入了大量精力pdfx.sty来确保与其他软件包的兼容性,并且正在做进一步的工作以允许它在 LaTeX 序言中的任何位置加载。因此,如果有人遇到任何不兼容问题,我将不胜感激。示例文档正是我所需要的。

相关内容