How to move the pgf-spectra boxes in a TikZ
Clash Royale CLAN TAG#URR8PPP
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclassstandalone
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
beginscopexshift=-4cm,yshift=1cm
pgfspectra[width=5cm]
endscope
endtikzpicture
enddocument
Here is the output it renders:
tikz-pgf
add a comment |
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclassstandalone
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
beginscopexshift=-4cm,yshift=1cm
pgfspectra[width=5cm]
endscope
endtikzpicture
enddocument
Here is the output it renders:
tikz-pgf
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
Jan 3 at 7:44
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
Jan 3 at 10:39
add a comment |
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclassstandalone
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
beginscopexshift=-4cm,yshift=1cm
pgfspectra[width=5cm]
endscope
endtikzpicture
enddocument
Here is the output it renders:
tikz-pgf
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclassstandalone
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
beginscopexshift=-4cm,yshift=1cm
pgfspectra[width=5cm]
endscope
endtikzpicture
enddocument
Here is the output it renders:
tikz-pgf
tikz-pgf
asked Jan 3 at 7:31
sab hoquesab hoque
1,497318
1,497318
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
Jan 3 at 7:44
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
Jan 3 at 10:39
add a comment |
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
Jan 3 at 7:44
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
Jan 3 at 10:39
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point that pgfspectra
sets? If that's the case, in my original question I wanted multiple pgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
Jan 3 at 7:44
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point that pgfspectra
sets? If that's the case, in my original question I wanted multiple pgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
Jan 3 at 7:44
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nesting tikzpicture
s?– marmot
Jan 3 at 10:39
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nesting tikzpicture
s?– marmot
Jan 3 at 10:39
add a comment |
2 Answers
2
active
oldest
votes
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
beginscope[shift=(-10cm,.5cm)]
% adapted from pgf-spectra.sty
pgfkeys/wl/.cd,width=5cm,height=1cm
foreach x in 380,...,780%
%
pgfmathparsewlwidth/(abs(wlend-wlbegin))edefxscalepgfmathresult
edefwl@linewidthxscale pt
wlcolorx%
pgfmathparse(x-380)*xscaleedefwl@currentxpgfmathresult pt%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
%
endscope
makeatother
endtikzpicture
enddocument
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
setlengthunitlength1cm
thicklines
beginpicture(0,0)
put(-5,2.5) parbox4cmpgfspectra[lines=390,490,540,690,absorption,height=0.5cm,width=5cm]
put(-5,2) parbox4cmpgfspectra[lines=395,495,545,695,absorption,height=0.5cm,width=5cm]
put(-5,1.5) parbox4cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm]
put(-5,1) parbox4cmpgfspectra[lines=405,505,555,705,absorption,height=0.5cm,width=5cm]
put(-5,0.5) parbox4cmpgfspectra[lines=410,510,560,710,absorption,height=0.5cm,width=5cm]
put(-5,-0.5) parbox14cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm,line width=4pt]
endpicture
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
endtikzpicture
tikz[overlay,remember picture]node at (-2.8,-0.5) Widening of absorption lines;
enddocument
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%2f468364%2fhow-to-move-the-pgf-spectra-boxes-in-a-tikz%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
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
beginscope[shift=(-10cm,.5cm)]
% adapted from pgf-spectra.sty
pgfkeys/wl/.cd,width=5cm,height=1cm
foreach x in 380,...,780%
%
pgfmathparsewlwidth/(abs(wlend-wlbegin))edefxscalepgfmathresult
edefwl@linewidthxscale pt
wlcolorx%
pgfmathparse(x-380)*xscaleedefwl@currentxpgfmathresult pt%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
%
endscope
makeatother
endtikzpicture
enddocument
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
add a comment |
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
beginscope[shift=(-10cm,.5cm)]
% adapted from pgf-spectra.sty
pgfkeys/wl/.cd,width=5cm,height=1cm
foreach x in 380,...,780%
%
pgfmathparsewlwidth/(abs(wlend-wlbegin))edefxscalepgfmathresult
edefwl@linewidthxscale pt
wlcolorx%
pgfmathparse(x-380)*xscaleedefwl@currentxpgfmathresult pt%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
%
endscope
makeatother
endtikzpicture
enddocument
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
add a comment |
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
beginscope[shift=(-10cm,.5cm)]
% adapted from pgf-spectra.sty
pgfkeys/wl/.cd,width=5cm,height=1cm
foreach x in 380,...,780%
%
pgfmathparsewlwidth/(abs(wlend-wlbegin))edefxscalepgfmathresult
edefwl@linewidthxscale pt
wlcolorx%
pgfmathparse(x-380)*xscaleedefwl@currentxpgfmathresult pt%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
%
endscope
makeatother
endtikzpicture
enddocument
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
beginscope[shift=(-10cm,.5cm)]
% adapted from pgf-spectra.sty
pgfkeys/wl/.cd,width=5cm,height=1cm
foreach x in 380,...,780%
%
pgfmathparsewlwidth/(abs(wlend-wlbegin))edefxscalepgfmathresult
edefwl@linewidthxscale pt
wlcolorx%
pgfmathparse(x-380)*xscaleedefwl@currentxpgfmathresult pt%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
%
endscope
makeatother
endtikzpicture
enddocument
edited Jan 3 at 8:17
answered Jan 3 at 7:48
TeXnicianTeXnician
24.7k63187
24.7k63187
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
add a comment |
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
Jan 3 at 7:53
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
Jan 3 at 8:08
1
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
Jan 3 at 8:16
Did exactly that see below
– sab hoque
Jan 3 at 9:02
Did exactly that see below
– sab hoque
Jan 3 at 9:02
1
1
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
@sabhoque Above (+1) ;)
– TeXnician
Jan 3 at 9:06
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
setlengthunitlength1cm
thicklines
beginpicture(0,0)
put(-5,2.5) parbox4cmpgfspectra[lines=390,490,540,690,absorption,height=0.5cm,width=5cm]
put(-5,2) parbox4cmpgfspectra[lines=395,495,545,695,absorption,height=0.5cm,width=5cm]
put(-5,1.5) parbox4cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm]
put(-5,1) parbox4cmpgfspectra[lines=405,505,555,705,absorption,height=0.5cm,width=5cm]
put(-5,0.5) parbox4cmpgfspectra[lines=410,510,560,710,absorption,height=0.5cm,width=5cm]
put(-5,-0.5) parbox14cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm,line width=4pt]
endpicture
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
endtikzpicture
tikz[overlay,remember picture]node at (-2.8,-0.5) Widening of absorption lines;
enddocument
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
setlengthunitlength1cm
thicklines
beginpicture(0,0)
put(-5,2.5) parbox4cmpgfspectra[lines=390,490,540,690,absorption,height=0.5cm,width=5cm]
put(-5,2) parbox4cmpgfspectra[lines=395,495,545,695,absorption,height=0.5cm,width=5cm]
put(-5,1.5) parbox4cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm]
put(-5,1) parbox4cmpgfspectra[lines=405,505,555,705,absorption,height=0.5cm,width=5cm]
put(-5,0.5) parbox4cmpgfspectra[lines=410,510,560,710,absorption,height=0.5cm,width=5cm]
put(-5,-0.5) parbox14cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm,line width=4pt]
endpicture
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
endtikzpicture
tikz[overlay,remember picture]node at (-2.8,-0.5) Widening of absorption lines;
enddocument
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
setlengthunitlength1cm
thicklines
beginpicture(0,0)
put(-5,2.5) parbox4cmpgfspectra[lines=390,490,540,690,absorption,height=0.5cm,width=5cm]
put(-5,2) parbox4cmpgfspectra[lines=395,495,545,695,absorption,height=0.5cm,width=5cm]
put(-5,1.5) parbox4cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm]
put(-5,1) parbox4cmpgfspectra[lines=405,505,555,705,absorption,height=0.5cm,width=5cm]
put(-5,0.5) parbox4cmpgfspectra[lines=410,510,560,710,absorption,height=0.5cm,width=5cm]
put(-5,-0.5) parbox14cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm,line width=4pt]
endpicture
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
endtikzpicture
tikz[overlay,remember picture]node at (-2.8,-0.5) Widening of absorption lines;
enddocument
I have made a workaround using TeXnician's suggestions:
documentclassarticle
usepackagetikz
usepackagepgf-spectra
usetikzlibrarydecorations.pathmorphing
tikzsetsnake it/.style=decorate, decoration=snake
begindocument
setlengthunitlength1cm
thicklines
beginpicture(0,0)
put(-5,2.5) parbox4cmpgfspectra[lines=390,490,540,690,absorption,height=0.5cm,width=5cm]
put(-5,2) parbox4cmpgfspectra[lines=395,495,545,695,absorption,height=0.5cm,width=5cm]
put(-5,1.5) parbox4cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm]
put(-5,1) parbox4cmpgfspectra[lines=405,505,555,705,absorption,height=0.5cm,width=5cm]
put(-5,0.5) parbox4cmpgfspectra[lines=410,510,560,710,absorption,height=0.5cm,width=5cm]
put(-5,-0.5) parbox14cmpgfspectra[lines=400,500,550,700,absorption,height=0.5cm,width=5cm,line width=4pt]
endpicture
begintikzpicture
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
endtikzpicture
tikz[overlay,remember picture]node at (-2.8,-0.5) Widening of absorption lines;
enddocument
answered Jan 3 at 9:02
sab hoquesab hoque
1,497318
1,497318
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%2f468364%2fhow-to-move-the-pgf-spectra-boxes-in-a-tikz%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
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
Jan 3 at 7:39
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
Jan 3 at 7:44
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
Jan 3 at 7:50
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nestingtikzpicture
s?– marmot
Jan 3 at 10:39