我在對我正在編寫的清單中的項目進行文字換行時遇到一些困難。這是一張說明困難的圖片(請參閱清單倒數第二項):
您對如何解決這個問題有什麼建議嗎?首先要查看的可能是新指令 checklistAStart 的建立。
範例程式碼如下:
\documentclass[american]{article}
% set page size and page margin
\usepackage[a5paper, margin=1.5 mm]{geometry}
% tables
% set table width
\usepackage{tabularx}
% tabularx alignment
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
% multi-spanned columns and rows in tables
\usepackage{multirow}
% date
\usepackage{babel}
\usepackage[iso, inputamerican]{isodate}
% lists
% description itemized list format
\usepackage{enumitem}
% border around pages
\usepackage{pgf}
\usepackage{pgfpages}
\pgfpagesdeclarelayout{boxed}{
\edef\pgfpageoptionborder{0pt}
}{
\pgfpagesphysicalpageoptions{%
logical pages=1,%
}
\pgfpageslogicalpageoptions{1}{
border code=\pgfsetlinewidth{2pt}\pgfstroke,%
border shrink=\pgfpageoptionborder,%
resized width=.98\pgfphysicalwidth,%
resized height=.98\pgfphysicalheight,%
center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
}%
}
\pgfpagesuselayout{boxed}
\begin{document}
\isodate
% tab
\newcommand{\tab}{\hspace*{2em}}
% commands for description itemised lists
% commands for dimensions in description itemised lists
% left position of item
\newcommand{\leftMarginDistance}{8.5 cm}
% #?
\newcommand{\itemIndentDistance}{2 cm}
% vertical separation
\newcommand{\itemSeparationDistance}{-4 pt}
% leftmost position of item denoter
\newcommand{\labelIndentDistance}{0.2 cm}
% commands for starting and ending description itemised lists
\newcommand{
\checklistAStart
}
{
\begin{description}[
style=multiline,
itemsep=\itemSeparationDistance,
leftmargin=\leftMarginDistance,
itemindent=\itemIndentDistance,
labelindent=\labelIndentDistance,
font=\normalfont]
}
\newcommand{
\checklistAEnd
}
{
\end{description}
}
% commands for description itemised list items
\newcommand{\checklistAitem}[2]{\item[#1 \dotfill]#2}
\newcommand{\checklistAitemEmph}[2]{\item[\emph{#1}\dotfill]\emph{#2}}
\newcommand{\checklistAtitle}[1]{\item[#1]}
\newcommand{\checklistAsubitem}[2]{\item[\hspace{\labelIndentDistance}#1 \dotfill]#2}
% commands for titles
% command for main titles
\newcommand{\titleA}[1]{\noindent\large\textbf{#1}\normalsize\\}
% command for subtitles
\newcommand{\titleB}[1]{\noindent\textbf{#1}\normalsize}
% commands for headings
% command for main headings
\newcommand{\headingA}{
\begin{center}
\begin{tabularx}{145 mm}{|lR|}
\hline
&\\
NORMAL AND EMERGENCY PROCEDURES CHECKLIST & MODEL \today-1\\
FOR CESSNA 172S INCLUDING G1000 AVIONICS&\\
&\\
\hline
\end{tabularx}
\end{center}}
\headingA
% left position of item
\renewcommand{\leftMarginDistance}{6.5 cm}
\titleA{PRE-FLIGHT INSPECTION: INTERNAL}
\titleB{COCKPIT}
\checklistAStart
\checklistAitem{aircraft position}{check obstructions}
\checklistAitem{parking break}{set}
\checklistAitem{control wheel lock}{remove and stow}
\checklistAitem{ignition switch}{off, key removed}
\checklistAitem{avionics switch (BUS 1 and BUS 2)}{off}
\checklistAitem{static pressure alternate source value}{off}
\checklistAitem{fuel selector}{both}
\checklistAitem{fuel shutoff valve}{on (push fully in)}
\checklistAitem{elevator trim}{check, set neutral (check full movement up and down)}
\checklistAitem{master switch}{on}
\checklistAEnd
\end{document}
答案1
一種方法是使用 aparbox
表示文字的右側:
\newcommand{\checklistAitem}[2]{\item[#1 \dotfill]\parbox[t]{5.50cm}{#2\unskip\strut}}
產生:
筆記:
- 根據 Barbara Beeton 的建議,我
\unskip\strut
在\parbox
.