This question is inspired by Displaying vertex coordinates of a polygon or line without creating a new layer and especially by the answer by @JGH: https://gis.stackexchange.com/a/381130/88814
The basic problem is how to label vertices in QGIS using expressions only (without creating a new layer). Whereas @JGH uses geometry generator to create points on the vertices and sets a Font Marker to it, which in turn is not a character, but an expression to generate in this way sort of a label for the coordinates of every vertex.
This is really a great solution, only that you don't have all the styling options for labels like marker lines, rotation, text buffer etc. (see screenshot below). It would be great to create real labels for each vertex. The only problem seems to be that it is not possible to select the
@geometry_part_num Variable (as in @JGH's solution) in the label text field as this variable is not available.
So the question is: is it possible to find an expression that generates the values of the x and y coordinates of each vertex?
Placing a label for each vertex of a geometry (but with the same label text) is possible by setting a label that is placed on a point created by geometry generator with the following expression - maybe it can be adapted somehow for the label text as well:
collect_geometries( array_foreach ( generate_series( 1, num_points( $geometry)), make_point ( x ( point_n($geometry, @element)), y ( point_n($geometry, @element)) ) ) )