我有一个这样的 url https://mp.weixin.qq.com/s?__biz=MzU3OTc1MDM1Mg==&mid=2247500792&idx=1&sn=7d6d688ce9cdb4f1a60b43f97163efe1&chksm=fd63d347ca145a51cbf42519a256ecbeafaaec40cc74c5ac96e481d747eaf094105e1db3fd72&scene=21#wechat_redirect
,这个 url 包含一些特殊字符。当我使用此命令来呈现它时:
\url{https://mp.weixin.qq.com/s?__biz=MzU3OTc1MDM1Mg==&mid=2247500792&idx=1&sn=7d6d688ce9cdb4f1a60b43f97163efe1&chksm=fd63d347ca145a51cbf42519a256ecbeafaaec40cc74c5ac96e481d747eaf094105e1db3fd72&scene=21#wechat_redirect}
它不起作用。我该怎么做才能处理特殊字符而不必\
一个接一个地添加?有可能批量处理特殊字符吗?
答案1
\documentclass{article}
\usepackage{showframe}
\usepackage{xurl}
\begin{document}
\url{https://mp.weixin.qq.com/s?__biz=MzU3OTc1MDM1Mg==&mid=2247500792&idx=1&sn=7d6d688ce9cdb4f1a60b43f97163efe1&chksm=fd63d347ca145a51cbf42519a256ecbeafaaec40cc74c5ac96e481d747eaf094105e1db3fd72&scene=21#wechat_redirect}
\end{document}