Can I get the output of a command line program with TeX (using e.g. read18)?Test success of write18Per-word info needed in DVI to create touch rectangles on LaTeX documents in iTeX for the iPadTeX command with argument BEFORE the commandTeX at the Command LineTikz externalisation not working despite enabling write 18 or shell escapesublimetext 2, auto-pst-pdf, enable shell escape, chemnumHow is the TeX engine informed of the OS's end-of-line marker and file encoding?Combine path from external program with draw in tikzDoes --no-shell-escape break pdf@shellescape?Can't execute jar from directory with umlaut
Would a "ring language" be possible?
Is it standard to have the first week's pay indefinitely withheld?
on the truth quest vs in the quest for truth
How was the blinking terminal cursor invented?
Does the US Supreme Court vote using secret ballots?
Cycling to work - 30mile return
Why is so much ransomware breakable?
Why didn't Daenerys' advisers suggest assassinating Cersei?
Windows reverting changes made by Linux to FAT32 partion
Quotient of Three Dimensional Torus by Permutation on Coordinates
How come Arya Stark wasn't hurt by this in Game of Thrones Season 8 Episode 5?
Combining two Lorentz boosts
Have GoT's showrunners reacted to the poor reception of the final season?
Cathy’s Composite party is powered by three Prime Pals. Can you find them?
What's is the easiest way to purchase a stock and hold it
When did Britain learn about the American Declaration of Independence?
Is my homebrew Awakened Bear race balanced?
What color to choose as "danger" if the main color of my app is red
What would be the game balance implications for using the Gygax method for applying falling damage?
Failing students when it might cause them economic ruin
Lock out of Oracle based on Windows username
Was Tyrion always a poor strategist?
Driving a school bus in the USA
Can more than one instance of Bend Luck be applied to the same roll by multiple Wild Magic sorcerers?
Can I get the output of a command line program with TeX (using e.g. read18)?
Test success of write18Per-word info needed in DVI to create touch rectangles on LaTeX documents in iTeX for the iPadTeX command with argument BEFORE the commandTeX at the Command LineTikz externalisation not working despite enabling write 18 or shell escapesublimetext 2, auto-pst-pdf, enable shell escape, chemnumHow is the TeX engine informed of the OS's end-of-line marker and file encoding?Combine path from external program with draw in tikzDoes --no-shell-escape break pdf@shellescape?Can't execute jar from directory with umlaut
Say I want to call some external program using write18
, which returns some text to the command line. Can I get that text from inside TeX?
As an example
> inkscape -V
returns the version of the inkscape installation, in my case
Inkscape 0.92.4 (5da689c313, 2019-01-14)
How can I retrieve this information using TeX?
(Note: I am running TeX on Windows, but would like the solution to be system independent.)
tex-core shell-escape command-line
add a comment |
Say I want to call some external program using write18
, which returns some text to the command line. Can I get that text from inside TeX?
As an example
> inkscape -V
returns the version of the inkscape installation, in my case
Inkscape 0.92.4 (5da689c313, 2019-01-14)
How can I retrieve this information using TeX?
(Note: I am running TeX on Windows, but would like the solution to be system independent.)
tex-core shell-escape command-line
1
input|"inkscape -V"
should work.
– egreg
5 hours ago
add a comment |
Say I want to call some external program using write18
, which returns some text to the command line. Can I get that text from inside TeX?
As an example
> inkscape -V
returns the version of the inkscape installation, in my case
Inkscape 0.92.4 (5da689c313, 2019-01-14)
How can I retrieve this information using TeX?
(Note: I am running TeX on Windows, but would like the solution to be system independent.)
tex-core shell-escape command-line
Say I want to call some external program using write18
, which returns some text to the command line. Can I get that text from inside TeX?
As an example
> inkscape -V
returns the version of the inkscape installation, in my case
Inkscape 0.92.4 (5da689c313, 2019-01-14)
How can I retrieve this information using TeX?
(Note: I am running TeX on Windows, but would like the solution to be system independent.)
tex-core shell-escape command-line
tex-core shell-escape command-line
asked 6 hours ago
schtandardschtandard
2,7041121
2,7041121
1
input|"inkscape -V"
should work.
– egreg
5 hours ago
add a comment |
1
input|"inkscape -V"
should work.
– egreg
5 hours ago
1
1
input|"inkscape -V"
should work.– egreg
5 hours ago
input|"inkscape -V"
should work.– egreg
5 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You could use input|"inkscape -V"
(requires -shell-escape
). However, I suggest defining a macro so that you can also manipulate the output:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
begindocument
inkscapebanner
enddocument
An example of manipulation:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%
expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
The mandatory expl3
version:
documentclassarticle
usepackageexpl3
ExplSyntaxOn
tl_new:N inkscapebanner
tl_new:N inkscapeversion
tl_new:N inkscapebuild
tl_new:N inkscaperelease
sys_shell_get:nnN inkscape~-V char_set_catcode_space:n `~ inkscapebanner
seq_set_split:NnV l_tmpa_seq ~ inkscapebanner
tl_set:Nx inkscapeversion seq_item:Nn l_tmpa_seq 2
tl_set:Nx inkscapebuild seq_item:Nn l_tmpa_seq 3
tl_set:Nx inkscapebuild tl_range:Nnn inkscapebuild 1 -1
tl_set:Nx inkscaperelease seq_item:Nn l_tmpa_seq 4
ExplSyntaxOff
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
Is the fact thatinput|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?
– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
@schtandard You can find it withtexdoc web2c
, section 4.5
– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when askingtexdoc web2c
, but the manual is also available online.)
– schtandard
4 hours ago
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%2f491224%2fcan-i-get-the-output-of-a-command-line-program-with-tex-using-e-g-read18%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
You could use input|"inkscape -V"
(requires -shell-escape
). However, I suggest defining a macro so that you can also manipulate the output:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
begindocument
inkscapebanner
enddocument
An example of manipulation:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%
expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
The mandatory expl3
version:
documentclassarticle
usepackageexpl3
ExplSyntaxOn
tl_new:N inkscapebanner
tl_new:N inkscapeversion
tl_new:N inkscapebuild
tl_new:N inkscaperelease
sys_shell_get:nnN inkscape~-V char_set_catcode_space:n `~ inkscapebanner
seq_set_split:NnV l_tmpa_seq ~ inkscapebanner
tl_set:Nx inkscapeversion seq_item:Nn l_tmpa_seq 2
tl_set:Nx inkscapebuild seq_item:Nn l_tmpa_seq 3
tl_set:Nx inkscapebuild tl_range:Nnn inkscapebuild 1 -1
tl_set:Nx inkscaperelease seq_item:Nn l_tmpa_seq 4
ExplSyntaxOff
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
Is the fact thatinput|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?
– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
@schtandard You can find it withtexdoc web2c
, section 4.5
– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when askingtexdoc web2c
, but the manual is also available online.)
– schtandard
4 hours ago
add a comment |
You could use input|"inkscape -V"
(requires -shell-escape
). However, I suggest defining a macro so that you can also manipulate the output:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
begindocument
inkscapebanner
enddocument
An example of manipulation:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%
expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
The mandatory expl3
version:
documentclassarticle
usepackageexpl3
ExplSyntaxOn
tl_new:N inkscapebanner
tl_new:N inkscapeversion
tl_new:N inkscapebuild
tl_new:N inkscaperelease
sys_shell_get:nnN inkscape~-V char_set_catcode_space:n `~ inkscapebanner
seq_set_split:NnV l_tmpa_seq ~ inkscapebanner
tl_set:Nx inkscapeversion seq_item:Nn l_tmpa_seq 2
tl_set:Nx inkscapebuild seq_item:Nn l_tmpa_seq 3
tl_set:Nx inkscapebuild tl_range:Nnn inkscapebuild 1 -1
tl_set:Nx inkscaperelease seq_item:Nn l_tmpa_seq 4
ExplSyntaxOff
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
Is the fact thatinput|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?
– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
@schtandard You can find it withtexdoc web2c
, section 4.5
– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when askingtexdoc web2c
, but the manual is also available online.)
– schtandard
4 hours ago
add a comment |
You could use input|"inkscape -V"
(requires -shell-escape
). However, I suggest defining a macro so that you can also manipulate the output:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
begindocument
inkscapebanner
enddocument
An example of manipulation:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%
expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
The mandatory expl3
version:
documentclassarticle
usepackageexpl3
ExplSyntaxOn
tl_new:N inkscapebanner
tl_new:N inkscapeversion
tl_new:N inkscapebuild
tl_new:N inkscaperelease
sys_shell_get:nnN inkscape~-V char_set_catcode_space:n `~ inkscapebanner
seq_set_split:NnV l_tmpa_seq ~ inkscapebanner
tl_set:Nx inkscapeversion seq_item:Nn l_tmpa_seq 2
tl_set:Nx inkscapebuild seq_item:Nn l_tmpa_seq 3
tl_set:Nx inkscapebuild tl_range:Nnn inkscapebuild 1 -1
tl_set:Nx inkscaperelease seq_item:Nn l_tmpa_seq 4
ExplSyntaxOff
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
You could use input|"inkscape -V"
(requires -shell-escape
). However, I suggest defining a macro so that you can also manipulate the output:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
begindocument
inkscapebanner
enddocument
An example of manipulation:
documentclassarticle
usepackagecatchfile
CatchFileDefinkscapebanner"inkscape -V"
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%
expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
The mandatory expl3
version:
documentclassarticle
usepackageexpl3
ExplSyntaxOn
tl_new:N inkscapebanner
tl_new:N inkscapeversion
tl_new:N inkscapebuild
tl_new:N inkscaperelease
sys_shell_get:nnN inkscape~-V char_set_catcode_space:n `~ inkscapebanner
seq_set_split:NnV l_tmpa_seq ~ inkscapebanner
tl_set:Nx inkscapeversion seq_item:Nn l_tmpa_seq 2
tl_set:Nx inkscapebuild seq_item:Nn l_tmpa_seq 3
tl_set:Nx inkscapebuild tl_range:Nnn inkscapebuild 1 -1
tl_set:Nx inkscaperelease seq_item:Nn l_tmpa_seq 4
ExplSyntaxOff
begindocument
inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar
enddocument
edited 5 hours ago
answered 5 hours ago
egregegreg
742k8919423274
742k8919423274
Is the fact thatinput|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?
– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
@schtandard You can find it withtexdoc web2c
, section 4.5
– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when askingtexdoc web2c
, but the manual is also available online.)
– schtandard
4 hours ago
add a comment |
Is the fact thatinput|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?
– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
@schtandard You can find it withtexdoc web2c
, section 4.5
– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when askingtexdoc web2c
, but the manual is also available online.)
– schtandard
4 hours ago
Is the fact that
input|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?– schtandard
5 hours ago
Is the fact that
input|"inkscape -V"
works a TeX feature or a side effect of its implementation? A search through the TeXbook yielded nothing and this isn't really how I thought the pipe command worked either (since a pipe usually directs output from its left to the command to its right). Why does this work?– schtandard
5 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
@schtandard It's a “TeX Live addition” added a few years ago.
– egreg
4 hours ago
1
1
@schtandard You can find it with
texdoc web2c
, section 4.5– egreg
4 hours ago
@schtandard You can find it with
texdoc web2c
, section 4.5– egreg
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when asking
texdoc web2c
, but the manual is also available online.)– schtandard
4 hours ago
Thanks for the pointer! (Actually, MiKTeX doesn't find anything when asking
texdoc web2c
, but the manual is also available online.)– schtandard
4 hours ago
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%2f491224%2fcan-i-get-the-output-of-a-command-line-program-with-tex-using-e-g-read18%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
1
input|"inkscape -V"
should work.– egreg
5 hours ago