Skip to content

Main content

Matrix as LaTeX Source Code

Browse the implementation files for Matrix as LaTeX.
@tool.io/tools/matrix/as-latex source ↗
tool.ts typescript
import { matrixAsLatex as formatPortableMatrixAsLatex } from '@tool.io/tools/matrix/as-latex';

export const matrixAsLatex = (input: unknown): string => {
	return formatPortableMatrixAsLatex(input) ?? '';
};

export const Tool: TypeTool = {
	name: 'Matrix as LaTeX',
	slug: 'matrix/as-latex',
	intro: 'Convert a numeric matrix into LaTeX bmatrix markup.',
	tool: matrixAsLatex,
	i: [
		{
			example: '[[1,2],[3,4]]',
			label: 'Matrix',
			placeholder: 'Enter a matrix',
			render: 'textarea',
			type: 'text'
		}
	],
	o: [
		{
			example: [
				'\\begin{bmatrix}',
				'1 & 2 \\\\',
				'3 & 4',
				'\\end{bmatrix}'
			].join('\n'),
			label: 'LaTeX',
			placeholder: 'LaTeX will appear here...',
			render: 'textarea',
			type: 'text'
		}
	],
	alternative: [
		{ title: 'Numeric Matrix Parser', url: '/parse/matrix' }
	]
};

export default Tool;

Description

Browse the implementation files for Matrix as LaTeX.

References

  1. Tool.io on GitHub
  2. Tool.io TypeScript tools library

Similar or alternative tools