Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主要符号对照表编译后如何按照首字母排序 #564

Open
shanzhajuan opened this issue Nov 22, 2024 · 3 comments
Open

主要符号对照表编译后如何按照首字母排序 #564

shanzhajuan opened this issue Nov 22, 2024 · 3 comments

Comments

@shanzhajuan
Copy link

shanzhajuan commented Nov 22, 2024

发生了什么?

现在主要符号对照表编译后的顺序与自己文档中列出的顺序是一致的,请问如何按照首字母自动排序呢?

你期望的结果

No response

问题复现的步骤(或者截图)

\begin{symbols}
\item[2D] 二维的(Two-Dimensional)
\item[3D] 三维的(Three-Dimensional)
\item[RGB] 红绿蓝三种颜色的英文缩写,代表了一个颜色模型
\item[LRW] 自然场景唇读数据集(Lip Reading in the Wild)
\item[HDTF] 高分辨率面部动画数据集(High-definition Talking Face Dataset)
\item[CREMA-D] 众包情感多模态数据集(Crowd-Sourced Emotional Multimodal Actors Dataset)
\end{symbols}

image

@fky2015
Copy link
Contributor

fky2015 commented Nov 22, 2024

因为数量不多,要不还是自己手动排一下序吧。

@YDX-2147483647
Copy link
Collaborator

YDX-2147483647 commented Nov 22, 2024

↓这有个类似例子,不过我完全看不懂是怎么实现的……如果你有需要,可以考虑让LLM改改。
itemize - Sorting a list based on the length of each entry - TeX - LaTeX Stack Exchange

ChtaGLM

The LaTeX code you've provided defines a custom list environment called Itemize. This environment is designed to typeset list items with a unique layout: the widest item determines the width of all the items, and each item is right-aligned with this width. Here's a breakdown of how it works:

  1. \def\Itemize{...}: This defines the Itemize environment, which starts a vertical box (\vbox) and sets up some local definitions for handling items.
  2. \def\ItemizeItem{...}: This macro starts a new item. It finishes the previous item (if any) and sets up a horizontal box (\hbox) for the new item, which is initially just a \strut (for consistent line spacing) and any ignored spaces.
  3. \def\endItemize{...}: This ends the Itemize environment by closing the vertical box that was started when the environment began.
  4. \def\xendItemizeItem{...}: This macro finishes an item. It does the following:
    • Ends the horizontal box for the item.
    • Sets up a vertical box (\vbox) to collect any wider items.
    • Loops through the remaining items in the vertical box, moving any wider items to the \vbox called \box4.
    • Finally, it places the current item followed by the wider items that were moved to \box4.
      Here's how the items will be laid out:
  • The widest item (in this case, "aaaaaa") determines the width for all items.
  • Each item is right-aligned to this width.
    When you compile this LaTeX code, you'll get a list where all items are right-aligned according to the width of the longest item, "aaaaaa". The output will look something like this:
aaaaaa
 aaaaa
  aaaa
   aaa
    a
     aa

Note that there are no bullet points or other markers before the items, and there is no indentation or vertical spacing between the items. If you want to add such features, you would need to modify the \ItemizeItem and \xendItemizeItem macros accordingly.

另:给一组文本排序可能非常复杂。例如 a < α < b 还是 a < b < α,fₓ 和 f(x) 又谁先谁后……所有可能规则的总数恐怕要超过一般情况下列表本身排列组合的数量,所以我建议还是手动排吧。

@YDX-2147483647
Copy link
Collaborator

YDX-2147483647 commented Nov 22, 2024

如果你用 PowerShell,可以选中这堆\item代码,复制,运行Get-Clipboard | Sort-Object(缩写gcb | sort),它会获取剪贴板并排序。

图片

也可以Get-Clipboard | Sort-Object | Set-Clipboard(缩写gcb | sort | scb)直接存到剪贴板里。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants