将表格和段落并排放置

将表格和段落并排放置

我想将表格和段落并排放置,如下所示: 在此处输入图片描述

挣扎了两天还是不知道怎么做,只能把它们如下所示一个接一个。有人能给我提示或纠正我的代码来实现它吗,非常感谢。这是我目前的代码和目前的结果:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage{geometry}
\usepackage{array, caption, floatrow, tabularx, makecell, booktabs}%
\captionsetup{labelfont = sc}
\setcellgapes{3pt}

\usepackage{array}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{tcolorbox}
\usepackage{tikz}
\usepackage{colortbl}

\def\boxit#1{%
  \smash{\color{red}\fboxrule=1pt\relax\fboxsep=2pt\relax%
  \llap{\rlap{\fbox{\vphantom{0}\makebox[#1]{}}}~}}\ignorespaces
}
\definecolor{Gray}{gray}{0.9}
\newcolumntype{g}{>{\columncolor{Gray}}c}

\newcommand{\addstuff}[2]{\tikz[remember picture]{
\node[inner sep=0pt](current content){#2};
#1
}}

\begin{document}

\begin{table}[ht!]
\addstuff{
\draw [<-] ([xshift=0.7cm]current content.north) -- ++(0,0.5) node [anchor=south] {};
\draw [<-] ([yshift=1.1cm]current content.south west) -- ++(-0.5,0) node [anchor=east] {};
}
{
\begin{tabular}{ c || c || c c g c c||}
 &  & $x_1$ & ... &$x_q$ & ... & $x_n$\\ 
\hline\hline
 1 & 1 & 1 & ...&1 & ...& 1\\
\hline\hline
 1 & 1 & 1 & ...&1 & ...& 1\\
... & ... & ... & ... & ... & ... &...\\\rowcolor{Gray} 
 1 & 1 & 1 & ...&\boxit{0.1in}1 & ...& 1\\
... & ... & ... & ... & ... & ... &...\\
 1 & 1 & 1 & ...&1 & ...& 1\\
\end{tabular}}
\caption{\label{tab:table-name}Your caption.}
\quad
\begin{flushleft}
    Analyze 1: This is the first statement
    \newline
    Analyze 2: This is second first statement
    \newline
    Analyze 3: This is third first statement
    \newline
    more
    \newline
    more
    \newline
    more
\end{flushleft}
\end{table}
\end{document} 

在此处输入图片描述

答案1

一种方法是在小页面中插入表格和文本:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage{geometry}
\usepackage{caption, floatrow}%
\captionsetup{labelfont = sc}

\usepackage{booktabs, makecell, multirow, tabularx}
\setcellgapes{3pt}
\usepackage[table]{xcolor}
\usepackage{tcolorbox}
\usepackage{tikz}

\def\boxit#1{%
  \smash{\color{red}\fboxrule=1pt\relax\fboxsep=2pt\relax%
  \llap{\rlap{\fbox{\vphantom{0}\makebox[#1]{}}}~}}\ignorespaces
}
\definecolor{Gray}{gray}{0.9}
\newcolumntype{g}{>{\columncolor{Gray}}c}

\newcommand{\addstuff}[2]{\tikz[remember picture]{
\node[inner sep=0pt](current content){#2};
#1
}}

\begin{document}
\begin{minipage}{0.48\linewidth}\centering
\addstuff{
\draw [<-] ([xshift=0.7cm]current content.north) -- ++(0,0.5) node [anchor=south] {};
\draw [<-] ([yshift=1.1cm]current content.south west) -- ++(-0.5,0) node [anchor=east] {};
        }
{
\begin{tabular}{ c || c || c c g c c||}
 &  & $x_1$ & ... &$x_q$ & ... & $x_n$\\
\hline\hline
 1 & 1 & 1 & ...&1 & ...& 1\\
\hline\hline
 1 & 1 & 1 & ...&1 & ...& 1\\
... & ... & ... & ... & ... & ... &...\\\rowcolor{Gray}
 1 & 1 & 1 & ...&\boxit{0.1in}1 & ...& 1\\
... & ... & ... & ... & ... & ... &...\\
 1 & 1 & 1 & ...&1 & ...& 1\\
\end{tabular}}
\captionof{table}{Your caption.}
\label{tab:table-name}
\end{minipage}
\hfill
\begin{minipage}{0.48\linewidth}\raggedright
    Analyze 1: This is the first statement
    \newline
    Analyze 2: This is second first statement
    \newline
    Analyze 3: This is third first statement
    \newline
    more
    \newline
    more
    \newline
    more
\end{minipage}

\end{document} 

在此处输入图片描述

相关内容