Skip to content

Conversation

@emuro
Copy link
Owner

@emuro emuro commented Apr 22, 2022

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Closes #...

peterjc added 11 commits July 30, 2019 17:15
$ for f in *.tex; do pandoc -f latex -t rst -o ${f%.*}.rst $f; done
(A) Initial approach:

$ for f in *.tex; do pandoc -f latex -t rst -o ../${f%.*}.rst $f; done

This does not handle the references (e.g. to chapters) properly.

(B) However, this does - it just needs cutting up again:

$ pandoc -f latex -t rst -o Tutorial.rst Tutorial.tex

Wrote a simple script to do this (after earlier standardising the
chapter labels to help):

$ pandoc -f latex -t rst Tutorial.tex | ../.github/rst_chunk.py

Fixes the chapter numbers, but dumps the references to the
end of the appendix (poorly formatted anyway).

This then fixes links to other chapters (since pandoc was writing
a single large RST file, it made all the links internal HTML style
starting with hash):

$ sed -i.bak "s/<#chapter:/<chapter:/g" chapter_*.rst

(C) Wrote a script to convert the links to :ref: style instead,
First, hack the comment lines which otherwise pandoc ignores,
the convert to RST:

$ sed -i.bak "s#^%doctest#\\\pandocignoreme .. doctest#g" *.tex
$ sed -i.bak "s#^%cont-doctest#\\\pandocignoreme .. cont-doctest#g" *.tex
$ for f in *.tex; do pandoc -f latex -t rst -o ../${f%.*}.rst $f; done
$ git checkout *.tex

Then fix links:

$ ../.github/ref_fix.py chapter_*.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants