Git Product home page Git Product logo

Comments (12)

JelteF avatar JelteF commented on August 16, 2024

It should return "{abc.def.fgh}.ijk", doesn't it do that?

from pylatex.

Vayel avatar Vayel commented on August 16, 2024

Will see here.

from pylatex.

Vayel avatar Vayel commented on August 16, 2024
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{graphicx}
\title{4978}
\author{}
\date{}

\begin{document}


\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{/home/eleve/vincent.lefoulon/mpf_env/lib/python3.4/site-packages/PyLaTeX-0.7.0-py3.4.egg/tmp/plottt}
\caption{Lactation 3}
\end{figure}




\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{/home/eleve/vincent.lefoulon/mpf_env/lib/python3.4/site-packages/PyLaTeX-0.7.0-py3.4.egg/tmp/plotttt}
\caption{Lactation 2}
\end{figure}


\end{document}

works but

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{graphicx}
\title{4978}
\author{}
\date{}

\begin{document}


\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{{/home/eleve/vincent.lefoulon/mpf_env/lib/python3.4/site-packages/PyLaTeX-0.7.0-py3.4}.egg/tmp/plottt}
\caption{Lactation 3}
\end{figure}




\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{{/home/eleve/vincent.lefoulon/mpf_env/lib/python3.4/site-packages/PyLaTeX-0.7.0-py3.4}.egg/tmp/plotttt}
\caption{Lactation 2}
\end{figure}


\end{document}

displays ! LaTeX Error: File '{/home/eleve/vincent.lefoulon/mpf_env/lib/python3.4/site-p ackages/PyLaTeX-0.7.0-py3.4}.egg/tmp/plottt' not found..

from pylatex.

JelteF avatar JelteF commented on August 16, 2024

Damn paths...

from pylatex.

Vayel avatar Vayel commented on August 16, 2024

Why is it necessary to use fix_filename?

from pylatex.

JelteF avatar JelteF commented on August 16, 2024

You should see the comment in the function: https://github.com/JelteF/PyLaTeX/blob/master/pylatex/utils.py#L64

I'm not sure when it breaks with paths maybe only the final file should have the curly braces fix if there is more than 1 dot in the filename.

from pylatex.

khyox avatar khyox commented on August 16, 2024

I had the same problem running the plt.py example:

> python3.4 ./plt.py
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./matplolib_pdf.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
[...]

! LaTeX Error: File `{/opt/local/Library/Frameworks/Python.framework/Versions/3
.4/lib/python3}.4/site-packages/tmp/plot' not found.

I had to open the generated latex file, remove the inner curly braces from the include command and then it works perfectly through pdflatex.

from pylatex.

JelteF avatar JelteF commented on August 16, 2024

An easy fix should be to just give the file an extension (like pdf or png or whatever it should be, I think pdf)
At the mometn it thinks .4/site-packages/tmp/plot is the extension. However, this should be fixed in PyLaTeX in a way that this error cannot occur.

from pylatex.

JelteF avatar JelteF commented on August 16, 2024

I just pushed some fixes and am waiting for travis to give the okay so I can do a bug fix release afterwards.

from pylatex.

khyox avatar khyox commented on August 16, 2024

@JelteF Many thanks! 👏

from pylatex.

JelteF avatar JelteF commented on August 16, 2024

Released

from pylatex.

khyox avatar khyox commented on August 16, 2024

@JelteF Working properly now, thanks!

from pylatex.

Related Issues (20)

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.