diff --git a/src/components/latex.js b/src/components/latex.js index 829866c..b0d7b55 100644 --- a/src/components/latex.js +++ b/src/components/latex.js @@ -1,14 +1,18 @@ import style from './latex.css'; -import { Component } from 'preact'; +import {useContext} from "preact/hooks"; +import LatexRenderColor from "../contexts/LatexRenderColor"; -export default class Latex extends Component { - render() { - let equation = `{\\color{White} ${this.props.children} }`; - return ( - ); - } -} \ No newline at end of file +export default function(props) { + let renderColor = useContext(LatexRenderColor); + + // black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow + let inline = props.inline ? `\\inline` : ""; + + let equation = `${inline} {\\color{${renderColor}} ${props.children} }`; + return ( + ); +} diff --git a/src/contexts/LatexRenderColor.js b/src/contexts/LatexRenderColor.js new file mode 100644 index 0000000..0c25062 --- /dev/null +++ b/src/contexts/LatexRenderColor.js @@ -0,0 +1,3 @@ +import {createContext} from "preact"; + +export default createContext("White"); diff --git a/src/index.js b/src/index.js index 5995921..467126e 100644 --- a/src/index.js +++ b/src/index.js @@ -22,25 +22,28 @@ import OttimizzazioneLineare from "./routes/ottimizzazioneLineare"; import BasiDiDati from './routes/basiDiDati'; import CalcoloNumerico from './routes/calcoloNumerico'; import ApprendimentoSistemiArtificiali from "./routes/apprendimentoSistemiArtificiali"; +import LatexRenderColor from "./contexts/LatexRenderColor"; // noinspection JSUnusedGlobalSymbols export default class App extends Component { render() { return (
); } diff --git a/src/routes/ottimizzazioneLineare.js b/src/routes/ottimizzazioneLineare.js index acaff64..2077552 100644 --- a/src/routes/ottimizzazioneLineare.js +++ b/src/routes/ottimizzazioneLineare.js @@ -193,6 +193,11 @@ export default class OttimizzazioneLineare extends Component {+ Se il problema è rappresentato in forma di tableau, allora esso è risolvibile applicando l'algoritmo di Gauss-Jordan, in aggiunta tenendo conto delle regole per la selezione delle variabili entranti e uscenti. +
+