当前位置:网站首页>[latex] production of complex tables: excel2latex and detail adjustment
[latex] production of complex tables: excel2latex and detail adjustment
2022-07-04 02:56:00 【Mr.zwX】
Just started to use LaTeX Write a paper , The first hurdle encountered is drawing tables , Smaller ordinary tables can be implemented with simple syntax , But the large and complex forms make me unable to start .
Excel2LaTeX plug-in unit
Here is a very handy tool I use :Excel2LaTeX plug-in unit
, Download address : Portal
Once you download it , stay excel It shows that add-in
, And will Excel2LaTeX.xla
File import to add-in
in , Restart excel You can see the following options :
stay Excel Draw tables and generate LaTeX Code
Now you can start in excel Draw the desired table form , Here's an example ( Multiple data sets 、 Multiple models 、 Multiple indicators 、 Contains a thick border 、 Bold font 、 Double border, etc ):
then , Using mouse Select generate LaTeX Table area of code , Click on the top left Convert Tabel to LaTeX
. Usually I'm used to checking Booktabs package
This option , Then copy .
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{
table}[htbp]
\centering
\caption{
Add caption}
\begin{
tabular}{
c|lrrrrrrrrr}
\toprule
\multicolumn{
2}{
c}{
\multirow{
2}[4]{
*}{
\textbf{
Method}}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 1}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 2}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 3}} \\
\cmidrule{
3-11} \multicolumn{
2}{
c}{
} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} \\
\midrule
\multirow{
2}[2]{
*}{
Non-Graph} & MLP & & & & & & & & & \\
& SVR & & & & & & & & & \\
\midrule
\multirow{
5}[2]{
*}{
Graph} & GCN & & & & & & & & & \\
& GAT & & & & & & & & & \\
& RGCN & & & & & & & & & \\
& GIN & & & & & & & & & \\
& ChebNet & & & & & & & & & \\
\midrule
\midrule
\textbf{
Proposed} & \textbf{
ABC} & & & & & & & & & \\
\bottomrule
\end{
tabular}%
\label{
tab:addlabel}%
\end{
table}%
Paste the code into LaTeX In the words of , Pay attention to adding macro package :\usepackage{Booktabs}, Otherwise it will compile incorrectly ! meanwhile , I used a multi row table , So you need to add \usepackage{multirow}.
Now the effect is as follows , The whole picture of the table has been outlined :
Modify and adjust the table format
Adjust the distance from the table title to the table
stay \centering Add... Below \setlength The order of :
\begin{
table}[htbp]
\centering
\setlength{
\abovecaptionskip}{
2pt}%
\setlength{
\belowcaptionskip}{
10pt}%
\caption{
It is a table.}
The effect is as follows :
The vertical line of the table is changed from discontinuous to continuous
What we need to know is ,hline bottomrule toprule
Separate the table horizontally , Use in table code bottomrule and toprule Will cause vertical line discontinuity . The solution is : take Except for the top and bottom bottomrule and toprule, All changed to hline. Why don't the top and bottom ones be changed to hline? The reason is that , I need to keep the top and bottom borders bold ! and hline It's a thin line .
If you finally find , The top and bottom of the vertical line are still not closely intersected with the border , then Put the top code \toprule Change it to \bottomrule, Put the code at the bottom \bottomrule Change it to \toprule.
The effect is as follows :
Will three Dataset The horizontal line below separates
In the generated LaTeX In the code ,Dataset The horizontal line code below is as follows :
\cmidrule{
3-11}
This is obviously a complete horizontal line , Now let's introduce how to divide it into three paragraphs .
Change the above code to :
\cmidrule(r){
3-5} \cmidrule(r){
6-8} \cmidrule{
9-11}
A complete horizontal line can be divided into three sections , The effect is as follows :
Text wrapping inside table cells
If the text inside the table is too long , How to manually wrap lines ?LaTeX There is no way to pass directly Enter or \\
The symbol realizes the line break of the text inside the table cell . My method is as follows :
First , Add new commands at the beginning of the article :\newcommand{\tabincell}[2]{\begin{tabular}{@{}#[email protected]{}}#2\end{tabular}}
Then I can wrap in the cell where I want to wrap , For example, I want you to Tabular Learning Methods
from Learning Wrap after , It can be modified as follows :\tabincell{c}{Tabular Learning\\Methods}
, The effect is as follows :
The final table effect
The complete code is as follows :
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{
table}[htbp]
\centering
\setlength{
\abovecaptionskip}{
2pt}%
\setlength{
\belowcaptionskip}{
10pt}%
\caption{
It is a table.}
\begin{
tabular}{
c|lrrrrrrrrr}
\bottomrule %\toprule
\multicolumn{
2}{
c}{
\multirow{
2}[4]{
*}{
\textbf{
Method}}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 1}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 2}} & \multicolumn{
3}{
c}{
\textbf{
Dataset 3}} \\
\cmidrule(r){
3-5} \cmidrule(r){
6-8} \cmidrule{
9-11} \multicolumn{
2}{
c}{
} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} & \multicolumn{
1}{
c}{
RMSE} & \multicolumn{
1}{
c}{
MAE} & \multicolumn{
1}{
c}{
ACC} \\
\hline
\multirow{
2}[2]{
*}{
Non-Graph} & MLP & & & & & & & & & \\
& SVR & & & & & & & & & \\
\hline
\multirow{
5}[2]{
*}{
Graph} & GCN & & & & & & & & & \\
& GAT & & & & & & & & & \\
& RGCN & & & & & & & & & \\
& GIN & & & & & & & & & \\
& ChebNet & & & & & & & & & \\
\hline
\hline
\textbf{
Proposed} & \textbf{
ABC} & & & & & & & & & \\
\toprule %\bottomrule
\end{
tabular}%
\label{
tab:addlabel}%
\end{
table}%
边栏推荐
- (column 23) typical C language problem: find the minimum common multiple and maximum common divisor of two numbers. (two solutions)
- 17. File i/o buffer
- Global and Chinese market for travel wheelchairs 2022-2028: Research Report on technology, participants, trends, market size and share
- Summarize the past to motivate yourself to move on
- VRRP+BFD
- Unspeakable Prometheus monitoring practice
- MySQL advanced (Advanced) SQL statement (I)
- CSCI 2134
- Global and Chinese market of digital impression system 2022-2028: Research Report on technology, participants, trends, market size and share
- Dare to climb here, you're not far from prison, reptile reverse actual combat case
猜你喜欢
MySQL advanced (Advanced) SQL statement (I)
false sharing
The "message withdrawal" of a push message push, one click traceless message withdrawal makes the operation no longer difficult
[software implementation series] software implementation interview questions with SQL joint query diagram
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
Backpropagation formula derivation [Li Hongyi deep learning version]
Ai aide à la recherche de plagiat dans le design artistique! L'équipe du professeur Liu Fang a été embauchée par ACM mm, une conférence multimédia de haut niveau.
WP collection plug-in free WordPress collection hang up plug-in
Take you to master the formatter of visual studio code
Code Execution Vulnerability - no alphanumeric rce create_ function()
随机推荐
1day vulnerability pushback skills practice (3)
Gee import SHP data - crop image
The difference between int (1) and int (10)
The "message withdrawal" of a push message push, one click traceless message withdrawal makes the operation no longer difficult
Unspeakable Prometheus monitoring practice
[Yugong series] February 2022 attack and defense world advanced question misc-84 (MySQL)
[development team follows] API specification
MySQL workbench use
Remember another interview trip to Ali, which ends on three sides
Amélioration de l'efficacité de la requête 10 fois! 3 solutions d'optimisation pour résoudre le problème de pagination profonde MySQL
Take you to master the formatter of visual studio code
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
C # learning notes: structure of CS documents
I stepped on a foundation pit today
The difference between MCU serial communication and parallel communication and the understanding of UART
[software implementation series] software implementation interview questions with SQL joint query diagram
CSCI 2134
Network byte order
LV1 previous life archives
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress