TikZ externalize → pdf → eps → Word import = ☠Attempt to export EPS figures from TikZ...
A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?
Dilemma of explaining to interviewer that he is the reason for declining second interview
Can a Pact of the Blade warlock use the correct existing pact magic weapon so it functions as a "Returning" weapon?
Eww, those bytes are gross
Why avoid shared user accounts?
Publishing research using outdated methods
Why do neural networks need so many training examples to perform?
Can a long polymer chain interact with itself via van der Waals forces?
How to limit sight distance to 1 KM
Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?
Why would space fleets be aligned?
Replacement expressions
Can a hotel cancel a confirmed reservation?
Citing paywalled articles accessed via illegal web sharing
What is the wife of a henpecked husband called?
I will be going to Sweden on business purpose .Can I visit London from Sweden and how much UK visa will cost?
Do authors have to be politically correct in article-writing?
What are "industrial chops"?
Cookies - Should the toggles be on?
In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?
Consequences of lack of rigour
Looking for access to original paper for Category O
Why is it that Bernie Sanders is always called a "socialist"?
Why zero tolerance on nudity in space?
TikZ externalize → pdf → eps → Word import = ☠
Attempt to export EPS figures from TikZ failsExternalize eps figure with TikZIs there a way to change styles in imported EPS files?How to insert a graphic/figure into LaTeX from Word?TikZ externalise: overlaying figuresCorrupted eps figures - Tikz externalizes EPS figures correctly but Photoshop does not open themExport eps figures from TikZ IIBuild errors with tikz externalizeOut of memory for large scatter plot in tikzDisabling main pdf with TikZ externalizeMaking TeX PDFs compatible with Word 2016 importing
I have a series of TikZ figures which I need to include in Word document (conference requiring Word submissions). Allowed format as EPS and TIFF. The figures are obviously vector graphics; they are
exported into separate .pdf files with
pgfplots.external
library andtikzexternalize
;converted to eps using
pdftops -eps foo.pdf
import into Word 2003, getting uninformative error (error loading file or such).
I found this this thread on the topic, but it is not conclusive. Curiously, EPS files converted from PDFs created with IPE are imported just fine.
What do I need to change to make the import work?
eps msword tikz-external import pdftops
|
show 2 more comments
I have a series of TikZ figures which I need to include in Word document (conference requiring Word submissions). Allowed format as EPS and TIFF. The figures are obviously vector graphics; they are
exported into separate .pdf files with
pgfplots.external
library andtikzexternalize
;converted to eps using
pdftops -eps foo.pdf
import into Word 2003, getting uninformative error (error loading file or such).
I found this this thread on the topic, but it is not conclusive. Curiously, EPS files converted from PDFs created with IPE are imported just fine.
What do I need to change to make the import work?
eps msword tikz-external import pdftops
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
2
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
2
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
1
I have used this link in the past for the recalculation of the bounding boxes of.eps
figures
– percusse
Dec 1 '11 at 12:56
|
show 2 more comments
I have a series of TikZ figures which I need to include in Word document (conference requiring Word submissions). Allowed format as EPS and TIFF. The figures are obviously vector graphics; they are
exported into separate .pdf files with
pgfplots.external
library andtikzexternalize
;converted to eps using
pdftops -eps foo.pdf
import into Word 2003, getting uninformative error (error loading file or such).
I found this this thread on the topic, but it is not conclusive. Curiously, EPS files converted from PDFs created with IPE are imported just fine.
What do I need to change to make the import work?
eps msword tikz-external import pdftops
I have a series of TikZ figures which I need to include in Word document (conference requiring Word submissions). Allowed format as EPS and TIFF. The figures are obviously vector graphics; they are
exported into separate .pdf files with
pgfplots.external
library andtikzexternalize
;converted to eps using
pdftops -eps foo.pdf
import into Word 2003, getting uninformative error (error loading file or such).
I found this this thread on the topic, but it is not conclusive. Curiously, EPS files converted from PDFs created with IPE are imported just fine.
What do I need to change to make the import work?
eps msword tikz-external import pdftops
eps msword tikz-external import pdftops
edited Dec 1 '11 at 13:24
eudoxos
asked Dec 1 '11 at 11:47
eudoxoseudoxos
1,74111633
1,74111633
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
2
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
2
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
1
I have used this link in the past for the recalculation of the bounding boxes of.eps
figures
– percusse
Dec 1 '11 at 12:56
|
show 2 more comments
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
2
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
2
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
1
I have used this link in the past for the recalculation of the bounding boxes of.eps
figures
– percusse
Dec 1 '11 at 12:56
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
2
2
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
2
2
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
1
1
I have used this link in the past for the recalculation of the bounding boxes of
.eps
figures– percusse
Dec 1 '11 at 12:56
I have used this link in the past for the recalculation of the bounding boxes of
.eps
figures– percusse
Dec 1 '11 at 12:56
|
show 2 more comments
4 Answers
4
active
oldest
votes
I summarize my findings. Hopefully others will find it useful.
Since EPS and TIFF figures were allowed, opening the EPS file in Gimp with 600dpi (with antialiasing and color/bw depending on the figure) and saving as TIFF with LZW compression made an importable figure. Despite the bitmap size of 4000x1600 and such, the file size was comparable to that of the EPS figure and looks nice.
For some reason, trying to achieve the same with ImageMagick's
convert -density=600
resulted in weird files, sometimes with monstrous sizes.
As @JosephWright suggested, I tried going via dvips to produce the eps. The problem is that dvips sets wrong bounding box: either it produces non-EPS file, thus having entire page as bbox, or, with
-E
, the bbox is too small (according to the man page, it computes the boox only from glyphs, but not from lines and other graphics which might show up in the figure).
The solution was to use
dvips -E
to produce EPS file with a wrong bounding box, and then fix it with epstool (in Debian, packageepstool
), as suggested by @percusse. It requires a temporary EPS file (I used the.foo.eps
suffix), and the setting for tikz looks like this:
usetikzlibrary{pgfplots.external}
tikzexternalize[]
tikzset{external/system call={latex tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "image" "texsource" && dvips -E -o "image".foo.eps "image".dvi && epstool --copy --bbox "image".foo.eps "image".eps && rm "image".foo.eps "image".dvi }}
The resulting EPS is indeed importable into Word, but it is ugly (probably due to no antialiasing) and rather unusable.
Verdict:
EDIT - gold winner: open in IrfanView, copy, paste into Word directly (thanks to Joseph for the suggestion; I could not do that in my case)
silver winner: have Gimp (ghostscript) do the rendering, save as TIFF and import to Word as bitmap; word is not able to render the EPS nicely, even if it is able to load it.
avoid conferences where submissions must be in Word.
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
add a comment |
I had a problem with generating EPS files for Word too (not with TikZ content, but whatever) some time ago. Don't remember the target version (possibly 2003 or 2007), but it took me some time to figure out a successful workflow. In the end I was doing it by:
$ pdf2ps file.pdf - | ps2eps | eps2eps - file.eps
Hope it will work in your case too.
add a comment |
To create TIFFs I would recommend generating a PDF about twice the size of your desired figure, then viewing the PDF in IrfanView and saving as a TIFF so you can produce a high quality image. Note that whey you produce a large figure you will need to vary the marker size, text size, line thickness and tick thickness so the scaled image in Word results in a desirable figure (see code samples below). This is very similar to @JosephWright's method, but saves an image file which is required by some journals separate from the image in the text.
Generate a PDF of your figure with your LaTeX front end, I use a .tex file such as the one here:
documentclass{article}
newlengthpaperSize
newlengthfigureheight
newlengthfigurewidth
newlengthmarkSize
setlength{paperSize}{6in}
usepackage[paperheight=1paperSize,paperwidth=1.25paperSize,margin=0in]{geometry}
usepackage{siunitx}
%for .tikz figures:
usepackage{pst-all}
usepackage{pstricks-add}
usepackage{pgf}
usepackage{pgfplots}
pgfplotsset{compat=newest}
pgfplotsset{plot coordinates/math parser=false}
usetikzlibrary{plotmarks}
begin{document}
setlengthfigureheight{0.65paperSize}
setlengthfigurewidth{0.65paperSize}
tikzstyle{every node}=[font=huge] %vary font size in figure
setlengthmarkSize{5pt} %vary marker size
begin{figure}
input{sample_figure.tikz}
end{figure}
end{document}
The input file looks like this, where variables are automatically included using mat2tikz (Matlab function file to produce .tikz):
begin{tikzpicture}
begin{axis}[%
major tick style={draw=black, thick},
width=figurewidth,
height=figureheight,
scale only axis,
xmin=0,
xmax=2,
xtick={0,0.5,...,2},
xlabel={x label text},
ymin=0,
ymax=2,
ytick={0,0.5,...,2},
ylabel={y label text},
legend style={at={(1.03,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
addplot [
color=black,
only marks,
mark=triangle*,
mark options={mark size=1markSize,solid}
]
table[row sep=crcr]{
0 0.75\
1.5 1.25\
};
addlegendentry{Legend entry 1};
addplot [
color=black,
only marks,
mark=square*,
mark options={mark size=0.85markSize,solid}
]
table[row sep=crcr]{
0.25 1.0\
0.75 1.75\
};
addlegendentry{Legend entry 2};
end{axis}
end{tikzpicture}
This is what the PDF looks like:
Once you have a PDF of your figure, open with IrfanView and do the following:
- Convert to grayscale (ctrl+G)
- Auto-crop (ctrl+shift+Y)
- Change image resolution to 300 dpi (ctrl+R, 96>300)
- Save as TIFF (S, change "Save as type" to "TIF")
Right-clicking and viewing properties should show 300 dpi instead of 96 dpi.
add a comment |
I have been struggling trying to import a standalone latex generated pdf into Word, found the accepted answer but it did not provide enough information more than using IrfanView and using the copy and paste option, but still the quality was not good enough for Word (for publishing papers), because when you zoom in the image, it got distorted. I also try converting the pdf with ImageMagick and Adobe Acrobat Pro DC but quality was too bad. Also exporting the LaTex file with pdftops
to EPS but the image looked really bad.
I created a standalone graph using pgfplot
and tikzpicture
.
Solution:
- Open IrfanView (with the Ghostscript plug-in installed)
- Set quality of the pdf you want to import in Options-Properties/Settings-Postscript options-Set DPI to one that works for you (I used 1000 x 1000)
- Open pdf file
- Export image using File-Save As..
- Change -Save as type: to EMF - Enhanced Window Metafile and save file
- In Office Word go to Insert-Insert Image and insert the EMF file
OP required EPS or TIFF, you can Save As TIF and import image to Office Word also, but the quality is not as good as when using EMF. I try a lot with EPS and didn't found a solution for converting the image with really good quality from a pdf.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f36790%2ftikz-externalize-%25e2%2586%2592-pdf-%25e2%2586%2592-eps-%25e2%2586%2592-word-import%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
I summarize my findings. Hopefully others will find it useful.
Since EPS and TIFF figures were allowed, opening the EPS file in Gimp with 600dpi (with antialiasing and color/bw depending on the figure) and saving as TIFF with LZW compression made an importable figure. Despite the bitmap size of 4000x1600 and such, the file size was comparable to that of the EPS figure and looks nice.
For some reason, trying to achieve the same with ImageMagick's
convert -density=600
resulted in weird files, sometimes with monstrous sizes.
As @JosephWright suggested, I tried going via dvips to produce the eps. The problem is that dvips sets wrong bounding box: either it produces non-EPS file, thus having entire page as bbox, or, with
-E
, the bbox is too small (according to the man page, it computes the boox only from glyphs, but not from lines and other graphics which might show up in the figure).
The solution was to use
dvips -E
to produce EPS file with a wrong bounding box, and then fix it with epstool (in Debian, packageepstool
), as suggested by @percusse. It requires a temporary EPS file (I used the.foo.eps
suffix), and the setting for tikz looks like this:
usetikzlibrary{pgfplots.external}
tikzexternalize[]
tikzset{external/system call={latex tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "image" "texsource" && dvips -E -o "image".foo.eps "image".dvi && epstool --copy --bbox "image".foo.eps "image".eps && rm "image".foo.eps "image".dvi }}
The resulting EPS is indeed importable into Word, but it is ugly (probably due to no antialiasing) and rather unusable.
Verdict:
EDIT - gold winner: open in IrfanView, copy, paste into Word directly (thanks to Joseph for the suggestion; I could not do that in my case)
silver winner: have Gimp (ghostscript) do the rendering, save as TIFF and import to Word as bitmap; word is not able to render the EPS nicely, even if it is able to load it.
avoid conferences where submissions must be in Word.
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
add a comment |
I summarize my findings. Hopefully others will find it useful.
Since EPS and TIFF figures were allowed, opening the EPS file in Gimp with 600dpi (with antialiasing and color/bw depending on the figure) and saving as TIFF with LZW compression made an importable figure. Despite the bitmap size of 4000x1600 and such, the file size was comparable to that of the EPS figure and looks nice.
For some reason, trying to achieve the same with ImageMagick's
convert -density=600
resulted in weird files, sometimes with monstrous sizes.
As @JosephWright suggested, I tried going via dvips to produce the eps. The problem is that dvips sets wrong bounding box: either it produces non-EPS file, thus having entire page as bbox, or, with
-E
, the bbox is too small (according to the man page, it computes the boox only from glyphs, but not from lines and other graphics which might show up in the figure).
The solution was to use
dvips -E
to produce EPS file with a wrong bounding box, and then fix it with epstool (in Debian, packageepstool
), as suggested by @percusse. It requires a temporary EPS file (I used the.foo.eps
suffix), and the setting for tikz looks like this:
usetikzlibrary{pgfplots.external}
tikzexternalize[]
tikzset{external/system call={latex tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "image" "texsource" && dvips -E -o "image".foo.eps "image".dvi && epstool --copy --bbox "image".foo.eps "image".eps && rm "image".foo.eps "image".dvi }}
The resulting EPS is indeed importable into Word, but it is ugly (probably due to no antialiasing) and rather unusable.
Verdict:
EDIT - gold winner: open in IrfanView, copy, paste into Word directly (thanks to Joseph for the suggestion; I could not do that in my case)
silver winner: have Gimp (ghostscript) do the rendering, save as TIFF and import to Word as bitmap; word is not able to render the EPS nicely, even if it is able to load it.
avoid conferences where submissions must be in Word.
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
add a comment |
I summarize my findings. Hopefully others will find it useful.
Since EPS and TIFF figures were allowed, opening the EPS file in Gimp with 600dpi (with antialiasing and color/bw depending on the figure) and saving as TIFF with LZW compression made an importable figure. Despite the bitmap size of 4000x1600 and such, the file size was comparable to that of the EPS figure and looks nice.
For some reason, trying to achieve the same with ImageMagick's
convert -density=600
resulted in weird files, sometimes with monstrous sizes.
As @JosephWright suggested, I tried going via dvips to produce the eps. The problem is that dvips sets wrong bounding box: either it produces non-EPS file, thus having entire page as bbox, or, with
-E
, the bbox is too small (according to the man page, it computes the boox only from glyphs, but not from lines and other graphics which might show up in the figure).
The solution was to use
dvips -E
to produce EPS file with a wrong bounding box, and then fix it with epstool (in Debian, packageepstool
), as suggested by @percusse. It requires a temporary EPS file (I used the.foo.eps
suffix), and the setting for tikz looks like this:
usetikzlibrary{pgfplots.external}
tikzexternalize[]
tikzset{external/system call={latex tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "image" "texsource" && dvips -E -o "image".foo.eps "image".dvi && epstool --copy --bbox "image".foo.eps "image".eps && rm "image".foo.eps "image".dvi }}
The resulting EPS is indeed importable into Word, but it is ugly (probably due to no antialiasing) and rather unusable.
Verdict:
EDIT - gold winner: open in IrfanView, copy, paste into Word directly (thanks to Joseph for the suggestion; I could not do that in my case)
silver winner: have Gimp (ghostscript) do the rendering, save as TIFF and import to Word as bitmap; word is not able to render the EPS nicely, even if it is able to load it.
avoid conferences where submissions must be in Word.
I summarize my findings. Hopefully others will find it useful.
Since EPS and TIFF figures were allowed, opening the EPS file in Gimp with 600dpi (with antialiasing and color/bw depending on the figure) and saving as TIFF with LZW compression made an importable figure. Despite the bitmap size of 4000x1600 and such, the file size was comparable to that of the EPS figure and looks nice.
For some reason, trying to achieve the same with ImageMagick's
convert -density=600
resulted in weird files, sometimes with monstrous sizes.
As @JosephWright suggested, I tried going via dvips to produce the eps. The problem is that dvips sets wrong bounding box: either it produces non-EPS file, thus having entire page as bbox, or, with
-E
, the bbox is too small (according to the man page, it computes the boox only from glyphs, but not from lines and other graphics which might show up in the figure).
The solution was to use
dvips -E
to produce EPS file with a wrong bounding box, and then fix it with epstool (in Debian, packageepstool
), as suggested by @percusse. It requires a temporary EPS file (I used the.foo.eps
suffix), and the setting for tikz looks like this:
usetikzlibrary{pgfplots.external}
tikzexternalize[]
tikzset{external/system call={latex tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "image" "texsource" && dvips -E -o "image".foo.eps "image".dvi && epstool --copy --bbox "image".foo.eps "image".eps && rm "image".foo.eps "image".dvi }}
The resulting EPS is indeed importable into Word, but it is ugly (probably due to no antialiasing) and rather unusable.
Verdict:
EDIT - gold winner: open in IrfanView, copy, paste into Word directly (thanks to Joseph for the suggestion; I could not do that in my case)
silver winner: have Gimp (ghostscript) do the rendering, save as TIFF and import to Word as bitmap; word is not able to render the EPS nicely, even if it is able to load it.
avoid conferences where submissions must be in Word.
edited Dec 1 '11 at 14:09
answered Dec 1 '11 at 13:22
eudoxoseudoxos
1,74111633
1,74111633
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
add a comment |
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
2
2
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
As I said, I'd use IrfanView (in my area, there are some operations which have to be done using Word on Windows, and even Word on the Mac is no good, so Windows is a must).
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
You can alter the bounding box of an EPS after it's been created, so the auto-generated bounding box is not really a problem.
– Joseph Wright♦
Dec 1 '11 at 13:40
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
I edited the answer to mention IrfanView.
– eudoxos
Dec 1 '11 at 14:09
2
2
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
+1 for suggestion 3
– Hans Janssen
Jul 11 '18 at 9:39
add a comment |
I had a problem with generating EPS files for Word too (not with TikZ content, but whatever) some time ago. Don't remember the target version (possibly 2003 or 2007), but it took me some time to figure out a successful workflow. In the end I was doing it by:
$ pdf2ps file.pdf - | ps2eps | eps2eps - file.eps
Hope it will work in your case too.
add a comment |
I had a problem with generating EPS files for Word too (not with TikZ content, but whatever) some time ago. Don't remember the target version (possibly 2003 or 2007), but it took me some time to figure out a successful workflow. In the end I was doing it by:
$ pdf2ps file.pdf - | ps2eps | eps2eps - file.eps
Hope it will work in your case too.
add a comment |
I had a problem with generating EPS files for Word too (not with TikZ content, but whatever) some time ago. Don't remember the target version (possibly 2003 or 2007), but it took me some time to figure out a successful workflow. In the end I was doing it by:
$ pdf2ps file.pdf - | ps2eps | eps2eps - file.eps
Hope it will work in your case too.
I had a problem with generating EPS files for Word too (not with TikZ content, but whatever) some time ago. Don't remember the target version (possibly 2003 or 2007), but it took me some time to figure out a successful workflow. In the end I was doing it by:
$ pdf2ps file.pdf - | ps2eps | eps2eps - file.eps
Hope it will work in your case too.
answered Dec 1 '11 at 14:49
przemocprzemoc
1,28211530
1,28211530
add a comment |
add a comment |
To create TIFFs I would recommend generating a PDF about twice the size of your desired figure, then viewing the PDF in IrfanView and saving as a TIFF so you can produce a high quality image. Note that whey you produce a large figure you will need to vary the marker size, text size, line thickness and tick thickness so the scaled image in Word results in a desirable figure (see code samples below). This is very similar to @JosephWright's method, but saves an image file which is required by some journals separate from the image in the text.
Generate a PDF of your figure with your LaTeX front end, I use a .tex file such as the one here:
documentclass{article}
newlengthpaperSize
newlengthfigureheight
newlengthfigurewidth
newlengthmarkSize
setlength{paperSize}{6in}
usepackage[paperheight=1paperSize,paperwidth=1.25paperSize,margin=0in]{geometry}
usepackage{siunitx}
%for .tikz figures:
usepackage{pst-all}
usepackage{pstricks-add}
usepackage{pgf}
usepackage{pgfplots}
pgfplotsset{compat=newest}
pgfplotsset{plot coordinates/math parser=false}
usetikzlibrary{plotmarks}
begin{document}
setlengthfigureheight{0.65paperSize}
setlengthfigurewidth{0.65paperSize}
tikzstyle{every node}=[font=huge] %vary font size in figure
setlengthmarkSize{5pt} %vary marker size
begin{figure}
input{sample_figure.tikz}
end{figure}
end{document}
The input file looks like this, where variables are automatically included using mat2tikz (Matlab function file to produce .tikz):
begin{tikzpicture}
begin{axis}[%
major tick style={draw=black, thick},
width=figurewidth,
height=figureheight,
scale only axis,
xmin=0,
xmax=2,
xtick={0,0.5,...,2},
xlabel={x label text},
ymin=0,
ymax=2,
ytick={0,0.5,...,2},
ylabel={y label text},
legend style={at={(1.03,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
addplot [
color=black,
only marks,
mark=triangle*,
mark options={mark size=1markSize,solid}
]
table[row sep=crcr]{
0 0.75\
1.5 1.25\
};
addlegendentry{Legend entry 1};
addplot [
color=black,
only marks,
mark=square*,
mark options={mark size=0.85markSize,solid}
]
table[row sep=crcr]{
0.25 1.0\
0.75 1.75\
};
addlegendentry{Legend entry 2};
end{axis}
end{tikzpicture}
This is what the PDF looks like:
Once you have a PDF of your figure, open with IrfanView and do the following:
- Convert to grayscale (ctrl+G)
- Auto-crop (ctrl+shift+Y)
- Change image resolution to 300 dpi (ctrl+R, 96>300)
- Save as TIFF (S, change "Save as type" to "TIF")
Right-clicking and viewing properties should show 300 dpi instead of 96 dpi.
add a comment |
To create TIFFs I would recommend generating a PDF about twice the size of your desired figure, then viewing the PDF in IrfanView and saving as a TIFF so you can produce a high quality image. Note that whey you produce a large figure you will need to vary the marker size, text size, line thickness and tick thickness so the scaled image in Word results in a desirable figure (see code samples below). This is very similar to @JosephWright's method, but saves an image file which is required by some journals separate from the image in the text.
Generate a PDF of your figure with your LaTeX front end, I use a .tex file such as the one here:
documentclass{article}
newlengthpaperSize
newlengthfigureheight
newlengthfigurewidth
newlengthmarkSize
setlength{paperSize}{6in}
usepackage[paperheight=1paperSize,paperwidth=1.25paperSize,margin=0in]{geometry}
usepackage{siunitx}
%for .tikz figures:
usepackage{pst-all}
usepackage{pstricks-add}
usepackage{pgf}
usepackage{pgfplots}
pgfplotsset{compat=newest}
pgfplotsset{plot coordinates/math parser=false}
usetikzlibrary{plotmarks}
begin{document}
setlengthfigureheight{0.65paperSize}
setlengthfigurewidth{0.65paperSize}
tikzstyle{every node}=[font=huge] %vary font size in figure
setlengthmarkSize{5pt} %vary marker size
begin{figure}
input{sample_figure.tikz}
end{figure}
end{document}
The input file looks like this, where variables are automatically included using mat2tikz (Matlab function file to produce .tikz):
begin{tikzpicture}
begin{axis}[%
major tick style={draw=black, thick},
width=figurewidth,
height=figureheight,
scale only axis,
xmin=0,
xmax=2,
xtick={0,0.5,...,2},
xlabel={x label text},
ymin=0,
ymax=2,
ytick={0,0.5,...,2},
ylabel={y label text},
legend style={at={(1.03,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
addplot [
color=black,
only marks,
mark=triangle*,
mark options={mark size=1markSize,solid}
]
table[row sep=crcr]{
0 0.75\
1.5 1.25\
};
addlegendentry{Legend entry 1};
addplot [
color=black,
only marks,
mark=square*,
mark options={mark size=0.85markSize,solid}
]
table[row sep=crcr]{
0.25 1.0\
0.75 1.75\
};
addlegendentry{Legend entry 2};
end{axis}
end{tikzpicture}
This is what the PDF looks like:
Once you have a PDF of your figure, open with IrfanView and do the following:
- Convert to grayscale (ctrl+G)
- Auto-crop (ctrl+shift+Y)
- Change image resolution to 300 dpi (ctrl+R, 96>300)
- Save as TIFF (S, change "Save as type" to "TIF")
Right-clicking and viewing properties should show 300 dpi instead of 96 dpi.
add a comment |
To create TIFFs I would recommend generating a PDF about twice the size of your desired figure, then viewing the PDF in IrfanView and saving as a TIFF so you can produce a high quality image. Note that whey you produce a large figure you will need to vary the marker size, text size, line thickness and tick thickness so the scaled image in Word results in a desirable figure (see code samples below). This is very similar to @JosephWright's method, but saves an image file which is required by some journals separate from the image in the text.
Generate a PDF of your figure with your LaTeX front end, I use a .tex file such as the one here:
documentclass{article}
newlengthpaperSize
newlengthfigureheight
newlengthfigurewidth
newlengthmarkSize
setlength{paperSize}{6in}
usepackage[paperheight=1paperSize,paperwidth=1.25paperSize,margin=0in]{geometry}
usepackage{siunitx}
%for .tikz figures:
usepackage{pst-all}
usepackage{pstricks-add}
usepackage{pgf}
usepackage{pgfplots}
pgfplotsset{compat=newest}
pgfplotsset{plot coordinates/math parser=false}
usetikzlibrary{plotmarks}
begin{document}
setlengthfigureheight{0.65paperSize}
setlengthfigurewidth{0.65paperSize}
tikzstyle{every node}=[font=huge] %vary font size in figure
setlengthmarkSize{5pt} %vary marker size
begin{figure}
input{sample_figure.tikz}
end{figure}
end{document}
The input file looks like this, where variables are automatically included using mat2tikz (Matlab function file to produce .tikz):
begin{tikzpicture}
begin{axis}[%
major tick style={draw=black, thick},
width=figurewidth,
height=figureheight,
scale only axis,
xmin=0,
xmax=2,
xtick={0,0.5,...,2},
xlabel={x label text},
ymin=0,
ymax=2,
ytick={0,0.5,...,2},
ylabel={y label text},
legend style={at={(1.03,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
addplot [
color=black,
only marks,
mark=triangle*,
mark options={mark size=1markSize,solid}
]
table[row sep=crcr]{
0 0.75\
1.5 1.25\
};
addlegendentry{Legend entry 1};
addplot [
color=black,
only marks,
mark=square*,
mark options={mark size=0.85markSize,solid}
]
table[row sep=crcr]{
0.25 1.0\
0.75 1.75\
};
addlegendentry{Legend entry 2};
end{axis}
end{tikzpicture}
This is what the PDF looks like:
Once you have a PDF of your figure, open with IrfanView and do the following:
- Convert to grayscale (ctrl+G)
- Auto-crop (ctrl+shift+Y)
- Change image resolution to 300 dpi (ctrl+R, 96>300)
- Save as TIFF (S, change "Save as type" to "TIF")
Right-clicking and viewing properties should show 300 dpi instead of 96 dpi.
To create TIFFs I would recommend generating a PDF about twice the size of your desired figure, then viewing the PDF in IrfanView and saving as a TIFF so you can produce a high quality image. Note that whey you produce a large figure you will need to vary the marker size, text size, line thickness and tick thickness so the scaled image in Word results in a desirable figure (see code samples below). This is very similar to @JosephWright's method, but saves an image file which is required by some journals separate from the image in the text.
Generate a PDF of your figure with your LaTeX front end, I use a .tex file such as the one here:
documentclass{article}
newlengthpaperSize
newlengthfigureheight
newlengthfigurewidth
newlengthmarkSize
setlength{paperSize}{6in}
usepackage[paperheight=1paperSize,paperwidth=1.25paperSize,margin=0in]{geometry}
usepackage{siunitx}
%for .tikz figures:
usepackage{pst-all}
usepackage{pstricks-add}
usepackage{pgf}
usepackage{pgfplots}
pgfplotsset{compat=newest}
pgfplotsset{plot coordinates/math parser=false}
usetikzlibrary{plotmarks}
begin{document}
setlengthfigureheight{0.65paperSize}
setlengthfigurewidth{0.65paperSize}
tikzstyle{every node}=[font=huge] %vary font size in figure
setlengthmarkSize{5pt} %vary marker size
begin{figure}
input{sample_figure.tikz}
end{figure}
end{document}
The input file looks like this, where variables are automatically included using mat2tikz (Matlab function file to produce .tikz):
begin{tikzpicture}
begin{axis}[%
major tick style={draw=black, thick},
width=figurewidth,
height=figureheight,
scale only axis,
xmin=0,
xmax=2,
xtick={0,0.5,...,2},
xlabel={x label text},
ymin=0,
ymax=2,
ytick={0,0.5,...,2},
ylabel={y label text},
legend style={at={(1.03,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
addplot [
color=black,
only marks,
mark=triangle*,
mark options={mark size=1markSize,solid}
]
table[row sep=crcr]{
0 0.75\
1.5 1.25\
};
addlegendentry{Legend entry 1};
addplot [
color=black,
only marks,
mark=square*,
mark options={mark size=0.85markSize,solid}
]
table[row sep=crcr]{
0.25 1.0\
0.75 1.75\
};
addlegendentry{Legend entry 2};
end{axis}
end{tikzpicture}
This is what the PDF looks like:
Once you have a PDF of your figure, open with IrfanView and do the following:
- Convert to grayscale (ctrl+G)
- Auto-crop (ctrl+shift+Y)
- Change image resolution to 300 dpi (ctrl+R, 96>300)
- Save as TIFF (S, change "Save as type" to "TIF")
Right-clicking and viewing properties should show 300 dpi instead of 96 dpi.
edited Jun 16 '17 at 6:56
David Carlisle
492k4111371885
492k4111371885
answered Sep 24 '13 at 1:59
static_overloadstatic_overload
34849
34849
add a comment |
add a comment |
I have been struggling trying to import a standalone latex generated pdf into Word, found the accepted answer but it did not provide enough information more than using IrfanView and using the copy and paste option, but still the quality was not good enough for Word (for publishing papers), because when you zoom in the image, it got distorted. I also try converting the pdf with ImageMagick and Adobe Acrobat Pro DC but quality was too bad. Also exporting the LaTex file with pdftops
to EPS but the image looked really bad.
I created a standalone graph using pgfplot
and tikzpicture
.
Solution:
- Open IrfanView (with the Ghostscript plug-in installed)
- Set quality of the pdf you want to import in Options-Properties/Settings-Postscript options-Set DPI to one that works for you (I used 1000 x 1000)
- Open pdf file
- Export image using File-Save As..
- Change -Save as type: to EMF - Enhanced Window Metafile and save file
- In Office Word go to Insert-Insert Image and insert the EMF file
OP required EPS or TIFF, you can Save As TIF and import image to Office Word also, but the quality is not as good as when using EMF. I try a lot with EPS and didn't found a solution for converting the image with really good quality from a pdf.
add a comment |
I have been struggling trying to import a standalone latex generated pdf into Word, found the accepted answer but it did not provide enough information more than using IrfanView and using the copy and paste option, but still the quality was not good enough for Word (for publishing papers), because when you zoom in the image, it got distorted. I also try converting the pdf with ImageMagick and Adobe Acrobat Pro DC but quality was too bad. Also exporting the LaTex file with pdftops
to EPS but the image looked really bad.
I created a standalone graph using pgfplot
and tikzpicture
.
Solution:
- Open IrfanView (with the Ghostscript plug-in installed)
- Set quality of the pdf you want to import in Options-Properties/Settings-Postscript options-Set DPI to one that works for you (I used 1000 x 1000)
- Open pdf file
- Export image using File-Save As..
- Change -Save as type: to EMF - Enhanced Window Metafile and save file
- In Office Word go to Insert-Insert Image and insert the EMF file
OP required EPS or TIFF, you can Save As TIF and import image to Office Word also, but the quality is not as good as when using EMF. I try a lot with EPS and didn't found a solution for converting the image with really good quality from a pdf.
add a comment |
I have been struggling trying to import a standalone latex generated pdf into Word, found the accepted answer but it did not provide enough information more than using IrfanView and using the copy and paste option, but still the quality was not good enough for Word (for publishing papers), because when you zoom in the image, it got distorted. I also try converting the pdf with ImageMagick and Adobe Acrobat Pro DC but quality was too bad. Also exporting the LaTex file with pdftops
to EPS but the image looked really bad.
I created a standalone graph using pgfplot
and tikzpicture
.
Solution:
- Open IrfanView (with the Ghostscript plug-in installed)
- Set quality of the pdf you want to import in Options-Properties/Settings-Postscript options-Set DPI to one that works for you (I used 1000 x 1000)
- Open pdf file
- Export image using File-Save As..
- Change -Save as type: to EMF - Enhanced Window Metafile and save file
- In Office Word go to Insert-Insert Image and insert the EMF file
OP required EPS or TIFF, you can Save As TIF and import image to Office Word also, but the quality is not as good as when using EMF. I try a lot with EPS and didn't found a solution for converting the image with really good quality from a pdf.
I have been struggling trying to import a standalone latex generated pdf into Word, found the accepted answer but it did not provide enough information more than using IrfanView and using the copy and paste option, but still the quality was not good enough for Word (for publishing papers), because when you zoom in the image, it got distorted. I also try converting the pdf with ImageMagick and Adobe Acrobat Pro DC but quality was too bad. Also exporting the LaTex file with pdftops
to EPS but the image looked really bad.
I created a standalone graph using pgfplot
and tikzpicture
.
Solution:
- Open IrfanView (with the Ghostscript plug-in installed)
- Set quality of the pdf you want to import in Options-Properties/Settings-Postscript options-Set DPI to one that works for you (I used 1000 x 1000)
- Open pdf file
- Export image using File-Save As..
- Change -Save as type: to EMF - Enhanced Window Metafile and save file
- In Office Word go to Insert-Insert Image and insert the EMF file
OP required EPS or TIFF, you can Save As TIF and import image to Office Word also, but the quality is not as good as when using EMF. I try a lot with EPS and didn't found a solution for converting the image with really good quality from a pdf.
answered 15 mins ago
farahfarah
83
83
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f36790%2ftikz-externalize-%25e2%2586%2592-pdf-%25e2%2586%2592-eps-%25e2%2586%2592-word-import%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is it really required to import EPS files? Aren't PDF files as good?
– egreg
Dec 1 '11 at 11:56
2
I'd just load the PDF in IrfanView (this needs GhostScript installed and a suitably high-resolution setting for the conversion to bitmap) and paste from there. Word's EPS inclusion is patchy at best, and with later versions does not even embed the EPS in the Word file, so there is a loss of vector format whatever approach you take. (I do this routinely for both TikZ graphics and EPS files from other sources. 600 dpi resolution usually does the job without making the Word files too big.)
– Joseph Wright♦
Dec 1 '11 at 11:56
@egreg: they require all images to be EPS or TIFF (don't ask me why).
– eudoxos
Dec 1 '11 at 11:58
2
Also, why not use the dvips route to make EPS files directly?
– Joseph Wright♦
Dec 1 '11 at 12:01
1
I have used this link in the past for the recalculation of the bounding boxes of
.eps
figures– percusse
Dec 1 '11 at 12:56