Hello John, Thanks a lot for this clarification Dorice On Sunday, July 23, 2017 at 12:10:41 PM UTC+2, John MacFarlane wrote: > > You're trying to comment out parts of the template using > LaTeX's %. This doesn't really work. The template syntax > is language independent, so the % isn't recognized as a > comment and the 'for' and 'if' commands inside the commented > part are still resolved. > > See https://github.com/jgm/pandoc/issues/3806 > > +++ dorice [Jul 18 17 13:55 ]: > > Hello, > > I am using attached latex template to convert docx documents to latex. > > Also see result file attached. > > To make it simple, I have the following lines (herited from default > > template) to include the appropriate packages for the tables > >$if(tables)$ > >\usepackage{longtable,booktabs} > >% Fix footnotes in tables (requires footnote package) > >\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{} > > >$endif$ > > > > In the generated tex file, I get this > >%%%%%%%\usepackage{longtable,booktabs} > >% Fix footnotes in tables (requires footnote package) > >\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{} > > > > > Can someone tell why the packages are not included while the second > > line of the conditionnal block is inserted ? > > Thanks in advance > > Dorice > > > > -- > > You received this message because you are subscribed to the Google > > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To post to this group, send email to > > [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To view this discussion on the web visit > > [3] > https://groups.google.com/d/msgid/pandoc-discuss/5ec5b2f3-8c0d-43bd- > > 9827-356f3869fffa%40googlegroups.com. > > For more options, visit [4]https://groups.google.com/d/optout. > > > >References > > > > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 3. > https://groups.google.com/d/msgid/pandoc-discuss/5ec5b2f3-8c0d-43bd-9827-356f3869fffa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer > > 4. https://groups.google.com/d/optout > > > >\documentclass[12pt,french,a5paper,openright,twoside]{CPHessay} > >%%%\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 > >%% \usepackage{unicode-math} > >%% \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 > >%}{} > >%%\IfFileExists{parskip.sty}{% > >%\usepackage{parskip} > >%}{% else > >%\setlength{\parindent}{0pt} > >%\setlength{\parskip}{6pt plus 2pt minus 1pt} > >%} > >%%\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref > >%%\usepackage[unicode=true]{hyperref} > >%%\hypersetup{ > >%% pdftitle={Titre livre titre livre}, > >%%% pdfauthor={Auteur Livre}, > >%%%% 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{longtable}}{} > > >%%%%\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 > >%%%\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex > >% \usepackage[shorthands=off,main=french]{babel} > >%%\else > > % load polyglossia as late as possible as it *could* call bidi if RTL > lang (e.g. Hebrew or Arabic) > >% \usepackage{polyglossia} > >% \setmainlanguage[]{french} > >%%\fi > >%% > >% set default figure placement to htbp > >%\makeatletter > >%\def\fps@figure{htbp} > >%\makeatother > > > >% > >\title{Titre livre titre livre} > >\providecommand{\subtitle}[1]{} > >\subtitle{Sous-titre livre sous-titre livre} > >\author{Auteur Livre} > >\providecommand{\originaltitle}[1]{} > >\originaltitle{Titre original livre titre original livre titre original > livre} > >\providecommand{\copyrightyear}[1]{} > >\copyrightyear{0000} > >\providecommand{\copyrightholder}[1]{} > >\copyrightholder{Titulaire Copyright} > >\newcommand{\isbn}[1]{} > >\isbn{abc-d-ef-ghijkj-m} > >\newcommand{\pinfos}[1]{} > >\pinfos{Infos production infos production infos production} > >\providecommand{\publishername}[1]{} > >\publishername{Nom Éditeur Livre} > >\providecommand{\publisheraddressone}[1]{} > >\publisheraddressone{Adresse éditeur ligne 1} > >\providecommand{\publisheraddresstwo}[1]{} > >\publisheraddresstwo{Adresse éditeur ligne 2} > >\providecommand{\publisheremail}[1]{} > >\publisheremail{Email éditeur email éditeur} > >\providecommand{\publisherphone}[1]{} > >\publisherphone{Téléphone éditeur} > > > >% > >%\date{} > > > > > >\begin{document} > > > >%\blankpage > >%\cleardoublepage > > > >\maketitle > > > >% > > > >{ > >\setcounter{tocdepth}{2} > >\tableofcontents > >} > > > >%% > >\begin{longtable}[]{@{}ll@{}} > >\toprule > >Auteur livre & Auteur livre\tabularnewline > >\midrule > >\endhead > >Titre livre & Titre livre titre livre\tabularnewline > >Sous-titre livre & Sous-titre livre sous-titre livre\tabularnewline > >Titre original & Titre original livre titre original livre titre > >original livre\tabularnewline > >Année copyright & AAAA\tabularnewline > >Titulaire copyright & Titulaire copyright\tabularnewline > >Isbn & ABC-D-EF-GHIJKL-M\tabularnewline > >Nom éditeur & Nom éditeur\tabularnewline > >Adresse éditeur ligne 1 & Adresse étiteur ligne 1\tabularnewline > >Adresse éditeur ligne 2 & Adresse éditeur ligne 2\tabularnewline > >E-mail éditeur & E-mail éditeur\tabularnewline > >Téléphone éditeur & Téléphone éditeur\tabularnewline > >Auteur couverture & Auteur couverture\tabularnewline > >Type document & Essai\tabularnewline > >Langue & Fr\tabularnewline > >\bottomrule > >\end{longtable} > > > >\chapter{Préface}\label{pruxe9face} > > > >Texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface. > > > >Texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte. > > > >Texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface. > > > >Texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface texte préface texte préface texte préface > >texte préface texte préface. > > > >Auteur Préface > > > >\part{Première partie}\label{premiuxe8re-partie} > > > >\chapter{Premier chapitre}\label{premier-chapitre} > > > >Texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre > >texte premier chapitre texte premier chapitre texte premier chapitre. > > > >\section{Première section}\label{premiuxe8re-section} > > > >Texte première section texte première section texte première section > >texte première section texte première section texte première section > >texte première section. > > > >\subsection{Première sous-section}\label{premiuxe8re-sous-section} > > > >Texte première sous-section texte première sous-section texte première > >sous-section texte première sous-section texte première sous-section > >texte première sous-section. > > > >\subsubsection{Premier paragraphe}\label{premier-paragraphe} > > > >Texte premier paragraphe texte premier paragraphe texte premier > >paragraphe texte premier paragraphe texte premier paragraphe texte > >premier paragraphe texte premier paragraphe. > > > >Texte premier paragraphe texte premier paragraphe texte premier > >paragraphe texte premier paragraphe. > > > >%% > >\end{document} > > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/42a14266-4afc-42ee-afc6-6490f7bca43a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.