Giter VIP home page Giter VIP logo

Comments (23)

ghseeli avatar ghseeli commented on July 18, 2024

Hi! The latex2blender does not expect your installation of dvisvgm to be anywhere, per se, but rather that your local $PATH variable include wherever it may be installed. Can you open a command prompt and verify that you can run dvisvgm there? Thank you!

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

2022-05-05 10_03_22-

Ok, that's good to know. I opened cmd.exe and ran "dvisvgm" and it seems to work, though I haven't been using it via the command line so I'm not familiar, but I can confirm that my installation of MikTex and Texmaker have been able to output PDFs. Attached is a screenshot of the command line responding and blender having the same error.

from latex2blender.

hamzaelbarmaki1994 avatar hamzaelbarmaki1994 commented on July 18, 2024

hi, i'm having the same issue and i installed miktex and tekmaker dvisvgm is working , my question is about the local path you mentioned is that we have to set it manually and how to do so and i prefer and hope you do a video explainig installation and cases where we have issues and how to solve them ..... feature and addon really needed thank you

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

As mentioned above, the directory containing latex or dvisvgm is probably not contained in your PATH environment variable and therefore when the add-on executes the the latex and dvisvgm commands, it doesn't know where to find them and therefore doesn't produce the svg file.

In command prompt, you could try typing where latex or where dvisvgm to find their location. Next you can open Blender and go to the scripting tab and in the console type import os. Then type os.environ['Path'] to see your PATH environment variable. If the directory containing latex or dvisvgm is not in the PATH environment variable, then this is probably the issue.

In the code for latex2blender, we added an extra directory to the PATH environment variable that latex and dvisvgm is often located in (at least on Mac), namely '/Library/TeX/texbin', in case the PATH environment variable does not contain this directory. However, it is possible your copy of dvisvgm is in some other directory not accounted for. I will work on adding an extra option to append the path of latex and dvisvgm to your PATH environment variable, but in the meantime, you can try replacing the path in line 152 of latex2blender.py (current release) with the folder that your copy of dvisvgm is located in and then reinstall the add-on.

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

I just made some changes to latex2blender.py to address this issue. Now you can enter the path to the latex and dvisvgm commands on the add-on. Let me know if this fixes your issue. Note, I haven't made a new release yet. I will do this once you confirm this fixes the issue.

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

Testing error
Sorry for the late reply. I ended up uninstalling MiKTeX and installed TeXLive to see if it would help. I installed the new version of latex2blender and I'm running Blender 3.2.0 stable. Thank you for adding that functionality, however both with and without using the new latex and dvisvgm fields I get the same error.

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

Hi, @dreamparacite ! Thank you for letting us know. I will see if I can reproduce this error on my windows machine sometime this week. I tested the new version with a fresh installation of MiKTeX and Blender and everything worked for me. When you have a chance, could you please open a command prompt and post the results of the commands where latex and where dvisvgm ? Thank you!

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

I think the issue is that the path you entered for latex and dvisvgm needs to be the path of the directory containing the latex/dvisvgm command, not the path of the actual command. So instead enter C:\texlive\2022\bin\win32\ rather than C:\texlive\2022\bin\win32\latex.exe or C:\texlive\2022\bin\win32\dvisvgm.exe and let me know if that works.

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

Path

I tried that just now and am getting the same error.

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

Ok thank you for letting me know. Let's try some further troubleshooting:

  1. If you type where dvisvgm and where latex into command prompt does it say exactly C:\texlive\2022\bin\win32\?
  2. Let's make sure latex and dvisvgm are functioning properly and outputting the correct files. Somewhere on your computer can you create a new folder and call it something like test_latex. Inside that folder add the file default_preamble.tex from the latex2blender repository. Then open that file and add to it:
\begin{document}
$1+1$
\end{document}

So the entire file should be:

\documentclass{amsart}
\usepackage{amssymb,amsfonts}
\usepackage{tikz}
\usepackage{tikz-cd} 
\pagestyle{empty}
\thispagestyle{empty}
\begin{document}
$1+1$
\end{document}

Save the file.

Now open command prompt and navigate to the folder test_latex using the cd command. Then in command prompt type latex default_preamble.tex. What files does this produce in the test_latex folder? If it worked as expected, there should be a file called default_preamble.dvi. If not then, this is at least one source of the problem.

  1. If the file default_preamble..dvi does appear, next try running dvisvgm default_preamble.dvi and let me know what files this produces in the test_latex folder. If it ran correctly, there should be a file called default_preamble.svg. If this file is not there, that could be another source of the problem.

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

