乳胶| HyperRef错误| ࿽的参数有一个额外的}。 \ end {document}
几天前,我得到了一台带有Windows 10 Pro操作系统的新电脑,并决定安装 TexStudio + Miktex 。
我遇到了一个问题编译乳胶文件。问题是当我尝试添加\ usepackage {hyperref}
或类似于此行的代码内容(如果我添加此行<,则在代码中更详细的代码%问题在这里/code>)我会收到一个错误,上面说:
参数�有额外的}。 \ end {document}
。
我的代码:
\documentclass[10pt,a4paper]{report}
\usepackage{cmap}
\usepackage{setspace}
\onehalfspacing
\usepackage{multicol}
\usepackage{textcomp}
\usepackage{verbatim}
\usepackage{floatrow,calc}
\DeclareFloatSeparators{mysep}{\hspace{3cm}}
\thisfloatsetup{floatrowsep=mysep}
\usepackage{ucs}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{amssymb,amsmath}
\DeclareGraphicsExtensions{.pdf, .png, .jpg}
\usepackage[labelsep=period]{caption}
\usepackage[utf8x]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian, english]{babel}
\usepackage[left=3cm, right=1.5cm, top=1.5cm, bottom=2cm]{geometry}
\usepackage{indentfirst}
\usepackage{color}
\definecolor{Black}{rgb}{0,0,0}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line
\usepackage{xcolor}
\definecolor{linkcolor}{HTML}{000000}
\definecolor{urlcolor}{HTML}{000000}
\hypersetup{pdfstartview=FitH, linkcolor=linkcolor, urlcolor=urlcolor, colorlinks=True} % problem is here if I add this line
\fontfamily{ptm}
\parindent=1cm
\sloppy
\bibliographystyle{unsrt}
\usepackage{hyperref} % problem is here if I add this line
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\leftmark}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}
\usepackage{subfig}
\usepackage{epigraph} %%% to make inspirational quotes.
\usepackage{amsfonts}
\begin{document}
Random text
${\mathcal {E}}=-{{d\Phi_{B}} \over dt},$ where
${\mathcal {E}}$ — random letter.
\end{document}
错误我得到: error
当我在 Overleaf 或上尝试此代码时笔记本或没有HyperRef软件包 - 一切都很好。但是我需要这个程序包,例如,我必须添加引用...
有人面临类似问题吗?也许我需要安装其他一些软件包?
I got a new PC with Windows 10 Pro operating system several days ago and decided to install TeXstudio + MiKTeX.
And I faced a problem compiling LaTeX file. The problem is when I try to add \usepackage{hyperref}
or code stuff similar to this line (more detailed in the code with the comment line % problem is here if I add this line
) I get an error which says: Argument of � has an extra }. \end{document}
.
My code:
\documentclass[10pt,a4paper]{report}
\usepackage{cmap}
\usepackage{setspace}
\onehalfspacing
\usepackage{multicol}
\usepackage{textcomp}
\usepackage{verbatim}
\usepackage{floatrow,calc}
\DeclareFloatSeparators{mysep}{\hspace{3cm}}
\thisfloatsetup{floatrowsep=mysep}
\usepackage{ucs}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{amssymb,amsmath}
\DeclareGraphicsExtensions{.pdf, .png, .jpg}
\usepackage[labelsep=period]{caption}
\usepackage[utf8x]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian, english]{babel}
\usepackage[left=3cm, right=1.5cm, top=1.5cm, bottom=2cm]{geometry}
\usepackage{indentfirst}
\usepackage{color}
\definecolor{Black}{rgb}{0,0,0}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line
\usepackage{xcolor}
\definecolor{linkcolor}{HTML}{000000}
\definecolor{urlcolor}{HTML}{000000}
\hypersetup{pdfstartview=FitH, linkcolor=linkcolor, urlcolor=urlcolor, colorlinks=True} % problem is here if I add this line
\fontfamily{ptm}
\parindent=1cm
\sloppy
\bibliographystyle{unsrt}
\usepackage{hyperref} % problem is here if I add this line
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\leftmark}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}
\usepackage{subfig}
\usepackage{epigraph} %%% to make inspirational quotes.
\usepackage{amsfonts}
\begin{document}
Random text
${\mathcal {E}}=-{{d\Phi_{B}} \over dt},$ where
${\mathcal {E}}$ — random letter.
\end{document}
Error I get:
Error
When I try this code in OverLeaf or on my notebook or without hyperref packages - everything's fine. But I need this package if, for example, I'll have to add references...
Did someone face similar problem? Maybe I need to install some other packages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自HyperRef维护者的报价:
如果
ucs
软件包和utf8x
inputenc选项已删除,请编译您的代码。此外,您应该从
graphicx
中删除pdftex
。它将自动选择与您的编译链相匹配的最佳选择。您也不应该多次加载相同的软件包,特别是没有不同的选项
和加载
HyperRef
在其他软件包之后(只有非常查看的异常)无需加载
color
如果您还加载
< < /p>xcolor
A quote from the hyperref maintainer:
If the
ucs
package andutf8x
inputenc option is removed, your code compiles.Furthermore you should remove the
pdftex
fromgraphicx
. It will automatically choose the best suited option to match your compilation chain.You should also not load the same package multiple times, in particular not with different options
And load
hyperref
after the other packages (there are only very view exceptions)No need to load
color
if you also loadxcolor
我遇到了同样的问题。我将 Tex Live版本更改为 2021 ,并得到了解决。 (最初,在我的设置中是2022。可以在菜单选项上找到设置)
I encountered the same problem. I changed the Tex Live Version to 2021 and it was resolved. (Initially, it was 2022 in my setting. Setting can be found on Menu option at the top-left corner)