我正在写一份关于 latex 的报告,遇到了一个问题。当我使用表格数组包中的“tblr”制作表格时,我发现我的表格本来应该适合当前页面,但却转到了下一页,而且有趣的是,它保持了第一页的大小。我该如何解决这个奇怪的问题?这是我希望表格开始的页面: 这是上述操作之后形成的页面。 显然,表格不适合整个页面,因此提前转到了下一页。此页面中的表格显然是为了适合上一页而生成的。为什么它会转到下一页?我该如何修复?
这是我正在使用的代码:
\documentclass{article}
\usepackage{graphicx}
\usepackage{url}
\usepackage{natbib}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[hidelinks]{hyperref} % Load hyperref last
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage[indent=0.75\parindent]{parskip}
\usepackage{tabularx}
\usepackage{tabularray}
\usepackage{changepage}
\usepackage{longtable}
\begin{document}
\section{Method}
\vspace{30mm}
\subsection{Data}
From Cambridge Dictionary, data is information, especially facts or numbers, collected to be examined and considered and used to help decision-making, or information in an electronic form that can be stored and used by a computer. There are two ways to collect data which are primary (direct) and secondary (indirect). Wagh. S (2022) stated that primary data is data generated by the researcher, such as surveys, interviews, and experimental research, which are specifically designed to help the researcher understand and in order to address the research source of the problem. Whereas secondary data is data which has already been managed to gather for another purpose (Allen. M, 2017). For instance, the data from World Bank, Government, journal, etc.
On this occasion, secondary data is a method that is used for collecting the data since this research needs to be valid and wide that can't be obtained by using direct methods that surely will consume plenty of time and cost. There are a lot of resources available but this research needs credibility and objectivity.
There are several benefit by using secondary data, which are
\begin{enumerate}
\item It is cost-effective. It saves both time and money.
\item It saves you time.
\item It aids in making primary data collection more specific because secondary data allows us to identify gaps and deficiencies, as well as what additional information needs to be collected.
\item It contributes to a better understanding of the problem.
\item It serves as a foundation for comparing the data gathered by the researcher.
\end{enumerate}
However, there is also disadvantages of using secondary data, which are
\begin{enumerate}
\item Secondary data rarely fits within the framework of marketing research factors.
\item The precision of secondary data is unknown.
\item Data may be out of date.
\end{enumerate}
In this case, to minimize time spending, secondary data is used as the resources since there are millions of lip products in Indonesia. \href{http://My-best.id}{My-best.id} website is a website that provides information about recommended products. With \href{http://My-best.id}{My-best.id}, people can easily find the best goods in some country without analyzing it one by one since it also provides a comparison table. However, to avoid irrelevant data, gaining some primary data from official websites is used to ensure that the data is credible and valid. Below is the table showing the population.
\begin{center}
\begin{adjustwidth}{-3cm}{}
\begin{tblr}[long, label={Table1}, caption={Population of Lip Products in Indonesia}]{colspec={l | c | c | c | c}, rowhead=1, hlines={}}
\textbf{Lip Product} & \textbf{Brand} & \textbf{Type of Lip Product} & \textbf{Shades} & \textbf{Price} \\
NIVEA LIP BALM SOOTHE \& PROTECT & Beiersdorf & Stick & 1 & 29000 \\
Extra lip tint & Bobbi Brown & Stick & 7 & 345000 \\
Perfect Matte Lip Coat & Dear Me Beauty & Liquid & 6 & 129000 \\
Creamytint & Emina & Liquid & 5 & 44000 \\
magic potion lip tint & Emina & Liquid & 6 & 46000 \\
Squeeze me up Lip Matte & Emina & Liquid & 4 & 53500 \\
Smoochies Lip balm & Emina & Solid & 2 & 30500 \\
Matte Lip Liquid & ESQA & Liquid & 7 & 165000 \\
Dear Darling Water gel tint & Etude House & Liquid & 10 & 35000 \\
Organic lip balm & Eucalie & Stick & 1 & 79000 \\
lip and cheek dual use liquid & Focallure & Liquid & 7 & 129045 \\
Melted Matte Lip & Goban Cosmetics & Liquid & 5 & 78000 \\
Sheen. Tinted lip balm + UV filter & HALE. & Stick & 3 & 98000 \\
Urban Lip Cream Matte & Implora & Liquid & 12 & 24000 \\
Beauty Lip \& Cheeck Crayon & Indoganic & Crayon & 3 & 129000 \\
Vivid oil tint & Innisfree & Liquid & 10 & 150000 \\
Metallic Lip Cream & Inul Beauty & Liquid & 4 & 89000 \\
Infalible Pro Matte Lip Liquid & L'oreal & Liquid & 4 & 150000 \\
Rouge Signature Liquid Matte Lipstick & L'oreal & Liquid & 10 & 150000 \\
Color Riche Matte & L'oreal & Stick & 45 & 75000 \\
Intense Matte Lip Cream & Liquid & Liquid & 12 & 110000 \\
Longlasting Matte Lip Cream Metalic & LT Pro & Liquid & 3 & 97500 \\
Ultra Light Lip Stain & Luxcrime & Liquid & 5 & 109000 \\
Airy lip mousse & Luxcrime & Liquid & 8 & 109000 \\
Dew tinted 6hr lip moisturizer & Mad for Makeup & Stick & 3 & 99000 \\
magnifique lip tint & Madame Gie & Liquid & 8 & 23000 \\
Brilliant Glaze Lip Liquide & Madame Gie & Liquid & 5 & 27000 \\
Moist Velvet \& Smooth Lip Liquide & Madame Gie & Liquid & 6 & 30000 \\
Hydrastay lip whip & Makeover & liquid & 12 & 105000 \\
Powestay Transfer Proof Matte Lip & Makeover & Liquid & 8 & 123000 \\
Sensational Liquid Matte & Maybelline & Liquid & 10 & 69000 \\
color sensational lip tint & Maybelline & Liquid & 5 & 119000 \\
Super Stay Matte Ink & Maybelline & Liquid & 44 & 125000 \\
Color sensational the powder & Maybelline mattes & stick & 24 & 55000 \\
Hydra Lip Cheek Tint & Mineral Botanica & Liquid & 4 & 51900 \\
the one A-Z lip balm SPF 25 & Oriflame & Stick & 2 & 139000 \\
Lip Cream & PIXY & Liquid & 16 & 53700 \\
2 in 1 color tint & Purbasari & Liquid & 3 & 38500 \\
Lip Cream Series & Raiku & Liquid & 13 & 118000 \\
SUEDED! Lip \& Cheek Cream & Rollover Reaction & Liquid & 12 & 129000 \\
Juicy Lip Balm & Rose All day & Stick & 4 & 139000 \\
Lip Color & Runa Beauty & Stick & 5 & 138000 \\
Lip Care & Sensatia Botanica & Liquid & 4 & 60000 \\
Coconut lip sleeping balm & Tiff Body & Liquid & 1 & 69000 \\
delight tony tint & Tony Moly & Liquid & 3 & 28000 \\
Exclusive Matte Lip Cream & Wardah & Liquid & 20 & 62000 \\
Colorfit Velvet Matte Lip Mousse & Wardah & Liquid & 14 & 73000 \\
Everyday Moisture Lip nutrition & Wardah & Stick & 2 & 27000 \\
Color Fit Ultralight Matte & Wardah & stick & 5 & 43000 \\
The Simplicity Love You tint & Y.O.U & Liquid & 6 & 45000 \\
\end{tblr}
\end{adjustwidth}
\end{center}
\subsection{Sampling}
Momoh. 0 (2021) stated that a population is a distinguishable group of people, whether that group is a nation or group of people who represent a characteristic. In this research the population is all the population data of popular lip products in Indonesia including several types. Whereas sampling is a technique for selecting individual members or a subset of the population in order to make statistical inferences and estimate population characteristics. From the population of 50 lip products, divided by five variables which are lip product, brand, type, shades and price. There are four methods of sampling which are random, stratified, systematic and cluster sampling. Stratified sampling method is used to determine the sample in this research by dividing the population into subgroups based on the brand. There are 35 data collections for samples.
The confidence interval is $95 \%$ with level of significance one-tailed test is 0.025 and level of significance two-tailed test is 0.05 . Below is the table showing the sample.
\begin{center}
\begin{adjustwidth}{-3cm}{}
\begin{tblr}[long, label={Table2}, caption={Sample of Lip Products in Indonesia}]{colspec={l | c | c | c | c}, rowhead=1, hlines={}}
\textbf{Lip Product} & \textbf{Brand} & \textbf{Type of Lip Product} & \textbf{Shades} & \textbf{Price} \\
NIVEA LIP BALM SOOTHE \& PROTECT & Beiersdorf & Stick & 1 & 29000 \\
Extra lip tint & Bobbi Brown & Stick & 7 & 345000 \\
Perfect Matte Lip Coat & Dear Me Beauty & Liquid & 6 & 129000 \\
Creamytint & Emina & Liquid & 5 & 44000 \\
Matte Lip Liquid & ESQA & Liquid & 7 & 165000 \\
Dear Darling Water gel tint & Etude House & Liquid & 10 & 35000 \\
Organic lip balm & Eucalie & Stick & 1 & 79000 \\
lip and cheek dual use liquid & Focallure & Liquid & 7 & 129045 \\
Melted Matte Lip Sheen & Goban & Liquid & 5 & 78000 \\
Tinted lip balm + UV filter & HALE. & Stick & 3 & 98000 \\
Urban Lip Cream Matte & Implora & Liquid & 12 & 24000 \\
Beauty Lip \& Cheeck Crayon & Indoganic & Crayon & 3 & 129000 \\
Vivid oil tint & Innisfree & Liquid & 10 & 150000 \\
Metallic Lip Cream & Inul Beauty & Liquid & 4 & 89000 \\
Infalible Pro Matte Lip Liquid & L'oreal & Liquid & 4 & 150000 \\
Intense Matte Lip Cream & Liquid & Liquid & 12 & 110000 \\
Longlasting Matte Lip Cream Metalic & LT Pro & Liquid & 3 & 97500 \\
Ultra Light Lip Stain & Luxcrime & Liquid & 5 & 109000 \\
Dew tinted 6hr lip moisturizer & Mad for & Stick & 3 & 99000 \\
magnifique lip tint & Madame Gie & Liquid & 8 & 23000 \\
Powestay Transfer Proof Matte & Makeover & Liquid & 8 & 123000 \\
Sensational Liquid Matte & Maybelline & Liquid & 10 & 69000 \\
Hydra Lip Cheek Tint & Mineral Botanica & Liquid & 4 & 51900 \\
The one A-Z lip balm SPF 25 & Oriflame & Stick & 2 & 139000 \\
Lip Cream & PIXY & Liquid & 16 & 53700 \\
2 in 1 color tint & Purbasari & Liquid & 3 & 38500 \\
Lip Cream Series & Raiku & Liquid & 13 & 118000 \\
SUEDED! Lip \& Cheek Cream & Rollover Reaction & Liquid & 12 & 129000 \\
Juicy Lip Balm & Rose All day & Stick & 4 & 139000 \\
Lip Color & Runa Beauty & Stick & 5 & 138000 \\
Lip Care & Sensatia Botanica & Liquid & 4 & 60000 \\
Coconut lip sleeping balm & Tiff Body & Liquid & 1 & 69000 \\
delight tony tint & Tony Moly & Liquid & 3 & 28000 \\
Exclusive Matte Lip Cream & Wardah & Liquid & 20 & 62000 \\
The Simplicity Love You tint & Y.O.U & Liquid & 6 & 45000 \\
\end{tblr}
\end{adjustwidth}
\end{center}
\end{document}
更新:: 我附上了完整的代码。更新:: 这是日志文件: 日志文件链接
答案1
好吧,通过评论我了解到问题主要是因为我的 texlive 是 2021 版而不是最新版本。但是,我偶然找到了一个解决方法。只需在表格前的 Sampling 段落后添加 \vspace{3pt}。不知为何表格会自动出现。