![! Ошибка LaTeX: Что-то не так — возможно, отсутствует \item. — при добавлении \textbf](https://rvso.com/image/461876/!%20%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0%20LaTeX%3A%20%D0%A7%D1%82%D0%BE-%D1%82%D0%BE%20%D0%BD%D0%B5%20%D1%82%D0%B0%D0%BA%20%E2%80%94%20%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%2C%20%D0%BE%D1%82%D1%81%D1%83%D1%82%D1%81%D1%82%D0%B2%D1%83%D0%B5%D1%82%20%5Citem.%20%E2%80%94%20%D0%BF%D1%80%D0%B8%20%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B8%20%5Ctextbf.png)
Я скачал шаблон C и использую его для написания своего резюме. В разделе «опыт работы» я решил добавить жирную строку, чтобы \textbf
классифицировать опыт в рамках соответствующего приобретенного передаваемого навыка. В первом rSubsection
резюме (см. Управление проектами) это сработало. Во втором, rSubsection
как показано ниже (Технические навыки), первая \textbf
строка выдает ошибку. Вторая (Работа в команде) работает просто отлично!
\begin{rSection}{Working Experience}
\begin{rSubsection}{University of city}{November 2021 - Present}{Postdoctoral Researcher}{city, country}
\textbf{Project Management}
\item Leading a research project
\item Delivered project milestones on time.
\end{rSubsection}
\begin{rSubsection}{University of city}{October 2016 - October 2019}{Imaging Scientist}{City, Country}
\textbf{Technical Skills} %the moment I use this line I get an error on the line below
\item Lab Maintenance: microscope setup, restocking of basic consumables.
\textbf{Teamwork}
\item Sharing expertise with undergraduate and postgraduate students
\end{rSubsection}
Сообщение об ошибке:
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.73 \item M
aintenance: microscope setup, restocking of basic consumables.
Вот также часть шаблона:
% SECTION FORMATTING
%----------------------------------------------------------------------------------------
% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
\sectionskip
\MakeUppercase{\bf #1} % Section title
\sectionlineskip
\hrule % Horizontal line
\begin{list}{}{ % List for each individual item in the section
\setlength{\leftmargin}{1.5em} % Margin within the section
}
\item[]
}{
\end{list}
}
%----------------------------------------------------------------------------------------
% WORK EXPERIENCE FORMATTING
%----------------------------------------------------------------------------------------
\newenvironment{rSubsection}[4]{ % 4 input arguments - company name, year(s) employed, job title and location
{\bf #1} \hfill {#2} % Bold company name and date on the right
\ifthenelse{\equal{#3}{}}{}{ % If the third argument is not specified, don't print the job title and location line
\\
{\em #3} \hfill {\em #4} % Italic job title and location
}\smallskip
\begin{list}{$\cdot$}{\leftmargin=0em} % \cdot used for bullets, no indentation
\itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
}{
\end{list}
\vspace{0.5em} % Some space after the list of bullet points
}
% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\namesize{\huge} % Size of the name at the top of the document
\def\addressskip{\smallskip} % The space between the two address (or phone/email) lines
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section
\def\nameskip{\bigskip} % The space after your name at the top
\def\sectionskip{\medskip} % The space after the heading section
Нет ничего \item
пропущенного, значит, должна быть какая-то проблема с \textbf
тем, что я добавляю, но я не могу понять, как это иногда работает, а иногда нет!
решение1
Код OP представляет собой измененную версию (добавление rSection
окружения) изкод предоставлен Стивеном Б. Сеглетесомв ответ наКак отключить список в rSubsection?.
В связанном коде можно вставлять текст или таблицы в rSubsection
среду. Не только \item
's.
Но первым в rSubsection
среде должен быть \item
.
Вы можете скрыть маркер в элементе списка с помощью \item[]
.
Чтобы все не было выделено жирным шрифтом, я добавил \normalfont
в код среды rSection
.
Я также удалил определения \namesize
, \addressskip
, и , \nameskip
которые не используются в коде OP.
Автор статьи пропустил этот момент \usepackage{ifthen}
, поэтому я его добавил (он нужен для \ifthenelse
).
\documentclass[11pt]{article}
\usepackage{ifthen}
% SECTION FORMATTING
%----------------------------------------------------------------------------------------
% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
\sectionskip
\MakeUppercase{\bf #1} % Section title
\sectionlineskip
\hrule % Horizontal line
\begin{list}{}{ % List for each individual item in the section
\setlength{\leftmargin}{1.5em} % Margin within the section
}
\normalfont\item[]
}{
\end{list}
}
%----------------------------------------------------------------------------------------
% WORK EXPERIENCE FORMATTING
%----------------------------------------------------------------------------------------
\newenvironment{rSubsection}[4]{ % 4 input arguments - company name, year(s) employed, job title and location
{\bf #1} \hfill {#2} % Bold company name and date on the right
\ifthenelse{\equal{#3}{}}{}{ % If the third argument is not specified, don't print the job title and location line
\\
{\em #3} \hfill {\em #4} % Italic job title and location
}\smallskip
\begin{list}{$\cdot$}{\leftmargin=0em} % \cdot used for bullets, no indentation
\itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
}{
\end{list}
\vspace{0.5em} % Some space after the list of bullet points
}
% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section
\def\sectionskip{\medskip} % The space after the heading section
\begin{document}
\begin{rSection}{Working Experience}
\begin{rSubsection}{University of city}{November 2021 - Present}{Postdoctoral Researcher}{city, country}
\item[] \textbf{Project Management} % added a \item[] because we need here an \item, but the bullet is hidden with the blank option []
\item Leading a research project
\item Delivered project milestones on time.
\end{rSubsection}
\begin{rSubsection}{University of city}{October 2016 - October 2019}{Imaging Scientist}{City, Country}
\item[] \textbf{Technical Skills} % added a \item[] because we need here an \item, but the bullet is hidden with the blank option []
\item Lab Maintenance: microscope setup, restocking of basic consumables.
\textbf{Teamwork} % \item[] not needed here. Moreover, without the `\item[]` here, a slight vertical space (welcomed) is added.
\item Sharing expertise with undergraduate and postgraduate students
\end{rSubsection}
\end{rSection} % <-- added (missing in the OP code)
\end{document}
Примечание:Код Стивена Б. Сеглетеса используется вэтот урокот Drshika Asher для того, чтобы сделать резюме в LaTeX. Это может дать этот макет:
(не связано с кодом, предоставленным OP, но в руководстве от Drshika Asher последний пример кода отсутствует \item[]
перед \textbf{Coursework:}
. Кроме того, в предоставленном проекте Overleaf с полным кодом некоторые \item[]
отсутствуют: в строках 100, 128, 133, 142).