Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.13k stars 959 forks source link

There is no line break between the H4-level heading and the body text #362

Open ShuwenY opened 12 months ago

ShuwenY commented 12 months ago

How can I get a line break between the H4 heading and the main text?

command:

pandoc -o $pdf_name $md_files \
    --from markdown \
    --pdf-engine=xelatex --listings \
    --template eisvogel \
    --toc --toc-depth=4 \
    -V mainfont="Alibaba PuHuiTi" \
    -V sansfont="Alibaba PuHuiTi" \
    -V monofont="Cascadia Code" \
    -V CJKmainfont="Alibaba PuHuiTi" \
    -V CJKsansfont="Alibaba PuHuiTi" \
    -V CJKmonofont="Cascadia Code" \
    -V colorlinks=true \
    -V urlcolor=blue \
    -V linkcolor=blue \
    -V toc-color=NavyBlue \
    -V titlepage=true \
    -V titlepage-color="FFFFFF" \
    -V titlepage-rule-color="FFFFFF" \
    -V titlepage-text-color="000000" \
    -V titlepage-logo="../logo.png" \
    -V logo-width=20mm

Problem phenomenon

image

cratermoon commented 12 months ago

That's built in to pandoc. If you add -V block-headings, that should give you the result you want.

dm5n commented 8 months ago

Also in YAML:

block-headings: true

GregoryKogan commented 6 months ago

block-headings sometimes doesn't work with book: true for me. I was able to add line breaks after H4 by manually specifying it.

# metadata.yaml

header-includes: |
  \RedeclareSectionCommand[
    beforeskip=-10pt plus -2pt minus -1pt,
    afterskip=1sp plus -1sp minus 1sp]{paragraph}
  \RedeclareSectionCommand[
    beforeskip=-10pt plus -2pt minus -1pt,
    afterskip=1sp plus -1sp minus 1sp,
    indent=0pt]{subparagraph}

You have full control over headings like this. You can change font as you wish.