LM317 datasheets have some application hints, showing how to to do voltage and current regulators.
For example, here's an example from the LM317 datasheet, which involves a LM301 opamp and a MJ4502 pnp power transistor (which you can replace with something else that's similar, probably TIP36c, mj1501-mj1504 etc )
*Lights in constant current mode
Figure 46. 5A Constant Voltage/Constant Current Regulator
Note the opamp that requires -6v and +6v probably but may tolerate up to 24-30v.
The "linear psu.rar" has the schematic of a very simple linear power supply
There's a transformer with several windings , two separate windings (can be a separate transformer) to power the opamps and other things with +/- 12v , two separate windings or a separate transformer for the multimeters that display the voltage and current on the front panel.
Depending on how much the voltage is set, the opamp triggers relays to couple to link windings of the transformer together so that the voltage on those power transistors is always just a bit more than the output. Those transistors dissipate the voltage difference as heat so it makes sense to use several steps.
Then depending on the current set another opamp limits the voltage and current relying on the sense resistor.
The last two designs attached are two commercial power supplies which follow the same principles
- a transformer with multiple windings which are linked together as needed using relays based on output voltage and current desired
- a transformer or separate transformer windings for +12 (for the relays) and +8v , -8v , +5 and -5v for opams and other integrated circuits used
- opamps that use the voltage drop on a current sense resistor and the current set by user through potentiometer or keyboard buttons to adjust and limit current/voltage