使用 latex pandoc 模板列出项目时出现的问题

使用 latex pandoc 模板列出项目时出现的问题

我尝试四处寻找,但找不到解决此问题的方法。我创建了一个与 pandoc 兼容的 Latex 模板。出于某种原因,每当我进入另一个 for 循环并尝试逐项列出变量时,我都会收到以下错误:

Error producing PDF.
! Missing $ inserted.
<inserted text>
                $
l.118           \item\small

导致此错误的 Latex 代码片段如下

$if(experience)$
\section{Experience}
    \resumeSubHeadingListStart
         $for(experience)$
              \resumeSubheading
               {$experience.title$}{$experience.dates$}
               {$experience.company$} {$experience.location$}
              $if(experience.details)$
               \begin{itemize}
               $for(experience.details)$
                     \item\small{$experience.details$ \vspace{-2pt}}
               $endfor$
               \end{itemize}
               $endif$
          $endfor$
  \resumeSubHeadingListEnd
 $endif$

resumeSubHeadingListStart并且resumeSubHeadingListEnd是执行以下操作的自定义命令:

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=0.15in, label={}]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}

然而,创建一个常规\item元素是可能的,但却缺少要点。

latex 输出如下所示

\documentclass[letterpaper,11pt]{article}

\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{tabularx}
\input{glyphtounicode}

\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

% Adjust margins
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.5in}
\addtolength{\textheight}{1.0in}

\urlstyle{same}

\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
\setlist[itemize]{topsep=0pt,before=\leavevmode\vspace{-5pt}}

% Sections formatting
\titleformat{\section}{
  \vspace{-4pt}\scshape\raggedright\large
}{}{0em}{}[\color{black}\titlerule \vspace{-5pt}]

% Ensure that generate pdf is machine readable/ATS parsable

%-------------------------
% Custom commands
\newcommand{\resumeItem}[1]{
  \item\small{
    {#1 \vspace{-2pt}}
  }
}

\newcommand{\resumeSubheading}[4]{
  \vspace{-2pt}\item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
    \end{tabular*}\vspace{-7pt}
}

\newcommand{\resumeSubSubheading}[2]{
    \item
    \begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
      \textit{\small#1} & \textit{\small #2} \\
    \end{tabular*}\vspace{-7pt}
}


\newcommand{\resumeProjectHeading}[1]{
    \item
    \begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
      \small#1  \\
    \end{tabular*}\vspace{-7pt}
}


\newcommand{\resumeSubItem}[1]{\resumeItem{#1}\vspace{-4pt}}

\renewcommand\labelitemii{\vcenter{\hbox{\tiny\bullet}}}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=0.15in, label={}]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

\begin{document}

\begin{center}
    \textbf{\Huge \scshape Latex Fan} \\ \vspace{1pt}
    \small +1-646-333-3333 | \href{mailto:[email protected]}{\underline{[email protected]}} |
    \href{test.xyz}{\underline{test.xyz}} |
    \href{https://github.com/test}{\underline{test}}
\end{center}

\section{Experience}
\resumeSubHeadingListStart
\resumeSubheading
  {ML Engineer}{Sep 2019 -- Current}
  {Some Company} {New York, NY}
    \begin{itemize} 
          \item\small{Developed and deployed a recommendation system
that applies reinforcement learning on a set of web page components to
discover the most optimal permutation based on the implicit user
feedback in near real time. \vspace{-2pt}}
          \item\small{Designed and implemented an even driven
architecture of the system as a decoupled monolith consisting of a
number of bounded contexts using principles of domain driven design and
clean architecture. \vspace{-2pt}}
      \end{itemize}
  \resumeSubheading
  {Quantitative Analyst}{2019 -- 2019}
  {Some Company} {New York, NY}
    \begin{itemize} 
          \item\small{Created a set of notebooks with quantitative
models for portfolio optimization, price forecasting, and hedging to
generate an optimal asset composition strategy. These tools assisted in
devising an index composition and launch of an ETF
product. \vspace{-2pt}}
          \item\small{Built an ETL pipeline to operate on various
financial and alternative data from internal sources as well as 3rd
party APIs. Also, set up a PostreSQL data warehouse for aggregating the
processed data for future analysis. \vspace{-2pt}}
          \item\small{Developed a dashboard for data visualization and
monitoring the performance of major world indices. \vspace{-2pt}}
      \end{itemize}
  \resumeSubheading
  {Research Engineer}{2018 -- 2019}
  {Other Office} {New York, NY}
    \begin{itemize} 
          \item\small{Developed quantimental strategies for price
forecasting and discovery of asymmetric information of various assets in
the public markets. \vspace{-2pt}}
          \item\small{Worked on bringing well-performing experimental
strategies into production by optimizing the existing code, rewriting
trading signal components in C++ and integrating them with legacy
services. \vspace{-2pt}}
          \item\small{Developed a module for integration with a
backtesting engine to simulate and test the performance of experimental
trading strategies. \vspace{-2pt}}
      \end{itemize}
  \resumeSubheading
  {Jr.~Partner}{2016 -- 2018}
  {Some Fund} {New York, NY}
    \begin{itemize} 
          \item\small{Researched the use cases for distributed ledger
technology and the development on Bitcoin, Ethereum, and EOS
networks. \vspace{-2pt}}
          \item\small{Developing services to process user transactions
and staking tokens on EOS and Ethereum networks for a recruitment
dApp. \vspace{-2pt}}
      \end{itemize}
  \resumeSubHeadingListEnd

\section{Education}
  \resumeSubHeadingListStart
      \resumeSubheading
    {Some School}{Philadelphia, PA}
    {Some Degree}{2100 -- 2104}
    \resumeSubHeadingListEnd

\end{document}

答案1

问题是您已经重新定义\labelitemii使用\bulletmathmode 命令:

\renewcommand\labelitemii{\vcenter{\hbox{\tiny\bullet}}}

更好的替代方案是:

\renewcommand\labelitemii\raisebox{.3ex}{\tiny\textbullet}

但更好的方法是使用enumitem方法:

\setlist[itemize,2]{label=\raisebox{.3ex}{\tiny\textbullet}}

此外,您不应该\vspace{}在任何地方使用否定命令。对于列表项,请使用键nosepenumitem控制列表间距。同样,您可以使用键在列表项之前before添加更改字体大小的命令。\small

相关内容