乳胶| HyperRef错误| ࿽的参数有一个额外的}。 \ end {document}

发布于 2025-02-08 11:38:18 字数 2118 浏览 5 评论 0原文

几天前,我得到了一台带有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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抹茶夏天i‖ 2025-02-15 11:38:18

来自HyperRef维护者的报价

,但我建议删除UTF8X/UCS。 utf8x/ucs撤消了UTF8处理的大多数改进,例如,您可以在\标签和文件名中使用它们。

如果ucs软件包和utf8x inputenc选项已删除,请编译您的代码。


  • 此外,您应该从graphicx中删除pdftex。它将自动选择与您的编译链相匹配的最佳选择。

  • 您也不应该多次加载相同的软件包,特别是没有不同的选项

  • 和加载HyperRef在其他软件包之后(只有非常查看的异常)

  • 无需加载color如果您还加载xcolor < < /p>


\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{xcolor}
\definecolor{Black}{rgb}{0,0,0}

\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}
%\usepackage{xcolor}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line

\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


\begin{document}

Random text
    
${\mathcal {E}}=-\frac{{d\Phi_{B}} }{ dt},$ where

${\mathcal {E}}$ — random letter.   

\end{document}

A quote from the hyperref maintainer:

But I would recommend to drop utf8x/ucs. Most improvements in the handling of utf8 which e.g. allow you to use them in \labels and filenames are undone by utf8x/ucs.

If the ucs package and utf8x inputenc option is removed, your code compiles.


  • Furthermore you should remove the pdftex from graphicx. 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 load xcolor


\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{xcolor}
\definecolor{Black}{rgb}{0,0,0}

\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}
%\usepackage{xcolor}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line

\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


\begin{document}

Random text
    
${\mathcal {E}}=-\frac{{d\Phi_{B}} }{ dt},$ where

${\mathcal {E}}$ — random letter.   

\end{document}
居里长安 2025-02-15 11:38:18

我遇到了同样的问题。我将 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文