Bonsoir, je suis ce tutoriel
https://tila.im/~al/PriseCours/
mais je rencontre un problème lors de la conversion du fichier markdown en fichier pdf en utilisant cette commande :
mathieu@mathieu-HP-ENVY-Laptop-13-aq0xxx:~/Téléchargements$ pandoc exempledecours.md -t latex --pdf-engine=xelatex --template=templateV2.tex $* -o cours.pdf
Error producing PDF.
! Undefined control sequence.
l.131 \hypertarget
Il semble y avoir un problème au niveau du script du template mais je n'y connais rien est-ce que quelqu'un peut m'aider svp ? Merci.
Le template :
%!TEX TS-program = xelatex
\documentclass[11pt]{scrartcl}
%\documentclass[11pt,twocolumn]{scrartcl}
% Note that Kieran Healy uses the swank 'Memoir' class,
% \documentclass[11pt,article,oneside]{memoir}
% which might be worth a look.
% -- We are in swanky unicode, XeTeX land, and must now import these packages:
% Characters
\usepackage{fontspec}
%,xltxtra,xunicode}
\usepackage[french]{babel}
% Math formules
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
% En-tête et pied de page
\usepackage{fancyhdr}
% Police
\usepackage{libertine}
\usepackage{longtable}
\usepackage{booktabs}
% Mise en forme
% couleurs
\usepackage[svgnames]{xcolor}
% page
\usepackage{a4wide}
\setlength{\parindent}{0pt}
\setlength{\parskip}{2pt plus 1pt minus 1pt}
% Définition en-tête et pied de page
\pagestyle{fancy}
\fancyhf{}
\rhead{\rightmark}
\lhead{\leftmark}
\lfoot{$title$}
\rfoot{Page \thepage}
\renewcommand{\footrulewidth}{1pt}
% Format des différents niveaux de titre
% Taille de l'espacement vertical
\RedeclareSectionCommand[beforeskip=0.1\baselineskip,afterskip=0.1\baselineskip]{section}
\RedeclareSectionCommand[beforeskip=0.1\baselineskip,afterskip=0.1\baselineskip]{subsection}
\RedeclareSectionCommand[beforeskip=0.1\baselineskip,afterskip=0.1\baselineskip]{subsubsection}
% Couleur
\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
% \@tempswafalse
\ifstr{#1}{section}{%
\colorbox{Black}{%
\color{white}
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep-#2}{%
\raggedsection
\@hangfrom{#3}{#4}%
}%
}%
}{%
\ifstr{#1}{subsection}{%
\colorbox{Orange}{%
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep-#2}{%
\raggedsection
\@hangfrom{#3}{#4}%
}%
}%
}{%
\ifstr{#1}{subsubsection}{%
% \colorbox{Yellow}{%
\color{Brown}
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep-#2}{%
\raggedsection
\@hangfrom{#3}{#4}%
}%
% }%
}
{%
\@hangfrom{\hskip #2#3}{#4}%
}%
}%
}%
}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% Paramètres tableaux
$if(tables)$
\usepackage{array}
% -- This is needed because raggedright in table elements redefines \\:
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash
$endif$
$if(subscript)$
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
$endif$
% Gestion des images
$if(graphics)$
\usepackage{graphicx}
% -- We will generate all images so they have a width \maxwidth. This means
% -- that they will get their normal width if they fit onto the page, but
% -- are scaled down if they would overflow the margins.
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
$endif$
% Red color bold text
%\let\oldtextbf\textbf
%\renewcommand{\textbf}[1]{\textcolor{red}{\oldtextbf{#1}}}
% Section numbering.
% Here again is a variable you can specify on the commandline
% `markdown2pdf my.txt --number-sections --xetex --template=/wherever/this/is -o my.pdf`
$if(numbersections)$
$else$
\setcounter{secnumdepth}{0}
$endif$
% Title, authors, date.
% If you specified title authors and date at the start of
% your pandoc-markdown file, pandoc knows the 'values' of the
% variables: title authors date and fills them in.
\addtokomafont{title}{\color{Brown}}
\subject{\vspace{-4\baselineskip}}
\publishers{\vspace{-1.5\baselineskip}}
$if(title)$
\title{$title$}
$endif$
$if(author)$
\author{$author$}
$endif$
$if(date)$
\date{$date$}
$endif$
% Début du document proprement dit
\begin{document}
$if(title)$
\maketitle
\thispagestyle{empty}
$endif$
$if(toc)$
\tableofcontents
$endif$
$body$
\end{document}