0

I create a document class testclass.

\NeedsTeXFormat{LaTeX2e} \ProvidesClass{testclass} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}} \ProcessOptions\relax \LoadClass[DIV=10,a4paper,11pt]{scrartcl} \RequirePackage[utf8]{inputenc} \RequirePackage[ngerman,english]{babel} \RequirePackage[T1]{fontenc} ... 

And I want to use it in my tex file.

\documentclass{testclass} \usepackage[utf8]{inputenc} \usepackage[english,ngerman]{babel} \usepackage{iflang} \IfLanguageName{ngerman}{\title{German Title}} \IfLanguageName{english}{\title{English Title}} \begin{document} \selectlanguage{english} \IfLanguageName{ngerman}{Test1} \IfLanguageName{english}{Test2} 

Then is all fine. But If I set selectlanguage to ngerman I get both contents. What did I maybe missunderstanding?

2
  • Please make sure your examples are complete. None of this ... and make sure your .tex example is complete Commented Apr 2, 2020 at 11:01
  • 1
    \IfLanguageName takes 3 arguments, you are only giving it two Commented Apr 2, 2020 at 11:04

1 Answer 1

2

The \IfLanguageName takes three argumnents in the form of

  • a language name
  • true branch
  • false branch

In all 4 uses of \IfLanguage you are missing the false branch, add them and it works ok.

1
  • 1
    Thank you. RTFM for myself ;-) Commented Apr 2, 2020 at 11:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.