GithubHelp home page GithubHelp logo

Converting EPS about latextools HOT 25 CLOSED

chrispx avatar chrispx commented on August 15, 2024
Converting EPS

from latextools.

Comments (25)

msiniscalchi avatar msiniscalchi commented on August 15, 2024

Pls see my reply to your earlier message.

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

[Copied from my earlier message for ease of reference]

Hmm... sorry to hear this. Couple of things: is the testimg file in the same directory as test.tex? Second, is this a simple one-file tex document, or is there a root file + included files? Finally, just to be sure, could you try running latexmk as follows:

latexmk -e "$pdflatex = 'pdflatex %O -synctex=1 %S'" -f -pdf epstest

which is the exact line used by the ST2/LaTeXTools build system?

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Hi,

msiniscalchi: is the testimg file in the same directory as test.tex?
chrispx: It happens when the file is in the same dir and also when a path is given with "graphicspath"

msiniscalchi: is this a simple one-file tex document, or is there a root file + included files?
chrispx: root file + included files, but it also happens with simple file structure.

msiniscalchi: try running latexmk as follows: latexmk -e "$pdflatex = 'pdflatex %O -synctex=1 %S'" -f -pdf epstest
chrispx: This gives the following error

chrispsmbai5:epstest chrisp$ latexmk -e "$pdflatex = 'pdflatex %O -synctex=1 %S'" -f -pdf
Latexmk: Stopping because executing following code from command line
= 'pdflatex %O -synctex=1 %S'
gave an error:
syntax error at (eval 15) line 1, near "="

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

Sorry, I messed up: the command line should be

latexmk -e "$pdflatex = 'pdflatex %O -synctex=1 %S'" -f -pdf epstest

Also, could you attach the simplest possible test file(s), i.e. one eps picture, a single tex file?

from latextools.

chrispx avatar chrispx commented on August 15, 2024

This line (latexmk -e "$pdflatex = 'pdflatex %O -synctex=1 %S'" -f -pdf epstest) works fine and produces the pdf from the eps file as expected. I immediately double checked with SL2 and it did not. The same error is shown as before:

