LaTeX forum ⇒ LyXMetafile to EPS converter: should it work from within LYX? Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Stef Pillaert
Posts: 25
Joined: Sat Oct 22, 2016 3:43 pm

Metafile to EPS converter: should it work from within LYX?

Postby Stef Pillaert » Sat Oct 22, 2016 4:14 pm

Hello
I'm very new to LYX, so I hope this is not all too "dumb": I have drawings, made with MS powerpoint (I work on a MS Windows 7-machine). I can export these drawings to .emf format quite easily. I then can convert them to .eps with the standalone metafile-to-EPS-converter, provided n the LYX website. But should this also be possible "from within" LYX? If so, how? If I import the .emf directly (by "copy-paste", or by using a saved version), there seem to be problems....
Thanks,
Stef

scottkosty
Site Moderator
Posts: 497
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Mon Oct 24, 2016 5:39 am

Hi Stef,

Are there problems with the display on LyX or the PDF output or both? Note that they are not necessarily the same, so if the PDF output works then that is the most important.

Since the stand-alone converter works you should be able to automate the process. First, try going to Tools > Reconfigure. This might take a few minutes. After that, exit and restart LyX. Does it work now? If not, make sure the converter is in you PATH on Windows (not sure how to do that since I'm on Ubuntu).

Stef Pillaert
Posts: 25
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Mon Oct 24, 2016 12:16 pm

If I try to include a .emf or .wmf file directly, LyX tells me that there is a problem with converting to a useable format (Sorry, translation from a dutch message).
I tried both tips you gave me, but even adding the dir to the windows-path doesn't solve the problem.
Anything else I can try? Are there windows-people where it works automatically? I use windows 7.
(Maybe this is a symptom too: if I try to open a .emf file by rightclicking it, and then choosing the converter, it does nothing - the converter doesn't even seem to start. But if I open the converter, and I drag the file to it, then is opens the file without problems...)
Also: LyX gives me the message about the conversion problem in the editor. But if I try to show the .pdf nevertheless, I get a message like this: "an error occurred while running convert -density 300 "3C__Users_stef_pillaert_desktop_testemffile.emf" ""3C__Users_stef_pillaert_desktop_testemffile.eps"

scottkosty
Site Moderator
Posts: 497
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Tue Oct 25, 2016 4:57 am

Stef Pillaert wrote:(Maybe this is a symptom too: if I try to open a .emf file by rightclicking it, and then choosing the converter, it does nothing - the converter doesn't even seem to start.


Yes this is a problem. First you must be able to convert from a command. Once you can do that, then we can figure things out in LyX.

Stef Pillaert wrote:Also: LyX gives me the message about the conversion problem in the editor. But if I try to show the .pdf nevertheless, I get a message like this: "an error occurred while running convert -density 300 "3C__Users_stef_pillaert_desktop_testemffile.emf" ""3C__Users_stef_pillaert_desktop_testemffile.eps"


convert is from ImageMagick. Can you use the 'convert' command to try converting from the command line? If you get an error, please paste the output here.

By the way, which LyX version are you using?

Stef Pillaert
Posts: 25
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Tue Oct 25, 2016 9:31 am

(I have LyX 2.2.2, and installed afterwards the standalone version of the converter)
hmmm.... it has been 30 years since I used MSDos, so I hope this isn't too silly :(
I tried this (in a command-prompt-DOS-window, in the dir C:\Users\stef.pillaert):
*just typing "convert" gives me the message "U moet een bestandssysteem opgeven" (transl.: "You should give a file system")
*I placed a file "testemffile.emf" in the directory c:\Users\stef.pillaert
*Then I tried this from the command line: "convert -density 300 "testemffile.emf" "testemffile.eps"
*I get this: ongeldige parameter -300 (transl.: unvalid parameter, but you probably guessed that...)

Should I do this in another directory?
(Note: when I type "convert" straight in the "run command" in windows from the start menu, the window of the (stand alone?) converter program pops up.)

Stef

scottkosty
Site Moderator
Posts: 497
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Tue Oct 25, 2016 4:13 pm

Strange, the convert command you gave should work. Try it again the same way as you did but without the "-density" argument. So just do:
  1. convert "testemffile.emf" "testemffile.eps"


Does that work?

Stef Pillaert
Posts: 25
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Tue Oct 25, 2016 5:39 pm

No, sorry. I get this:
Ongeldige parameter - "testemffile.eps"
When I just do
convert "testemffile.emf"
I get this:
Ongeldige stationsspecificatie (transl: unvalid station (or drive?) specification)
[I just did a complete new install on another PC, this time windows10, with exactly the same problems...]

scottkosty
Site Moderator
Posts: 497
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Tue Oct 25, 2016 9:06 pm

Stef Pillaert wrote:No, sorry. I get this:
Ongeldige parameter - "testemffile.eps"
When I just do
convert "testemffile.emf"
I get this:
Ongeldige stationsspecificatie (transl: unvalid station (or drive?) specification)
[I just did a complete new install on another PC, this time windows10, with exactly the same problems...]


Dang, sorry for the frustration. It is not surprising that LyX doesn't work given that the command doesn't work. I have no idea why that command doesn't work though.

We can try a different approach. You can install Inkscape, which supposedly is able to do conversion of wmf. Once you install Inkscape, run the following command (I'm not sure what the inkscape command is on Windows):

  1. inkscape_command_name --file=your_wmf_filename --export-area-drawing --without-gui --export-eps=newfile.eps


If that works, then I can tell you how to ask LyX to use that command to convert.

Stef Pillaert
Posts: 25
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Wed Oct 26, 2016 8:00 am

I discovered that the command line "convert" is something completely different on my system? E.g. see https://technet.microsoft.com/en-us/library/ee851683.aspx?
When I do "convert /?" in the command line, I get a message that seems to confirm this...
Do you still want me to try the "Inkscape"-solution? Or is the above mentioned problem solveable, you think?
(Thanks, many thanks for all your time!)

scottkosty
Site Moderator
Posts: 497
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Wed Oct 26, 2016 10:08 pm

Ah yes that is helpful! Does the command 'magick' work? It appears that ImageMagick changed the name of the command (perhaps because of the conflict with the convert command you saw).


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 4 guests