楼主: oliyiyi
1574 2

Tikz定理环境设计样例 [推广有奖]

版主

已卖:2997份资源

泰斗

1%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
7
论坛币
27300 个
通用积分
31674.3271
学术水平
1454 点
热心指数
1573 点
信用等级
1364 点
经验
384134 点
帖子
9629
精华
66
在线时间
5508 小时
注册时间
2007-5-21
最后登录
2025-7-8

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

楼主
oliyiyi 发表于 2015-12-18 22:15:52 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
之前分享了一个定理环境的设计,其代码也是由Tikz完成的,其具体内容见:这里,今天分享的内容,和之前的基本接近,只是其设计样式如下:

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

沙发
oliyiyi 发表于 2015-12-18 22:16:16
  1. \documentclass{book}
  2. \usepackage{tikz}
  3. \usepackage{xcolor}
  4. \usepackage{environ}
  5. \usepackage{amsmath,mathrsfs,amsfonts}
  6. \usepackage{xparse}

  7. \usetikzlibrary{shapes,decorations}
  8. \definecolor{bule}{RGB}{18,29,57}
  9. \definecolor{bablue}{RGB}{248,248,248}
  10. \definecolor{main}{RGB}{127,191,51}
  11. \definecolor{seco}{RGB}{0,145,215}
  12. \definecolor{thid}{RGB}{180,27,131}


  13. \newcommand{\newfancytheoremstyle}[5]{%
  14.   \tikzset{#1/.style={draw=#3, fill=#2,very thick,rectangle,
  15.       rounded corners, inner sep=10pt, inner ysep=20pt}}
  16.   \tikzset{#1title/.style={fill=#3, text=#2}}
  17.   \expandafter\def\csname #1headstyle\endcsname{#4}
  18.   \expandafter\def\csname #1bodystyle\endcsname{#5}
  19. }

  20. \newfancytheoremstyle{fancythrm}{blue!10}{seco}{\bfseries\sffamily}{\sffamily}

  21. \makeatletter
  22. \DeclareDocumentCommand{\newfancytheorem}{ O{\@empty} m m m O{fancythrm} }{%
  23.   % define the counter for the theorem
  24.   \ifx#1\@empty
  25.     \newcounter{#2}
  26.   \else
  27.     \newcounter{#2}[#1]
  28.     \numberwithin{#2}{#1}
  29.   \fi
  30.   %% define the "newthem" environment
  31.   \NewEnviron{#2}[1][{}]{%
  32.     \noindent\centering
  33.     \begin{tikzpicture}
  34.       \node[#5] (box){
  35.         \begin{minipage}{0.93\columnwidth}
  36.           \csname #5bodystyle\endcsname \BODY~##1
  37.         \end{minipage}};
  38.       \node[#5title, right=10pt] at (box.north west){
  39.         {\csname #5headstyle\endcsname #3 \stepcounter{#2}\csname the#2\endcsname\; ##1}};
  40.       \node[#5title, rounded corners] at (box.east) {#4};
  41.     \end{tikzpicture}
  42.   }[\par\vspace{.5\baselineskip}]
  43. }
  44. \makeatother

  45. % Define new styles
  46. % \newfancytheoremstyle{<name>}{inner color}{outer color}{head style}{body style}
  47. \newfancytheoremstyle{fancydef}{green!10}{green}{\itshape\sffamily}{\sffamily}

  48. % Define some new environments
  49. % \newfancytheorem[<number within>]{<name>}{<head>}{<symbol>}[<style>]
  50. \newfancytheorem[chapter]{newthem}{Theorem}{$\clubsuit$}
  51. \newfancytheorem[section]{newcor}{Corollary}{$\heartsuit$}

  52. \newfancytheorem{newdef}{Definition}{$\spadesuit$}[fancydef]

  53. \begin{document}

  54. \begin{newthem}
  55.     test
  56. \end{newthem}

  57. \begin{newcor}
  58.   test
  59. \end{newcor}

  60. \begin{newdef}
  61.   test
  62. \end{newdef}

  63. \end{document}
复制代码

藤椅
夏目贵志 发表于 2015-12-30 23:31:05
之前我做了一个beamer模板,设计了很多漂亮的按钮什么的。结果一旦开始写内容了,什么按钮什么的,都懒得用。最后几百页的课件就用了一两次按钮||||||

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-27 13:03