Comments (9)
Andrea has added this feature in
e24ce1c
so you can compile the github version to test it.
The first paragraph after a header will have style "First paragraph" instead of "Text body."
Note that sometimes the first paragraph after a header comes after a non-paragraph block, such as a list or code block; in this case it still gets the "First paragraph" style. In this and a few other cases, you may need to do some manual tweaking, but this should help.
from pandoc.
Cool!
Given my previous problems with ghc and cabal, any tips on how best to compile and test the version without screwing up my setup (again)? I presume I'd want to compile it to a local directory and test there, but am not sure how.
On the logic of the application, I think it's probably generally reasonable to apply the behavior to all following paragraphs. So, for example, it would get applied to the first paragraph following a block (like a blockquote).
When I deal with this in HTML, I normally just have a CSS rule like:
p + p { /* indent first line */ }
from pandoc.
Just clone the repository, cd to it, and 'cabal install'.
I wouldn't expect problems if you've been able to do 'cabal install
pandoc' without problems.
+++ bdarcus [Mar 12 11 13:59 ]:
Cool!
Given my previous problems with ghc and cabal, any tips on how best to compile and test the version without screwing up my setup (again)? I presume I'd want to compile it to a local directory and test there, but am not sure how.
from pandoc.
OK, compiled fine.
Comments:
Right now, the "First Paragraph" style doesn't get applied to the first paragraph after blocks, so the consequence is that paragraphs immediately following blockquotes and lists, for example, are indented (if I change the body text style to do first-line indent).
Is there any reason not to have done it the other way around: body text for first after block, and then all other paragraphs with "First Line Indent"?
from pandoc.
Sometimes an author wants a new paragraph after a blockquote or list, sometimes not. There is no way for pandoc to tell which is intended. So the only question is what is the best default. Let me run this by Andrea.
from pandoc.
I'm not sure I understand the problem here. Bruce said:
Right now, the "First Paragraph" style doesn't get applied to the first paragraph after blocks, so the consequence is that paragraphs immediately following blockquotes and lists, for example, are indented (if I change the body text style to do first-line indent).
This is not correct: the first text paragraph immediately following blockquotes or a list paragraph will have a "First paragraph" style. So, if "Text body" has a first line indent, the paragraph after a blockquote will not have the first line indented.
Is there any reason not to have done it the other way around: body text for first after block, and then all other paragraphs with "First Line Indent"?
Yes, there is -- even though I don't know if it is reasonable: the fact is that it is the first paragraph of a section which needs some kind of special treatment (not having the first line indented). So I prefer to keep the normal paragraph as "Text body" and use a special style only for the first paragraph.
from pandoc.
If I run the below test doc, only "one" gets "First Paragraph", where I also expect "three" and "four."
So I'm seeing something different than you are, I guess?
# Introduction
one
two
> block
three
* x
* y
* z
four
five
from pandoc.
Sorry I didn't understand. I've sent John a patch that sets the "First paragraph" style for every paragraph immediately following a section heading or definition, ordered and unordered lists.
The first paragraph will not be used after tables, code blocks and horizontal rule. It is easy to change the behavior of the code though.
from pandoc.
I've pushed the patch, with modifications to include tables, code blocks, and horizontal rules. (I think it makes sense to make the behavior consistent and predictable.) I also moved 'setFirstPara' from 'inHeaders' to 'blockToOpenDocument', so you can see at a glance which blocks reset this. I'll close this unless someone thinks there's still more to do.
from pandoc.
Related Issues (20)
- employ the already established `.unlisted` class in markdown also in the ePUB writer HOT 4
- Thesis support
- `linestretch` does not take effect for latex beamer slides HOT 3
- unexpected repeating of information in other sections of epub due to self-closed div being handled as unclosed
- When converting from md to html, the <script> and <center> tags in tables were ignored. HOT 1
- pandoc markdown->latex->pdf , please convert `<br/>` into `\newline` HOT 3
- `pandoc server` not emitting code highlighting HOT 3
- Add scroll: view option to revealjs template HOT 4
- ODT reference.odt does not contain TableCaption style HOT 3
- Pandoc with `--natbib` swallows locators in its output HOT 4
- How to Added the Text Align and Text Color added the HTML to DOCX convert HOT 4
- How to Added the Text Align and Text Color added the HTML to DOCX convert HOT 1
- Inconsistent heading levels with AsciiDoc output HOT 3
- [new feature] SCDOC format HOT 7
- How to added custom table border XHTML to DOCX HOT 1
- pandoc-lua can't require binary packages when installed with Conda HOT 4
- Leading tabs in code block are not retained in org reader with `-p` HOT 9
- conversion to .tex breaks line about documentclass HOT 2
- In pandoc 3.3 html tables rendered from markdown don't look right HOT 6
- Large inline images use a lot of memory HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc.