Detalhes do pacote

sanity-plugin-latex-input

sanity-io4.2kMIT2.0.6

Latex input for Portable Text Editor in Sanity Studio V3.

sanity, plugin, latex

readme (leia-me)

LaTeX input for Sanity

This is a Sanity Studio v3 plugin. For the v2 version, please refer to the v2-branch.

What is it?

sanity-plugin-latex-input adds support for latex schema type, so it can be used in Portable Text Editor (PTE) in Sanity Studio.

latex-input preview

Installation

npm install --save sanity-plugin-latex-input

or

yarn add sanity-plugin-latex-input

Usage

Import and add the plugin to your studio config in sanity.config.ts (or .js):

import { latexInput } from "sanity-plugin-latex-input";

export default defineConfig({
  /* ... */

  plugins: [
      latexInput()
  ]
})

You may now use the type name latex in your schema, such as in portable text.

Example schema definition for portable text

import React from 'react'
const mathInlineIcon = () => (
  <span>
    <span style={{ fontWeight: 'bold' }}>∑</span>b
  </span>
)
const mathIcon = () => <span style={{ fontWeight: 'bold' }}>∑</span>

export default {
  name: 'portableTextWithLatex',
  type: 'array',
  title: 'Body',
  of: [
    {
      type: 'block',
      title: 'Block',
      of: [
        { type: 'latex', icon: mathInlineIcon, title: 'Inline math' },
      ],
    },
    { type: 'latex', icon: mathIcon, title: 'Math block' },
  ],
}

The Portable Text editor will render a preview of the contents with KaTeX.

License

MIT-licensed. See LICENSE.

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Release new version

Run "CI & Release" workflow. Make sure to select the v3 branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.

changelog (log de mudanças)

📓 Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.6 (2025-07-10)

Bug Fixes

  • deps: allow studio v4 in peer dep ranges (#54) (223f2e4)

2.0.5 (2024-11-06)

Bug Fixes

  • deps: update non-major (#33) (a10a49a)
  • remove unnecessary styled-components dependency (#52) (d30fab7)

2.0.4 (2022-12-06)

Bug Fixes

  • preview works in portable text and arrays in sanity 3.0.0+ (d2cc3b6)

2.0.3 (2022-11-25)

Bug Fixes

  • deps: sanity ^3.0.0 (rc.3 compatible) (0d83c2d)

2.0.2 (2022-11-15)

Bug Fixes

  • corrected v2 version link (a128304)

2.0.1 (2022-11-15)

Bug Fixes

  • docs: updated install command (2ffd0cf)

2.0.0 (2022-11-15)

⚠ BREAKING CHANGES

  • this version only works in sanity V3
  • this version does not work in Studio V2

Features

Bug Fixes

  • branchname (a49af98)
  • ci: added semver workflow (add8f89)
  • compiled for sanity 3.0.0-rc.0 (b008c1c)
  • deps: dev-preview.21 (d1ae97f)
  • deps: dev-preview.22 (05b8ad1)
  • deps: pkg-utils & @sanity/plugin-kit (5a5e9cf)
  • deps: sanity 3.0.0-dev-preview.17 (c9e98da)

0.3.0-v3-studio.5 (2022-11-04)

Bug Fixes

  • deps: pkg-utils & @sanity/plugin-kit (5a5e9cf)

0.3.0-v3-studio.4 (2022-11-03)

Bug Fixes

  • compiled for sanity 3.0.0-rc.0 (b008c1c)

0.3.0-v3-studio.3 (2022-10-27)

Bug Fixes

0.3.0-v3-studio.2 (2022-10-07)

Bug Fixes

  • deps: dev-preview.21 (d1ae97f)
  • deps: sanity 3.0.0-dev-preview.17 (c9e98da)

0.3.0-v3-studio.1 (2022-09-14)

Bug Fixes