当前位置:网站首页>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)}
边栏推荐
- SSM project quick build project configuration file
- Confused, I'm going to start running in the direction of [test]
- restFul接口使用个人总结
- 分享几种管理C程序中标志位的方法
- 2021csdn blog star selection, mutual investment
- IDEA配置 service(Run Dashboard) 服务,多模块同时启动
- 导出excel,生成多个sheet页,并命名
- (黑马)MYSQL初级-高级笔记(博主懒狗)
- 接口幂等性问题
- C language characters and strings
猜你喜欢

Duoyu security browser will improve the security mode and make users browse more safely
![[slam] lvi-sam analysis - Overview](/img/66/f15f6f574807b9a783e9321c71d422.png)
[slam] lvi-sam analysis - Overview

How does Alibaba use DDD to split microservices?

Thinking on multi system architecture design

Struct模块到底有多实用?一个知识点立马学习

regular expression

论文模型主图范例

多线程进阶:volatile的作用以及实现原理

Edge calculation kubeedge+edgemash

BigDecimal 进行四舍五入 四舍六入和保留两位小数
随机推荐
JUC笔记
docker 部署 mysql5.7.35
I interviewed a 38 year old programmer and refused to work overtime
MySQL basic query
Flask Development & get/post request
凛冬已至,程序员该怎么取暖
24小时内的时间段无交叉
Printf function of input and output function in C language
ES6 new variable modifiers let and const, new basic data type symbol
regular expression
Personal summary of restful interface use
测试开发---自动化测试中的UI测试
Lamda gets the current number of cycles, atomicinteger
Duoyu security browser will improve the security mode and make users browse more safely
Making RPM packages with nfpm
解决Oracle使用in语句不能超过1000问题
架构设计思考合集
You must configure either the server or JDBC driver (via the ‘serverTimezone)
11.< tag-动态规划和子序列, 子数组>lt.115. 不同的子序列 + lt. 583. 两个字符串的删除操作 dbc
How to compare long and integer and why to report errors