Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include-in-header overwrites header-includes #4328

Closed
tolot27 opened this issue Jan 31, 2018 · 4 comments
Closed

include-in-header overwrites header-includes #4328

tolot27 opened this issue Jan 31, 2018 · 4 comments

Comments

@tolot27
Copy link
Contributor

tolot27 commented Jan 31, 2018

With pandoc v2.1.1 -H/--include-in-header overwrites header-includes: provided in the yaml block of the input markdown. According to the manual, it should Include contents of FILE, verbatim, at the end of the header.

Example file header_with.md with content:

---
title: metatest
author: Mathias Walter
header-includes:
  - '`\usepackage{todonotes}`{=latex}'
...

# Test

Some text.

additional.tex:

\usepackage{multicol}

Command: pandoc -s -t latex header_with.md -H additional.tex

The line \usepackage{todonotes} does not appear in the output anymore:

\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\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}
  \usepackage{textcomp} % provides euro and other symbols
\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}
}
\usepackage{hyperref}
\hypersetup{
            pdftitle={metatest},
            pdfauthor={Mathias Walter},
            pdfborder={0 0 0},
            breaklinks=true}
\urlstyle{same}  % don't use monospace font for urls
\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

\usepackage{multicol}

\title{metatest}
\author{Mathias Walter}
\date{}

\begin{document}
\maketitle

\hypertarget{test}{%
\section{Test}\label{test}}

Some text.

\end{document}
@jgm
Copy link
Owner

jgm commented Jan 31, 2018

Dup of #3139? See the discussion there.

@tolot27
Copy link
Contributor Author

tolot27 commented Feb 1, 2018

Closing in favor of #3139 and continue at pandoc-discuss.
Nevertheless, the documentation is incorrect because the "contents of FILE" is not really included at the end of the header because it replaces some part.

@tolot27 tolot27 closed this as completed Feb 1, 2018
@jgm
Copy link
Owner

jgm commented Feb 1, 2018

the documentation is incorrect because the "contents of FILE" is not really included at the end of the header because it replaces some part.

The FILE in this case is additional.tex (that's the argument to -H). It is included in full:


\usepackage{multicol}

@tolot27
Copy link
Contributor Author

tolot27 commented Feb 1, 2018

included at the end of the header

That part is wrong because it is not included at the end rather than it replaces the complete header-include part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants