如何将格式从 s 列表更改\item
为项目网格:
\documentclass[margin,line]{resume}
\usepackage[hidelinks]{hyperref}
\usepackage{enumitem}
\begin{document}
\begin{resume}
\section{\mysidestyle Hobbies}
\begin{itemize}[leftmargin=3.7mm]
\renewcommand\labelitemi{--}% < LOCALLY Setting the bullet as an en-dash
\vspace{0mm}
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize}
\end{resume}
\end{document}
例如,上面的代码生成以下内容,但我该如何转换它:
变成这样:
答案1
简单易用tasks
或shortlst
:%模板来源:https://github.com/sbrother/resume
\documentclass[margin, line]{resume}
\usepackage[hidelinks]{hyperref}
\usepackage[inline]{enumitem}
\usepackage[utf8]{inputenc}
\usepackage{tasks}
\usepackage{shortlst}
\newenvironment{tabitemize}[1][3]{%
\settowidth{\labelwidth}{\labelitemi}%
\setlength{\leftmargini}{\dimexpr\parindent+\labelwidth+\labelsep\relax}%
\setlength{\shortitemwidth}{\dimexpr\linewidth/#1-\labelwidth-2\labelsep\relax}%
\begin{shortitemize}}%
{\end{shortitemize}}%
\makeatletter\newcommand*{\compress}{\@minipagetrue}\makeatother
\begin{document}
\name{\Large 3kstc}
\begin{resume}
\section{\mysidestyle Contact\\Information}
Phone: (\texttt{+}02) 0123 45 67 89 \hfill LinkedIn: \href{https://www.linkedin.com/deadlink/}{https://www.linkedin.com/deadlink} \\
\noindent Email: [email protected] \hfill Address: some street, in some city, of the world\vspace{0mm}\\\vspace{-4.5mm}
\section{\mysidestyle Hobbies}
% \leavevmode\vspace*{-\baselineskip }
\begin{itemize}[leftmargin=3.7mm, before = \leavevmode\vspace*{-\parskip}]%
\renewcommand\labelitemi{--} % < LOCALLY Setting the bullet as an en-dash
\vspace{0mm}
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize}
\section{\mysidestyle Hobbies 2}
\leavevmode\vspace*{-\dimexpr\baselineskip + \parsep}%-\parskip
\begin{tasks}[style = itemize, label = \bfseries\textendash, label-width = 0.8em, item-indent = 1.15em](3)
\task Chess
\task Photography
\task Programming
\task Travelling
\task Volunteer work
\end{tasks}
\section{\mysidestyle Hobbies 3}%
\renewcommand{\labelitemi}{\textendash}
\begin{tabitemize}[3]
\renewcommand\labelitemi{--} % < LOCALLY Setting the bullet as an en-dash
\vspace{0mm}
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{tabitemize}
\end{resume}
\end{document}
答案2
由于您已经在使用该enumitem
包,\usepackage[inline]{enumitem}
那么您可以使用“内联项目化”环境来\begin{itemize*}....\end{itemize*}
生成:
要将项目“分隔符”从项目符号更改为它,只需将其添加到选项中--
即可。以下是完整代码:label=--
itemize
\documentclass[margin,line]{article}
\usepackage[hidelinks]{hyperref}
\usepackage[inline]{enumitem}
\parindent=0pt
\begin{document}
\section{Hobbies}
\begin{itemize*}[leftmargin=3.7mm]
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize*}
\begin{itemize*}[leftmargin=3.7mm, label=--]
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize*}
\end{document}
...完整输出:
resume.cls
[正如其他人所做的那样,由于我没有安装它,因此我放弃了。]
编辑
据我所知,enumitem
它没有提供更改行内间距的方法\items
,但是,您可以通过使用类似的东西使标签更宽来解决这个问题label={\hspace*{12mm}--}
。(如下一个示例所示,您也可以使用itemjoin
它。)例如,代码
\documentclass[margin,line]{article}
\usepackage[hidelinks]{hyperref}
\usepackage[inline]{enumitem}
\parindent=0pt
\begin{document}
\section{Hobbies}
\begin{itemize*}[label={\hspace*{12mm}--}]
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize*}
\end{document}
生产
据我所知,不可能设置每行的项目数,但只要再坚持一下,你也可以做到这一点:
\documentclass{article}
\usepackage[hidelinks]{hyperref}
\usepackage[inline]{enumitem}
\parindent=0pt
\newlist{inlineitemize}{itemize*}{1}
\setlist[inlineitemize]{% create a custom in-line list environment
itemjoin=\itemizenewline,
label={--}
}
\newcounter{inline}
\newcommand\itemizenewline{% start newline every 4=3+1 columns
\ifnum\value{inline}=3\setcounter{inline}{0}\newline%
\else\stepcounter{inline}\hspace{14mm}% 14mm between \items
\fi%
}
\begin{document}
\section{Hobbies}
\begin{inlineitemize}
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{inlineitemize}
\end{document}
生成结果:
请注意,这里的“项目宽度”会有所不同,因此项目不太可能排列在列中,但如果这是您想要的,您可能应该使用像这样的环境tabular
。
答案3
我不知道 documentclass resume
,也不知道您是如何定义的\mysidestyle
,所以我的答案只在那个范围内有用,但它可能适合您的修复,并与您的 sidestyle 部分标题完美对齐。使用 multicols 和 minipage 的解决方案:
\documentclass{article}
\usepackage{enumitem}
\usepackage{multicol}
\begin{document}
\noindent\textsc{Hobbies}
\begin{minipage}[top]{100mm}
\begin{multicols}{3}
\begin{itemize}%[leftmargin=3.7mm]
\renewcommand\labelitemi{--}
\vspace{0mm}
\item Chess
\item Photography
\item Programming
\item Travelling
\item Volunteer work
\end{itemize}
\end{multicols}
\end{minipage}
\end{document}
爱好不一致,但您可能会想出如何正确地做到这一点\mysidestyle
。我厚颜无耻地\noindent\textsc{Hobbies}
从上面的巴纳德的答案中偷来了。