Skip to content

Commit b6360bb

Browse files
committed
- bugfix
1 parent 112d9e0 commit b6360bb

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

AddinUtilities.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ public static bool executeDviPs(LatexEquation equation)
348348
return true;
349349
}
350350

351-
public static bool createLatexPng(LatexEquation equation, bool usePreview, bool firstRun)
351+
public static bool createLatexPng(LatexEquation equation, bool firstRun)
352352
{
353353
// Check paths
354354
SettingsManager mgr = SettingsManager.getCurrent();
355355

356356
string appPath = AddinUtilities.getAppDataLocation();
357357
Directory.SetCurrentDirectory(appPath);
358-
LatexFileGenerator.writeTexFile(appPath + "\\teximport.tex", equation, usePreview);
358+
LatexFileGenerator.writeTexFile(appPath + "\\teximport.tex", equation);
359359
if (!executeMikTex())
360360
return false;
361361
if (!executeDviPng(equation, firstRun))
@@ -371,7 +371,7 @@ public static bool createLatexPs(LatexEquation equation)
371371

372372
string appPath = AddinUtilities.getAppDataLocation();
373373
Directory.SetCurrentDirectory(appPath);
374-
LatexFileGenerator.writeTexFile(appPath + "\\teximport.tex", equation, false);
374+
LatexFileGenerator.writeTexFile(appPath + "\\teximport.tex", equation);
375375
if (!executeMikTex())
376376
return false;
377377
if (!executeDviPs(equation))

LatexDialog.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ private bool generateEquation(bool createShape)
231231
// Run once with preview to get depth value
232232
m_finishedSuccessfully = true;
233233
if (!createShape)
234-
m_finishedSuccessfully = AddinUtilities.createLatexPng(m_latexEquation, true, true);
234+
m_finishedSuccessfully = AddinUtilities.createLatexPng(m_latexEquation, true);
235235

236236
if (m_finishedSuccessfully)
237237
{
238238
// Run once without to get correct tight image
239239
if (!createShape)
240-
m_finishedSuccessfully = AddinUtilities.createLatexPng(m_latexEquation, false, false);
240+
m_finishedSuccessfully = AddinUtilities.createLatexPng(m_latexEquation, false);
241241
else
242242
{
243243
m_finishedSuccessfully = AddinUtilities.createLatexPs(m_latexEquation);

LatexFileGenerator.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public LatexEquation(string latexCode, float fontSize, string textColor, LatexFo
4949

5050
public class LatexFileGenerator
5151
{
52-
public static void writeTexFile(string fileName, LatexEquation equation, bool usePreview)
52+
public static void writeTexFile(string fileName, LatexEquation equation)
5353
{
5454
string templateText = "";
5555
string templateFileName = AddinUtilities.getAppDataLocation() + "\\LatexTemplate.txt";
@@ -79,8 +79,6 @@ public static void writeTexFile(string fileName, LatexEquation equation, bool us
7979
}
8080

8181
string content = "";
82-
if (usePreview)
83-
content += "\\begin{preview}\n";
8482
content += "\\definecolor{txtcolor}{rgb}{" + equation.m_color + "}\n"; ;
8583
content += "\\color{txtcolor}\n";
8684
content += "\\changefont{" + equation.m_font.latexFontName + "}{" +
@@ -89,8 +87,6 @@ public static void writeTexFile(string fileName, LatexEquation equation, bool us
8987
equation.m_fontSize.ToString() + "}{" +
9088
((equation.m_fontSize * 1.2)).ToString(System.Globalization.CultureInfo.InvariantCulture) + "}\n";
9189
content += equation.m_code;
92-
if (usePreview)
93-
content += "\n\\end{preview}\n";
9490

9591
templateText = templateText.Replace("${Content}", content);
9692

Resources/LatexTemplate.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
\documentclass[12pt,a4paper,ngerman]{article}
1+
\documentclass[12pt,a4paper]{article}
22
\usepackage{amsmath}
3+
\usepackage{amsfonts}
4+
\usepackage{amssymb}
35
\usepackage[utf8]{inputenc}
46
\usepackage{bbm}
57
\usepackage{ae,aecompl}
68
\usepackage{color}
7-
\usepackage[active,displaymath,textmath,tightpage]{preview}
89
\newcommand{\changefont}[5]{\fontfamily{#1} \fontseries{#2} \fontshape{#3} \fontsize{#4}{#5}\selectfont}
910
\setlength{\parindent}{0pt}
1011
\begin{document}

0 commit comments

Comments
 (0)