Giter Club home page Giter Club logo

Comments (9)

GjjvdBurg avatar GjjvdBurg commented on June 18, 2024

Hi @ChelsyMena, thanks for reporting this issue. I'm sorry to hear you're having trouble getting the code to work. Do you have a working Latex installation on your system, including latexmk? As that is what is used to create the Tex time line.

You might be able to test this by running:

>>> from labella.tex import text_dimensions
>>> text_dimensions("foo", silent=False)

from labella.py.

GjjvdBurg avatar GjjvdBurg commented on June 18, 2024

Closing due to inactivity. Please reopen if the issue persists.

from labella.py.

SeaDude avatar SeaDude commented on June 18, 2024

Hello,

What is meant by: Do you have a working Latex installation on your system, including latexmk??

Besides pip install latexmk.py, what else constitutes "installation"?

from labella.py.

GjjvdBurg avatar GjjvdBurg commented on June 18, 2024

from labella.py.

SeaDude avatar SeaDude commented on June 18, 2024

Wow..heck of a set of pre-req's for Windows.

From https://ctan.math.utah.edu/ctan/tex-archive/support/latexmk/INSTALL:

1.  Make sure you have working installations of Perl and TeX/LaTeX,    
    complete with viewers for dvi, postscript and/or pdf files.  You will
    also need whatever packages your document needs.

2.  If necessary, unpack the latexmk distribution.  

3.  **Difference compared with UNIX-type systems**: Copy the file
    latexmk.pl to a suitable directory (your choice), and arrange for it to
    be invoked as a command.  (If you don't know how to do this, find out
    about "executable extension for perl on windows", by a web search.) 

For those who come after, looking for Windows 10 instructions:

Determine if Perl is installed

  • Add / Remove Programs
  • Search for "Perl"
  • No results

Download Perl for Windows 10

  • Go to perl.org and download
    • Went with "Strawberry Perl"
    • Select 32 vs 64 bit
  • Install:
    • Next
    • Accept
    • Next
    • Select location C:\Strawberry\
    • Install
    • Approve
      • (takes a fair amount of time to download!)
    • Finish

Determine if "TeX/LaTeX" is installed

  • Add / Remove Programs
  • Search for "TeX" and "LaTeX"
  • No results

Download TeX/LaTeX for Windows 10

  • Visit to https://miktex.org/download
  • Download
  • Accept
  • Next
  • Install for me or all users?
  • Next
  • Select location: C:\Users\<you>\AppData\Local\Programs\MiKTeX
  • Next
  • Set:
    • Preferred paper: A4 and
    • Install missing packages on-the-fly: Ask me first
  • Next
  • Start
    • (takes a fair amount of time to download too!)
  • Next
  • Check for updates now: Checked
  • Next
  • Close

Download the latexmk package from MiKTeX

  • Open MiKTeX
  • You'll probably get a popup stating "Check for updates"
    • Click Ok
  • OPTIONAL:
    • Click Updates tab
    • Check for updates
    • WARNING: I have no idea what these are packages are doing. DO NOT download them until you know they are safe
  • Click Packages tab
  • In the search bar, type latexmk
  • Hit Enter
  • Select latexmk
  • Click the + icon
  • Ok
  • When download is complete, click Close

Test PATH variable

  • Open a cmd/PowerShell/etc terminal
  • Type latexmk -h
  • If the results are an error like this:
    • The latexmk package (program?) added in previous step must be added to your PATH variable
latexmk : The term 'latexmk' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or  
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ latexmk -h
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (latexmk:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Place latexmk in the Users' PATH variable

  • Click Windows button on keyboard
  • Type env
  • Select the result Edit environment variables for your account
    • NOTE: This only installs the program for the particular User (You!)
    • You may want to read-up on User vs. System env variables before setting the System PATH env var
  • Click Environment Variables
  • Under User variables for <yourUserName>, double click the Path variable
  • Click New
  • Unless you change it, MiKTeX installs packages in the following directory.
    • C:\Users\<you>\AppData\Local\Programs\MiKTeX\miktex\bin\x64
    • Add \latexmk.exe to the above path and paste the whole exe path into the new field
    • Should be: C:\Users\<you>\AppData\Local\Programs\MiKTeX\miktex\bin\x64\latexmk.exe
  • IMPORTANT: CLOSE THEN OPEN (RESTART) YOUR TERMINAL WINDOW
    • There isn't a (easy) way to source bash.rc your Windows cmd terminal.
    • You must close/reopen the terminal for the PATH environmental variable to be refreshed

Verify PATH variable

  • Open a new cmd/PowerShell/etc terminal
  • Type latexmk -h
  • Results should look like this:
Latexmk 4.76: Automatic LaTeX document generation routine

Usage: latexmk [latexmk_options] [filename ...]

  Latexmk_options:
   -aux-directory=dir or -auxdir=dir 
                 - set name of directory for auxiliary files (aux, log)


                 - Currently this only works with MiKTeX

...<con't>...

  Run latexmk
with the option -showextraoptions to see a list of these

Report bugs etc to John Collins <jcc8 at psu.edu>.

Additional cleanup

  • When you initially try to run your Python script (say python .\timeline.py), you will get an notification from MiKTeX:
  • image
  • Click Install
  • CTRL+z the execution of your script
  • Rerun python .\timeline.py
  • If you're using the examples, ls should yield a .pdf, '.svg, and a .tex file
  • PDF:
  • image
  • SVG:
  • image
  • TEX:
  • image

from labella.py.

GjjvdBurg avatar GjjvdBurg commented on June 18, 2024

from labella.py.

SeaDude avatar SeaDude commented on June 18, 2024

I also have MiKTeX added to PATH variable. Still getting FileNotFoundError: [WinError 2] The system cannot find the file specified.

image

from labella.py.

GjjvdBurg avatar GjjvdBurg commented on June 18, 2024

from labella.py.

SeaDude avatar SeaDude commented on June 18, 2024

RE: Pull Request:

  • I'd probably just PR the README.md and add
  • "For Windows instructions, see here".

I have to actually see if this tool is going to work for my use case!

Thank you!

from labella.py.

Related Issues (15)

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.