Git Product home page Git Product logo

pandoc-latex-unlisted's Introduction

This filter is now deprecated as it is now in the core of pandoc.

pandoc-latex-unlisted

Coveralls Scrutinizer PyPI version PyPI format License Python version Development Status

pandoc-latex-unlisted is a pandoc filter for unlisting some headers in the table of contents in LaTeX.

Documentation

See the wiki pages.

Usage

To apply the filter, use the following option with pandoc:

--filter pandoc-latex-unlisted

Installation

pandoc-latex-unlisted requires python, a programming language that comes pre-installed on linux and Mac OS X, and which is easily installed on Windows. Either python 2.7 or 3.x will do.

Install pandoc-latex-unlisted as root using the bash command

pip install pandoc-latex-unlisted

To upgrade to the most recent release, use

pip install --upgrade pandoc-latex-unlisted

To upgrade to the current code, use

pip install --upgrade --force git+https://github.com/chdemko/pandoc-latex-unlisted

pip is a script that downloads and installs modules from the Python Package Index, PyPI. It should come installed with your python distribution. If you are running linux, pip may be bundled separately. On a Debian-based system (including Ubuntu), you can install it as root using

apt-get update
apt-get install python-pip

Getting Help

If you have any difficulties with pandoc-latex-unlisted, please feel welcome to file an issue on github so that we can help.

pandoc-latex-unlisted's People

Contributors

chdemko avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

anton-4

pandoc-latex-unlisted's Issues

'MetaBlocks' object has no attribute 'append'

I am getting an error when running pandoc-latex-unlisted.

Thanks!

Traceback (most recent call last):
  File "/usr/local/bin/pandoc-latex-unlisted", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/pandoc_latex_unlisted.py", line 43, in main
    return run_filter(header, prepare = prepare, doc = doc, finalize = finalize)
  File "/usr/local/lib/python2.7/site-packages/panflute/io.py", line 265, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/panflute/io.py", line 249, in run_filters
    finalize(doc)
  File "/usr/local/lib/python2.7/site-packages/pandoc_latex_unlisted.py", line 40, in finalize
    doc.metadata['header-includes'].append(MetaInlines(RawInline('\\let\\oldaddcontentsline\\addcontentsline', 'tex')))
AttributeError: 'MetaBlocks' object has no attribute 'append'
Error running filter pandoc-latex-unlisted:

`finalize` not working when using `-H` and not using `header-includes`

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

warning about importing the future

Thanks a lot for this filter it works perfectly. I am using it in a bookdown project.

The only thing worrying me is the warning that is displayed every time I convert a markdown file to PDF with pandoc. click complains about unicode_literals __future__ import.
Is something wrong with my setup? Am I using the wrong Python version?

The behavior is reproducible with your example on ubuntu 18.04 and pandoc 2.3.1 (brought in by RStudio):

pandoc -N pandoc-latex-unlisted-sample.txt --pdf-engine=xelatex --filter pandoc-latex-unlisted -o out.pdf

results in exactly the pdf shown in your wiki and the following warning

/usr/local/lib/python2.7/dist-packages/panflute/autofilter.py:163: Warning: Click detected the use of the unicode_literals __future__ import.  This is heavily discouraged because it can introduce subtle bugs in your code.  You should instead use explicit u"" literals for your unicode strings.  For more information see https://click.palletsprojects.com/python3/
  "that is appended to the search list.")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.