Change TeXForm of ArcTanFormat and TeXForm does not work as expectedis it possible to change/customize some conversions done by TeXForm?Awkward output of TeXFormHow to type a capital 'E' in Mathematica 9 using 'ToExpression' and 'TeXForm'?Multiplication sign in TeXForm?TeXForm without simplificationTeXForm producing weird outputsUsing patterns to modify TeXForm outputTeXForm: Adding colorMultiple TeXForm returns just single outputHow to Custominze the Output of TeXFormUsing TeXForm for subscripted variables

Boss making me feel guilty for leaving the company at the end of my internship

My parents claim they cannot pay for my college education; what are my options?

Does every chapter have to "blow the reader away" so to speak?

How to search for Android apps without ads?

Why is my Taiyaki (Cake that looks like a fish) too hard and dry?

Is fission/fusion to iron the most efficient way to convert mass to energy?

DBCC SHRINKFILE on the distribution database

Do Veracrypt encrypted volumes have any kind of brute force protection?

Jam with honey & without pectin has a saucy consistency always

Is it true that "only photographers care about noise"?

Placement of positioning lights on A320 winglets

What do I need to do, tax-wise, for a sudden windfall?

Why not make one big cpu core?

Someone who is granted access to information but not expected to read it

Can Mage Hand be used to indirectly trigger an attack?

Is there a term for someone whose preferred policies are a mix of Left and Right?

What game uses dice with compass point arrows, forbidden signs, explosions, arrows and targeting reticles?

