代码拉取完成,页面将自动刷新
原帖由 @Minyang2021 发布在 https://gitee.com/zepinglee/exam-zh/issues/I4SQLI#note_8567080_link。
还有一个问题就是,显示答案的括号里面和横线上面能不能加个颜色,好区分开来,更醒目。
我曾经统一包装过\uline
和\CJKunderline
,重定义了\underline
,可以分别控制内容和下划线的颜色,下划线的厚度,可以参考:
\documentclass{ctexart}
\usepackage{xcolor}
\usepackage{xeCJKfntef}
\ExplSyntaxOn
\tl_new:N \l__coloruline_line_color_tl
\tl_new:N \l__coloruline_text_color_tl
\dim_new:N \l__coloruline_line_width_dim
\keys_define:nn { coloruline }
{
textcolor .tl_set:N = \l__coloruline_text_color_tl,
textcolor .initial:n = black,
linecolor .tl_set:N = \l__coloruline_line_color_tl,
linecolor .initial:n = black,
line-width .dim_set:N = \l__coloruline_line_width_dim,
line-width .initial:n = 0.4pt,
thickness .dim_set:N = \l__coloruline_line_width_dim,
thickness .initial:n = 0.4pt,
}
\NewDocumentCommand{ \coloruline } { O{} m }
{
\group_begin:
\keys_set:nn { coloruline } {#1}
\bgroup
\color{ \tl_use:N \l__coloruline_text_color_tl }
\markoverwith
{
\textcolor
{ \tl_use:N \l__coloruline_line_color_tl }
{ \rule[-0.5ex]{2pt}{ \l__coloruline_line_width_dim } }
}
\ULon{#2}
\group_end:
}
\NewDocumentCommand{ \colorCJKuline }{ O{} m }
{
\group_begin:
\keys_set:nn { coloruline } {#1}
\CJKunderline
[
format = { \color{\l__coloruline_line_color_tl} },
textformat = { \color{\l__coloruline_text_color_tl} },
thickness = \l__coloruline_line_width_dim
]
{#2}
\group_end:
}
\RenewDocumentCommand{ \underline }{ s O{} m }
{
\IfBooleanTF {#1}
{
\colorCJKuline[#2]{#3}
}
{
\coloruline[#2]{#3}
}
}
\ExplSyntaxOff
\begin{document}
\underline[textcolor = red, linecolor = blue]{
这是一段中文测试,具体测试什么呢,想测试uline的中文支持,看看能否换行
}
\underline{
When we published our data analysis of the security questions on Stack Overflow and the Information Security Stack Exchange back in October, we found that every time that there was a major vulnerability or breach, there would be a corresponding uptick in the number of questions asked. It made intuitive sense, but the data confirmed it. But we didn’t expect to have new data to confirm this trend so soon.
}
\underline*[thickness = 1pt]{
这是一段中文测试,具体测试什么呢,想测试uline的中文支持,看看能否换行
}
\underline*[line-width = 1pt]{
When we published our data analysis of the security questions on Stack Overflow and the Information Security Stack Exchange back in October, we found that every time that there was a major vulnerability or breach, there would be a corresponding uptick in the number of questions asked. It made intuitive sense, but the data confirmed it. But we didn’t expect to have new data to confirm this trend so soon.
}
\end{document}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论