Giter Club home page Giter Club logo

latex_tools's Introduction

latex_tools

Tools that automatically edit latex files for scientific publications.

This repository houses scripts that can be used for automatically editing and processing LaTeX files for scientific publication. All scripts were tested on an anaconda distribution of python 3.6.9. In this read me, I will describe each script one by one:

reforder.py

This script will take in a set of LaTeX .tex documents, identify the order of appearance in the text of each supplemental figure, and then reorder your in text references so that they are all called fig:figureS1, fig:figureS2, and so forth, in order of appearance in the text. This doesn't assume anything about the formatting of your references initially, but will change them all to the fig:figureSX format, including both \ref and \label instances.

After running the script, you need to manually copy and paste around your figure blocks so that they are in order. You can use this script to check the order of your labels after doing so (label_order variable). The script also assumes you will order your main text figures by yourself, but can easily use it to check the order of appearace of references by changing line 33 to

ref_usages = np.array(unlist([re.findall('\\\\ref\{fig:figure.*?\}',x) for x in reflines]))

The script requires 2 input variables:

  • homedir: the local path to the directory containing your .tex files
  • tex_files: a list of filenames for .tex files to assess, without the extension

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.