显示/重定义内部宏

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了显示/重定义内部宏相关的知识,希望对你有一定的参考价值。

These four LaTeX control sequences are workalikes of the built-ins show, showthe and def and of a command sequence call. Unlike the usual variants, they work on internal macros which contain characters with the "wrong" category code, such as "@". They take the name of the command sequence (without the leading "") as their argument.

The scrollmode is not necessary, it just saves you pressing Return for every listing output. The obeyspaces is needed only if you want to display or manipulate control sequences whose names contain spaces.

Gratuitous use of don and/or defn will probably break LaTeX.
  1. scrollmode
  2.  
  3. obeyspaces
  4.  
  5. defshown#1{expandaftershowcsnamestring#1endcsname}
  6. defshowthen#1{expandaftershowthecsnamestring#1endcsname}
  7. defdon#1{csnamestring#1endcsname}
  8. defdefn#1{expandafterdefcsnamestring#1endcsname}
  9.  
  10. % example usage:
  11.  
  12. % show listing of [email protected]
  13. shown{@startsection}
  14.  
  15. % show the value of the skip @tempskipa
  16. showthen{@tempskipa}
  17.  
  18. % execute control sequence "\ "
  19. don{ }
  20.  
  21. % redefine @startsection (works like def)
  22. defn{@startsection}{ elax}
  23.  
  24. % use at your own risk. user forfeits all rights to data integrity, mental health, world order, cookies.

以上是关于显示/重定义内部宏的主要内容,如果未能解决你的问题,请参考以下文章

inline内联函数

如何查看xcode下已经预先定义好的宏

Printf重定义

是否可以在宏内部定义宏?

12_关于flask中的宏

Flask之模板之宏继承包含