<<peeters` ;
peeters`setGitDir[ "figures\\phy487" ]

(* http://mathematica.stackexchange.com/questions/16275/why-are-plotlegends-not-combined-with-plots *)
getTheGraphics[g_Graphics]:=g;
getTheGraphics[plot_Legended]:=Module[{gr},ToBoxes[plot/.Placed[i_,coords:_Symbol,f_]:>Placed[i,coords/.{Left->{-0.1,0.5},Right|After->{1.1,0.5},Top->{0.5,1.1},Bottom->{0.5,-0.1}},f]]/.g_GraphicsBox:>(gr=g;Break[Null,ReplaceAll]);
ToExpression[gr]]

Clear[ t, p, q, r, l, bt ]
r = {1, 1/2, 0, -1} ;
bt = {" -2B", " -B", "", " + 2B"} ;
t = Cos[u] + Cos[v] == # &/@ r ;
l = Row[{"E = (Subscript[E, s]) - A ", #}] &/@ bt  ;
q = ContourPlot[ 
Evaluate@t, {u, - Pi,  Pi}, {v, - Pi,  Pi}

, FrameTicks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, {-Pi, -Pi/2, 0, Pi/2, Pi}}
] 

p = ContourPlot[ 
Evaluate@t, {u, - Pi,  Pi}, {v, - Pi,  Pi}
, PlotLegends -> l (*Placed[ l , {Right,Top} ]*)
, FrameTicks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, {-Pi, -Pi/2, 0, Pi/2, Pi}}
]

peeters`lblPlot[q]

peeters`exportForLatex["qmSolidsPs8dFig1", p]

Clear[ t, p, r]
r = Table[u, {u, -2, 2, 0.01}] ;
t = Cos[u] + Cos[v] == # &/@ r ;

p = ContourPlot[ 
Evaluate@t, {u, - Pi,  Pi}, {v, - Pi,  Pi}
, FrameTicks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, {-Pi, -Pi/2, 0, Pi/2, Pi}}
]

Clear[ p]

p = Plot3D[ 
 -2(Cos[u] + Cos[v])
, {u, - Pi,  Pi}, {v, - Pi,  Pi}
, Ticks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, {-Pi, -Pi/2, 0, Pi/2, Pi}, None}
]

Clear[ p ]

p = ContourPlot3D[ 
-2(Cos[u] + Cos[v]) == e
, {u, - Pi,  Pi}
, {v, - Pi,  Pi}
, {e, -4,  4}
(*, PlotLegends -> l (*Placed[ l , {Right,Top} ]*)*)
, Ticks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, {-Pi, -Pi/2, 0, Pi/2, Pi}, None}
]

peeters`exportForLatex["qmSolidsPs8dFig2", p, True]
(*Export[ "qmSolidsPs8dFig2.png", p]*)