TransWikia.com

How to create a schedule in beamer

TeX - LaTeX Asked on April 3, 2021

I need to create this schedule in beamer, but I have no idea, because I am learning to use it

enter image description here

One Answer

The luaprogtable that I wrote is intended to deal with large and complicated table like this. Here is an example of using the package to reduce workload (LuaLaTeX needed!):

enter image description here

documentclass{article}
usepackage[T1]{fontenc}
usepackage[landscape]{geometry}
usepackage{array}
usepackage{multirow}
usepackage{colortbl}
usepackage{xcolor}
% the package is new, so it is unlikely to be included
% in your TeX distribution. You can download it form
% https://github.com/xziyue/luaprogtable
usepackage{luaprogtable}
usepackage{expl3}

begin{document}

% create a table with 24 columns
LPTNewTable{schedule}{24}{|*{24}{c|}}[
    default after line=hline,
    nrows=16
]
% set current table
LPTSetCurrentTable{schedule}
% add horizontal line before first line
LPTSetRowProp{1}{before line=hline}

LPTSetCell{1, 1}[3,1]{multirow{3}{*}{No.}}
LPTSetRowProp{1}{after line=cline{2-24}}
LPTSetCell{1,2}[1,23]{multicolumn{23}{c|}{Title}}
LPTSetCell{2,2}[2,1]{multirow{2}{*}{Activities}}
LPTSetRowProp{2}{after line=cline{3-24}}
begin{lptview}{2,3:}
{multicolumn{4}{c|}{August}}[-4]
{multicolumn{5}{c|}{September}}[-5]
{multicolumn{4}{c|}{October}}[-4]
{multicolumn{4}{c|}{November}}[-4]
{multicolumn{5}{c|}{December}}[-5]
end{lptview}

% latex3 code to fill the table quickly
ExplSyntaxOn
% list the "activities"
clist_set:Nn l_tmpa_clist {lorem,ipsum,dolor,sit,amet,consectetuer,adipiscing,elit,aenean,commodo,ligula,eget,dolor}
% start filling the table
int_step_inline:nn {clist_count:N l_tmpa_clist} {
    % set number indices
    exp_args:Nxx LPTSetCell {int_eval:n {3+#1}, 1} {#1}
    % set activities
    exp_args:Nxx LPTSetCell {int_eval:n {3+#1}, 2} {clist_item:Nn l_tmpa_clist {#1}}
}

% fill the numbers
tl_set:Nn l_tmpa_tl {1234123451234123412345}
int_step_inline:nn {tl_count:N l_tmpa_tl} {
    exp_args:Nxx LPTSetCell {3,int_eval:n {2+#1}} {tl_item:Nn l_tmpa_tl {#1}}
}

% now, declare a command to change cell color
newcommand{togglecell}[2]{
    exp_args:Nxx LPTSetCell {int_eval:n {3+#1},int_eval:n {2+#2}} {exp_not:n{cellcolor{blue!50}}}
}
ExplSyntaxOff

togglecell{1}{1}
togglecell{5}{12}

% use the table
LPTUseTable
end{document}

Of course, if you are not interested in the package, you can refer to the LaTeX source generated by the code above (if you feel comfortable editing something like this)

begin{tabular}{|*{24}{c|}}
hline 
multirow {3}{*}{No.} & multicolumn {23}{c|}{Title} cline {2-24}
 & multirow {2}{*}{Activities} & multicolumn{4}{c|}{August} & multicolumn{5}{c|}{September} & multicolumn{4}{c|}{October} & multicolumn{4}{c|}{November} & multicolumn{5}{c|}{December} cline {3-24}
 &  & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 5 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 5 hline 
1 & lorem & cellcolor {blue!50} &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
2 & ipsum &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
3 & dolor &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
4 & sit &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
5 & amet &  &  &  &  &  &  &  &  &  &  &  & cellcolor {blue!50} &  &  &  &  &  &  &  &  &  &  hline 
6 & consectetuer &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
7 & adipiscing &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
8 & elit &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
9 & aenean &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
10 & commodo &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
11 & ligula &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
12 & eget &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
13 & dolor &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  hline 
end{tabular}

Answered by Alan Xiang on April 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP