下午好
我有一张表格(longtable
)。该表格有很多行,只有三列。第一列是标志(图片,jpg),其他列是一些文本。我的问题在于文本 - 文本不在单元格的中心,图片在下面,但文本向下。如何修复?
感谢帮助。
\documentclass[10pt,a6paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[main=english,slovak]{babel}
\usepackage[cm]{fullpage}
\usepackage[a6paper, top=10mm, left=10mm, right=10mm, bottom=10mm,foot=5mm,marginparsep=0mm,showframe]{geometry}
%showframe
\usepackage{tipa}
\usepackage{tabularx,booktabs}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{longtable}
\begin{document}
\catcode`\-=12
\sloppy
{\small
\begin{longtable}{l p{2cm}p{3cm}}
\toprule
\includegraphics[scale=0.1]{sk.png} &
Slovakia \textsl{[\textipa{sl@\textprimstress v\ae k.i.@}]} &
Bratislava\\
\toprule
\end{longtable}}
\end{document}
答案1
这是因为includegraphics
将图像放在基线上。Asimple\raisebox
将执行以下操作:
\documentclass[10pt,a6paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[main=english,slovak]{babel}
\usepackage[cm]{fullpage}
\usepackage[a6paper, top=10mm, left=10mm, right=10mm, bottom=10mm,foot=5mm,marginparsep=0mme]{geometry}
%showframe
\usepackage{tipa}
\usepackage{tabularx,booktabs}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage[table, svgnames]{xcolor} \usepackage{longtable}
\begin{document}
\catcode`\-=12
\sloppy
{\small\setlength\fboxsep{0pt}\setlength\fboxrule{0.2pt}
\begin{longtable}{l p{2cm}p{3cm}}
\toprule
\raisebox{-0.5\height}{\fbox{\includegraphics[scale=0.1]{sk.png}}} &
Slovakia \textsl{[\textipa{sl@\textprimstress v\ae k.i.@}]} &
Bratislava\\
\bottomrule
\end{longtable}}
\end{document}