我想在第二题的第一行加上XXX和YY,但不知道怎么做
\documentclass[a4paper,12pt]{article}
\usepackage{tabto}
\usepackage{newtxtext}
% Margins
\usepackage[
top=2.5cm,
bottom=2.5cm,
left=20mm,
right=20mm
]{geometry}
\usepackage{enumitem}
\begin{document}
\TabPositions{13cm, 15cm}
\begin{enumerate}
\item What is your name? \tab XXX \tab YY
\item What is your name? What is your name? What is your name? What is your name? What is your name? What is your name?
\tab XXX \tab YY
\end{enumerate}
\end{document}
答案1
您可以使用parbox
来获得所需的结果。以下是示例:
\documentclass[a4paper,12pt]{article}
\usepackage{newtxtext}
% Margins
\usepackage[
top=2.5cm,
bottom=2.5cm,
left=20mm,
right=20mm
]{geometry}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item \parbox[t]{125mm}{What is your name?}
\parbox[t]{20mm}{XXX}
\parbox[t]{20mm}{YY}
\item \parbox[t]{125mm}{What is your name? Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea
rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet.
}
\parbox[t]{20mm}{XXX}
\parbox[t]{20mm}{YY}
\end{enumerate}
输出如下所示:
根据您的需要/喜好调整间距。