For accurate electrocardiogram (ECG) analysis, the construction of a representative single-beat template is de- sirable, as it enables the assessment of global ECG char- acteristics by minimizing the influence of inter-beat vari- ability. This work extends an existing template generation method based on RR-intervals for extracting the single heartbeats (ECG snippets), therefore called RR-based ap- proach. The proposed template generation utilizes the in- formation of P-wave onset and T-wave offset in the ECG snippet extraction and is therefore called PT-based ap- proach. The quality of the templates generated with the two methods was assessed by signal-to-noise ratio (SNR) and length of the template. In cases of high heart rate, the RR-based approach yielded low-quality templates that comprised multiple heartbeats in contrast to the PT-based approach. More- over, the templates created with the PT-based approach had reduced isoelectric line length in the beginning and end of the signal, condensing the information of the tem- plate. Additionally, baseline wander artifacts were re- duced and SNR was improved by a mean of 1.47 dB. In conclusion, this work offers a robust PT-based single-beat ECG template generation available as open source code.