Skip to main content

Write scientific articles in markdown

Project description

texmark

Write scientific articles in markdown

Installation

for development, after cloning:

pip install -e .

and soon:

pip install texmark

Example

See example.md for a sample markdown file with yaml metadata in the header.

The command to convert the markdow to tex is:

texmark example.md

And to convert to PDF

texmark example.md --pdf

For another journal, it is enough to change the journal -> template' field in the yaml metadata. For testing it is also possible to pass -jfor--journal-template`:

texmark example.md --pdf -j science -o build/example-science.pdf --tex build/example-science.tex

See the example tex and pdf results in build

For now only copernicus and science template are available. Only partial support is provided. Upon submission you'll most likely need to rework the final latex version, especially to handle things like appendix or special sections. Alternatively, you may write your custom template (see the advanced section)

Collect figures and tables at the end of the document

Just add

collect_figures_and_tables: true

to your markdown yaml metadata.

Advanced: latex template

The templates are written in jinja2.

Just copy from e.g. texmark/templates/science/template.tex to your own, e.g. custom_template.tex And run again with:

texmark example.md --pdf -j science -o build/example-science.pdf --tex build/example-science.tex --template custom_template.tex

The -j journal template option (here science) is still used to set custom filters (e.g. only \cite for Science, no \citet ; extract specific sections as metadata to be injected as {{section}} instead of {{body}} etc). The machinery is defined in texmark/filters.py and can in principle be extended or copied. Two approaches are possible:

  • just add more filters via the --filters command or in the yaml metadata.
  • extend the existing filters in a module, e.g. custom_filter.py, that extends the filters dict from the texmark.filters module (see the source code to check the details). And then pass it via --filters-module custom_filter parameter (or custom_filter in the metadata) to prompt the texmark filter to load that module and make it available via -j your-custom-name. Note that will require you to explicitly pass --template as well. Unless you overwrite an existing filter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

texmark-0.5.5.tar.gz (112.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

texmark-0.5.5-py3-none-any.whl (116.3 kB view details)

Uploaded Python 3

File details

Details for the file texmark-0.5.5.tar.gz.

File metadata

  • Download URL: texmark-0.5.5.tar.gz
  • Upload date:
  • Size: 112.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for texmark-0.5.5.tar.gz
Algorithm Hash digest
SHA256 6003b228b30d77b5c260658909812f57887b5ab4c28d05a7b8ce2b9efc5ad7b5
MD5 6cb39fe944caaa823d71f8d90b0f2da9
BLAKE2b-256 42523ae615bb703c12a9d4bd3b858b739b7dc691f5b7503235d9e1be792780b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for texmark-0.5.5.tar.gz:

Publisher: pypi.yml on perrette/texmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texmark-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: texmark-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 116.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for texmark-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4441aa0291cdcb7b8fdbb1c6f44285e261934ba83e269f95a0ffc24c462cd46f
MD5 28bd3f2f6396778b2f0c2bffb26bea4b
BLAKE2b-256 6f3ce9e03fcca4003645b1c65f24909eddcb3df73a1cbb6213f2e2c5e9edc576

See more details on using hashes here.

Provenance

The following attestation bundles were made for texmark-0.5.5-py3-none-any.whl:

Publisher: pypi.yml on perrette/texmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page