I have created a class and defined a command in there, to create a titlepage:
class.cls :
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2019/03/25 myLaTeX class]
\LoadClass{scrartcl}
\RequirePackage{etoolbox}
\RequirePackage{babel}
\edef\file@titlepage{titlepage-\languagename}
\renewcommand{\titlepage}{%
\makeatletter
\input{\file@titlepage.def}
\raggedright
\pagebreak
}
Now I am calling \titlepage
in the .tex file:
\documentclass[english]{myclass}
\begin{document}
\titlepage
\end{document}
My texmf directory looks like that:
C:\localtexmf\tex\latex\myclass:
- myclass.cls
- titlepage-english.def
Now the compiler always throws the following error:
File `titlepage-english.def' not found. \titlepage
\InputIfFileExists
rather than\input
so that you get more friendly behaviour with languages for which you do not have an existing def file.\InputIfFileExists
\InputIfFileExists
command did not solved my problem. It was only a good idea to extendmyclass
filename database
.