当前位置:网站首页>latex使用\hl进行高亮时遇到引用总是报错,显示少了括号或者多了括号
latex使用\hl进行高亮时遇到引用总是报错,显示少了括号或者多了括号
2022-07-28 05:17:00 【一知半解百晓生】
Problems with \ref when using soul for highlighting
报错
I’ve run across a `}’ that doesn’t seem to match anything.
解决方法解决方法
Enclosing the \ref{x} in { } works. soul then takes it as one element instead of breaking it up, I guess. It seems to me that it reads both \ref and {x} in two steps and sets it together again while adding another set of braces, i.e. the result is \ref{ {x}}. This doesn’t matter much for font commands but \ref takes the inner braces as part of the label name. This causes the warning about the unknown label. The error is caused because \ref is then also expanded by soul inside a { } group, i.e. {\ref}. Don’t ask me why.
Note that you can’t label a \section* because it doesn’t has a number.
\documentclass[10pt]{
article}
\usepackage[usenames,dvipsnames]{
color}
\usepackage{
soul}
%\soulregister{
\ref}{
1}
\begin{
document}
\section{
x}\label{
x}
\section{
y}
\hl{
Some text.
Section~{
\ref{
x}}.
}
\end{
document}
我尝试的是在 \ref{x}外面增加个大括号就行变成{\ref(x)}
边栏推荐
- BigDecimal rounds and retains two decimal places
- BigDecimal 进行四舍五入 四舍六入和保留两位小数
- Mybats foreach multi select query, index loop, and cancel the and/or tag
- Mysql数据库索引(innodb引擎)
- 论文写作用词
- 11. < tag dynamic programming and subsequence, subarray> lt.115. Different subsequences + Lt. 583. Deletion of two strings DBC
- regular expression
- MySQL date and time function, varchar and date are mutually converted
- Mysql处理遗留数据样例
- Antd setfieldsvalue warning problem cannot use 'setfieldsvalue' until you use 'getfielddecorator' or
猜你喜欢

21 day SQL punch in summary
Printf function of input and output function in C language

架构设计思考之一(SSO设计)

Personal summary of restful interface use

论文模型主图范例

Thinking on multi system architecture design

ByteBuffer.position 抛出异常 IllegalArgumentException

How practical is the struct module? Learn a knowledge point immediately

repackag failed: Unable to find main class

在ruoyi生成的对应数据库的代码 之后我该怎么做才能做出下边图片的样子
随机推荐
There is no crossover in the time period within 24 hours
科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同
C language: addition and deletion of linked list in structure
regular expression
Internal implementation principle of yymodel
BeanUtils. Copyproperties cannot copy different list sets problem solving lists.transform function
Long和Integer如何进行比较,为什么报错
FreeRTOS personal notes - task notification
多线程进阶:synchronized底层原理,锁优化、锁升级的过程
First acquaintance with C language (2)
Digital twin technology creates visual application of smart mine
Autoreleasepool problem summary
【MySQL】MySQL时区问题、数据库时间相差8小时问题解决
【idea插件神器】教你如何使用IDEA一键set实体类中所有属性
Framework step by step easy-to-use process
ES6 new variable modifiers let and const, new basic data type symbol
mysql中使用list作为参数进行查询
I've been in an outsourcing company for two years, and I feel like I'm going to die
Flask Development & get/post request
论文模型主图范例