Import an image using Matex without the path of the image inserted in the output
$begingroup$
I am playing with MaTeX to include an image. It works but it also displays the path of the image in the output which messes things out.
Here is a MWE (on windows with 11.3)
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\usepackage{graphicx}"}];
MaTeX["This is a test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} with data"]
which gives
I'd like the path of the images not to show in the text output.
Is there a way to do that?
MaTeX Version 1.7.4, Mathematica 11.3 on windows 10.
Could someone on windows 10 please try to see if they can reproduce this?
Updated
I also tried using text{}
<<MaTeX`
MaTeX["\text{Test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} image}","Preamble"->{"\usepackage{graphicx}"}]
matex
$endgroup$
|
show 2 more comments
$begingroup$
I am playing with MaTeX to include an image. It works but it also displays the path of the image in the output which messes things out.
Here is a MWE (on windows with 11.3)
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\usepackage{graphicx}"}];
MaTeX["This is a test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} with data"]
which gives
I'd like the path of the images not to show in the text output.
Is there a way to do that?
MaTeX Version 1.7.4, Mathematica 11.3 on windows 10.
Could someone on windows 10 please try to see if they can reproduce this?
Updated
I also tried using text{}
<<MaTeX`
MaTeX["\text{Test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} image}","Preamble"->{"\usepackage{graphicx}"}]
matex
$endgroup$
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
Can you try putting it intext{}
? Does it work then?
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, doClearMaTeXCache
before theMaTeX
call and add the option"TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace theMaTeX{ ... }
with simply$ ... $
. Then you can remove most of the preamble (which just serves to defineMaTeX
).
$endgroup$
– Szabolcs
2 hours ago
|
show 2 more comments
$begingroup$
I am playing with MaTeX to include an image. It works but it also displays the path of the image in the output which messes things out.
Here is a MWE (on windows with 11.3)
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\usepackage{graphicx}"}];
MaTeX["This is a test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} with data"]
which gives
I'd like the path of the images not to show in the text output.
Is there a way to do that?
MaTeX Version 1.7.4, Mathematica 11.3 on windows 10.
Could someone on windows 10 please try to see if they can reproduce this?
Updated
I also tried using text{}
<<MaTeX`
MaTeX["\text{Test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} image}","Preamble"->{"\usepackage{graphicx}"}]
matex
$endgroup$
I am playing with MaTeX to include an image. It works but it also displays the path of the image in the output which messes things out.
Here is a MWE (on windows with 11.3)
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\usepackage{graphicx}"}];
MaTeX["This is a test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} with data"]
which gives
I'd like the path of the images not to show in the text output.
Is there a way to do that?
MaTeX Version 1.7.4, Mathematica 11.3 on windows 10.
Could someone on windows 10 please try to see if they can reproduce this?
Updated
I also tried using text{}
<<MaTeX`
MaTeX["\text{Test \includegraphics[width=.5\textwidth]{C:/Program Files/Wolfram Research/Mathematica/11.3/Documentation/English/System/ExampleData/pearls.png} image}","Preamble"->{"\usepackage{graphicx}"}]
matex
matex
edited 3 hours ago
Nasser
asked 4 hours ago
NasserNasser
57.8k488205
57.8k488205
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
Can you try putting it intext{}
? Does it work then?
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, doClearMaTeXCache
before theMaTeX
call and add the option"TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace theMaTeX{ ... }
with simply$ ... $
. Then you can remove most of the preamble (which just serves to defineMaTeX
).
$endgroup$
– Szabolcs
2 hours ago
|
show 2 more comments
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
Can you try putting it intext{}
? Does it work then?
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, doClearMaTeXCache
before theMaTeX
call and add the option"TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace theMaTeX{ ... }
with simply$ ... $
. Then you can remove most of the preamble (which just serves to defineMaTeX
).
$endgroup$
– Szabolcs
2 hours ago
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
Can you try putting it in
text{}
? Does it work then?$endgroup$
– Szabolcs
3 hours ago
$begingroup$
Can you try putting it in
text{}
? Does it work then?$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, do
ClearMaTeXCache
before the MaTeX
call and add the option "TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace the MaTeX{ ... }
with simply $ ... $
. Then you can remove most of the preamble (which just serves to define MaTeX
).$endgroup$
– Szabolcs
2 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, do
ClearMaTeXCache
before the MaTeX
call and add the option "TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace the MaTeX{ ... }
with simply $ ... $
. Then you can remove most of the preamble (which just serves to define MaTeX
).$endgroup$
– Szabolcs
2 hours ago
|
show 2 more comments
1 Answer
1
active
oldest
votes
$begingroup$
This happens because the file path that you provided contains spaces. Everything after the first space is interpreted as text. This is discussed in this TeX.SE thread:
- Prevent the file path of an image appearing above the image when using begin{figure} includegraphics{filepath}
As mentioned there, the solution is to use grffile package.
Thus, use
"Preamble" -> {"\usepackage{graphicx}", "\usepackage{grffile}"}
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
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%2fmathematica.stackexchange.com%2fquestions%2f190346%2fimport-an-image-using-matex-without-the-path-of-the-image-inserted-in-the-output%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This happens because the file path that you provided contains spaces. Everything after the first space is interpreted as text. This is discussed in this TeX.SE thread:
- Prevent the file path of an image appearing above the image when using begin{figure} includegraphics{filepath}
As mentioned there, the solution is to use grffile package.
Thus, use
"Preamble" -> {"\usepackage{graphicx}", "\usepackage{grffile}"}
$endgroup$
add a comment |
$begingroup$
This happens because the file path that you provided contains spaces. Everything after the first space is interpreted as text. This is discussed in this TeX.SE thread:
- Prevent the file path of an image appearing above the image when using begin{figure} includegraphics{filepath}
As mentioned there, the solution is to use grffile package.
Thus, use
"Preamble" -> {"\usepackage{graphicx}", "\usepackage{grffile}"}
$endgroup$
add a comment |
$begingroup$
This happens because the file path that you provided contains spaces. Everything after the first space is interpreted as text. This is discussed in this TeX.SE thread:
- Prevent the file path of an image appearing above the image when using begin{figure} includegraphics{filepath}
As mentioned there, the solution is to use grffile package.
Thus, use
"Preamble" -> {"\usepackage{graphicx}", "\usepackage{grffile}"}
$endgroup$
This happens because the file path that you provided contains spaces. Everything after the first space is interpreted as text. This is discussed in this TeX.SE thread:
- Prevent the file path of an image appearing above the image when using begin{figure} includegraphics{filepath}
As mentioned there, the solution is to use grffile package.
Thus, use
"Preamble" -> {"\usepackage{graphicx}", "\usepackage{grffile}"}
answered 2 hours ago
SzabolcsSzabolcs
159k13435930
159k13435930
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica 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.
Use MathJax to format equations. MathJax reference.
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%2fmathematica.stackexchange.com%2fquestions%2f190346%2fimport-an-image-using-matex-without-the-path-of-the-image-inserted-in-the-output%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
$begingroup$
I just tried this on macOS with MacTeX 2018 and I cannot reproduce the problem. I see only the images, not the path. I don't know why the path appears for you. i.stack.imgur.com/U8Bw2.png
$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs thanks for trying. It might be a Platform related then? There are no errors or warning generated also.
$endgroup$
– Nasser
3 hours ago
$begingroup$
Can you try putting it in
text{}
? Does it work then?$endgroup$
– Szabolcs
3 hours ago
$begingroup$
@Szabolcs I did. I tried exactly your example. It did not work. I will now post that as well.
$endgroup$
– Nasser
3 hours ago
$begingroup$
I suggest you create a TeX-only minimal example and ask on TeX.SE. Do let me know if you found out why it happens or if you have a solution! To create a minimal example, do
ClearMaTeXCache
before theMaTeX
call and add the option"TeXFileFunction" -> Print
. This will show you the TeX source that MaTeX generates. As a first simplification, replace theMaTeX{ ... }
with simply$ ... $
. Then you can remove most of the preamble (which just serves to defineMaTeX
).$endgroup$
– Szabolcs
2 hours ago