http://www.gettysburg.stonesentinels.com/HQ-CSA/ANV-2-Johnson-Jones.php
The following site shows the order of battle for the Army of Northern Virginia at Gettysburg.
The 42nd Virginia Infantry was a part of Brig. General John M. Jones' Brigade in Major General Edward Johnson's Division, one of three divisions in the Second Corps under Lt. General Richard S. Ewell.
http://www.militaryhistoryonline.com/gettysburg/misc/csaunits.aspx