cmd
This is the result of asking where latex and dvisvgm are
output
Here is the output from the two operations on default_preamble.tex, the first image being the result of latex default_preamble.tex and the second being dvisvgm default_preamble.dvi

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

Thank you. Hmm, latex and dvisvgm seem to be working as expected. I will have to think more about what the issue could be and get back to you.

from latex2blender.

peterkj1 avatar peterkj1 commented on July 18, 2024

Okay, I have one other idea. The issue might be that the path C:\texlive\2022\bin\win32\ has backslashes rather than forward slashes. Python may think the backslash is an escape character. Can you try changing all of your backslashes to forward slashes, i.e. C:/texlive/2022/bin/win32/ and let me know if you still get the error? If that works, then I will add some code to automatically deal with the slashes so you don't have to manually do it.

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

I have not yet been able to figure out how to reproduce the issue on my Windows machine, but I made a new branch which attempts to expose more of the error messages that come from the system. @dreamparacite , if you try to use the version on the pull request #14, this may better expose your issue! If you have a chance to try it, please let us know what happens.

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

@peterkj1 I tried both versions with the backslashes and the forward slashes and still got errors

@ghseeli I'm not familiar with git so I wasn't sure how to download the pull request, so I manually made the py file with the code from pull request #14 and got this error message:

pull request error

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

Hi @dreamparacite ! Thank you for running this. The way you got the code is fine. I still have not been able to reproduce your error. To further explore, I have updated the file in the pull request to add a 60 second "pause" in the latex2blender code between creating the .tex file and trying to compile it. If you can, could you please install this new version and do the following?

  1. First, open C:\Users\<username>\AppData\Local\Temp in Windows Explorer.
  2. Then, run latex2blender on something generic like you have been doing.
  3. Within 60 seconds (the pause time), look for a new folder in the Temp directory; it will begin with tmp and then a bunch of random characters.
  4. Verify there is a test.tex file and open it with a text editor to verify the contents.

If anything goes wrong with any of these steps, please let us know. It will be helpful information if one of these steps is not possible.

Also, we were wondering: does your account have administrator privileges on the machine? Furthermore, are you running blender with the same user account that installed it?

Thank you!

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

My account does have administrator privileges and I am running blender with the same user account that installed it, however this is a work machine and so may have settings I'm not aware of. That being said I do recall trying latex2blender at home a few weeks back and having the same error.

I installed the new script and ran the sample TeX code $1+1=2$

error
Here is the contents of temp.tex that was created in the folder tmpt_rfoasu

errormessage
After the 60 second wait the folder disappeared and the error message displayed in blender. I'm including the entire error message because it's possible the path it's showing is part of the problem. The user is KarlLocal but I'm seeing KARLLO and KARLLO~1 in parts of the error message and I'm not sure if that's relevant or not.

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

Ahah! I think the issue is that your username has a ~ character. The ~ character is an active character in TeX and so the latex command is not parsing the filepath correctly. For instance, if you ran latex C:/Users/KARLLO~1/Documents/test.tex in the command prompt, you would get a similar error. I will try to get this fixed soon.

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

I'm not sure where the ~ is coming from in that error message, since my username should just be all alphabetical characters, for reference the path should be C:\Users\KarlLocal\AppData\Local\Temp

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

Right. I should have said, the Python is abbreviating your username. This is an artifact from old implementations of Windows and I am not sure why Python is reverting to the abbreviation instead of the full name. I will investigate more.

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

@dreamparacite I was able to reproduce your issue and then @peterkj1 and I were able to fix it on my end. I have updated pull request #14 with the fix. Can you see if it works now? Thank you!

from latex2blender.

dreamparacite avatar dreamparacite commented on July 18, 2024

works
I tested it just now and it works! I tested compiling for each of the object types and they all worked without issue. In addition, it seems to have detected latex and dvisvgm and I didn't have to set their paths. Thank you both for looking into this!

from latex2blender.

ghseeli avatar ghseeli commented on July 18, 2024

Great! I am glad to hear it! @peterkj1 and I will incorporate this fix into the official release in the next few days. Thank you for helping us troubleshoot!

from latex2blender.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.