Usually the project author is located under the
@project_author, however, you can use the following expression to extract the initials of the project author, and it should be applied without a problem if you replace
@user_full_name. But in this example, I am using
@project_author. Please make sure to adjust the start and length of the
substr(string,start[,length]) based on string that you have.
@project_author || ': ' || '(' || substr(@project_author, 1,1) || substr(@project_author, 7,1) || ')'
Here is the input in expression:
Here is the output:
If you want the initials to be created automatically, you need to create a custom function for it. You can use the following function to create the initials:
from qgis.core import *
from qgis.gui import *
def nameInitial(text_field, feature, parent):
split_text = text_field.split()
initial = [nm for nm in split_text]
joinNM = "".join(initial)
Then from Custom functions select the function the you created (nameInitial in this example) and
The output is same as the above but without user adjustment:
@project_author || ': ' || '(' || nameInitial(@project_author ) || ')'