Math & Science ⇒ create a chart
create a chart
i have to create a chart in latex and hope that you can help me.
the chart has to look like: how can i realise that?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
create a chart
The way I would do it would be to imagine that every square on the paper in your example represents a column or row then only put in lines when appropriate.
You will need to use \multicolumn and \cline commands. I'm busy at the moment so have only done a small example to get you started. If you don't understand anything please ask.
Code: Select all
\documentclass{article}
\usepackage{slashbox,multirow}
\begin{document}
\begin{tabular}{|ccc|}
\hline
\multicolumn{1}{|c|}{A}&&\\
\cline{1-1}
&$x_{12}$&\\
&&\\
\hline
\multicolumn{3}{|c|}{\multirow{3}{*}{\backslashbox{20}{20}}}\\ && \\ &&\\
\hline
\end{tabular}
\end{document}
http://www.tex.ac.uk/tex-archive/macros ... /slashbox/
create a chart
thank you for the quick answer.
i have no problems to add new boxes in one way. But how can i add new splits?
My code looks now like that:
Code: Select all
\documentclass{article}
\usepackage{slashbox,multirow}
\begin{document}
\begin{tabular}{|ccc|}
\hline
\multicolumn{1}{|c}{}&&\\
&$B_1$&\\
&&\\
\hline
\hline
\multicolumn{1}{|c|}{2}&&\\
\cline{1-1}
&$x_{11}$&\\
&&\\
\hline
\multicolumn{1}{|c|}{2}&&\\
\cline{1-1}
&$x_{21}$&\\
&&\\
\hline
\multicolumn{1}{|c|}{1}&&\\
\cline{1-1}
&$x_{31}$&\\
&&\\
\hline
\multicolumn{1}{|c}{}&&\\
&$10$&\\
&&\\
\hline
\end{tabular}
\end{document}
create a chart
Code: Select all
\begin{tabular}{|ccc|ccc|ccc|}
Code: Select all
\begin{tabular}{cc|cc|cc|ccc}
&&\multicolumn{2}{|c|}{B{\tiny 1}}&\multicolumn{2}{|c|}{B{\tiny 2}}&\multicolumn{3}{|c}{a{\tiny i}}\\
\hline
\multicolumn{2}{c|}{\multirow{2}{*}{A{\tiny 1}}}&\multicolumn{1}{|c|}{1}&$x_{11}$&\multicolumn{1}{|c|}{2}&$x_{12}$&\multicolumn{3}{c}{\multirow{2}{*}{ 10 }}\\
\cline{3-3}\cline{5-5}
&&&&&&\\
\hline
\multicolumn{2}{c|}{\multirow{2}{*}{A{\tiny 2}}}&\multicolumn{1}{|c|}{3}&$x_{21}$&\multicolumn{1}{|c|}{4}&$x_{22}$&\multicolumn{3}{c}{\multirow{2}{*}{ 10 }}\\
\cline{3-3}\cline{5-5}
&&&&&&\\
\hline
\multicolumn{2}{c|}{\multirow{2}{*}{b{\tiny i}}}&\multicolumn{2}{c|}{\multirow{2}{*}{10}}&\multicolumn{2}{c|}{\multirow{2}{*}{10}}&\multicolumn{3}{c}{\multirow{2}{*}{\backslashbox{20}{20}}}\\
&&&&&\\
\end{tabular}
Code: Select all
\hline
\multicolumn{1}{|c|}{2}&$x_{11}$&\\
\cline{1-1}
&&\\
&&\\
\hline
Re: create a chart
