Compare commits

..

17 Commits

Author SHA1 Message Date
0cf390d159 Merge f09e34ad49 into ba05c9d952 2025-01-01 11:23:49 +08:00
f09e34ad49 longtable added and little changes 2024-05-15 16:49:59 +08:00
8d92c6e073 Add support for multiple columns 2024-05-15 16:47:52 +08:00
65c4fed894 format correct markdown 2024-05-15 16:39:31 +08:00
0ad226479c colour and box for text 2024-05-15 16:34:31 +08:00
0aabf4f9e2 Merge branch 'main' of github.com:SchwarzerYV/reference 2024-05-15 16:28:23 +08:00
0a9251dad6 add overset and underset function 2024-05-15 16:27:49 +08:00
1164edcb8e Merge branch 'jaywcjlove:main' into main 2024-05-15 16:06:09 +08:00
1cebc5add8 draft done 2024-05-15 14:53:21 +08:00
4bfba5a92a Adjusting Margins and Page Size in LaTeX 2024-05-15 14:24:53 +08:00
9feb3f1e6d add table example 2024-05-15 13:31:29 +08:00
f482310851 latex 2024-05-15 12:46:41 +08:00
de73319346 list test 2024-05-15 12:19:26 +08:00
945e403df2 item 2024-05-15 12:15:50 +08:00
448025733c add some font 2024-05-15 11:59:10 +08:00
889d613a6a my part 2024-05-15 11:53:08 +08:00
b836d77449 bf test 2024-05-14 20:15:50 +08:00
10 changed files with 376 additions and 731 deletions

View File

@ -24,3 +24,5 @@ yarn.lock
*.iml
*.ipr
*.iws
*.tex

2
.gitignore vendored
View File

@ -23,3 +23,5 @@ yarn.lock
*.iml
*.ipr
*.iws
\demo

View File

@ -337,7 +337,7 @@ jobs:
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
<a href="https://github.com/h7ml" title="h7ml"><img src="https://avatars.githubusercontent.com/u/55233292?v=4" width="42;" alt="h7ml"/></a>
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
<a href="https://github.com/aixcyi" title="阿羽"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="阿羽"/></a>
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
<a href="https://github.com/alex-reinfoce" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
@ -354,7 +354,6 @@ jobs:
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
@ -374,13 +373,13 @@ jobs:
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
<a href="https://github.com/Kisa-Dong" title="Kisa-Dong"><img src="https://avatars.githubusercontent.com/u/84782008?v=4" width="42;" alt="Kisa-Dong"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
@ -394,7 +393,7 @@ jobs:
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
<a href="https://github.com/larry-xue" title="yujian(larry) xue"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="yujian(larry) xue"/></a>
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
@ -402,18 +401,17 @@ jobs:
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
<a href="https://github.com/emoji-share" title="emoji-share🤪"><img src="https://avatars.githubusercontent.com/u/192275245?v=4" width="42;" alt="emoji-share🤪"/></a>
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
<a href="https://github.com/gaoxiaoduan" title="Coder Duan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="Coder Duan"/></a>
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
<a href="https://github.com/rainbowatcher" title="rainbowatcher"><img src="https://avatars.githubusercontent.com/u/42316353?v=4" width="42;" alt="rainbowatcher"/></a>
<a href="https://github.com/rainbowatcher" title="看彩虹的人"><img src="https://avatars.githubusercontent.com/u/42316353?v=4" width="42;" alt="看彩虹的人"/></a>
<a href="https://github.com/HChenX" title="焕晨HChen"><img src="https://avatars.githubusercontent.com/u/123531821?v=4" width="42;" alt="焕晨HChen"/></a>
<a href="https://github.com/LebranceBW" title="落叶乌龟"><img src="https://avatars.githubusercontent.com/u/19501514?v=4" width="42;" alt="落叶乌龟"/></a>
<a href="https://github.com/LongYinStudio" title="敬培全"><img src="https://avatars.githubusercontent.com/u/42208852?v=4" width="42;" alt="敬培全"/></a>
@ -431,13 +429,13 @@ jobs:
<a href="https://github.com/swift-fs" title="swift-fs"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift-fs"/></a>
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
<a href="https://github.com/ri-fumo" title="ri-fumo"><img src="https://avatars.githubusercontent.com/u/190000479?v=4" width="42;" alt="ri-fumo"/></a>
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
<a href="https://github.com/openapphub" title="openapphub"><img src="https://avatars.githubusercontent.com/u/175949671?v=4" width="42;" alt="openapphub"/></a>
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
<a href="https://github.com/likeadmin-likeshop" title="likeadmin通过管理后台-likeshop全开源商城"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeadmin通过管理后台-likeshop全开源商城"/></a>
@ -454,7 +452,6 @@ jobs:
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
<a href="https://github.com/daining810" title="dain"><img src="https://avatars.githubusercontent.com/u/125986872?v=4" width="42;" alt="dain"/></a>
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
@ -478,6 +475,7 @@ jobs:
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
@ -494,8 +492,7 @@ jobs:
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a><!--GAMFC-END-->
上图贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成贡献者图片。

View File

