![在表格中插入图片 - Latex Overleaf](https://linux22.com/image/449883/%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%AD%E6%8F%92%E5%85%A5%E5%9B%BE%E7%89%87%20-%20Latex%20Overleaf.png)
我想要一个有两列两行的表格,其中一列我想放一张图片,第二列我想放一个段落
这是我目前的代码:
\begin{tabular}{ | m{5cm}| m{30em}| }
\hline
{laravel.png} & Laravel is a free open-source PHP web application framework with expressive, elegant syntax. Was released by Taylor Otwell and follows the model–view–controller (MVC) architectural pattern and is based on Symfony. This framework attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:
\newline Powerful dependency injection container.
\newline Simple, fast routing engine.
… etc
\\
\hline
\end{tabular}
我希望它是这样的:
答案1
欢迎来到 TeX.SE!
编辑:
两个例子。都使用graphicx
、enumitem
和etoolbox
包作为表体:
- 带环境的表
tabularx
:
\documentclass{article}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{table}{%
\setlist[itemize]{nosep,
leftmargin=*,
label=\textbullet,
before={\begin{minipage}[t]{\hsize}},
after ={\end{minipage}}
}
}% end of \AtBeginEnvironment
\usepackage{tabularx}
\begin{document}
\begin{table}[ht]
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{tabularx}{\textwidth}{|m{44mm}|X|}
\hline
Lavarell Framework 8.83.9
& Description \\
\hline
\includegraphics[width=\linewidth]{example-image-duck}
& Laravel is a free open-source PHP web application framework with expressive, elegant syntax. Was released by Taylor Otwell and follows the model–view–controller (MVC) architectural pattern and is based on Symfony. This framework attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:
\begin{itemize}
\item Powerful dependency injection container.
\item Simple, fast routing engine.
\item etc
\end{itemize} \\
\hline
\end{tabularx}
\end{table}
\end{document}
tblr
包中定义的环境表tabularray
:
\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{table}{%
\setlist[itemize]{nosep,
leftmargin=*,
label=\textbullet,
before={\begin{minipage}[t]{\hsize}},
after ={\end{minipage}}
}
}% end of \AtBeginEnvironment
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\begin{document}
\begin{table}[ht]
\begin{tblr}{hlines, vlines,
colspec = {Q[l, wd=44mm] X[m] },
row{1} = {font=\small\bfseries},
measure = vbox
}
Lavarell Framework 8.83.9
& Description \\
\includegraphics[width=\linewidth, valign=m]{example-image-duck}
& Laravel is a free open-source PHP web application framework with expressive, elegant syntax. Was released by Taylor Otwell and follows the model–view–controller (MVC) architectural pattern and is based on Symphony. This framework attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:
\begin{itemize}
\item Powerful dependency injection container.
\item Simple, fast routing engine.
\item etc
\end{itemize} \\
\end{tblr}
\end{table}
\end{document}
编辑(2):
最新的 LaTeX 已经在内核中实现了包提供的大部分定义etoolbox
,因此使用时\AtBeginEnvironment
不再需要加载它。