当前位置:网站首页>[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}%
边栏推荐
- Imperial cms7.5 imitation "D9 download station" software application download website source code
- There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection
- Stm32bug [stlink forced update prompt appears in keilmdk, but it cannot be updated]
- Global and Chinese market for travel wheelchairs 2022-2028: Research Report on technology, participants, trends, market size and share
- PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation
- 15. System limitations and options
- [development team follows] API specification
- JS object definition
- FRP intranet penetration
- Kiss number + close contact problem
猜你喜欢
![Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine](/img/3a/cf6285ae1c01bda42874eeca9fe5b1.jpg)
Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine

Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram

Tsinghua University product: penalty gradient norm improves generalization of deep learning model
![[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)](/img/e9/818bdfeae766dca7d2318b52b4424d.jpg)
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)

Li Chuang EDA learning notes IX: layers

I stepped on a foundation pit today

Redis transaction

Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to

7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages

3D game modeling is in full swing. Are you still confused about the future?
随机推荐
Sword finger offer 20 String representing numeric value
Network byte order
Global and Chinese market of handheld melanoma scanners 2022-2028: Research Report on technology, participants, trends, market size and share
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
LV1 previous life archives
基於.NetCore開發博客項目 StarBlog - (14) 實現主題切換功能
2006 translation
Record a problem that soft deletion fails due to warehouse level error
No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
Contest3145 - the 37th game of 2021 freshman individual training match_ E: Eat watermelon
ZABBIX API batch delete a template of the host
96% of the collected traffic is prevented by bubble mart of cloud hosting
The first spring of the new year | a full set of property management application templates are presented, and Bi construction is "out of the box"
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
Basé sur... Netcore Development blog Project Starblog - (14) Implementation of theme switching function
Learn these super practical Google browser skills, girls casually flirt
PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
Keep an IT training diary 054- opening and closing