Book 5
Ship's Troops: "Most ships over 1,000 tons have a marine (or military) contingent aboard which ranges in size from a squad to a regiment. Such contingents range from three per 100 tons to three per thousand tons."
Okay, those are the Marines.
Service Crew: "The ship itself may have a requirement for other sections which provide basic services, including shops and storage, security (especially if there are no ship's troops aboard), maintenance, food service, and other operations. Such personnel are drawn from the crew branch if no other appears appropriate. Allow two crew per 1000 tons of ship; three per 1000 tons if there are no ship's troops."
And there's your Naval Infantry - about one person per thousand tons in the larger ships, per rules. That's the number you'd use if someone tried to board you and you didn't have your own Marine contingent to resist. That's not necessarily all the men who'd have the needed training; that's the men armed, armored and ready to repel boarders.
(I've never liked the boarding rule - if someone's boarding, I'd arm everyone who isn't actually keeping the power going and the air fresh. A guy in a vacc-suit's not quite the same as an armored fighter, but 1 per 50??)
Book 5 implies anyone but engineering/technical and medical have a shot at the training. Figure a given character (in the appropriate branch) has roughly a 50:50 shot at getting gun training before completing a 4-year term, and that your enlisted will run the gamut from trainees to able spacehands and petty officers. So figure from a third to a half of your non-Engineering, non-Medical crew know how to handle a gun reasonably well. However, you don't want to take all of them away from their duty stations. Even if you keep the machinery running, people will get mighty hungry if your kitchen staff's ashore fighting rioters.
Sail ships seemed to take roughly a fifth to a quarter of the crew. Aramis' link had an item about 2200 t. WW-II destroyers (crew ~330-350) fielding two squads of 10 each, or about 20 men total, and the same link spoke to destroyers in the '60's (about the same crew) being able to field a squad of 13 men.
Traveller ships use a lot of tech - a lot fewer men to draw from. The Supplement-9 destroyer escorts only have 14-16 crew total, the 3000 ton destroyer has 33 (I think - Supplement-9 has some inaccuracies). You're in a 40-50 thousand ton cruiser before you have as many crew as a WW-II destroyer or a Napoleonic 4th-rater, so that 1 per thousand-dTon bit's in the ballpark.
So, say you're captaining a Fer de Lance, 1000 dT. Book-5 says you've only got 1 Ship's Troop - but Book-5 also says you're under Book-2 crew rules, so that doesn't apply. Book-2 says you have a pilot (presumably captain), navigator, 9 engineers, 1 Medic, 4 Gunners (Supplement-9 is off). You've probably got your navigator/XO and a couple of gunners who are qualified to handle a firefight. (I assume we're not doing the Captain Kirk bit.)
Captain a PF Sloan, with a crew of 40 ... er, 62 if you follow Book-5 rules (how did Supplement-9 get those numbers??). Oops - 63 with the ship's doctor. You've got a 5-man security detail and 41 other crew who aren't engineers or medical. Figure 14-20 know how to handle themselves in a firefight. So, you've got 5 designated Naval Infantry and another 14-20 that you could order down in an extreme, "The Ambassador wants every spare body now," situation - but you'd best hope you can get most of them back within a few days because the engineer's mates resent having to peel potatoes, the flight officer's had to tag out one of the boats for lack of repairs, the rest of the engineering crew are too busy maintaining the drives shorthanded to cover the work orders for plumbing and air filtration, and it's going to be a choice between lasers and the meson screen if you have to fight.
On the positive side, what are the odds of a Zhodani cruiser showing up around Ruie while your men are planetside helping the Ambassador and his handful of embassy Marines protect the embassy from rioters?
A cruiser can put together a platoon for Naval Infantry. A dreadnought can put together a full company. And of course, that force can be supplemented if the ship's willing to put a bit of a crimp in its readiness.
Your gunners also have a role with your Naval Infantry detachment, acting as forward observer for the ship's weapons. In the gunpowder era, ship's gunners would also act as artillerists for light artillery brought ashore with the infantry. In the Traveller era, there's probably not enough similarity between a ship's laser fired at a target a half-light-second off and a turret-mounted laser being fired over open sights for the gunner to be of value. At any rate, Book-5 gunnery skill and Book-4 heacy weapons skill are different skills.