Giter VIP home page Giter VIP logo

circledtext's People

Contributors

registor avatar

Watchers

 avatar  avatar  avatar

circledtext's Issues

配合enumitem设置有序列表的序号,结果字体大小不一致

这是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,这个数字就不会变大(当然也就不漂亮了)
折腾了很久搞不定,也没弄明白这是为什么,求解决方法

临时变量 `\l__circledtext_negative_bool` 或许应当作为参数传入辅助函数

您好!事情的起因是在文档类中尝试对阴文和阳文的 \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

与 luacolor 不兼容

在加载了 luacolor 并使用 lualatex 编译的情况下会生成全黑的圆

mwe:

\documentclass{ctexart}

\RequirePackage{circledtext}
\RequirePackage{luacolor}

\begin{document}

\circledtext{测试}

\end{document}

output:
output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.