pandoc 的设置

pandoc 的设置

pandoc我希望编辑控制 Markdown 文件转换为 LaTeX 的设置,以避免.tex在 Ubuntu 中的最终文件中出现不必要的代码。请就此事指导我。这是我的示例 Markdown 文件

Hello
$$ 
\begin{matrix}
   a & b \\
   c & d
\end{matrix}
$$

 | Syntax      |Description 
  ------------|------------
  |Header      |Title       |     
  |Paragraph   |Text        |

这是 pandoc 的 latex 输出

\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
\else % if luatex or xelatex
  \ifxetex
    \usepackage{mathspec}
  \else
    \usepackage{fontspec}
  \fi
  \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
\usepackage[unicode=true]{hyperref}
\hypersetup{
            pdfborder={0 0 0},
            breaklinks=true}
\urlstyle{same}  % don't use monospace font for urls
\usepackage{longtable,booktabs}
% Fix footnotes in tables (requires footnote package)
\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% Redefines (sub)paragraphs to behave more like sections
\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

% set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother


\date{}

\begin{document}

Test

Hello \[ 
\begin{matrix}
   a & b \\
   c & d
\end{matrix}
\]

\begin{longtable}[]{@{}ll@{}}
\toprule
Syntax & Description\tabularnewline
\midrule
\endhead
Header & Title\tabularnewline
Paragraph & Text\tabularnewline
\bottomrule
\end{longtable}

\end{document}

这是所需的输出

\documentclass[]{article}
\usepackage{amssymb,amsmath}
\usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}
\usepackage[unicode=true]{hyperref}
\usepackage{longtable,booktabs}

\begin{document}

Test

Hello \[ 
\begin{matrix}
   a & b \\
   c & d
\end{matrix}
\]

\begin{longtable}[]{@{}ll@{}}
\toprule
Syntax & Description\tabularnewline
\midrule
\endhead
Header & Title\tabularnewline
Paragraph & Text\tabularnewline
\bottomrule
\end{longtable}

\end{document}

谢谢,成功了。我编辑了 default.latex 以适应我的需要,值得注意的是,我必须在使用它之前先创建它。

答案1

相关内容