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

epub chapter generated by latex before first markdown section #2161

Closed
danomatika opened this issue May 20, 2015 · 5 comments
Closed

epub chapter generated by latex before first markdown section #2161

danomatika opened this issue May 20, 2015 · 5 comments

Comments

@danomatika
Copy link

Using: pandoc 1.13.2.1

I'm working with markdown and using some latex after the yaml header and my first section # section. When exporting an epub (epub & epub3), the ignored latex triggers a blank chapter with the same name as the title.

Expected behavior for me, would be to ignore the latex and use the first section as the first chapter. This also ocurrs with html comments, but I see that as expected since epub uses html.

A minimal example, test.md:


---
title: A Paper
author: John Doe
rights: Copyright © 2015 by John Doe

---

\linebreak

# Abstract

Hello World

# Section 1

123456

# Section 2

abcdefg

epub generated with:

pandoc -f markdown -t epub3 text.md -o text.epub

results in these first two pages as viewed in iBooks on OSX:

screen shot 2015-05-20 at 4 51 01 am

@danomatika danomatika changed the title epub output: latex before first markdown section generates chapter latex before first markdown section generates epub chapter May 20, 2015
@danomatika danomatika changed the title latex before first markdown section generates epub chapter epub chapter generated by latex before first markdown section May 20, 2015
@jgm
Copy link
Owner

jgm commented May 20, 2015 via email

@danomatika
Copy link
Author

Yeah, that's probably the right way to do it, but I'm trying to avoid using templates so I have less to maintain. At least that's my initial thought in jumping into Pandoc. Instead, I override what I need using a header .sty and only need a custom title in the pdf output to fit a specific requirement.

Since the same latex is ignored in the other output formats, I figured it would be in the epub output as well.

@danomatika
Copy link
Author

Using my demo project: https://github.com/danomatika/pandoc-test

Build epub and printing first chapter:

make clean && make && make check-first

gives me:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <title>A Paper</title>
  <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<section id="a-paper" class="level1 unnumbered">
<h1>A Paper</h1>
<p></p>
</section>
</body>
</html>

@jgm
Copy link
Owner

jgm commented May 27, 2015

I'd rather not do something ad hoc here, so I'm going to recommend the template approach.

@jgm jgm closed this as completed May 27, 2015
@danomatika
Copy link
Author

Yeah that makes sense. I actually have exported and modified the default templates which is the better option so far.

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