我的自定义列表和左边距的空间有问题:
为了说明,
我不明白为什么 [*] 不从标签宽度开始,而标签宽度按定义必须是 1<><><><> 长。您可以更改 <> 的数量以查看 listparindent 是否不变....
我想要的是所有彩色箭头都位于蓝色箭头开始的位置。我还想将标签 1<><><><> 放置在距左边距未知值 X 厘米 [例如 2 厘米] 的位置。我不在乎文本实际从哪里开始。
我有一个 MWE:
%\RequirePackage{fix-cm}
\documentclass[twoside, a4paper, 11pt]{article}
\newcounter{list1}
\setcounter{list1}{0}
\newenvironment{mylist}
% level = 0
\begin{list}
{
{\arabic{list1}<><><><>}
}
{
%\let\makelabel\descriptionlabel
%\setlength{\labelwidth}{0ex}
%\setlength{\leftmargin}{\leftmargini}
\setlength{\rightmargin}{0ex}
\setlength{\labelsep}{0cm}
\setlength{\itemindent}{1\parindent}
%\setlength{\listparindent}{\labelwidth}
\setlength{\listparindent}{1\parindent}
\setlength{\itemsep}{0ex}
\setlength{\topsep}{0\parskip plus 0.5\parskip minus 0.5\parskip}
\setlength{\parsep}{1\parskip plus 0.5\parskip minus 0.5\parskip}
\setlength{\partopsep}{0\parskip}
\usecounter{list1}
}
\begin{document}
\small
here are many font families e.g. Computer Modern, Times, Arial and Courier. Those families can be grouped into three main categories: roman (rm) or serif, sans serif (sf) and monospace (tt) (see Typeface for more details). Each font family comes with the default design which falls into one of those categories
\begin{mylist}
\item However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
[*]However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\item However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\end{mylist}
However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\end{document}
答案1
您最初的定义有错误:您正在定义一个环境,但没有为开始部分提供正确的语法,并且忘记了结束部分。
我建议你使用enumitem
包来轻松定义您的列表:
\documentclass[twoside, a4paper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\newlist{mylist}{enumerate}{2}
\setlist[mylist,1]{label=\arabic*<><><><>,leftmargin=*}
\begin{document}
\small
here are many font families e.g. Computer Modern, Times, Arial and Courier. Those families can be grouped into three main categories: roman (rm) or serif, sans serif (sf) and monospace (tt) (see Typeface for more details). Each font family comes with the default design which falls into one of those categories
\begin{mylist}
\item However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
[*]However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\item However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\end{mylist}
However, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.
\end{document}
使用labelindent=<length>
(如labelindent=3cm
)并可能更改leftmargin=*
为leftmargin=<length>
(如leftmargin=4cm
),如果需要,您可以在问题的第二部分中获得所需的结果。