在使用 LaTeX写论文或者画海报的时候,希望两张较小的表格可以并排,(一般情况的LaTeX插入两张图片是上下布局的)

查找了一下,相关的例子如下:

  1. \begin{minipage}{\textwidth}
  2. \begin{minipage}[t]{0.45\textwidth}
  3. \centering
  4. \makeatletter\def\@captype{table}\makeatother\caption{表格标题1}
  5. \begin{tabular}{cccc}
  6. 表格内容
  7. \end{tabular}
  8. \end{minipage}
  9. \begin{minipage}[t]{0.45\textwidth}
  10. \centering
  11. \makeatletter\def\@captype{table}\makeatother\caption{表格标题2}
  12. \begin{tabular}{cccc}
  13. 表格内容
  14. \end{tabular}
  15. \end{minipage}
  16. \end{minipage}

 

  1. \begin{minipage}{\textwidth}
  2. \begin{minipage}[t]{0.45\textwidth}
  3. \centering
  4. \makeatletter\def\@captype{table}\makeatother\caption{title1}
  5. \begin{tabular}{ccc}
  6. \hline
  7. n & L & $L+n$ \\ \hline
  8. 0 & 1 & 1 \\
  9. 1 & 3 & 4 \\
  10. 2 & 5 & 7 \\
  11. 3 & 7 & 10\\
  12. 4 & 9 & 13 \\
  13. 5 & 11 & 16 \\
  14. 6 & 13 & 19\\
  15. 7 & 15 & 22 \\
  16. 8 & 17 & 25 \\
  17. 9 & 19 & 28\\
  18. 10 & 21 & 31 \\
  19. 11 & 23 & 34\\
  20. 12 & 25 & 37 \\
  21. 13 & 27 & 40 \\
  22. 14 & 29 & 43 \\
  23. 15 & 31 & 46 \\
  24. 16 & 33 & 49 \\
  25. 17 & 35 & 52\\
  26. \hline
  27. \end{tabular}
  28. \end{minipage}
  29. \begin{minipage}[t]{0.45\textwidth}
  30. \centering
  31. \makeatletter\def\@captype{table}\makeatother\caption{title2}
  32. \begin{tabular}{ccc}
  33. \hline
  34. n & L & $L+n$ \\ \hline
  35. 0 & 1 & 1 \\
  36. 1 & 3 & 4 \\
  37. 2 & 5 & 7 \\
  38. 3 & 7 & 10\\
  39. 4 & 9 & 13 \\
  40. 5 & 11 & 16 \\
  41. 6 & 13 & 19\\
  42. 7 & 15 & 22 \\
  43. 8 & 17 & 25 \\
  44. 9 & 19 & 28\\
  45. 10 & 21 & 31 \\
  46. 11 & 23 & 34\\
  47. 12 & 25 & 37 \\
  48. 13 & 27 & 40 \\
  49. 14 & 29 & 43 \\
  50. 15 & 31 & 46 \\
  51. 16 & 33 & 49 \\
  52. 17 & 35 & 52\\
  53. \hline
  54. \end{tabular}
  55. \end{minipage}
  56. \end{minipage}

 

 

【Reference】

1、关于Latex并排两张表格的解决方案

 

版权声明:本文为shenxiaolin原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/shenxiaolin/p/10323731.html