Forgot password?
 Create new account
View 2046|Reply 6

\倾斜brace

[Copy link]

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2017-12-17 16:03:37 |Read mode
上有 \overbrace 下有 \underbrace ,左右直接 \left\{ \right\} ,没想到竟然会有倾斜的需要。

问题来自:bbs.ctex.org/forum.php?mod=viewthread&tid=154759,要输出这样的公式:

问题.png

这么难搞的东西还是上 tikz 吧,测试代码:
  1. \documentclass{ctexart}
  2. \usepackage{amsmath}
  3. \usepackage{tikz}
  4. \usetikzlibrary{decorations.pathreplacing}
  5. \newcommand\tikzmark[2][0,0]{%
  6. \tikz[baseline,remember picture,overlay]
  7. \coordinate (#2) at (#1);}
  8. \begin{document}
  9. $k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个
  10. \[
  11. A_{km}(x)=2^{
  12. \tikzmark[0pt,4.5pt]{C1}
  13. 2^{2^{\cdot^{\cdot^{\cdot^{
  14. \tikzmark[2pt,4pt]{C2}
  15. 2^{x^{
  16. \tikzmark[0pt,3.5pt]{C3}
  17. 2^{2^{\cdot^{\cdot^{\cdot^{
  18. \tikzmark[2pt,4pt]{C4}
  19. 2}}}}}}}}}}}}},
  20. B_k(y)=4^{
  21. \tikzmark[0.5pt,4pt]{B1}
  22. 4^{4^{\cdot^{\cdot^{\cdot^{
  23. \tikzmark[2pt,4pt]{B2}
  24. 4^y}}}}}}.
  25. %
  26. \tikz[remember picture,overlay]
  27. {
  28. \draw[decorate,decoration=brace]
  29. (C1)--node[shift={(135:8pt)}]{$\scriptstyle k\text{个}$}(C2);
  30. \draw[decorate,decoration=brace]
  31. (C3)--node[shift={(135:8pt)}]{$\scriptstyle m\text{个}$}(C4);
  32. \draw[decorate,decoration=brace]
  33. (B1)--node[shift={(135:8pt)}]{$\scriptstyle k\text{个}$}(B2);
  34. }
  35. \]
  36. $k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个
  37. \end{document}
Copy the Code
注意:需要编译两次才会正确显示。
效果:
捕获.PNG

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2017-12-17 17:35:42
自定义命令这么强

462

Threads

969

Posts

9934

Credits

Credits
9934

Show all posts

青青子衿 Posted at 2019-7-7 12:45:13
回复 1# kuing
kk,有办法在分式边上弄个花括号吗?
kuing.cjhb.site/forum.php?mod=viewthread&tid=6293
7个7?

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

 Author| kuing Posted at 2019-7-7 13:52:22
回复 3# 青青子衿

照套 1# 的不就行了吗
  1. \documentclass{ctexart}
  2. \usepackage{amsmath}
  3. \usepackage{tikz}
  4. \usetikzlibrary{decorations.pathreplacing}
  5. \newcommand\tikzmark[2][0,0]{%
  6. \tikz[baseline,remember picture,overlay]
  7. \coordinate (#2) at (#1);}
  8. \begin{document}
  9. $k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$ 个$k$ 个$k$个$k$个$k$个
  10. \[
  11. \dfrac{7+\sqrt{77}}{7+7}\approx
  12. 1+\cfrac1{\tikzmark[-3pt,3pt]{x1}7
  13.    +\cfrac1{1
  14.     +\cfrac1{7
  15.      +\cfrac1{1
  16.       +\cfrac1{7
  17.        +\cfrac1{1
  18.         +\cfrac1{7
  19.          +\cfrac1{1
  20.           +\cfrac1{7
  21.            +\cfrac1{1
  22.             +\cfrac1{7
  23.              +\cfrac1{1
  24.               +\cfrac1{\tikzmark[-135:7pt]{x2}7}}}}}}}}}}}}}
  25. \tikz[remember picture,overlay]
  26. {
  27. \draw[decorate,decoration={brace,amplitude=10pt}]
  28. (x2)--node[shift={(-135:20pt)}]{$\scriptstyle7\text{个}7$}(x1);
  29. }
  30. \]
  31. $k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$个$k$ 个$k$ 个$k$个$k$个$k$个
  32. \end{document}
Copy the Code
QQ截图20190707135556.png

462

Threads

969

Posts

9934

Credits

Credits
9934

Show all posts

青青子衿 Posted at 2019-7-7 14:01:41
回复 4# kuing
kk太强了!
"7个7"能斜着写吗?kk

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

 Author| kuing Posted at 2019-7-7 14:29:00
回复 5# 青青子衿

将最后那个 node[shift={(-135:20pt)}] 改成 node[sloped,below=10pt] 就会变成:
QQ截图20190707142814.png

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

 Author| kuing Posted at 2022-8-8 17:15:08
知乎看到类似式子:zhihu.com/question/547389513 但不需要倾斜,不用 tikz 也行

手机版Mobile version|Leisure Math Forum

2025-4-20 22:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list