Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

finalize not working when using -H and not using header-includes #1

Closed
sky-y opened this issue Apr 4, 2018 · 3 comments
Closed

finalize not working when using -H and not using header-includes #1

sky-y opened this issue Apr 4, 2018 · 3 comments

Comments

@sky-y
Copy link

sky-y commented Apr 4, 2018

I'm using Pandoc with LuaLaTeX.

  • The pandoc options contain -H header.tex and metadata.yaml as one of the input files.
  • metadata.yaml and input files don't contain header-includes.

But the LuaLaTeX compiler says

! Undefined control sequence.
\addcontentsline #1#2#3->\oldaddcontentsline
                                             {#1}{#2}{#3}
l.1240 \section{段落についての議論}  % in Japanese

This issue may be caused by the finalize function on pandoc_latex_unlisted.py.

My workaround works appending:

\let\oldaddcontentsline\addcontentsline

to header.tex directly.

Related Issue

Thanks for your help, however using your filter I get the following error: Chapter 1. ! Undefined control sequence. \addcontentsline #1#2#3->\oldaddcontentsline {#1}{#2}{#3} l.327 \chapter{Introduction}\label{introduction}} . Do you have an idea what the problem could be here? See here for my full build command. – Anton Mar 31 at 16:01

@chdemko
Copy link
Owner

chdemko commented Apr 4, 2018

Could you please post your input file here?

@sky-y
Copy link
Author

sky-y commented Apr 4, 2018

@chdemko
Copy link
Owner

chdemko commented Apr 5, 2018

It's definitively a pandoc issue which cannot be solved directly in the filter

See

So in you want to use the pandoc-latex-unlisted filter and the -H option, you have to define \let\oldaddcontentsline\addcontentsline in your latex file

@chdemko chdemko closed this as completed Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants