排序后的条目的悬挂缩进(见这里) 似乎是无法改变的,我尝试在各处放置\hangindent
's 和's,但似乎没有什么能够改变看起来像半英寸的悬挂缩进,这太大了。\hangafter
我最初认为也许multicol
是包的问题,但即使禁用它,缩进仍然是一样的。
我最好使用 12pt 左右的悬挂缩进来节省空间,因为我不需要单独的条目脱颖而出那很多。
梅威瑟:
\documentclass[11pt,twoside]{article}
\usepackage[paperheight=9in,paperwidth=6in,bottom=1in]{geometry}
\usepackage{multicol}
\usepackage{fontspec,xunicode}
\usepackage{fancyhdr}
\usepackage{datatool}
%Command Setups
\newcommand{\wn}[5]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize n.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{\textit{pl.\hspace{2pt}#4 }}%
\DTLnewdbentry{list}{extra}{#5}%
}
\newcommand{\wv}[4]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize v.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{}%
\DTLnewdbentry{list}{extra}{#4}%
}
\newcommand{\wa}[4]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize adj.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{}%
\DTLnewdbentry{list}{extra}{#4}%
}
%Enviroment Setup
\newenvironment{sortedlist}%
{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}%
}%
{%
\DTLsort{label}{list}%
\begin{description}%
\DTLforeach*{list}{\theLabel=label,\theDesc=description,\theIp=ipa,\thePl=plural,\theEx=extra}{%
\markboth{\theLabel}{\theLabel}%
\item[\theLabel] \theDesc \theIp \thePl \theEx
}%
\end{description}%
}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,LO]{\textsc{\rightmark}}
\fancyhead[CO,CE]{\thepage}
\fancyhead[RE,RO]{\textsc{\leftmark}}
\begin{multicols}{2}\hangindent=1pt\setlength{\columnseprule}{.5pt}
\raggedright
\begin{sortedlist}
\wn{Lorem}{ipsum}{dolor}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\wa{Lorem}{ipsum}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\wv{Lorem}{ipsum}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\end{sortedlist}
\end{multicols}
\end{document}
答案1
由于您正在使用description
环境,因此最好加载enumitem
包并进行调整leftmargin
:
\begin{description}[leftmargin=3em]
在 的定义中sortedlist
。
\newenvironment{sortedlist}%
{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}%
}%
{%
\DTLsort{label}{list}%
\begin{description}[leftmargin=3em]%
\DTLforeach*{list}{\theLabel=label,\theDesc=description,\theIp=ipa,\thePl=plural,\theEx=extra}{%
\markboth{\theLabel}{\theLabel}%
\item[\theLabel] \theDesc \theIp \thePl \theEx
}%
\end{description}%
}
根据需要调整 3em。
\documentclass[11pt,twoside]{article}
\usepackage[paperheight=9in,paperwidth=6in,bottom=1in]{geometry}
\usepackage{multicol}
%\usepackage{fontspec,xunicode}
\usepackage{fancyhdr}
\usepackage{datatool}
\usepackage{enumitem}
%Command Setups
\newcommand{\wn}[5]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize n.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{\textit{pl.\hspace{2pt}#4 }}%
\DTLnewdbentry{list}{extra}{#5}%
}
\newcommand{\wv}[4]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize v.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{}%
\DTLnewdbentry{list}{extra}{#4}%
}
\newcommand{\wa}[4]{%
\DTLnewrow{list}%
\DTLnewdbentry{list}{label}{#1}%
\DTLnewdbentry{list}{description}{\textit{\textsc{{\footnotesize adj.}}} \textbf{#2} }
\DTLnewdbentry{list}{ipa}{(#3) }%
\DTLnewdbentry{list}{plural}{}%
\DTLnewdbentry{list}{extra}{#4}%
}
%Enviroment Setup
\newenvironment{sortedlist}%
{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}%
}%
{%
\DTLsort{label}{list}%
\begin{description}[leftmargin=3em]%
\DTLforeach*{list}{\theLabel=label,\theDesc=description,\theIp=ipa,\thePl=plural,\theEx=extra}{%
\markboth{\theLabel}{\theLabel}%
\item[\theLabel] \theDesc \theIp \thePl \theEx
}%
\end{description}%
}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,LO]{\textsc{\rightmark}}
\fancyhead[CO,CE]{\thepage}
\fancyhead[RE,RO]{\textsc{\leftmark}}
\begin{multicols}{2}\setlength{\columnseprule}{.5pt}
\raggedright
\begin{sortedlist}
\wn{Lorem}{ipsum}{dolor}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\wa{Lorem}{ipsum}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\wv{Lorem}{ipsum}{amet}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}
\end{sortedlist}
\end{multicols}
\end{document}
我们leftmargin=1em
得到
还有其他长度可以使用 进行调整enumitem
。有关详细信息,请参阅手册。