registor / circledtext Goto Github PK
View Code? Open in Web Editor NEWAn circledtext LaTeX package based on l3draw with expl3.
An circledtext LaTeX package based on l3draw with expl3.
这是mwe
\documentclass[fontset=none, zihao=-4]{ctexart}
\usepackage{enumitem}
\usepackage{circledtext}
\newlist{steps}{enumerate}{2}
\setlist[steps,1]{label=(\arabic*)}
\setlist[steps,2]{label=\circledtext{\arabic*}}
\begin{document}
\begin{steps}
\item
item1
\begin{steps}
\item
item1.1
\item
item1.2
\end{steps}
\item
item2
\end{steps}
\end{document}
你会看到item1.1
之前的带圈的数字明显比item1
之前带括号的数字大
如果把\circledtext
改成\textcircled
,这个数字就不会变大(当然也就不漂亮了)
折腾了很久搞不定,也没弄明白这是为什么,求解决方法
您好!事情的起因是在文档类中尝试对阴文和阳文的 \circledtext
命令进行封装,追溯到了其定义
\NewDocumentCommand{\circledtext}{ s O{} m }
{
\group_begin:
\IfBooleanTF{ #1 }
{
\bool_set_true:N \l__circledtext_negative_bool
}{
\bool_set_false:N \l__circledtext_negative_bool
}
\__circledtext_handle:nn { #2 } { #3 }
\group_end:
}
可以看到控制格式的布尔值 \l__circledtext_negative_bool
在每次调用命令时均会被刷新,这意味着这个变量作为参数传入辅助函数或许更为简洁。并且,xparse
提供的 s
类参数会通过 \BooleanTrue
传入,可以直接用 LaTeX3 的 N
型展开来处理。我构想的重构是
\NewDocumentCommand{\circledtext}{ s O{} m }
{ \__circledtext_handle:Nnn #1 { #2 } { #3 } }
相应地,后续将被调用的函数也会增加一个参数位置,如 \__circledtext_new_char_box_construct:Nnn
\__circledtext_single_construct:NN
等。
我不清楚这个项目是否接受 PR,所以先开贴,希望与您讨论一下可行性:)
另,手册有一个 typo:目录中第五节误被写作 Inerface
。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.