2

I am new to latex and I'm quite unable to figure out how to achieve this:

figure

So far I have done this:

\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,ragged2e,booktabs,caption}
\begin{document}
    \begin{table}[ht]
        \caption {Dataframe} \label{tab:title} 
        \centering
        \begin{tabular}{rllll}
        \hline
        & a & b & c & d \\ 
        \hline
        1 & $a_1$ & $b_1$ & $c_1$ & $d_1$ \\ 
        2 & $a_2$ & $b_2$ & $c_2$ & $d_2$ \\ 
        3 & $a_3$ & $b_3$ & $c_3$ & $d_3$ \\ 
        4 & . & . & . & . \\ 
        5 & . & . & . & . \\ 
        6 & $a_n$ & $b_n$ & $c_n$ & $d_n$ \\ 
        \hline
    \end{tabular}
\end{table}
\end{document}
6

for me the simplest way is drawing this table as tikz picture:

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{matrix, positioning}

\begin{document}
    \begin{tikzpicture}[node distance=3mm and 0mm]
\matrix (m) [matrix of math nodes]
{
      & A   & B   & C   & D     \\
    0 & a_0 & b_0 & c_0 & d     \\
%
    1 & a_1 & b_1 & c_1 & d_1   \\
    2 & a_2 & b_2 & c_2 & d_2   \\
    3 & a_3 & b_3 & c_3 & d_3   \\
    4 & .   & .   & .   & .     \\
    5 & .   & .   & .   & .     \\
    6 & a_n & b_n & c_n & d_n   \\
};
\draw[densely dashed,blue]  (m-2-3.north west) -| (m-8-3.south east) -| cycle;
\draw[densely dashed,blue]  (m-3-2.north west) -| (m-5-5.south east) -| cycle;
% right part
\draw[->] (m-4-5) -- ++ (1.5,0) node (n1) [right] {xxxxx/yyyyy};
\matrix (n2) [matrix of math nodes,
              below=of n1]
{
    1 & A_1 & B_1 & C_1 & D_1   \\
    2 & A_2 & B_2 & C_2 & D_2   \\
    3 & A_3 & B_3 & C_3 & D_3   \\
};
\draw[->] (n1) -- (n2);
% bottom part
\draw[<-] (m-8-1.south) -- ++ (0,-0.8) node[below] {index};
%
\draw[<-] (m-8-3.south) |- ++ (1,-1) node (n3) [right] {xxx/yyy};
\matrix (n4) [matrix of math nodes,
              below=of n3]
{
    0 & b_0 \\
%
    1 & b_1 \\
    2 & b_2 \\
    3 & b_3 \\
    4 & .   \\
    5 & .   \\
    6 & b_n \\
};
\draw[->] (n4) -- (n3);
\end{tikzpicture}
\end{document}

hopefully from above mwe to form as you like to have in your document is not very high step ... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.