Here is my MWE:
\documentclass[ngerman,german,14pt,twoside,openany]{scrbook}
\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2.5cm]{geometry}
\usepackage[ngerman]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{currfile}
\begin{document}
\ifcurrfiledir{folder1/folder2/Jungs}{Lieber}{Liebe}
\end{document}
I am struggling with the following problem: In german language you talk to boy with the word "Lieber..." and you talk to a girl with the word "Liebe..." (for our english speaking friends: this means "Dear...". Now I would like to automate these words in a way that if the document is in the folder "folder1/folder2/Jungs" (Jungs means boy) then the word "Lieber" should be inserted and for the rest (i.e. the girls) the word "Liebe" should be used. For this purpose I tried the "currfile" package by Martin Scharrer with the code detailed above. But this doesn´t work since in both cases Lualatex returns "Liebe". Can anyone help me please?
\usepackage[utf8x]{inputenc}
(utf8x
has not been recommended for years, and in current releases it is defined to do nothing other than give a warning that it should not be used)folder1/folder2/Jungs
, so there is no relative folder.14pt
forscrbook
is obsolete. You should usefontsize=14pt
instead as reported in thelog
file and shown in my answer. And if you have several options in the option list of\documentclass
but only the main language as option forbabel
, it is recommended to usemain=…
when loading babel to avoid warnings. See again the warning in thelog
file of your example.