sidebar: ai: fix latex

This commit is contained in:
end-4
2024-05-18 15:22:07 +07:00
parent 38b9b2bc32
commit 22367b9192
2 changed files with 3 additions and 1 deletions
@@ -102,7 +102,8 @@ const Latex = (content = '') => {
// You can add this line in the middle for debugging: echo "$text" > ${filePath}.tmp
const renderScript = `#!/usr/bin/env bash
text=$(cat ${filePath} | sed 's/$/ \\\\\\\\/g' | sed 's/&=/=/g')
LaTeX -headless -input="$text" -output=${outFilePath} -textsize=${fontSize * 1.1} -padding=0 -maxwidth=${latexViewArea.get_allocated_width() * 0.85}
cd "$(dirname $(command -v LaTeX))"
./LaTeX -headless -input="$text" -output=${outFilePath} -textsize=${fontSize * 1.1} -padding=0 -maxwidth=${latexViewArea.get_allocated_width() * 0.85} > /dev/null 2>&1
sed -i 's/fill="rgb(0%, 0%, 0%)"/style="fill:#000000"/g' ${outFilePath}
sed -i 's/stroke="rgb(0%, 0%, 0%)"/stroke="${darkMode.value ? '#ffffff' : '#000000'}"/g' ${outFilePath}
`;
+1
View File
@@ -99,5 +99,6 @@ install-MicroTeX (){
x make -j32
x sudo mkdir -p /usr/local/bin
x sudo cp ./LaTeX /usr/local/bin/
x sudo cp -r ./res /usr/local/bin/
x cd $base
}