
pandoc
LaTeX PDF 템플릿을 사용하여 Markdown 파일을 PDF로 변환하는 프로젝트가 있습니다 .
테이블에 이상한 문제가 있습니다. 매우 소수의 경우(문서 200개 중 2개 정도) 페이지 나누기 후에 테이블이 삽입됩니다. 기본적으로 LaTeX에 대한 경험이 거의 없기 때문에 페이지 나누기인지 확실하지 않지만 그런 것 같습니다.
이것은 제가 변환하는 Markdown 파일 중 하나입니다.
... More stuff above
Lorem
- 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.
# LOREM IPSUM
## Lorem Ipsum is simply dummy
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.
| Column 1 | Column 2 |
| ---------------------------------------------- | --------------------------------------------------------------------------- |
| Lorem Ipsum is simply dummy text | Lorem Ipsum |
| Lorem Ipsum is simply dummy text of the | Lorem Ipsum is simply dummy text of the printing and typesetting industry. |
## Lorem Ipsum is simply dummy text of the
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.
... More stuff below
내 pandoc
명령은 다음과 같습니다(Powershell로 실행되며 달러 기호가 있는 변수에 대한 내용입니다).
pandoc --metadata=title:"asasas" `
--resource-path="$markdownPath" `
--template="$pdfTemplatePath" `
--fail-if-warnings `
--variable numbersections="true" `
--variable mainfont="Arial" `
--variable sansfont="Helvetica" `
--variable monofont="Courier" `
--variable fontsize=12pt `
--variable version=2.0 `
--variable geometry="left=20mm, top=10mm, right=20mm, bottom=20mm" `
--variable toc-own-page="true" `
--toc `
--toc-depth=5 `
--lua-filter="version_table.lua" `
--variable titlepage="true" `
--variable logo="PDF/logo.eps" `
--columns=50 `
-f markdown-implicit_figures+escaped_line_breaks+raw_tex `
-t latex `
-s `
-o "$outputFileName" `
"$tempFileName"
제가 사용하고 있는 PDF 템플릿은 다음과 매우 유사합니다.pandoc-라텍스-템플릿, 아마도 그 위에 세워졌을 것입니다.
명령을 실행하면 pandoc
테이블에 대한 출력은 다음과 같습니다.
문제가 무엇인지 아시나요? 내가 시도해야 할 것이 있다면 도움이 될까요?
위 스크린샷에서 생성된 tex 파일의 일부입니다.
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*,table}{xcolor}
%
\documentclass[
12pt,
a4paper,
,tablecaptionabove
]{scrartcl}
\usepackage{lmodern}
\usepackage{setspace}
\setstretch{1.2}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage[utf8x]{inputenc}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
% \usepackage[utf8x]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\setmainfont[]{Arial}
\setsansfont[]{Helvetica}
\setmonofont[]{Courier}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\definecolor{default-linkcolor}{HTML}{A50000}
\definecolor{default-filecolor}{HTML}{A50000}
\definecolor{default-citecolor}{HTML}{4077C0}
\definecolor{default-urlcolor}{HTML}{4077C0}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={asasas},
hidelinks,
breaklinks=true,
pdfcreator={LaTeX via pandoc with the Eisvogel template}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=2.5cm,includehead=true,includefoot=true,centering,left=20mm, top=10mm, right=20mm, bottom=20mm]{geometry}
\usepackage[export]{adjustbox}
\usepackage{graphicx}
\usepackage{longtable,booktabs}
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx,grffile}
\makeatletter
\def\ScaleWidthIfNeeded{%
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\def\ScaleHeightIfNeeded{%
\ifdim\Gin@nat@height>0.9\textheight
0.9\textheight
\else
\Gin@nat@width
\fi
}
\makeatother
\setkeys{Gin}{width=\ScaleWidthIfNeeded,height=\ScaleHeightIfNeeded,keepaspectratio}%
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\usepackage{float}
\floatplacement{figure}{H}
\title{asasas}
\date{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,main=english]{babel}
\else
\usepackage{polyglossia}
\setmainlanguage[]{english}
\fi
\usepackage{pagecolor}
\usepackage{afterpage}
\usepackage{multicol}
\PassOptionsToPackage{hyphens}{url}
\usepackage{csquotes}
\definecolor{caption-color}{HTML}{777777}
\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=raggedright]{caption}
\setcapindent{0em}
\definecolor{blockquote-border}{RGB}{221,221,221}
\definecolor{blockquote-text}{RGB}{119,119,119}
\usepackage{mdframed}
\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}
\definecolor{heading-color}{RGB}{40,40,40}
\addtokomafont{section}{\color{heading-color}}
\usepackage{titling}
\title{asasas}
\author{}
% tables
\definecolor{table-row-color}{HTML}{F5F5F5}
\definecolor{table-rule-color}{HTML}{999999}
\arrayrulecolor{table-rule-color} % color of \toprule, \midrule, \bottomrule
\setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule
\renewcommand{\arraystretch}{1.3} % spacing (padding)
\let\oldlongtable\longtable
\let\endoldlongtable\endlongtable
\renewenvironment{longtable}{
\rowcolors{3}{}{table-row-color!100} % row color
\oldlongtable} {
\endoldlongtable
\global\rownum=0\relax}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\usepackage{fancyhdr,lastpage}
\fancypagestyle{eisvogel-header-footer}{
\fancyhead{}
\fancyfoot{}
\lhead[]{asasas}
\chead[]{}
\rhead[asasas]{}
\lfoot{{Version: 2}{, effective date: 01-Sep-2020}}
\cfoot[]{}
\rfoot{{\thepage} of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
}
\pagestyle{eisvogel-header-footer}
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{colortbl}
\begin{document}
\arrayrulecolor{table-rule-color}
\restoregeometry
{
\setcounter{tocdepth}{5}
\tableofcontents
\newpage
}
\hypertarget{process-description}{%
\section{LOREM IPSUM}\label{process-description}}
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.
\hypertarget{objective-and-benefits}{%
\section{OBJECTIVE AND
BENEFITS}\label{objective-and-benefits}}
\hypertarget{objective}{%
\subsection{Objective}\label{objective}}
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum has been the
industry's standard
\hypertarget{benefits}{%
\subsection{Benefits}\label{benefits}}
\begin{itemize}
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry.
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry.
\end{itemize}
\hypertarget{definition}{%
\section{DEFINITION}\label{definition}}
Lorem Ipsum
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry.
\end{itemize}
Lorem Ipsum
\begin{itemize}
\tightlist
\item
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
\end{itemize}
Lorem Ipsum
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum has been the
industry's standard dummy
\end{itemize}
Lorem Ipsum
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum is
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum is
\end{itemize}
\hypertarget{roles-responsibilities}{%
\section{LOREM IPSUM}\label{roles-responsibilities}}
Lorem
\begin{itemize}
\tightlist
\item
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 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.
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lore
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
Lorem Ipsum is simply dummy text of the printing
and typesetting industry.
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
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.
\end{itemize}
Lorem
\begin{itemize}
\tightlist
\item
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.
\end{itemize}
\hypertarget{lorem-ipsum}{%
\section{LOREM IPSUM}\label{lorem-ipsum}}
\hypertarget{lorem-ipsum-is-simply-dummy}{%
\subsection{Lorem Ipsum is simply
dummy}\label{lorem-ipsum-is-simply-dummy}}
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.
\begin{longtable}[]{@{}ll@{}}
\toprule
\begin{minipage}[b]{0.36\columnwidth}\raggedright
Column 1\strut
\end{minipage} &
\begin{minipage}[b]{0.58\columnwidth}\raggedright
Column 2\strut
\end{minipage}\tabularnewline
\midrule
\endhead
\begin{minipage}[t]{0.36\columnwidth}\raggedright
Lorem Ipsum is simply dummy text\strut
\end{minipage} &
\begin{minipage}[t]{0.58\columnwidth}\raggedright
Lorem Ipsum\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.36\columnwidth}\raggedright
Lorem Ipsum is simply dummy text of the\strut
\end{minipage} &
\begin{minipage}[t]{0.58\columnwidth}\raggedright
Lorem Ipsum is simply dummy text of the printing
and typesetting industry.\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
\end{document}