Edit and compile if you like:
% Author: Izaak Neutelings (March 2020)\documentclass[border=3pt,tikz]{standalone}\usepackage{amsmath} % for \dfrac\usepackage{physics}\usepackage{ifthen}\usepackage{tikz,pgfplots}\usepackage{tikz-3dplot}\usepackage{auto-pst-pdf}\usepackage{pst-magneticfield}\usepackage[outline]{contour} % glow around text\usetikzlibrary{angles,quotes} % for pic (angle labels)\usetikzlibrary{arrows,arrows.meta}\usetikzlibrary{calc}\usetikzlibrary{decorations.markings}\tikzset{>=latex} % for LaTeX arrow head\usepackage{xcolor}\colorlet{Ecol}{orange!90!black}\colorlet{EcolFL}{orange!80!black}\colorlet{veccol}{green!45!black}\colorlet{projcol}{blue!70!black}\colorlet{EFcol}{red!60!black}\colorlet{Bcol}{violet!90}\colorlet{Bcol1}{violet!80!blue!90}\colorlet{Bcol2}{violet!80!red!90}\colorlet{BFcol}{red!70!black}\colorlet{veccol}{green!45!black}\colorlet{Icol}{blue!70!black}\colorlet{Ampcol}{green!60!black!70}\tikzstyle{BField}=[->,thick,Bcol]\tikzstyle{current}=[->,Icol,thick]\tikzstyle{force}=[->,thick,BFcol]\tikzstyle{vector}=[->,thick,veccol]\tikzstyle{velocity}=[->,very thick,vcol]\tikzstyle{metal}=[top color=black!15,bottom color=black!25,middle color=black!20,shading angle=10]\tikzstyle{darkmetal}=[top color=black!40,bottom color=black!70,middle color=black!30,shading angle=10]\tikzstyle{lightmetal}=[thin,black!20,top color=black!3,bottom color=black!6,middle color=black!1,shading angle=10]\tikzstyle{proj}=[projcol!80,line width=0.08] %very thin\tikzstyle{area}=[draw=veccol,fill=veccol!80,fill opacity=0.6]\tikzstyle{measline}=[{Latex[length=3]}-{Latex[length=3]}]\tikzset{BFieldLine/.style={thick,Bcol,decoration={markings,mark=at position #1 with {\arrow{latex}}},
Click to download: magnetic_field_loop.tex • magnetic_field_loop.pdf
Open in Overleaf: magnetic_field_loop.tex
Hello,
The magnetic field lines for the bottom image are not showing up when I try this on Overleaf.