基本上我想修改description
列表,以便第一个单词带下划线和粗体
如果你编译这个文件。
\documentclass{article}
\usepackage{soul}
\newenvironment{mydescription}{%
\renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{\ul{##1}}}
\begin{description}%
}{%
\end{description}%
}
\begin{document}
\begin{mydescription}
\item[First] Test
\item[Second] Test
\end{mydescription}
\end{document}
输出没问题。但是如果你编译下面的代码,你会发现环境不是它应该有的样子。序言中的哪些命令干扰了编译以及如何解决这个问题?
\documentclass[10pt]{article}
\usepackage{soul}
\usepackage[margin=0.75in]{geometry}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Lecture 1}
\rhead{Handout 2}
\usepackage{tikz}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\usetikzlibrary{decorations.pathreplacing,calc,graphs,decorations.markings}
\def\annotateEquality#1{ %for the arrow from equality sign
\tikz[overlay]
\draw[blue,<-] (-1.5ex,1.5ex) -- +(.7,.5) node[right] {#1};
}
\usepackage{comment}
\usepackage{mathtools}
\newcommand{\verteq}{\rotatebox{90}{$\,\neq$}}
\newcommand{\equalto}[2]{\underset{\scriptstyle\overset{\mkern4mu\verteq}{#2}}{#1}}
\usepackage{enumitem,array}
\usepackage{relsize}
\usepackage{amsmath}
\usepackage{amsthm} %for proof
\newtheorem*{mythm}{Theorem}
\newtheorem*{mydef}{Definition}
\usepackage{centernot} %for `not implies' symbol
\usepackage{amssymb} %for 'therefore' symbol
\usepackage{tikz-cd}% Commutative diagram
\title{\ul{Expectations in Bivariate Probability Distribution}}
\date{}
\everymath=\expandafter{\the\everymath\displaystyle}
\tikzset{degil/.style={
decoration={markings,
mark= at position 0.5 with {
\node[transform shape] (tempnode) {$\backslash$};
%\draw[thick] (tempnode.north east) -- (tempnode.south west);
}
},
postaction={decorate}
}
}
\newenvironment{mydescription}{%
\renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{\ul{##1}}}
\begin{description}%
}{%
\end{description}%
}
\begin{document}
\thispagestyle{fancy}
%These define a new itemize environment with 'invisible' bullets
\newenvironment{Myitemize}{%
\renewcommand{\labelitemi}{{}}%
\begin{itemize}[nosep]}{\end{itemize}}
\maketitle
\thispagestyle{fancy}
\begin{mydescription}
\begin{mydescription}
\item[First] Test
\item[Second] Test
\end{mydescription}
\end{document}
答案1
在加载时,命令不能soul
在可选参数中使用:它们非常脆弱,不喜欢出现在特定的地方(除了错误之外)。\item
enumitem
Reconstruction failed
\enit@align
您可以使用ulem
:
\documentclass[10pt]{article}
\usepackage[normalem]{ulem}
\usepackage{enumitem}
\newenvironment{mydescription}{%
\renewcommand\descriptionlabel[1]{%
\hspace{\labelsep}\textbf{\uline{##1}}%
}%
\begin{description}%
}{%
\end{description}%
}
\begin{document}
\begin{mydescription}
\item[First] Test
\item[Second] Test
\end{mydescription}
\end{document}
但最好的事情是忘记下划线,这在精细的排版中被认为是不好的做法。