Page LayoutNon-English language in the question environment.

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Non-English language in the question environment.

Post by Xiphias »

So I am using the question environment for my document since it contains a lot of math problems.

When I wanted to move my code from sharlatex.com to my locale Texmaker the question environment went from Norwegian "Oppgave" to "Exercise" instead. Is there some pre-amble code I can use to force it to be Norwegain?

Here is some important parts of my code:

Code: Select all

\documentclass[14pt,norsk,a4paper,twoside,article]{memoir}
\usepackage{exsheets}
\SetupExSheets{
  counter-within = chapter ,
  counter-format = ch
}
\usepackage{icomma}
\usepackage{libertine}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,graphicx,varioref}
\usepackage{libertine}
\usepackage{exsheets}
\usepackage{amsmath}
\numberwithin{question}{section}
\renewcommand*{\thequestion}{\thesection.\arabic{question}}
\SetupExSheets{headings-format={\normalsize\sffamily}}
\usepackage{tasks}
\settasks{label-format={\sffamily}}
\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
\DeclareSymbolFontAlphabet{\mathrm}{letters}
\title{Oppgaver 2P}
\begin{document}
Last edited by Stefan Kottwitz on Mon Sep 07, 2015 1:51 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Non-English language in the question environment.

Post by cgnieder »

exsheets translates the titles of questions and solutions to the currently active language:

Code: Select all

\documentclass{article}
\usepackage[english,ngerman,norsk]{babel}
\usepackage{exsheets}
\begin{document}
\begin{question}
\end{question}
\selectlanguage{english}
\begin{question}
\end{question}
\selectlanguage{ngerman}
\begin{question}
\end{question}
\end{document}
The change never happens arbitrarily. If the title is changed to »Exercise« this can only be because you either have
  • changed the language to English
  • changed the language into a language where exsheets doesn't know the translation of. It then switches to the English default.
  • set the option question/name = Exercise explicitly
A remark: are you sure you want counter-format = ch? This will give every question the number of the current chapter! The line

Code: Select all

\renewcommand*{\thequestion}{\thesection.\arabic{question}}
let's me guess you want counter-format = se.qu or counter-format = ch.se.qu

BTW: are you aware that you're loading both exsheets and libertine twice?

Regards
site moderator & package author
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Non-English language in the question environment.

Post by cgnieder »

Maybe check your local version. If you locally have exsheets older than 2013/10/11 v0.10 then your version does not have Norwegian translations.

Then you can
  • update your TeX distribution (probably to be preferred),
  • explicitly set question/name = Oppgave, or
  • add the translations yourself

    Code: Select all

    \DeclareTranslation{Norsk}{exsheets-exercise-name}{Oppgave}
    \DeclareTranslation{Norsk}{exsheets-question-name}{Oppgave}
    \DeclareTranslation{Norsk}{exsheets-solution-name}{L\o sning}
Regards
site moderator & package author
Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Re: Non-English language in the question environment.

Post by Xiphias »

Thanks for all the help. i got what I needed :)
Post Reply