/Users/chrisp/Desktop/test/epstest/epstest.tex:15: Package pdftex.def Error: File `cc-eps-converted-to.pdf' not found. [\includegraphics{cc}]

Under [1] the tex, eps and the log file can be downloaded.

[1] http://dl.dropbox.com/u/41850/epstest.zip

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

This looks bad. I can definitely reproduce the issue. What's more, TeXworks has no problem compiling this (selecting the latexmk "engine"). As far as I can tell, I am passing the exact same command line to latexmk as TeXworks (it was a little different, but I now made it exactly the same). Yet, no PDF is created.

The problem is that it seems like the (r)epstopdf command is never actually invoked. The log file states that running the appropriate system command is allowed / safe, but then somehow nothing happens...

I'll dig some more as soon as I can, and report back.

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Thanks for the feedback. I will stay tuned in order to test your ideas...

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

OK, I have confusing news. I wrote a python script that duplicates the commands in the make_pdf.py file, except in a linear way. I ran it from the command line: bingo, no problem at all. The file gets compiled, the eps file is converted, and latexmk is happy as a clam.

However, if I run the exact same script from the console in Sublime Text, it fails---the eps file does not get converted. Inspecting the log shows that epstopdf was invoked, but did not actually run---exactly what happens when I build from ST2.

I suspect there's something funny going on when a process launched from an ST2 plugin in turn invokes another process. But, I'm surprised, as "make" and indeed "latexmk" surely run a host of other processes!

I'll have to ask jps.

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Thanks for the reply! I hope the issue will be solved soon. Because at the moment I have to switch all the time to the command line...

Best
Christian

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Any news on this issue, msiniscalchi?

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

I'm really sorry... I've been pestering jps in the tech support forum:

http://www.sublimetext.com/forum/viewtopic.php?f=3&t=3459

however, to date, there is no answer. I'll try a couple more things,
plus a bit of "social engineering" :-) The trouble is, if it's a ST2
limitation, there's nothing I can do about it.

On Tue, Oct 25, 2011 at 7:41 AM, chrispx
[email protected]
wrote:

Any news on this issue, msiniscalchi?

Reply to this email directly or view it on GitHub:
#7 (comment)

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Any news on this issue?

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Just played a bit more.

It now seems like to be a latexmk issue in connection with the restricted -shell-escape for e.g. epstopdf when eps files are in a different directory as the main tex file. What I did.

I used TextMate added the option "-shell-escape" and compiled with pdflatex my tex file (with eps files on a different path on dropbox) and it worked fine (no extra "epstopdf" package loading in the tex file). "pdflatex" from the command line w/o the -shell-escape does not work.

Then, I used the latexmk in TextMate and the conversion of the eps to a pdf file failed.

Two ideas: Could you please provide different build engines as TeXworks or TeXShop (pdflatex, biblatex with biber etc.)? If you could build in the -shell-escape then with pdflatex it should work.

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

That's easy to do: open the file named

LaTeX.sublime-build

and look in the "osx" section, specifically the "cmd" setting. Change
the line that says

"-e", "$pdflatex = q/pdflatex -synctex=1 %O %S/",

so it reads

"-e", "$pdflatex = q/pdflatex -shell-escape -synctex=1 %O %S/",

[the comma at the end is important]. This simply tells latexmk to add
the -shell-escape switch when running pdflatex.

Now, I still think there's something weird going on, because the
-shell-escape is not needed when (1) running from the terminal, and
(2) running a python script launched from the terminal that in turn
invokes the latexmk command, as I did in my tests. Also, I feel a bit
queasy about enabling -shell-escape by default. I'd rather add a
comment in the README about it.

Hopefully Jon will get back to me at some point.

BTW, are you "trinix" in the ST2 forums? Or is there another user with
the exact same problem you are having?

On Mon, Oct 31, 2011 at 6:52 AM, chrispx
[email protected]
wrote:

Just played a bit more.

It now seems like to be a latexmk issue in connection with the restricted -shell-escape for e.g. epstopdf when eps files are in a different directory as the main tex file. What I did.

I used TextMate added the option "-shell-escape" and compiled my tex file (with eps files on a different path on dropbox) and it worked fine (no extra "epstopdf" package loading in the tex file).

Then, I used the latexmk in TextMate and the conversion of the eps to a pdf file failed.

Two ideas: Could you please provide different build engines as TeXworks or TeXShop (pdflatex, biblatex with biber etc.)? If you could build in the -shell-escape then with pdflatex it should work.

Reply to this email directly or view it on GitHub:
#7 (comment)

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

chrispx avatar chrispx commented on August 15, 2024

In my case, this is not working because latexmk is used. As I said, in my tests it only worked with pdflatex...

BTW:
The line in my "LaTeX.sublime-build" look as follows:

"cmd": ["latexmk",
"-e", "$pdflatex = 'pdflatex %O -synctex=1 %S'",
"-f", "-pdf"],

Best
Christian (trinix)

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

Sure, latexmk invokes pdflatex. The line I mentioned tells latexmk
which flags to pass to pdflatex.

Also, sorry---your line looks fine: I think I just tried /q.../ to see
if it made a difference, and forgot to revert it back on my machine at
work. Just try

"cmd": ["latexmk",
                               "-e", "$pdflatex = 'pdflatex %O
-shell-escape -synctex=1 %S'",
                               "-f", "-pdf"],

In the meantime I'm also trying something else jps suggested. I'll
report back...

On Mon, Oct 31, 2011 at 12:31 PM, chrispx
[email protected]
wrote:

In my case, this is not working because latexmk is used. As I said, in my tests it only worked with pdflatex...

BTW:
The line in my "LaTeX.sublime-build" look as follows:

"cmd": ["latexmk",
                               "-e", "$pdflatex = 'pdflatex %O -synctex=1 %S'",
                               "-f", "-pdf"],

Best
Christian (trinix)

Reply to this email directly or view it on GitHub:
#7 (comment)

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

SOLVED!

epstopdf runs ghostscript to do its magic. Unfortunately, gs is
installed in /usr/local/bin on OSX. This directory is added to the
PATH in the Terminal (shell), but not if you run ST2 from the dock or
finder. Hence the problems we are experiencing.

Solution: open LaTeX.sublime-build and, in the "osx" section, add
"/usr/local/bin" to the "path" variable. In the end, your line should
be something like:

"path" : "$PATH:/usr/local/bin:/usr/texbin",

[note the comma at the end]. This fixed the issue for me.

Yay! I'll push the change as soon as I have some time.

On Mon, Oct 31, 2011 at 9:20 PM, Marciano Siniscalchi
[email protected] wrote:

Sure, latexmk invokes pdflatex. The line I mentioned tells latexmk
which flags to pass to pdflatex.

Also, sorry---your line looks fine: I think I just tried /q.../ to see
if it made a difference, and forgot to revert it back on my machine at
work. Just try

"cmd": ["latexmk",
                               "-e", "$pdflatex = 'pdflatex %O
-shell-escape -synctex=1 %S'",
                               "-f", "-pdf"],

In the meantime I'm also trying something else jps suggested. I'll
report back...

On Mon, Oct 31, 2011 at 12:31 PM, chrispx
[email protected]
wrote:

In my case, this is not working because latexmk is used. As I said, in my tests it only worked with pdflatex...

BTW:
The line in my "LaTeX.sublime-build" look as follows:

"cmd": ["latexmk",
                               "-e", "$pdflatex = 'pdflatex %O -synctex=1 %S'",
                               "-f", "-pdf"],

Best
Christian (trinix)

Reply to this email directly or view it on GitHub:
#7 (comment)

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

chrispx avatar chrispx commented on August 15, 2024

EXELLENT!!!

Nice to hear, that the issue could be solved. Nevertheless, I still do need (what is ok for me) a -shell-escape as an option for compilation. Here my build code:

"cmd": ["latexmk",
"-e", "$pdflatex = 'pdflatex %O -shell-escape -synctex=1 %S'",
"-f", "-pdf"],

    "path": "$PATH:/usr/local/bin:/usr/texbin",

I think that is because of the directory structure I use for my LaTeX projects. I have a "teximg" folder for images on my Dropbox. This folder is symlink'ed (works fine with svn) to my LaTeX-project and used with "graphicspath". Now, when I compile a tex file with eps, the pdf needs to be created back via symlink in the original folder on Dropbox. This may cause the need for a -shell-escape. What do you think?

Create work and create support!

Thanks a lot,
Christian

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

Hm... I don't know; it may be necessary in your setup. I didn't need
it though. M

On Fri, Nov 4, 2011 at 12:57 AM, chrispx
[email protected]
wrote:

EXELLENT!!!

Nice to hear, that the issue could be solved. Nevertheless, I still do need (what is ok for me) a -shell-escape as an option for compilation. Here my build code:

"cmd": ["latexmk",
                               "-e", "$pdflatex = 'pdflatex %O -shell-escape -synctex=1 %S'",
                               "-f", "-pdf"],

               "path": "$PATH:/usr/local/bin:/usr/texbin",

I think that is because of the directory structure I use for my LaTeX projects. I have a "teximg" folder for images on my Dropbox. This folder is symlink'ed (works fine with svn) to my LaTeX-project and used with "graphicspath". Now, when I compile a tex file with eps, the pdf needs to be created back via symlink in the original folder on Dropbox. This may cause the need for a -shell-escape. What do you think?

Create work and create support!

Thanks a lot,
Christian


Reply to this email directly or view it on GitHub:
#7 (comment)

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

chrispx avatar chrispx commented on August 15, 2024

Thanks!

from latextools.

amr2393 avatar amr2393 commented on August 15, 2024

Hi,

I'm now having the same issue on Windows, and adding the path to ghostscript in LaTeX.sublime-build doesn't seem to help

This is the error message I get:

LaTeX Error: File `image1' not found. [...ne{\includegraphics[width=8.5cm]{image1}}]

