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

Was Tyrion always a poor strategist?

Why didn't Daenerys' advisers suggest assassinating Cersei?

How to customize the pie chart background in PowerPoint?

Combining two Lorentz boosts

Referring to a character in 3rd person when they have amnesia

In Dutch history two people are referred to as "William III"; are there any more cases where this happens?

Why aren't satellites disintegrated even though they orbit earth within earth's Roche Limits?

Why is the S-duct intake on the Tu-154 uniquely oblong?

Cathy’s Composite party is powered by three Prime Pals. Can you find them?

Should all adjustments be random effects in a mixed linear effect?

How to pipe results multiple results into a command?

Why wear sunglasses in indoor velodromes?

Pedaling at different gear ratios on flat terrain: what's the point?

Why does a table with a defined constant in its index compute 10X slower?

How does this piece of code determine array size without using sizeof( )?

Alternative classical explanation of the Stern-Gerlach Experiment?

Lock out of Oracle based on Windows username

Gambler's Fallacy Dice

FIFO data structure in pure C

Why are stats in Angband written as 18/** instead of 19, 20...?

Why do academics prefer Mac/Linux?

How to get all possible paths in 0/1 matrix better way?

Shortest amud or daf in Shas?

Why would you put your input amplifier in front of your filtering for an ECG signal?



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













5















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.)










share|improve this question

















  • 1





    input|"inkscape -V" should work.

    – egreg
    5 hours ago















5















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.)










share|improve this question

















  • 1





    input|"inkscape -V" should work.

    – egreg
    5 hours ago













5












5








5


1






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.)










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 5 hours ago









schtandardschtandard

2,7041121




2,7041121







  • 1





    input|"inkscape -V" should work.

    – egreg
    5 hours ago












  • 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










1 Answer
1






active

oldest

votes


















5














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

begindocument

inkscapebanner

enddocument


enter image description here



An example of manipulation:



documentclassarticle
usepackagecatchfile

CatchFileDefinkscapebanner
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%

expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother

begindocument

inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar

enddocument


enter image description here



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





share|improve this answer

























  • 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
    4 hours ago











  • @schtandard It's a “TeX Live addition” added a few years ago.

    – egreg
    4 hours ago






  • 1





    @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











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
);



);













draft saved

draft discarded


















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









5














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

begindocument

inkscapebanner

enddocument


enter image description here



An example of manipulation:



documentclassarticle
usepackagecatchfile

CatchFileDefinkscapebanner
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%

expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother

begindocument

inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar

enddocument


enter image description here



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





share|improve this answer

























  • 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
    4 hours ago











  • @schtandard It's a “TeX Live addition” added a few years ago.

    – egreg
    4 hours ago






  • 1





    @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















5














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

begindocument

inkscapebanner

enddocument


enter image description here



An example of manipulation:



documentclassarticle
usepackagecatchfile

CatchFileDefinkscapebanner
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%

expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother

begindocument

inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar

enddocument


enter image description here



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





share|improve this answer

























  • 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
    4 hours ago











  • @schtandard It's a “TeX Live addition” added a few years ago.

    – egreg
    4 hours ago






  • 1





    @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













5












5








5







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

begindocument

inkscapebanner

enddocument


enter image description here



An example of manipulation:



documentclassarticle
usepackagecatchfile

CatchFileDefinkscapebanner
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%

expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother

begindocument

inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar

enddocument


enter image description here



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





share|improve this answer















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

begindocument

inkscapebanner

enddocument


enter image description here



An example of manipulation:



documentclassarticle
usepackagecatchfile

CatchFileDefinkscapebanner
makeatletter
def@getinkscapeversioninfo#1 #2 #3, #4@nil%
definkscapeversion#2%
definkscapebuild#3%
definkscaperelease#4%

expandafter@getinkscapeversioninfoinkscapebanner@nil
makeatother

begindocument

inkscapebannerpar
inkscapeversionpar
inkscapebuildpar
inkscapereleasepar

enddocument


enter image description here



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






share|improve this answer














share|improve this answer



share|improve this answer








edited 5 hours ago

























answered 5 hours ago









egregegreg

742k8919423274




742k8919423274












  • 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
    4 hours ago











  • @schtandard It's a “TeX Live addition” added a few years ago.

    – egreg
    4 hours ago






  • 1





    @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

















  • 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
    4 hours ago











  • @schtandard It's a “TeX Live addition” added a few years ago.

    – egreg
    4 hours ago






  • 1





    @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
















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
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
4 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Log på Navigationsmenu

Wonderful Copenhagen (sang) Eksterne henvisninger | NavigationsmenurSide på frankloesser.comWonderful Copenhagen

Detroit Tigers Spis treści Historia | Skład zespołu | Sukcesy | Członkowie Baseball Hall of Fame | Zastrzeżone numery | Przypisy | Menu nawigacyjneEncyclopedia of Detroit - Detroit TigersTigers Stadium, Detroit, MITigers Timeline 1900sDetroit Tigers Team History & EncyclopediaTigers Timeline 1910s1935 World Series1945 World Series1945 World Series1984 World SeriesComerica Park, Detroit, MI2006 World Series2012 World SeriesDetroit Tigers 40-Man RosterDetroit Tigers Coaching StaffTigers Hall of FamersTigers Retired Numberse