LaTeX forum ⇒ Page LayoutNon-English language in the question environment. Topic is solved

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

Non-English language in the question environment.

Postby Xiphias » Mon Sep 07, 2015 1:45 pm

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:

  1. \documentclass[14pt,norsk,a4paper,twoside,article]{memoir}
  2. \usepackage{exsheets}
  3. \SetupExSheets{
  4. counter-within = chapter ,
  5. counter-format = ch
  6. }
  7. \usepackage{icomma}
  8. \usepackage{libertine}
  9. \usepackage[utf8]{inputenc}
  10. \usepackage[T1]{fontenc}
  11. \usepackage{babel,graphicx,varioref}
  12. \usepackage{libertine}
  13. \usepackage{exsheets}
  14. \usepackage{amsmath}
  15. \numberwithin{question}{section}
  16. \renewcommand*{\thequestion}{\thesection.\arabic{question}}
  17. \SetupExSheets{headings-format={\normalsize\sffamily}}
  18. \usepackage{tasks}
  19. \settasks{label-format={\sffamily}}
  20. \DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
  21. \DeclareSymbolFontAlphabet{\mathrm}{letters}
  22. \title{Oppgaver 2P}
  23. \begin{document}
Last edited by Stefan Kottwitz on Mon Sep 07, 2015 1:51 pm, edited 1 time in total.
Reason: inline code changed to code block

Tags:

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Sep 07, 2015 4:02 pm

exsheets translates the titles of questions and solutions to the currently active language:
  1. \documentclass{article}
  2. \usepackage[english,ngerman,norsk]{babel}
  3. \usepackage{exsheets}
  4. \begin{document}
  5. \begin{question}
  6. \end{question}
  7. \selectlanguage{english}
  8. \begin{question}
  9. \end{question}
  10. \selectlanguage{ngerman}
  11. \begin{question}
  12. \end{question}
  13. \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
  1. \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
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Sep 07, 2015 4:16 pm

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
    1. \DeclareTranslation{Norsk}{exsheets-exercise-name}{Oppgave}
    2. \DeclareTranslation{Norsk}{exsheets-question-name}{Oppgave}
    3. \DeclareTranslation{Norsk}{exsheets-solution-name}{L\o sning}

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Tue Sep 08, 2015 9:27 am

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


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests