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

{.unnumbered} tag cannot work at level 4 or lower? #6018

Closed
bsnresearcher opened this issue Dec 28, 2019 · 9 comments · Fixed by sthagen/jgm-pandoc#22
Closed

{.unnumbered} tag cannot work at level 4 or lower? #6018

bsnresearcher opened this issue Dec 28, 2019 · 9 comments · Fixed by sthagen/jgm-pandoc#22

Comments

@bsnresearcher
Copy link

bsnresearcher commented Dec 28, 2019

Do you have any idea to solve this?

I want to disappear the section number on the level4 of headline.

The un-numbering command {-} or {.unnumberd} can work expectedly as follows below figures.

However the number on the level4- of headline did not disappear unexpectedly.

  • input(test.md)
### Level3 or higher{-}
The {-} of this section work well.

#### Level4 or lower{-}
\
This {-} of this section did not work.
  • output(test.pdf)
    image

  • cmd: pandoc test.md -s -o test.pdf -N -F pandoc-crossref --pdf-engine=lualatex -V documentclass=ltjsarticle -V luatexjapresetoption=ms

  • pandoc: v2.9.1

P.S This pdf was produced by vscode-pandec addon @ VSCode

@jgm
Copy link
Owner

jgm commented Dec 29, 2019

Please explain what you mean "cannot work." What command did you try with this input? What output did you get? What did you expect? What version of pandoc?

@bsnresearcher bsnresearcher changed the title {.unnumbered} tag cannot work below level 4? {.unnumbered} tag cannot work at level 4 or lower? Dec 29, 2019
@mb21
Copy link
Collaborator

mb21 commented Dec 30, 2019

Can you try without pandoc-crossref? Is it only when using luatex?

@bsnresearcher
Copy link
Author

Pandoc-crossref, Pandoc-citeproc and so on are in requirement. The unexpected result occurred at upLatex too. I tried without the crossref filter but the result was same.
Thank you.

@jgm
Copy link
Owner

jgm commented Jan 2, 2020

OK, reproduced this with simply

 pandoc 6018.md  --number-sections -o 6018.pdf

where 6018.md is

### Level3 or higher{-}
The {-} of this section work well.

#### Level4 or lower{-}
\
This {-} of this section did not work.

@jgm
Copy link
Owner

jgm commented Jan 2, 2020

With level-3 headers, we use latex \subsection, or for unnumbered subsections the variant \subsection*. But it seems that with level-4 sections, \paragraph is used for both numbered and unnumbered. Looks like there actually is a \paragraph* command which we should use.

@bsnresearcher
Copy link
Author

Thank you, jgm. If you have any method to change a command \paragraph of LaTeX to \paragraph* inside Markdown file, tell me please.

@T-o-m-H-u
Copy link

@jgm

block-headings: true seems to break paragraph and subparagraph. The star ends up in the wrong place. --number-sections is implied.

block-headings

---
secnumdepth: 5
block-headings: true

...

# numbered section
fine

# unnumbered section {-}
fine too

#### numbered paragraph
right

#### unnumbered paragraph {-}
star ending up in wrong place

@ofabel
Copy link
Contributor

ofabel commented Mar 3, 2024

@T-o-m-H-u is indeed true.

A temporary solution to this problem is set block-headings to false and add the following code snippet to the header section (use include-in-header):

% Make \paragraph and \subparagraph free-standing
\let\oldparagraph\paragraph
\let\oldsubparagraph\subparagraph

\makeatletter

\renewcommand{\paragraph}{
  \@ifstar
    \xxxParagraphStar
    \xxxParagraphNoStar
}
\renewcommand{\subparagraph}{
  \@ifstar
    \xxxSubParagraphStar
    \xxxSubParagraphNoStar
}

\newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}
\newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}

\newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}
\newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}

\makeatother

@jgm
Copy link
Owner

jgm commented Mar 3, 2024

@T-o-m-H-u or @ofabel

block-headings: true seems to break paragraph and subparagraph.

Please create a new issue for this.

jgm pushed a commit that referenced this issue Mar 9, 2024
`block-headings: true` seems to break unnumbered paragraphs and subparagraphs. This is due to the fact, that the unnumbered version uses the star macros \paragraph* and \subparagraph*. See issue #6018 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants