
我正在嘗試編寫一個tabular
,其中第二列包含一些參考文獻(\cite{}
)。獲得的結果是每個單元格的唯一行,我想將參考放入 2 行,以便具有與其他行相當的長度。
我能怎麼做?
程式碼如下,圖片是我獲得的。
\documentclass[a4paper,twoside,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{caption,setspace}
\usepackage{quoting}
\usepackage[version=3]{mhchem}
\usepackage{booktabs, array}
\usepackage{tabularx}
\usepackage{tikz}
\usetikzlibrary{arrows}
\quotingsetup{font=small}
\captionsetup{font={small,stretch=1}}
\begin{document}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1cm}}
\newcolumntype{M}[1]{>{\small\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1cm}}
\begin{tabular}{C{1.7} M{2} C{2.5} C{2.2} C{1.6} C{2}}
\toprule
{\bf Type of crop} & {\bf Reference} & {\bf Location}\\
\midrule
{\bf Rice} & {\cite{Lugato:2013}} & {Northern Italy}\\
{\bf Maize} & {\cite{Uzoma:2011}} & {Tottori, Japan}\\
{\bf Maize} & {\cite{Oguntunde:2004}} &{Ejura, Ghana}\\
{\bf Soyabean} & {\cite{Tagoe:2008}} & {Gifu, Japan}\\
\bottomrule
\end {tabular}
\include{biblio}
\bibliographystyle{apalike}
\bibliography{Tesi}
\end{document}
答案1
我建議您不要m
在表中使用說明符。您喜歡這樣的佈局嗎?另請注意,您在表頭中指定了六列。
\documentclass[a4paper,twoside,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs, array, tabularx}
\usepackage{lmodern, natbib, ragged2e}
\begin{document}
\newcolumntype{P}[1]{>{\small\hspace{0pt}\RaggedRight}p{#1cm}}
\newcolumntype{B}[1]{>{\small\hspace{0pt}\RaggedRight\bfseries}p{#1cm}}
\newcolumntype{L}{>{\small\hspace{0pt}\RaggedRight}l}
\begin{tabular}{@{}B{1.7} P{2} L@{}}
\toprule
\mdseries Type of crop & Reference & Location \\ \midrule
Rice & \citet{Lugato:2013} & Northern Italy \\
Maize & \citet{Uzoma:2011} & Tottori, Japan \\
Maize & \citet{Oguntunde:2004} & Ejura, Ghana \\
Soyabean & \citet{Tagoe:2008} & Gifu, Japan \\
\bottomrule
\end{tabular}
\begin{thebibliography}{}
\bibitem[Lugato et al.(2013)]{Lugato:2013} Lugato et al.(2013).
\bibitem[Uzoma et al.(2011)]{Uzoma:2011} Uzoma et al.(2011).
\bibitem[Oguntunde et al.(2014)]{Oguntunde:2004} Oguntunde et
al. (2014).
\bibitem[Tagoe et al.(2008)]{Tagoe:2008} Tagoe et al.(2008).
\end{thebibliography}
\end{document}