当前位置:网站首页>When using \hl for highlighting, latex always reports an error when encountering a reference, showing that there are fewer or more parentheses
When using \hl for highlighting, latex always reports an error when encountering a reference, showing that there are fewer or more parentheses
2022-07-28 05:37:00 【A little knowledge, a hundred Xiaosheng】
Problems with \ref when using soul for highlighting
Report errors
I’ve run across a `}’ that doesn’t seem to match anything.
resolvent resolvent
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}
What I try is to \ref{x} Add a brace outside and it will become {\ref(x)}
边栏推荐
- Mabtis (I) basic use of framework
- ByteBuffer.position 抛出异常 IllegalArgumentException
- 图像增强评价指标学习之——结构相似性SSIM
- Openjudge: judge whether the string is palindrome
- 多模块打包:程序包:xxx不存在
- PyTorch 使用 MaxPool 实现图像的膨胀和腐蚀
- Redis 之布隆过滤器
- SSM project quick build project configuration file
- 论文写作用词
- Test Development - UI testing in automated testing
猜你喜欢
随机推荐
Feignclient calls the get method and reports an error resultvo{result= unknown exception. Exception details: request method 'post' not supported
多线程进阶:volatile的作用以及实现原理
Edge calculation kubeedge+edgemash
Redis 之布隆过滤器
First acquaintance with C language (1)
Response<T>类
Fusiongan code learning (I)
Scope, execution process and life cycle of bean
子父线程交互
Response < t > class
mysql 为查询结果增加序号
Localdatetime removes T, and jsonfield is invalid
动态卷积的本质
Mybats foreach multi select query, index loop, and cancel the and/or tag
BeanUtils. Copyproperties cannot copy different list sets problem solving lists.transform function
Docker deploy mysql5.7.35
latex使用\hl进行高亮时遇到引用总是报错,显示少了括号或者多了括号
There is no crossover in the time period within 24 hours
regular expression
block yandex bot









