简介
最近因为要做一个时间表, 于是查找了一下LaTeX的模板, 找到了下面这个比较合适的模板. 最终可以生成如下样式的时间表, 其中时间间隔之类的都是可以自己设置的.
仓库链接: Timetable-Github
具体代码
下面看一下具体的代码, 因为这一份模板的详细说明打不开了(年代久远), 我就直接把说明写在注释里面.
可以修改的地方有:
- timetable的名称
- 每个框的大小
- \setslotsize{2.8cm}{0.8cm}
- 一周多少天, 一天多少小时
- \setslotcount {7} {14} % <days> <hours per day>(每天工作的时间)
- 标题的高度
- \settopheight{2}
- 定义事件的类型
- \defineevent{lunch} {0.0}{0.28}{1.0} {1.0}{1.0}{1.0} %(定义事件的类型, {block rgb}, {text rgb})
- 设置每天开始事件, 时间间隔, 结束时间
- \hours{08}{60}{22} % <start hour> <minute stepping> <print end time?>
- 最后就是设置每天的事件
- \event week {start time} {end time} {name} {teacher name} {classroom} {type}
- \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture}
下面是完整的例子, 所有注释都已经标在上面了.
- \documentclass[a4paper,10pt]{report}
- \usepackage[UTF8]{ctex}
- % Definitions
- \usepackage{lscape}
- \usepackage[height=25cm]{geometry}
- \usepackage{timetable}
- \begin{document}
- \thispagestyle{empty}
- \begin{landscape}
- % 标题
- \noindent\printheading{Time table $0^\mathsf{th}$ Semester}
- % Define the layout of your time tables
- \setslotsize{2.8cm}{0.8cm} % Arguments: <width> <height>
- \setslotcount {7} {14} % <days> <hours per day>(每天工作的时间)
- \settopheight{2} % 标题的高度
- \settextframe{0.8mm}
- % Retro
- %\setframetype[t]{1}
- %\seteventcornerradius{0pt}
- % Print timestamps into event blocks
- %\setprinttimestamps{2}
- % Define event types (定义事件的类型, {block rgb}, {text rgb})
- \defineevent{lunch} {0.0}{0.28}{1.0} {1.0}{1.0}{1.0}
- \defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
- \defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
- \defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0}
- \defineevent{work} {0.21}{0.5}{0.16} {1.0}{1.0}{1.0}
- \defineevent{corelecture} {0.118}{0.565}{1.0} {1.0}{1.0}{1.0}
- % Start the time table
- \begin{timetable}
- % 设置每天开始事件, 结束时间, 时间间隔
- \hours{08}{60}{22} % <start hour> <minute stepping> <print end time?>
- \englishdays{1} % 每周开始的时间
- % \event week {start time} {end time} {name} {teacher name} {classroom} {type}
- \event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture}
- \event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work}
- \event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture}
- \event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture}
- \event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny 1} HaDePra} {work}
- \event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny 3} 002} {corelecture}
- \event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny 1} 3.06} {seminar}
- \event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny 3} 003} {corelecture}
- \event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny 3} SR014} {work}
- \event 5 {1000} {1300} {Bremser Meeting} {SysArch United} {E1{\tiny 3}} {work}
- \event 5 {1500} {1800} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture}
- \event 6 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture}
- \event 7 {2000} {2200} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny 3} 001} {corelecture}
- \end{timetable}
- \end{landscape}
- \end{document}
最终生成的效果就是最上面的那张图片.
- 微信公众号
- 关注微信公众号
- QQ群
- 我们的QQ群号
评论