嵌套清單無法從 markdown 或 html 轉換為 pdf

嵌套清單無法從 markdown 或 html 轉換為 pdf

我正在嘗試轉換markdownpdf使用pandoc乳膠引擎集,因為xelatex我正在嘗試使用系統上安裝的字體。我已嘗試切換pdf-enginepdflatex但問題仍然存在。

我將這段 Markdown 貼到Pandoc 線上試用演示:

###Lipsum
  + **Lipsum Generator (Sept 2013-Present)**

   **[google](https://www.google.com/)**

   Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged

    * Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.

    * Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance

渲染後的乳膠:

\subsubsection{Lipsum}\label{lipsum}

\begin{itemize}
\tightlist
\item
  \textbf{Lipsum Generator (Sept 2013-Present)}
\end{itemize}

\textbf{\href{https://www.google.com/}{google}}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged

\begin{verbatim}
* Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.

* Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance
\end{verbatim}

我注意到, 我認為是導致錯誤的\begin{verbatim}原因。\begin{itemize}

我使用了這個指令:

pandoc resume.md --standalone --latex-engine=xelatex -f markdown --atx-headers -t latex -o resume_pandoc.pdf -V mainfont=Ubuntu -V sansfont=Lato -V fontsize=11pt -V title="Vamsi Deepak Ampolu" -V papersize=letter

我也嘗試使用此命令將其轉換htmlpdf

pandoc resume.html --standalone --latex-engine=xelatex -V mainfont=Ubuntu -V sansfont=Lato -V papersize=letter title="Vamsi Deepak Ampolu"

但是,我發現嵌套列表可以在輸出html中正確渲染,如下所示pdf

+ built a layer of dynamic, reusable UI templates using Handlebars based on Twitter Bootstrap

答案1

您必須為每個等級精確縮排四 (4) 個空格。

輸入:

### Lipsum
+ **Lipsum Generator (Sept 2013-Present)**

    **[google](https://www.google.com/)**

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged

    * Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.

    * Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance

輸出:

\subsubsection{Lipsum}\label{lipsum}

\begin{itemize}
\item
  \textbf{Lipsum Generator (Sept 2013-Present)}

  \textbf{\href{https://www.google.com/}{google}}

  Lorem Ipsum is simply dummy text of the printing and typesetting
  industry. Lorem Ipsum has been the industry's standard dummy text ever
  since the 1500s, when an unknown printer took a galley of type and
  scrambled it to make a type specimen book. It has survived not only
  five centuries, but also the leap into electronic typesetting,
  remaining essentially unchanged

  \begin{itemize}
  \item
    Contrary to popular belief, Lorem Ipsum is not simply random text.
    It has roots in a piece of classical Latin literature from 45 BC,
    making it over 2000 years old.
  \item
    Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of ``de Finibus
    Bonorum et Malorum'' (The Extremes of Good and Evil) by Cicero,
    written in 45 BC. This book is a treatise on the theory of ethics,
    very popular during the Renaissance
  \end{itemize}
\end{itemize}

相關內容