Thanks in advance for any help

from latextools.

msiniscalchi avatar msiniscalchi commented on August 15, 2024

Are you on MikTeX or TeXlive?

On Fri, Oct 5, 2012 at 5:06 AM, amr2393 [email protected] wrote:

Hi,

I'm now having the same issue on Windows, and adding the path to
ghostscript in LaTeX.sublime-build doesn't seem to help

This is the error message I get:

LaTeX Error: File `image1' not found.
[...ne{\includegraphics[width=8.5cm]{image1}}]

Thanks in advance for any help


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-9170881.

Marciano Siniscalchi
Economics Department, Northwestern University
http://faculty.wcas.northwestern.edu/~msi661

from latextools.

amr2393 avatar amr2393 commented on August 15, 2024

I'm using MikTeX

from latextools.

kasclark avatar kasclark commented on August 15, 2024

I was getting an error message about a syntax error when running the following build command.

-COMMAND-
latexmk -e $pdflatex = 'pdflatex %O -synctex=1 %S' -f -pdf document.tex

-ERROR-
Latexmk: Stopping because executing following code from command line
=
gave an error:
syntax error at (eval 15) line 1, near "="

I'm on a Mac using TexLive via MacPorts. This installs everything in /opt/local/bin/. I simply appended this to the path variable found in LaTeX.sublime-build (~/Library/Application Support/Sublime Text 2/LaTeXTools/) and the error message went away. Everything compiles just fine now.

from latextools.

jintiangufei avatar jintiangufei commented on August 15, 2024

Hi,
I am using the sublime3 text's latex. Now i want to use eps files in the pdflatex. Having tried to use your proposed method, it still doesn't work. My latex.sublime_build file is as follows:

/* Let's not preview for now. This should be OK on Win/MikTeX, too (?) /
/
Make sure latexmk is on the $PATH, AND add it to .MacOSX/environment.plist */

{
"cmd": ["latexmk",
"-e", "\$pdflatex = 'pdflatex %O -shell-escape -file-line-error --max-print-line=200 -synctex=1 %S'",
"-e", "\$pdf_previewer = qq{if [ -n "ps axww | grep Skim | grep -v grep" ] ; then osascript -e 'tell app "Skim" to revert front document' ; else open -a Skim %O %S ; fi}",
//"-e", "\$pdf_previewer = qq{/Applications/Skim.app/Contents/SharedSupport/displayline -g -r 0 %S}",
"-pv", "-pdf", "$file"],
"working_dir": "$file_path", /* crucial or latexmk will spew stuff in /!!! /
"file_regex": "^(...
?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex",
"path" : "$PATH:/usr/local/bin",

// Windows-specific command
// ASSUMES sumatrapdf is default viewer
// Only problem is that it comes to the foreground
"windows":
	{
		"cmd": ["texify", "-b", "-p",
		"--tex-option=\"--synctex=1\"", 
		"--tex-option=\"--max-print-line=200\"", 
		"--tex-option=\"-file-line-error\"",
		"--run-viewer",
		"--viewer-option=\"-reuse-instance\"",
		"$file"]
	}

}
Please help me to solve the problem, thanks very much!

from latextools.

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.