Must a CPU have a GPU if the motherboard provides a display port (when there isn't any separate video card)?

What publication claimed that Michael Jackson died in a nuclear holocaust?

Is it possible to install Firefox on Ubuntu with no desktop enviroment?

Why are backslashes included in this shell script?

Nth term of Van Eck Sequence

Are athletes' college degrees discounted by employers and graduate school admissions?

Why does there seem to be an extreme lack of public trashcans in Taiwan?



Change TeXForm of ArcTan


Format and TeXForm does not work as expectedis it possible to change/customize some conversions done by TeXForm?Awkward output of TeXFormHow to type a capital 'E' in Mathematica 9 using 'ToExpression' and 'TeXForm'?Multiplication sign in TeXForm?TeXForm without simplificationTeXForm producing weird outputsUsing patterns to modify TeXForm outputTeXForm: Adding colorMultiple TeXForm returns just single outputHow to Custominze the Output of TeXFormUsing TeXForm for subscripted variables













4












$begingroup$


When using ArcTan, the corresponding TeXForm is tan^-1 and not arctan which I would prefer for aesthetic reasons. How to fix that?










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
    $endgroup$
    – Szabolcs
    May 29 at 11:40















4












$begingroup$


When using ArcTan, the corresponding TeXForm is tan^-1 and not arctan which I would prefer for aesthetic reasons. How to fix that?










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
    $endgroup$
    – Szabolcs
    May 29 at 11:40













4












4








4


2



$begingroup$


When using ArcTan, the corresponding TeXForm is tan^-1 and not arctan which I would prefer for aesthetic reasons. How to fix that?










share|improve this question











$endgroup$




When using ArcTan, the corresponding TeXForm is tan^-1 and not arctan which I would prefer for aesthetic reasons. How to fix that?







latex format






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 29 at 19:15









Carl Woll

83.6k3105217




83.6k3105217










asked May 29 at 11:38









KutsubatoKutsubato

574




574







  • 2




    $begingroup$
    Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
    $endgroup$
    – Szabolcs
    May 29 at 11:40












  • 2




    $begingroup$
    Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
    $endgroup$
    – Szabolcs
    May 29 at 11:40







2




2




$begingroup$
Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
$endgroup$
– Szabolcs
May 29 at 11:40




$begingroup$
Possible duplicate: mathematica.stackexchange.com/q/153876/12 (TeXForm was unfortunately not designed to be customizable.)
$endgroup$
– Szabolcs
May 29 at 11:40










2 Answers
2






active

oldest

votes


















6












$begingroup$

Using the code from my answer to
Format and TeXForm does not work as expected (which I include at the bottom of this answer:



Format[ArcTan[x_], TeXForm] := arctan[x]


Then:



1 + ArcTan[x] //TeXForm



$arctan (x)+1$




Here is the code:



Initial /: Verbatim[TagSetDelayed][Initial[sym_], lhs_, rhs_] := With[

new = Block[sym,
TagSetDelayed[sym, lhs, rhs];
First @ Language`ExtendedDefinition[sym]
],
protect = Unprotect[sym]
,

sym;
Replace[new,
Rule[values_, n:Except[]] :> (
values[sym] = DeleteDuplicates@Join[n, values[sym]]
),
2
];
Protect@protect;
]

Initial[Convert`TeX`ExpressionToTeX] /:
Convert`TeX`ExpressionToTeX[e__] /; !TrueQ@$TeX := Block[
$
TeX = True,
Convert`TeX`ExpressionToTeX[e]
]

Initial[Format] /: TagSetDelayed[sym_Symbol, Verbatim[Format][x_, TeXForm], rhs_] := With[
fmt = TraditionalForm,

Initial[sym] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
]

Initial[Format] /: SetDelayed[Verbatim[Format][x_, TeXForm], rhs_] := With[
s = getTagSymbol[Format[x, TeXForm]], fmt = TraditionalForm,
Replace[s,
HoldForm[tag_] :> (
Initial[tag] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
)
]
]

SetAttributes[getTagSymbol, HoldFirst]

getTagSymbol[Format[x_, TeXForm]] := Module[dummy, t,
extractTag[Hold[Message[Format::tag, HoldForm@Format, _, tag_], False]] := t = tag;
Internal`HandlerBlock[Message, extractTag,
Quiet[dummy[1] /: Format[x, TeXForm] := 1]
];
t
]

System`Convert`TeXFormDump`maketex[s_String] /; !StringMatchQ[s, """~~___~~"""] && SyntaxQ[s, TeXForm] := Replace[
s,

n_ /; StringMatchQ[n, NumberString] :> n,
w_?wordQ :> "\operatorname"<>w<>""

]

wordQ[s_String] := Length @ StringSplit[s, WordBoundary] == 1





share|improve this answer









$endgroup$












  • $begingroup$
    Looks good but it changes my $text$ blocks into $operatorname$...
    $endgroup$
    – Kutsubato
    May 31 at 7:55


















4












$begingroup$

Usually the simplest methods tend to be the best. Try the code



expr = ArcTan[x/y] - ArcTan[z/w];
StringReplace[ToString[expr, TeXForm], "\tan ^-1" -> "\arctan"]


which returns



arctanleft(fracxyright)-arctanleft(fraczwright)


and in display form is



$$ arctanleft(fracxyright)-arctanleft(fraczwright) $$






share|improve this answer











$endgroup$












  • $begingroup$
    Should work but tends to be slow
    $endgroup$
    – Kutsubato
    May 31 at 7:55











Your Answer








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



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199315%2fchange-texform-of-arctan%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









6












$begingroup$

Using the code from my answer to
Format and TeXForm does not work as expected (which I include at the bottom of this answer:



Format[ArcTan[x_], TeXForm] := arctan[x]


Then:



1 + ArcTan[x] //TeXForm



$arctan (x)+1$




Here is the code:



Initial /: Verbatim[TagSetDelayed][Initial[sym_], lhs_, rhs_] := With[

new = Block[sym,
TagSetDelayed[sym, lhs, rhs];
First @ Language`ExtendedDefinition[sym]
],
protect = Unprotect[sym]
,

sym;
Replace[new,
Rule[values_, n:Except[]] :> (
values[sym] = DeleteDuplicates@Join[n, values[sym]]
),
2
];
Protect@protect;
]

Initial[Convert`TeX`ExpressionToTeX] /:
Convert`TeX`ExpressionToTeX[e__] /; !TrueQ@$TeX := Block[
$
TeX = True,
Convert`TeX`ExpressionToTeX[e]
]

Initial[Format] /: TagSetDelayed[sym_Symbol, Verbatim[Format][x_, TeXForm], rhs_] := With[
fmt = TraditionalForm,

Initial[sym] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
]

Initial[Format] /: SetDelayed[Verbatim[Format][x_, TeXForm], rhs_] := With[
s = getTagSymbol[Format[x, TeXForm]], fmt = TraditionalForm,
Replace[s,
HoldForm[tag_] :> (
Initial[tag] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
)
]
]

SetAttributes[getTagSymbol, HoldFirst]

getTagSymbol[Format[x_, TeXForm]] := Module[dummy, t,
extractTag[Hold[Message[Format::tag, HoldForm@Format, _, tag_], False]] := t = tag;
Internal`HandlerBlock[Message, extractTag,
Quiet[dummy[1] /: Format[x, TeXForm] := 1]
];
t
]

System`Convert`TeXFormDump`maketex[s_String] /; !StringMatchQ[s, """~~___~~"""] && SyntaxQ[s, TeXForm] := Replace[
s,

n_ /; StringMatchQ[n, NumberString] :> n,
w_?wordQ :> "\operatorname"<>w<>""

]

wordQ[s_String] := Length @ StringSplit[s, WordBoundary] == 1





share|improve this answer









$endgroup$












  • $begingroup$
    Looks good but it changes my $text$ blocks into $operatorname$...
    $endgroup$
    – Kutsubato
    May 31 at 7:55















6












$begingroup$

Using the code from my answer to
Format and TeXForm does not work as expected (which I include at the bottom of this answer:



Format[ArcTan[x_], TeXForm] := arctan[x]


Then:



1 + ArcTan[x] //TeXForm



$arctan (x)+1$




Here is the code:



Initial /: Verbatim[TagSetDelayed][Initial[sym_], lhs_, rhs_] := With[

new = Block[sym,
TagSetDelayed[sym, lhs, rhs];
First @ Language`ExtendedDefinition[sym]
],
protect = Unprotect[sym]
,

sym;
Replace[new,
Rule[values_, n:Except[]] :> (
values[sym] = DeleteDuplicates@Join[n, values[sym]]
),
2
];
Protect@protect;
]

Initial[Convert`TeX`ExpressionToTeX] /:
Convert`TeX`ExpressionToTeX[e__] /; !TrueQ@$TeX := Block[
$
TeX = True,
Convert`TeX`ExpressionToTeX[e]
]

Initial[Format] /: TagSetDelayed[sym_Symbol, Verbatim[Format][x_, TeXForm], rhs_] := With[
fmt = TraditionalForm,

Initial[sym] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
]

Initial[Format] /: SetDelayed[Verbatim[Format][x_, TeXForm], rhs_] := With[
s = getTagSymbol[Format[x, TeXForm]], fmt = TraditionalForm,
Replace[s,
HoldForm[tag_] :> (
Initial[tag] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
)
]
]

SetAttributes[getTagSymbol, HoldFirst]

getTagSymbol[Format[x_, TeXForm]] := Module[dummy, t,
extractTag[Hold[Message[Format::tag, HoldForm@Format, _, tag_], False]] := t = tag;
Internal`HandlerBlock[Message, extractTag,
Quiet[dummy[1] /: Format[x, TeXForm] := 1]
];
t
]

System`Convert`TeXFormDump`maketex[s_String] /; !StringMatchQ[s, """~~___~~"""] && SyntaxQ[s, TeXForm] := Replace[
s,

n_ /; StringMatchQ[n, NumberString] :> n,
w_?wordQ :> "\operatorname"<>w<>""

]

wordQ[s_String] := Length @ StringSplit[s, WordBoundary] == 1





share|improve this answer









$endgroup$












  • $begingroup$
    Looks good but it changes my $text$ blocks into $operatorname$...
    $endgroup$
    – Kutsubato
    May 31 at 7:55













6












6








6





$begingroup$

Using the code from my answer to
Format and TeXForm does not work as expected (which I include at the bottom of this answer:



Format[ArcTan[x_], TeXForm] := arctan[x]


Then:



1 + ArcTan[x] //TeXForm



$arctan (x)+1$




Here is the code:



Initial /: Verbatim[TagSetDelayed][Initial[sym_], lhs_, rhs_] := With[

new = Block[sym,
TagSetDelayed[sym, lhs, rhs];
First @ Language`ExtendedDefinition[sym]
],
protect = Unprotect[sym]
,

sym;
Replace[new,
Rule[values_, n:Except[]] :> (
values[sym] = DeleteDuplicates@Join[n, values[sym]]
),
2
];
Protect@protect;
]

Initial[Convert`TeX`ExpressionToTeX] /:
Convert`TeX`ExpressionToTeX[e__] /; !TrueQ@$TeX := Block[
$
TeX = True,
Convert`TeX`ExpressionToTeX[e]
]

Initial[Format] /: TagSetDelayed[sym_Symbol, Verbatim[Format][x_, TeXForm], rhs_] := With[
fmt = TraditionalForm,

Initial[sym] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
]

Initial[Format] /: SetDelayed[Verbatim[Format][x_, TeXForm], rhs_] := With[
s = getTagSymbol[Format[x, TeXForm]], fmt = TraditionalForm,
Replace[s,
HoldForm[tag_] :> (
Initial[tag] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
)
]
]

SetAttributes[getTagSymbol, HoldFirst]

getTagSymbol[Format[x_, TeXForm]] := Module[dummy, t,
extractTag[Hold[Message[Format::tag, HoldForm@Format, _, tag_], False]] := t = tag;
Internal`HandlerBlock[Message, extractTag,
Quiet[dummy[1] /: Format[x, TeXForm] := 1]
];
t
]

System`Convert`TeXFormDump`maketex[s_String] /; !StringMatchQ[s, """~~___~~"""] && SyntaxQ[s, TeXForm] := Replace[
s,

n_ /; StringMatchQ[n, NumberString] :> n,
w_?wordQ :> "\operatorname"<>w<>""

]

wordQ[s_String] := Length @ StringSplit[s, WordBoundary] == 1





share|improve this answer









$endgroup$



Using the code from my answer to
Format and TeXForm does not work as expected (which I include at the bottom of this answer:



Format[ArcTan[x_], TeXForm] := arctan[x]


Then:



1 + ArcTan[x] //TeXForm



$arctan (x)+1$




Here is the code:



Initial /: Verbatim[TagSetDelayed][Initial[sym_], lhs_, rhs_] := With[

new = Block[sym,
TagSetDelayed[sym, lhs, rhs];
First @ Language`ExtendedDefinition[sym]
],
protect = Unprotect[sym]
,

sym;
Replace[new,
Rule[values_, n:Except[]] :> (
values[sym] = DeleteDuplicates@Join[n, values[sym]]
),
2
];
Protect@protect;
]

Initial[Convert`TeX`ExpressionToTeX] /:
Convert`TeX`ExpressionToTeX[e__] /; !TrueQ@$TeX := Block[
$
TeX = True,
Convert`TeX`ExpressionToTeX[e]
]

Initial[Format] /: TagSetDelayed[sym_Symbol, Verbatim[Format][x_, TeXForm], rhs_] := With[
fmt = TraditionalForm,

Initial[sym] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
]

Initial[Format] /: SetDelayed[Verbatim[Format][x_, TeXForm], rhs_] := With[
s = getTagSymbol[Format[x, TeXForm]], fmt = TraditionalForm,
Replace[s,
HoldForm[tag_] :> (
Initial[tag] /: MakeBoxes[x, fmt] /; $TeX := MakeBoxes[rhs, fmt]
)
]
]

SetAttributes[getTagSymbol, HoldFirst]

getTagSymbol[Format[x_, TeXForm]] := Module[dummy, t,
extractTag[Hold[Message[Format::tag, HoldForm@Format, _, tag_], False]] := t = tag;
Internal`HandlerBlock[Message, extractTag,
Quiet[dummy[1] /: Format[x, TeXForm] := 1]
];
t
]

System`Convert`TeXFormDump`maketex[s_String] /; !StringMatchQ[s, """~~___~~"""] && SyntaxQ[s, TeXForm] := Replace[
s,

n_ /; StringMatchQ[n, NumberString] :> n,
w_?wordQ :> "\operatorname"<>w<>""

]

wordQ[s_String] := Length @ StringSplit[s, WordBoundary] == 1






share|improve this answer












share|improve this answer



share|improve this answer










answered May 29 at 14:44









Carl WollCarl Woll

83.6k3105217




83.6k3105217











  • $begingroup$
    Looks good but it changes my $text$ blocks into $operatorname$...
    $endgroup$
    – Kutsubato
    May 31 at 7:55
















  • $begingroup$
    Looks good but it changes my $text$ blocks into $operatorname$...
    $endgroup$
    – Kutsubato
    May 31 at 7:55















$begingroup$
Looks good but it changes my $text$ blocks into $operatorname$...
$endgroup$
– Kutsubato
May 31 at 7:55




$begingroup$
Looks good but it changes my $text$ blocks into $operatorname$...
$endgroup$
– Kutsubato
May 31 at 7:55











4












$begingroup$

Usually the simplest methods tend to be the best. Try the code



expr = ArcTan[x/y] - ArcTan[z/w];
StringReplace[ToString[expr, TeXForm], "\tan ^-1" -> "\arctan"]


which returns



arctanleft(fracxyright)-arctanleft(fraczwright)


and in display form is



$$ arctanleft(fracxyright)-arctanleft(fraczwright) $$






share|improve this answer











$endgroup$












  • $begingroup$
    Should work but tends to be slow
    $endgroup$
    – Kutsubato
    May 31 at 7:55















4












$begingroup$

Usually the simplest methods tend to be the best. Try the code



expr = ArcTan[x/y] - ArcTan[z/w];
StringReplace[ToString[expr, TeXForm], "\tan ^-1" -> "\arctan"]


which returns



arctanleft(fracxyright)-arctanleft(fraczwright)


and in display form is



$$ arctanleft(fracxyright)-arctanleft(fraczwright) $$






share|improve this answer











$endgroup$












  • $begingroup$
    Should work but tends to be slow
    $endgroup$
    – Kutsubato
    May 31 at 7:55













4












4








4





$begingroup$

Usually the simplest methods tend to be the best. Try the code



expr = ArcTan[x/y] - ArcTan[z/w];
StringReplace[ToString[expr, TeXForm], "\tan ^-1" -> "\arctan"]


which returns



arctanleft(fracxyright)-arctanleft(fraczwright)


and in display form is



$$ arctanleft(fracxyright)-arctanleft(fraczwright) $$






share|improve this answer











$endgroup$



Usually the simplest methods tend to be the best. Try the code



expr = ArcTan[x/y] - ArcTan[z/w];
StringReplace[ToString[expr, TeXForm], "\tan ^-1" -> "\arctan"]


which returns



arctanleft(fracxyright)-arctanleft(fraczwright)


and in display form is



$$ arctanleft(fracxyright)-arctanleft(fraczwright) $$







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 5 at 10:57

























answered May 29 at 18:41









SomosSomos

2,5651211




2,5651211











  • $begingroup$
    Should work but tends to be slow
    $endgroup$
    – Kutsubato
    May 31 at 7:55
















  • $begingroup$
    Should work but tends to be slow
    $endgroup$
    – Kutsubato
    May 31 at 7:55















$begingroup$
Should work but tends to be slow
$endgroup$
– Kutsubato
May 31 at 7:55




$begingroup$
Should work but tends to be slow
$endgroup$
– Kutsubato
May 31 at 7:55

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199315%2fchange-texform-of-arctan%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

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?