@ -181,7 +181,6 @@ Quick Reference
[Tmux](./docs/tmux.md)<!--rehype:style=background: rgb(99 99 99);-->
[Taskset](./docs/taskset.md)<!--rehype:style=background: rgb(99 99 99);-->
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=解压缩-->
[Yazi](./docs/yazi.md)<!--rehype:style=background: rgb(255 165 0);&class=tag&data-lang=文件管理器;&class=contributing-->
[Zip](./docs/zip.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=解压缩-->
[FTP](./docs/ftp.md)<!--rehype:style=background: rgb(99 99 99);-->
<!--rehype:class=home-card-->
@ -301,7 +300,7 @@ Quick Reference
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
<a href="https://github.com/h7ml" title="h7ml"><img src="https://avatars.githubusercontent.com/u/55233292?v=4" width="42;" alt="h7ml"/></a>
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
<a href="https://github.com/aixcyi" title="阿羽"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="阿羽"/></a>
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
<a href="https://github.com/alex-reinfoce" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
@ -318,7 +317,6 @@ Quick Reference
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
@ -338,13 +336,13 @@ Quick Reference
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
<a href="https://github.com/Kisa-Dong" title="Kisa-Dong"><img src="https://avatars.githubusercontent.com/u/84782008?v=4" width="42;" alt="Kisa-Dong"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
@ -358,7 +356,7 @@ Quick Reference
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
<a href="https://github.com/larry-xue" title="yujian(larry) xue"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="yujian(larry) xue"/></a>
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
@ -366,18 +364,17 @@ Quick Reference
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
<a href="https://github.com/emoji-share" title="emoji-share🤪"><img src="https://avatars.githubusercontent.com/u/192275245?v=4" width="42;" alt="emoji-share🤪"/></a>
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
<a href="https://github.com/gaoxiaoduan" title="Coder Duan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="Coder Duan"/></a>
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
<a href="https://github.com/rainbowatcher" title="rainbowatcher"><img src="https://avatars.githubusercontent.com/u/42316353?v=4" width="42;" alt="rainbowatcher"/></a>
<a href="https://github.com/rainbowatcher" title="看彩虹的人"><img src="https://avatars.githubusercontent.com/u/42316353?v=4" width="42;" alt="看彩虹的人"/></a>
<a href="https://github.com/HChenX" title="焕晨HChen"><img src="https://avatars.githubusercontent.com/u/123531821?v=4" width="42;" alt="焕晨HChen"/></a>
<a href="https://github.com/LebranceBW" title="落叶乌龟"><img src="https://avatars.githubusercontent.com/u/19501514?v=4" width="42;" alt="落叶乌龟"/></a>
<a href="https://github.com/LongYinStudio" title="敬培全"><img src="https://avatars.githubusercontent.com/u/42208852?v=4" width="42;" alt="敬培全"/></a>
@ -395,13 +392,13 @@ Quick Reference
<a href="https://github.com/swift-fs" title="swift-fs"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift-fs"/></a>
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
<a href="https://github.com/ri-fumo" title="ri-fumo"><img src="https://avatars.githubusercontent.com/u/190000479?v=4" width="42;" alt="ri-fumo"/></a>
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
<a href="https://github.com/openapphub" title="openapphub"><img src="https://avatars.githubusercontent.com/u/175949671?v=4" width="42;" alt="openapphub"/></a>
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
<a href="https://github.com/likeadmin-likeshop" title="likeadmin通过管理后台-likeshop全开源商城"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeadmin通过管理后台-likeshop全开源商城"/></a>
@ -418,7 +415,6 @@ Quick Reference
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
<a href="https://github.com/daining810" title="dain"><img src="https://avatars.githubusercontent.com/u/125986872?v=4" width="42;" alt="dain"/></a>
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
@ -442,6 +438,7 @@ Quick Reference
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
@ -458,8 +455,7 @@ Quick Reference
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a>
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a><!--GAMFC-END-->
[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 根据提交次数的先后顺序自动生成
<!--rehype:style=padding-top:1rem;-->
@ -566,8 +562,6 @@ Quick Reference
[afetera.top](https://note.afetera.top)<!--rehype:target=_blank-->
[trtuaazz.com](https://reference.trtuaazz.com)<!--rehype:target=_blank-->
[anhaoyang.com](http://dev-doc.anhaoyang.com/)<!--rehype:target=_blank-->
[xxcxx.lat](https://xxcxx.lat/)<!--rehype:target=_blank-->
[fishlee.net](https://cr.fishlee.net/)<!--rehype:target=_blank-->
<!--rehype:class=home-card home-links-->
如果你有资源,可以很方便[部署 web 版](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637),这非常简单,只需要克隆 [gh-pages](https://github.com/jaywcjlove/reference/tree/gh-pages) 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
@ -578,33 +572,6 @@ Quick Reference
- [Quick Reference for VSCode](https://marketplace.visualstudio.com/items?itemName=jackiotyu.quick-reference) 由 [jackiotyu](https://github.com/jackiotyu/vscode-quick-reference) 提供
## 赞助支持
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
非常感谢那些一直支持我开源工作的朋友们。如果您对我的工作感到满意,可以选择在[这里进行赞助](https://wangchujiang.com/#/sponsor)<!--rehype:target=_blank-->。如果目前经济上不宽裕,也可以通过下载并使用我开发的 [macOS 应用](https://wangchujiang.com/#/app)<!--rehype:target=_blank-->来支持我。以下是我个人开发的 macOS 应用:
<p style="display: inline-block">
<a target="_blank" href="https://wangchujiang.com/key-clicker/" title="KeyClicker for macOS"><img align="center" alt="KeyClicker" height="50" width="50" src="https://github.com/user-attachments/assets/5a19fcb9-cb81-4855-b4ea-31c604d9612a"></a>
<a target="_blank" href="https://wangchujiang.com/daybar/" title="DayBar for macOS"><img align="center" alt="DayBar" height="50" width="50" src="https://github.com/user-attachments/assets/b67d4a2e-92e2-4d8c-8c6f-2a1eb3e2fa93"></a>
<a target="_blank" href="https://wangchujiang.com/iconed/" title="Iconed for macOS"><img align="center" alt="Iconed" height="50" width="50" src="https://github.com/user-attachments/assets/8a35dc7b-4faf-4e2a-9311-f66d6844a896"></a>
<a target="_blank" href="https://wangchujiang.com/rightmenu-master/" title="RightMenu Master for macOS"><img align="center" alt="RightMenu Master" height="50" width="50" src="https://github.com/user-attachments/assets/39a76541-71bf-4de7-a01c-c62f0557dff5"></a>
<a target="_blank" href="https://wangchujiang.com/paste-quick/" title="Paste Quick for macOS"><img align="center" alt="Quick RSS" height="50" width="50" src="https://github.com/user-attachments/assets/bdaad5b7-9810-44ce-8f17-8410864465d2"></a>
<a target="_blank" href="https://wangchujiang.com/quick-rss/" title="Quick RSS for macOS/iOS"><img align="center" alt="Quick RSS" height="50" width="50" src="https://github.com/user-attachments/assets/374106b5-a448-4d1d-9ccb-b04b6bc681ed"></a>
<a target="_blank" href="https://wangchujiang.com/web-serve/" title="Web Serve for macOS"><img align="center" alt="Web Serve" height="50" width="50" src="https://github.com/user-attachments/assets/e1d9f76f-0f3d-4ba5-8a15-253ee173bb1c"></a>
<a target="_blank" href="https://wangchujiang.com/copybook-generator/" title="Copybook Generator for macOS/iOS"><img align="center" alt="Copybook Generator" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/b90e42ff-158b-4534-82ca-5898fd0e8d73"></a>
<a target="_blank" href="https://wangchujiang.com/devtutor/" title="DevTutor for macOS/iOS"><img align="center" alt="DevTutor for SwiftUI" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/f15c154d-0192-48eb-8e0e-9e245ffd974a"></a>
<a target="_blank" href="https://wangchujiang.com/regex-mate/" title="RegexMate for macOS/iOS"><img align="center" alt="RegexMate" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/aabe5aa9-9a96-4390-8bed-c3e4023d0dea"></a>
<a target="_blank" href="https://wangchujiang.com/time-passage/" title="Time Passage for macOS/iOS"><img align="center" alt="Time Passage" height="50" width="50" src="https://github.com/jaywcjlove/time-passage/assets/1680273/6f30e429-e6f3-4dbe-9921-a5effe2a05e9"></a>
<a target="_blank" href="https://wangchujiang.com/IconizeFolder/" title="IconizeFolder for macOS"><img align="center" alt="Iconize Folder" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/fa9d8b9c-1e51-4ded-877c-fa5b21c47220"></a>
<a target="_blank" href="https://wangchujiang.com/TextSoundSaver/" title="Textsound Saver for macOS/iOS"><img align="center" alt="Textsound Saver" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/0595e842-980b-4574-8891-a8ba853a08be"></a>
<a target="_blank" href="https://wangchujiang.com/create-custom-symbols/" title="Create Custom Symbols for macOS"><img align="center" alt="Create Custom Symbols" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/8cd022ce-a3f1-4e89-b7c6-6fbd0d4db77c"></a>
<a target="_blank" href="https://wangchujiang.com/DevHub/" title="DevHub for macOS"><img align="center" alt="DevHub" height="50" width="50" src="https://github.com/user-attachments/assets/4a44a4fd-67ce-430b-af0a-72f18feaa47d"></a>
<a target="_blank" href="https://wangchujiang.com/ResumeRevise/" title="Resume Revise for macOS"><img align="center" alt="Resume Revise" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c9954a20-1905-48de-bdf8-d71837974aa2"></a>
<a target="_blank" href="https://wangchujiang.com/palette-genius/" title="Palette Genius for macOS"><img align="center" alt="Palette Genius" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/27340413-d355-45b2-8f6f-6ac37682d957"></a>
<a target="_blank" href="https://wangchujiang.com/symbol-scribe/" title="Symbol Scribe for macOS"><img align="center" alt="Symbol Scribe" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c7249f05-fa70-4def-a1e9-571d5f171fc9"></a>
</p>
<!--rehype:style=padding-top:1rem;max-width: 520px;margin: 0 auto;-->
<!--rehype:ignore:start-->
## 开发

574
docs/c.md
View File

@ -7,6 +7,7 @@ C 备忘清单
----
### hello.c
<!--rehype:wrap-class=row-span-2-->
```c
#include <stdio.h>
@ -34,51 +35,40 @@ $ ./hello
<!--rehype:wrap-class=row-span-2-->
```c
int myNum = 15; // 定义并初始化变量 myNum
int myNum = 15;
int myNum2; // 声明变量 myNum2
myNum2 = 15; // 初始化变量 myNum2
// 变量声明后第一次赋值我们称为初始化
// 如果 初始化 和 赋值 在同一行
// 那么我们可以直接称为 定义变量 myNum2
myNum2 = 15;
int myNum3 = 15; // 定义并初始化变量 myNum3
myNum3 = 10; // 重新赋值 myNum3
```
int myNum3 = 15; // myNum3 值为 15
myNum3 = 10; // 现在 myNum3 值为 10
定义不同类型的变量
float myFloatNum = 5.99; // 浮点数
char myLetter = 'D'; // 字符
```c
// 定义并初始化浮点数变量
float myFloatNum = 5.99;
// 定义并初始化字符变量
char myLetter = 'D';
```
变量相加
```c
int x = 5, y = 6;
int sum = x + y; // 变量相加
```
声明并初始化多个变量
```c
int x = 5;
int y = 6;
int sum = x + y; // 添加变量相加
// 声明多个变量
int x = 5, y = 6, z = 50;
int a, b, c = 10;
```
仅声明变量不初始化
```c
//仅声明变量不初始化
int result;
// 未初始化变量 result 会导致不可预测的结果
// 如果未初始化变量的值是未定义的,使用它会导致错误的结果
// 此时,变量的值是随机的,因此在使用该变量之前必须进行初始化。
result = result + 10; // 错误:未初始化的变量 result 会导致不可预测的结果
// 部分编译器会输出 Warning警告未初始化的变量可能导致未定义行为。
result = result + 10; // 错误:未初始化的变量
// 部分编译器会警告未初始化的变量可能导致未定义行为
```
### 常量 Constants
<!--rehype:wrap-class=row-span-2-->
常量不能被改变的值,使用常量可以使代码更清晰和安全
常量在 C 语言中我们一般理解为不能被改变的值,用常量与符号常量,可以使代码更清晰和安全
```c
const int minutesPerHour = 60;
@ -91,53 +81,37 @@ const float PI = 3.14;
const int BIRTHYEAR = 1980;
```
#### **命名规范**
<!--rehype:style=text-align: left;-->
说明与补充:
1. **常量命名规范**:常量通常使用全大写字母,多个单词之间用下划线分隔(例如 BIRTHYEAR、MAX_LENGTH
常量通常使用全大写字母,单词间用下划线分隔(如 BIRTHYEAR、MAX_LENGTH
2. **`#define``const`**
- **`#define`**:宏常量通常在预处理阶段进行替换,不进行类型检查;
- **`const`**:类型安全的常量,编译器可以检查类型,一般更推荐使用 `const`
#### **数组大小**
<!--rehype:style=text-align: left;-->
3. **数组大小**:可以使用 `const` 来定义数组的常量大小,这样编译器会将其作为编译时常量处理
使用 `const` 定义数组大小,编译器将其作为编译时常量处理。
#### **`#define` 与 `const`**
<!--rehype:style=text-align: left;-->
- `#define`:宏常量在预处理阶段替换,不进行类型检查
- `const`:类型安全的常量,编译器可检查类型,推荐使用
#### **注意事项**
- `const` 常量在定义时必须初始化,否则会导致编译错误。
- `const` 常量的值不能被修改,任何尝试修改 `const` 常量的操作都会导致编译错误。
- 使用 `const` 常量可以提高代码的可读性和可维护性,避免魔法数字的使用。
### 注释
```c
// 这是一个单行注释
printf("Hello World!"); // 行内注释
// 这是一个注释
printf("Hello World!"); // 这是一个注释
/*
多行注释:
用于注释跨多行的内容
多行注释:用于注释跨多行的内容
上面的代码将打印出 Hello World! 到屏幕上
注意:多行注释不能嵌套,否则会导致编译错误
*/
```
**注意**:
单行注释`//`可以嵌套,`////////这种注释也是对的`
但行内注释应避免过长,以免影响代码可读性
- 单行注释 `//` 可以嵌套,如 `/////`
- 行内注释应避免过长,以免影响代码可读性。
- 多行注释不能嵌套,否则会导致编译错误。
多行注释不能嵌套,否则会导致编译错误(详见下文 [### Warning 和 Error](#warning-和-error)
```c
/* 这是一个多行注释的开始
/* 嵌套的多行注释C语言不支持 */
*/
/* 这是嵌套的多行注释C语言不支持 */
```
<!--rehype:style=background:#ff000030;-->
### 打印文本
@ -152,34 +126,21 @@ printf("Value = %f", f);
short a = 0b1010110; // 2 进制数字
int b = 02713; // 8 进制数字
long c = 0X1DAB83; // 16 进制数字
```
//变量a和c分别为short和long型所以输出必须加上对应的修饰符h和l
变量a和c分别为 `short``long` 型,所以输出必须加上对应的修饰符 `h``l`
#### 以 8 进制形式输出
```c
// 以 8 进制形式输出
printf("a=%ho, b=%o, c=%lo\n", a, b, c);
// 输出 => a=126, b=2713, c=7325603
```
#### 以 10 进制形式输出
```c
// 以 10 进制形式输出
printf("a=%hd, b=%d, c=%ld\n", a, b, c);
// 输出 => a=86, b=1483, c=1944451
```
#### 以 16 进制形式输出(字母小写)
```c
// 以 16 进制形式输出(字母小写)
printf("a=%hx, b=%x, c=%lx\n", a, b, c);
// 输出 => a=56, b=5cb, c=1dab83
```
#### 以 16 进制形式输出(字母大写)
```c
// 以 16 进制形式输出(字母大写)
printf("a=%hX, b=%X, c=%lX\n", a, b, c);
// 输出 => a=56, b=5CB, c=1DAB83
```
@ -208,75 +169,67 @@ printf("%-9d %-9d %-9d\n", d1, d2, d3);
34 0 23
```
解释:`%-9d``d` 表示进制输出,`9` 表示最少占 9 个字符宽度,`-` 表示左对齐,不使用 `-` 则默认右对齐
对于整型数据:
`%-9d` 中,`d` 表示`10` 进制输出,`9` 表示最少占 `9` 个字符宽度,宽度不足以空格补齐,`-` 表示左对齐,如果不使用左对齐则默认右对齐
对于整型数据,假设:
```c
int a = 12345;
printf("%md", a);
printf(%md,a);
```
1. 若 m <= 实际数据的宽度,则按实际情况输出
2. 若 m > 实际数据的宽度,则在实际数据的左边用空格补齐
3. `printf(“%0md”,a);` 则实际的结果不够 m 位的在数据的左边用0补齐
-`m <=` 实际数据宽度,则按实际情况输出。
-`m >` 实际数据宽度,则在左边用空格补齐。
- `printf("%0md", a);` 则在左边用 `0` 补齐。
对于浮点型数据:
对于浮点型数据,宽度=整数部分的位数+小数点+小数部分的宽度
假设:
```c
float a = 1.2345;
printf("%m.nf", a);
// m -- 整个数据宽度n -- 小数位数
printf(%m.nf,a); //m --整个数据的宽度n--小数位数
```
1. 实际小数位数>n截去小数右边多余的小数截去的第一位要注意四舍五入
2. 实际小数位数< n在小数的最后补0
3. 若m省略则写作%.n 整数部分按照实际输出小数部分按照以上两个规则进行
4. m < n+1自动突破宽度为m的限制按照实际数据进行输出
5. m > n+1整个数据的最左边补空格
- 实际小数位数 `> n`,截去多余小数,注意四舍五入。
- 实际小数位数 `< n`,在小数最后补 `0`
-`m` 省略则写作 `%.n`,整数部分按实际输出,小数部分按以上规则。
-`m < n+1`,自动突破宽度限制,按实际数据输出。
-`m > n+1`,左边补空格。
### 字符串 (Strings)
在 C 语言中,字符串是以 `\0` 结尾的字符数组,而不是一种单独的数据类型。可以通过字符数组来表示字符串。
#### 定义并打印字符串
### 字符串 Strings
```c
char greetings[] = "Hello World!";
printf("%s", greetings);
```
#### 访问字符串中的字符
访问字符串
```c
char greetings[] = "Hello World!";
printf("%c", greetings[0]);
```
访问字符串 `greetings` 的第一个字符 `H`
#### 修改字符串中的字符
修改字符串
```c
char greetings[] = "Hello World!";
greetings[0] = 'J'; // 修改第一个字符为 'J'
greetings[0] = 'J';
printf("%s", greetings);
// 输出 "Jello World!"
```
#### 另一种创建字符串的方法
另一种创建字符串的方法
```c
char greetings[] = {'H','e','l','l','\0'};
printf("%s", greetings);
// 输出 "Hell"
// 输出 "Hell!"
```
**注意**C 语言中没有 `String` 类型,字符串是由字符数组 `char[]` 表示的,且必须以 `\0` 结尾以标识字符串的结束。
`C` **没有** String 类型,使用 `char` 类型并创建一个字符 `array`
### 条件判断
<!--rehype:wrap-class=row-span-2-->
```c
int time = 20;
@ -286,7 +239,6 @@ if (time < 18) {
printf("晚上好!");
}
// 输出 -> "晚上好!"
int time = 22;
if (time < 10) {
printf("早上好!");
@ -307,40 +259,25 @@ if (time > 8) {
// 输出 -> "中午好!"
```
#### 说明
- `if` 语句用于根据条件执行代码块。
- `else` 语句在 `if` 条件不满足时执行。
- `else if` 语句用于检查多个条件。
- 可以嵌套 `if` 语句以检查多个条件。
### 三元运算符
三元运算符(`? :`)是一种简洁的条件判断方式,用于根据条件选择表达式的值由三个部分组成:
- 条件表达式
<!--rehype:wrap-class=col-span-2-->
三元运算符(? :)是一种简洁的条件判断方式,用于根据条件选择表达式的值,由三个部分组成:
- 一个条件表达式
- 条件为真时的结果
- 条件为假时的结果
基本语法:`(条件) ? 表达式1 : 表达式2;`
如果 `条件` 为真,则返回 `表达式1`,否则返回 `表达式2`
#### 示例
基本语法:`(condition) ? expression1 : expression2;`
如果`condition`为真,则返回`expression1`否则返回`expression2`
```c
int time = 20;
(time < 18) ? printf("再会!")
: printf("晚上好!");
(time < 18) ? printf("再会!") : printf("晚上好!");
// 输出 -> "晚上好!"
```
嵌套使用示例(不建议过多嵌套):
三元运算符可以嵌套使用,但嵌套层级太多会导致代码可读性下降,不建议在实际场景使用
```c
int time = 22;
printf((time < 10) ? "早上好!"
: (time < 20) ? "再会!"
: "晚上好!");
printf((time < 10) ? "早上好!" : (time < 20) ? "再会!" : "晚上好!");
// 输出 -> "晚上好!"
```
@ -352,36 +289,10 @@ int day = 4;
switch (day) {
case 3: printf("周三"); break;
case 4: printf("周四"); break;
default: printf("期待周末");
default:
printf("期待周末");
}
// 输出 -> "周四"
```
#### 说明
- `switch` 语句根据表达式的值跳转到匹配的 `case` 标签。
- 匹配到 `case` 后执行相应代码,并通过 `break` 跳出 `switch`
- 如果没有匹配到任何 `case`,则执行 `default` 语句(如果存在)。
#### 注意事项
- `switch` 表达式可以是整型、字符型和枚举型。
- `case` 后的常量表达式值不能相同。
- `case` 后可以有多个语句,不需要 `{ }` 括起来。
- `case``default` 语句的顺序不影响程序执行结果。
- `break` 语句用于结束 `switch`,如果没有 `break`,程序会继续执行下一个 `case`
#### 示例
```c
int day = 3;
switch (day) {
case 3: printf("周三");
case 4: printf("周四"); break;
default: printf("期待周末");
}
// 输出 -> "周三周四"
// 输出 -> "周四" (day 4)
```
### While 循环
@ -393,53 +304,9 @@ while (i < 5) {
printf("%d\n", i);
i++;
}
// 输出 -> 0 1 2 3 4
```
#### 解释
- `while` 循环首先检查条件 `i < 5` 是否为真。
- 如果为真,程序进入循环体,执行打印操作并增加 `i` 的值。
- 循环会继续进行,直到 `i` 达到 5此时条件 `i < 5` 不再为真,循环结束。
#### 打印 1 到 10 的数字
```c
int i = 1;
while (i <= 10) {
printf("%d\n", i);
i++;
}
// 输出 -> 1 2 3 4 5 6 7 8 9 10
```
#### 打印偶数
```c
int i = 0;
while (i <= 10) {
if (i % 2 == 0) {
printf("%d\n", i);
}
i++;
}
// 输出 -> 0 2 4 6 8 10
```
#### 无限循环(需手动终止)
```c
int i = 0;
while (1) {
printf("无限循环\n");
i++;
if (i == 5) break; // 添加条件以退出循环
}
// 输出 -> 无限循环 (打印 5 次)
```
**注意**:不要忘记增加条件中使用的变量,否则循环永远不会结束,成为“死循环”!
### Do/While 循环
@ -450,83 +317,20 @@ do {
printf("%d\n", i);
i++;
} while (i < 5);
// 输出 -> 0 1 2 3 4
```
#### 解释
- `do/while` 循环至少执行一次循环体,因为条件检查在循环体执行之后进行。
- 首先执行 `do` 中的代码,然后检查条件 `i < 5` 是否为真。
- 如果为真,继续执行循环;如果为假,则退出循环。
#### 打印从 5 开始的数字,直到条件不满足
```c
int i = 5;
do {
printf("%d\n", i); // 输出 5
i++;
} while (i < 5);
// 输出 -> 5
```
#### 计算 1 到 10 的和
```c
int i = 1;
int sum = 0;
do {
sum += i;
i++;
} while (i <= 10);
printf("Sum: %d\n", sum);
// 输出 -> Sum: 55
```
### For 循环
```c
for (表达式1; 表达式2; 表达式3) {
循环体语句;
}
```
- 表达式1设置初始条件只执行一次。
- 表达式2循环条件表达式每次循环前检查。
- 表达式3循环体执行后的调整操作。
示例:
```c
int i;
for (i = 0; i < 5; i++) {
printf("%d\n", i);
}
// 输出 -> 0 1 2 3 4
```
#### 注意事项
- `for` 语句的三个表达式不是必须的。
- 当条件表达式表达式2为假时`for` 循环结束。
- 可以在循环体内使用 `break``continue``goto` 语句。
- 如果表达式2为空则表示无限循环`for(;;)` 相当于 `while(1)`
#### 变体
- `for (i = m; i < n; i++)``i = m` 开始到 `i = n-1`,循环 `n - m` 次。
- `for (i = m; i <= n; i++)``i = m``i = n`,循环 `n - m + 1` 次。
### 跳出循环 (Break/Continue/Goto)
<!--rehype:wrap-class=row-span-3-->
#### `break` 语句
跳出当前循环或 `switch` 语句,执行后续代码。
### 跳出循环 Break/Continue
<!--rehype:wrap-class=row-span-2-->
```c
int i;
@ -537,12 +341,9 @@ for (i = 0; i < 10; i++) {
}
printf("%d\n", i);
}
// 输出 -> 0 1 2 3
```
#### `continue` 语句
跳过当前循环的剩余语句,直接进入下一次循环。
`i` 等于 `4` 时跳出循环
```c
int i;
@ -553,40 +354,72 @@ for (i = 0; i < 10; i++) {
}
printf("%d\n", i);
}
// 输出 -> 0 1 2 3 5 6 7 8 9
```
#### `goto` 语句
示例跳过 `4` 的值
无条件跳转到指定标签位置。
### While Break 示例
```c
int i = 0;
while (i < 10) {
if (i == 4) {
goto skip; // 跳转到 skip 标签
break;
}
printf("%d\n", i);
i++;
}
skip:
printf("Exited the loop at i = %d\n", i);
// 输出 -> 0 1 2 3 Exited the loop at i = 4
```
#### 注意事项
- 标签必须在当前函数内定义,命名规则与变量相同。
- `goto` 语句应慎用,避免代码逻辑混乱,通常使用循环或条件语句代替。
#### 设置数组大小
### While continue 示例
```c
// 声明一个由四个整数组成的数组
int myNumbers[4];
int i = 0;
while (i < 10) {
i++;
if (i == 4) {
continue;
}
printf("%d\n", i);
}
```
### 数组 Arrays
<!--rehype:wrap-class=row-span-2-->
```c
int myNumbers[] = {25, 50, 75, 100};
printf("%d", myNumbers[0]);
// 输出 25
```
更改数组元素
```c
int myNumbers[] = {25, 50, 75, 100};
myNumbers[0] = 33;
printf("%d", myNumbers[0]);
```
循环遍历数组
```c
int myNumbers[] = {25, 50, 75, 100};
int i;
for (i = 0; i < 4; i++) {
printf("%d\n", myNumbers[i]);
}
```
设置数组大小
```c
// 声明一个由四个整数组成的数组:
int myNumbers[4];
// 添加元素
myNumbers[0] = 25;
myNumbers[1] = 50;
@ -634,35 +467,6 @@ switch(day){
}
```
### 数组 Arrays
#### 定义和访问数组元素
```c
int myNumbers[] = {25, 50, 75, 100};
printf("%d", myNumbers[0]); // 输出 25
```
#### 更改数组元素
```c
int myNumbers[] = {25, 50, 75, 100};
myNumbers[0] = 33;
printf("%d", myNumbers[0]); // 输出 33
```
#### 循环遍历数组
```c
int myNumbers[] = {25, 50, 75, 100};
int i;
for (i = 0; i < 4; i++) {
printf("%d\n", myNumbers[i]);
}
// 输出 -> 25 50 75 100
```
### 用户输入
```c
@ -694,27 +498,39 @@ printf("Hello %s.", firstName);
### 内存地址
创建变量时,会为该变量分配一个内存地址
创建变量时,会为该变量分配一个内存地址
```c
int myAge = 43;
printf("%p", &myAge);
// 输出 myAge 的内存地址,例如0x7ffe5367e044
// 输出0x7ffe5367e044
```
要访问变量的内存地址,请使用引用运算符 (`&`)
要访问,请使用引用运算符 (`&`)
### 创建指针
```c
int myAge = 43; // 一个 int 变量
printf("%d", myAge); // 输出 myAge(43)的值
// 输出 myAge 的内存地址0x7ffe5367e044
printf("%p", &myAge);
```
### 指针变量
<!--rehype:wrap-class=col-span-2-->
```c
int myAge = 43; // 一个 int 变量
int *ptr = &myAge; // 创建指向 myAge 的指针
int* ptr = &myAge; // 名为 ptr 的指针变量,用于存储 myAge 的地址
printf("%d\n", myAge); // 输出 myAge 的值 -> 43
printf("%p\n", &myAge); // 输出 myAge 的内存地址例如0x7ffe5367e044
printf("%p\n", ptr); // 输出指针 ptr 的值(即 myAge 的内存地址)
printf("%d\n", *ptr); // 通过指针访问 myAge 的值 -> 43
printf("%d\n", myAge); // 输出 myAge (43) 的值
printf("%p\n", &myAge); // 输出 myAge 的内存地址0x7ffe5367e044
printf("%p\n", ptr); // 用指针0x7ffe5367e044输出myAge的内存地址
```
### 取消引用
@ -730,18 +546,6 @@ printf("%p\n", ptr);
printf("%d\n", *ptr);
```
### 指针变量
<!--rehype:wrap-class=col-span-2-->
```c
int myAge = 43; // 一个 int 变量
int* ptr = &myAge; // 名为 ptr 的指针变量,用于存储 myAge 的地址
printf("%d\n", myAge); // 输出 myAge (43) 的值
printf("%p\n", &myAge); // 输出 myAge 的内存地址0x7ffe5367e044
printf("%p\n", ptr); // 用指针0x7ffe5367e044输出myAge的内存地址
```
运算符
---
@ -1084,78 +888,46 @@ int main(void) {
### Warning 和 Error
<!--rehype:wrap-class=row-span-2-->
在 C 语言中警告Warning和错误Error是编译器用于标识代码潜在问题或阻止代码编译的机制
#### 警告
在 C 语言中警告Warning和错误Error是编译器用于标识代码潜在问题或阻止代码编译的两种机制
**警告**
警告提示代码中可能存在的问题,但不会阻止代码编译。处理警告可以提升代码质量和可移植性。
#### **常见警告示例**
**常见警告示例**
1. 未使用的变量
`int x; printf("%d",x);`
2. 类型隐式转换(可能导致数据丢失)
`int x = 3.14; //浮点数被隐式转换`
`int a = 2147483647 + 1; //可能溢出`
3. 函数声明与定义不匹配
未使用的变量
```c
int x; printf("%d", x);
```
类型隐式转换(可能导致数据丢失)
```c
int x = 3.14; // 浮点数被隐式转换
int a = 2147483647 + 1; // 可能溢出
```
函数声明与定义不匹配
#### 错误
错误会阻止代码编译,必须修复才能继续编译。
**错误**
警告提示代码中可能存在的问题,但不会阻止代码编译。处理警告可以提升代码质量和可移植性。
**常见错误示例**
语法错误(如缺少分号)
```c
int x = 1
```
函数定义冲突
```c
1. 语法错误(如缺少分号)
`int x=1 `
2. 函数定义冲突
```C
void func(int);
void func(double);
```
3. 函数或变量未定义
`y = 10; printf("%d",y);`
4. 头文件缺失或冲突
`#include <unknown.h>`
函数或变量未定义
```c
y = 10; printf("%d", y);
```
头文件缺失或冲突
```c
#include <unknown.h>
```
### 使用编译器指令控制警告和错误
<!--rehype:wrap-class=col-span-2-->
#### 抑制警告
**使用编译器指令控制警告和错误**:
1. 抑制警告
可以使用编译器选项来关闭特定的警告,例如在 GCC 中:
```sh
```GCC
gcc -w file.c # 禁用所有警告
gcc -Wall file.c # 启用所有常见警告
gcc -Werror file.c # 将警告视为错误
```
#### 使用 `#pragma` 控制警告
在某些编译器中,可以使用 `#pragma` 指令启用或禁用警告:
```c
2. 使用 #pragma 控制警告
在某些编译器中,可以使用`#pragma`指令启用或禁用警告
```C
#include <stdio.h>
#pragma warning(disable : 4996) // 禁用警告(适用于 MSVC 编译器)
@ -1165,8 +937,7 @@ int main() {
}
```
#### 总结
**总结**
| 区别点 | Warning警告 | Error错误 |
|------------------|----------------------------------------|----------------------------------------|
| 严重程度 | 程序可继续编译,但可能存在隐患 | 编译无法完成,必须修复 |
@ -1175,6 +946,7 @@ int main() {
| 修复必要性 | 可选择修复,但建议修复以避免潜在问题 | 必须修复才能继续编译 |
| 编译器选项调整 | 可以忽略或转换为错误(如 `-Werror` | 无法调整,必须修复 |
函数
----

View File

@ -985,7 +985,6 @@ Github emoji 图标标记
--------
- [Emoji searcher](https://emoji.muan.co/) _(muan.co)_
- [Share Emojis-With Your 🥺Fiends With An Great Way And Unique✅ |copy & download|](https://emoji-share.com/) _(emoji-share.com)_
- [Get Emoji — All Emojis to ✂️ Copy and 📋 Paste](https://getemoji.com/) _(getemoji.com)_
- [Emoji Guide 🔥 The Ultimate Emoji Guide: 🌈 Meanings, 🍎 Platforms, 🆘 Codes and 😍 More](https://emojiguide.com/) _(emojiguide.com)_
- [Full Emoji List, v15.0](https://unicode.org/emoji/charts/full-emoji-list.html) _(unicode.org)_

View File

@ -242,12 +242,10 @@ sb.append("!");
### 比较
```java
String s1 = "QuickRef";
String s1 = new String("QuickRef");
String s2 = new String("QuickRef");
s1 == s2 // false
s1.equals(s2) // true
// intern 方法获得字符串常量池中的惟一引用
s1 == s2.intern() // true
"AB".equalsIgnoreCase("ab") // true
```
@ -312,7 +310,7 @@ int[] a3 = new int[]{1, 2, 3};
int[] a4 = new int[3];
a4[0] = 1;
a4[2] = 2;
a4[3] = 3; // 会出现索引越界异常
a4[3] = 3;
```
### 修改 Modify

View File

@ -72,7 +72,7 @@ Supported Functions
``KaTeX:\\\`{a}`` <pur><code>\\&#96;{a}</code></pur> | `KaTeX:\={a}` <pur>`\={a}`</pur> |
`KaTeX:\"{a}` <pur>`\"{a}`</pur> | `KaTeX:\v{a}` <pur>`\v{a}`</pur> |
`KaTeX:\^{a}` <pur>`\^{a}`</pur> | `KaTeX:\u{a}` <pur>`\u{a}`</pur> |
`KaTeX:\r{a}` <pur>`\r{a}`</pur> |
`KaTeX:\r{a}` <pur>`\r{a}`</pur>
### Delimiter Sizing
@ -156,6 +156,7 @@ Supported Functions
`KaTex:\sout{abc}` | <pur>`\sout{abc}`</pur> | `KaTex:\boxed{\pi=\frac c d}` | <pur>`\boxed{\pi=\frac c d}`</pur>
`KaTex:\$a_{\angl n}` _<red>MD语法冲突</red>_ | <pur>`$a_{\angl n}`</pur> | `KaTex:a_\angln` | <pur>`a_\angln`</pur>
`KaTex:\phase{-78^\circ}` | <pur>`\phase{-78^\circ}`</pur>
`KaTex:\overset{a}{B}` | <pur>`\overset{a}{B}`</pur> | `KaTex:\underset{a}{B}` | <pur>`\underset{a}{B}`</pur>
<pur>\tag{hi} x+y^{2x}</pur>
@ -202,6 +203,7 @@ Supported Functions
| `KaTex:f'` | <pur>`f'`</pur> | `KaTex:\underline{abc}` | <pur>`\underline{abc}`</pur> | `KaTex:\overleftarrow{abc}` | <pur>`\overleftarrow{abc}`</pur> |
| `KaTex:\sqrt{abc}` | <pur>`\sqrt{abc}`</pur> | `KaTex:\widehat{abc}` | <pur>`\widehat{abc}`</pur> | `KaTex:\overbrace{abc}` | <pur>`\overbrace{abc}`</pur> |
| `KaTex:\sqrt[n]{abc}` | <pur>`\sqrt[n]{abc}`</pur> | `KaTex:\widetilde{abc}` | <pur>`\widetilde{abc}`</pur> | `KaTex:\underbrace{abc}` | <pur>`\underbrace{abc}`</pur> |
|`KaTex:\frac{d^n y}{d x^n}`| <pur>`\frac{d^n y}{d x^n}`</pur> | `KaTex:\int_{b}^{a} \,dx` | <pur>`\int_{b}^{a} \,dx`</pur> | `KaTex:\lim_{x \to \infty}` | <pur>`\lim_{x \to \infty}`</pur> |
### 分隔符 Delimiters
<!--rehype:wrap-class=col-span-3-->
@ -891,6 +893,7 @@ x = \begin{cases}
`KaTex:\LARGE AB` | <pur>`\LARGE AB`</pur> | `KaTex:\LARGE AB` | <pur>`\LARGE AB`</pur> | `KaTex:\footnotesize AB` | <pur>\footnotesize AB</pur>
`KaTex:\Large AB` | <pur>`\Large AB`</pur> | `KaTex:\Large AB` | <pur>`\Large AB`</pur> | `KaTex:\scriptsize AB` | <pur>\scriptsize AB</pur>
`KaTex:\large AB` | <pur>`\large AB`</pur> | `KaTex:\large AB` | <pur>`\large AB`</pur> | `KaTex:\tiny AB` | <pur>\tiny AB</pur>
`KaTex:\mathcal{AB}` | <pur>`\mathcal{AB}`</pur> | `KaTex:\mathak{AB}` | <pur>`\mathak{AB}`</pur> | `KaTex:\mathbb{AB}` | <pur>`\mathbb{AB}`</pur> | `KaTex:\mathsf{AB}` | <pur>`\mathsf{AB}`</pur>
### Style 样式
<!--rehype:wrap-class=col-span-3-->
@ -900,7 +903,165 @@ x = \begin{cases}
`KaTex:\displaystyle\sum_{i=1}^n` | <pur>\displaystyle\sum_{i=1}^n</pur> | `KaTex:\textstyle\sum_{i=1}^n` | <pur>\textstyle\sum_{i=1}^n</pur>
`KaTex:\scriptstyle x` | <pur>\scriptstyle x</pur> | `KaTex:\scriptscriptstyle x` | <pur>\scriptscriptstyle x</pur>
`KaTex:\lim\limits_x` | <pur>\lim\limits_x</pur> | `KaTex:\lim\nolimits_x` | <pur>\lim\nolimits_x</pur>
`KaTex:\verb!x^2!` | <pur>\verb!x^2!</pur>
`KaTex:\verb!x^2!` | <pur>\verb!x^2!</pur> | `KaTeX:\mathbf{a}` <pur>`\textbf{a}`</pur> |
`KaTeX:\mathit{a}` <pur>`\textit{a}`</pur> | `KaTeX:\textup{a}` <pur>`\textup{a}`</pur> | `KaTeX:\textsl{a}` <pur>`\textsl{a}`</pur> | `KaTeX:\textsc{a}` <pur>`\textsc{a}`</pur> | `KaTeX:\underline{a}` <pur>`\underline{a}`</pur>
列表,图片,表格表示
---
### 列表
```latex
| - First item |
| - Second item |
\begin{enumerate}
\item First item
\item Second item
\end{enumerate}
| 1. First item |
| 2. Second item |
\begin{itemize}
\item First item
\item Second item
\end{itemize}
|First item |
|Second item |
\begin{description}
\item First item
\item Second item
\end{description}
```
### 图片
```latex
% 展示单张图像
\usepackage{graphicx}
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{path/to/your/image.jpg}
\caption{Caption for the single figure.}
\label{fig:singlefig}
\end{figure}
% 展示多张图像
\usepackage{graphicx}
\usepackage{subcaption}
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{path/to/your/image1.jpg}
\caption{First subfigure}
\label{fig:sub1}
\end{subfigure}
\hfill % 在子图之间添加水平间距
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{path/to/your/image2.jpg}
\caption{Second subfigure}
\label{fig:sub2}
\end{subfigure}
\caption{Caption for the entire figure}
\label{fig:mainfig}
\end{figure}
```
### 表格
```latex
\begin{table}[hbpt] % 使用 longtable 包创建可以跨页的表格
\centering % 居中表格
\caption{Example Table}
\label{tab:example}
\begin{tabular}{|c|l|r|} % 对齐列:居中、居左、居右
\hline % 插入一条水平线
\textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\ \hline
Data 1 & Data 2 & Data 3 \\ % 数据
Data 4 & Data 5 & Data 6 \\ \hline
\end{tabular}
\end{table}
```
LaTex排版
----
### 调整页边距和页面类型
```latex
\usepackage[left=3cm, right=3cm, top=2cm, bottom=2cm]{geometry} or \geometry{left=3cm, right=3cm, top=2cm, bottom=2cm}
\usepackage[a4paper]{geometry} % 另有a5paper, b5paper, letterpaper等格式
```
### 页面分割和布局
```latex
\quad | 添加空格
\qquad | 双空格
\vspace{} | 增加纵向间距
\hspace{} | 增加横向间距
\newpage | 开始新的一页
\clearpage | 清除当前页,并处理所有未处理的浮动体
\vfill | 在当前页面的剩余空间中插入垂直空白
```
### 页面页眉和页脚
```latex
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} | 清除所有页眉和页脚字段
\fancyhead[L]{Left header} | 左页眉
\fancyhead[C]{Center header} | 中页眉
\fancyhead[R]{Right header} | 右页眉
\fancyfoot[L]{Left footer} | 左页脚
\fancyfoot[C]{\thepage} | 页脚中央的页码
\fancyfoot[R]{Right footer} | 右页脚
```
其他
----
### bib文献管理
```latex
\cite{example} | 在文本中引用
\bibliographystyle{plain} | 设定引用格式
\bibliography{references} | 假设.bib文件名为 'references.bib'
```
### URL
```latex
\usepackage{hyperref} | 加载 hyperref 包以增强 PDF 文档的交互性,如添加超链接和书签
\href{URL}{text} | 创建一个指向 URL 的超链接
\url{URL} | 显示 URL 并作为链接
```
### 颜色和盒子
```latex
\usepackage{color} | 使用 color 包来给文本添加颜色
\color{color} | 设置文本颜色
\fbox{content} | 在内容周围创建一个边框
```
### 多栏布局
```latex
\usepackage{multicol} | 使用 multicol 包创建多栏文本
\begin{multicols}{num} ... \end{multicols} | 开始一个多栏环境,其中 num 指定列数
\onecolumn | 文档从当前位置开始变为单列格式
\twocolumn | 文档从当前位置开始变为双列格式
```
另见
----

View File

@ -1,253 +0,0 @@
Yazi 备忘清单
===
这份快速参考备忘单提供了Yazi 快速的终端文件管理的简要概述,以及 Yazi的基本操作
入门
----
### 功能特点
- <code>**跨平台支持**</code>Yazi 支持 Linux、macOS 和 Windows提供一致的跨平台体验
- <code>**轻量高效**</code>:简洁设计,启动和操作快速,资源消耗低
- <code>**插件扩展**</code>:支持插件安装,灵活扩展功能
- <code>**文件操作**</code>:支持复制、剪切、粘贴、删除、重命名等操作,且支持批量和多选功能,提升效率
### 安装
| 系统 | 安装方法 |
| ----- | ----- |
| 使用 Cargo 安装 | `cargo install yazi` |
| Arch Linux | `yay -S yazi` |
| Debian/Ubuntu | 可以使用 `Cargo` 进行安装 |
| macOS (使用 Homebrew) | `brew install yazi` |
| Windows (使用 Carg) | `cargo install yazi` |
| Windows (使用 Scoop) | `scoop install yazi` |
### 使用方法
#### 命令启动 Yazi
```sh
yazi
```
#### 查看 Yazi 的帮助文档
```sh
yazi --help
```
## 常用的快捷键
<!--rehype:body-class=cols-2-->
### 导航
:- | :-
:- | :-
| `h` | 返回上一级目录 |
| `j` | 向下移动选中项 |
| `k` | 向上移动选中项 |
| `l` | 进入选中的目录或打开文件 |
<!--rehype:className=shortcuts-->
### 文件操作
:- | :-
:- | :-
| `y` | 复制选中的文件或目录 |
| `d` | 剪切选中的文件或目录 |
| `p` | 粘贴文件或目录 |
| `x` | 删除选中的文件或目录 |
| `r` | 重命名选中的文件或目录 |
<!--rehype:className=shortcuts-->
### 搜索与过滤
:- | :-
:- | :-
| `/` | 开始搜索模式 |
| `n` | 在搜索模式中跳到下一个匹配项 |
| `N` | 在搜索模式中跳到上一个匹配项 |
<!--rehype:className=shortcuts-->
### 视图操作
:- | :-
:- | :-
| `gg` | 跳到列表的顶部 |
| `G` | 跳到列表的底部 |
| `Ctrl+f` | 向下滚动一页 |
| `Ctrl+b` | 向上滚动一页 |
<!--rehype:className=shortcuts-->
## 自定义配置
### 自定义配置
通过编辑配置文件来自定义 `Yazi`,配置文件通常位于 `$HOME/.config/yazi/xxx.toml`,可修改默认设置如快捷键、主题等。
- `yazi.toml` - 常规配置
- `keymap.toml` - 快捷键绑定
- `theme.toml` - 主题配置
### 配置文件示例yazi.toml
<!--rehype:wrap-class=row-span-2-->
```toml
[general]
# 设置主界面主题为 dark 或 light
theme = "dark"
# 启动时的默认路径
default_path = "~"
# 是否启用自动保存配置
auto_save_config = true
[keybindings]
# 自定义快捷键绑定
quit = "q" # 退出
copy = "y" # 复制文件
paste = "p" # 粘贴文件
delete = "d" # 删除文件
[ui]
# 界面相关配置
preview_enabled = true # 是否启用文件预览
show_hidden_files = true # 显示隐藏文件
columns = 2 # 文件列表列数
[search]
# 搜索行为配置
case_sensitive = false # 搜索是否区分大小写
search_timeout = 30 # 搜索超时时间(秒)
[sorting]
# 排序规则配置
sort_by = "name" # 排序方式: name,size,date
reverse_sort = false # 是否反向排序
[plugins]
# 插件加载配置
enabled_plugins = ["git", "archive"]
```
### keymap.toml 配置示例
<!--rehype:wrap-class=row-span-2-->
```toml
# 全局快捷键配置
[global]
# 全局退出应用程序
quit = "Ctrl+Q"
# 打开文件或目录
open = "Enter"
# 返回上级目录
back = "Backspace"
# 搜索功能触发
search = "/"
# 复制路径
copy_path = "Ctrl+C"
# 窗口控制快捷键
[window]
# 切换窗口
switch_window = "Tab"
# 新建窗口
new_window = "Ctrl+N"
# 关闭窗口
close_window = "Ctrl+W"
# 文件操作快捷键
[file]
# 删除文件
delete_file = "D"
# 重命名文件
rename_file = "R"
# 复制文件
copy_file = "Y"
# 粘贴文件
paste_file = "P"
# 移动文件
move_file = "M"
# 文件选择快捷键
[selection]
# 全选
select_all = "Ctrl+A"
# 取消所有选择
deselect_all = "Ctrl+D"
# 反选
invert_selection = "Ctrl+I"
# 选择当前文件/目录
select_item = "Space"
# 页面导航快捷键
[navigation]
# 向上移动光标
move_up = "K"
# 向下移动光标
move_down = "J"
# 向左切换标签
move_left = "H"
# 向右切换标签
move_right = "L"
# 自定义命令触发键
[custom]
# 触发自定义功能
custom_action_1 = "Ctrl+1"
custom_action_2 = "Ctrl+2"
custom_action_3 = "Ctrl+3"
```
### theme.toml 配置示例
```toml
[general]
# 设置主界面配色方案
background_color = "#1e1e2e" # 背景颜色
foreground_color = "#cdd6f4" # 文本颜色
cursor_color = "#89dceb" # 光标颜色
selection_color = "#585b70" # 选中项背景颜色
highlight_color = "#fab387" # 高亮颜色
# 字体设置
font_family = "FiraCode" # 字体名称
font_size = 14 # 字体大小
[ui]
# 界面边框与间距
border_color = "#45475a" # 边框颜色
padding = 4 # 界面内容的内边距
[file_browser]
# 文件浏览器颜色配置
directory_color = "#89b4fa" # 目录名称颜色
file_color = "#cdd6f4" # 普通文件颜色
symlink_color = "#f5c2e7" # 符号链接颜色
hidden_file_color = "#6c7086" # 隐藏文件颜色
[status_bar]
# 状态栏颜色
background_color = "#313244" # 状态栏背景
foreground_color = "#a6adc8" # 状态栏文字
error_color = "#f38ba8" # 状态栏错误信息
[search]
# 搜索结果配色
match_color = "#a6e3a1" # 搜索结果的匹配高亮
current_match_color = "#fab387" # 当前匹配项的高亮
[progress_bar]
# 进度条的配色
filled_color = "#89dceb" # 已填充部分
empty_color = "#313244" # 未填充部分
```
另见
----
- [Yazi 官方文档](https://yazi-rs.github.io/) _(yazi-rs.github.io)_
- [Yazi Github](https://github.com/sxyazi/yazi) _(github.com)_

View File

@ -1,6 +1,6 @@
{
"name": "@wcj/reference",
"version": "1.46.0",
"version": "1.45.0",
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
"author": "jaywcjlove",
"license": "MIT",