2

The last item in my enumerate in my itemize list oversteps the margin. I have tried bounding it in {} but didn't work.

My code is as follows:

\begin{itemize}
  \item Hver uafhængig sløjfe tildeles en sløjfestrøm i kredsløb, der 
  indeholder $N$ sløjfer.
  \item Hvis kredsløbet kun indeholder uafhængige forsyninger, 
  opstilles N lineært uafhængige KVL-ligninger, en for hver sløjfe. 
  Hvis der findes afhængige forsyninger behandles disse som uafhængige, 
  og ligningen for afhængigheden opstilles.
  \item Hvis der findes forsyninger i kredsløbet, der indgår i mere end 
  én sløjfe, kan én af følgende to teknikker anvendes.
  \begin{enumerate}
    \item Supermesh; strømforsyningen „fjernes“, og der laves en ny 
    sløjfe af de to tidligere sløjfer. Hernæst skal KVL-ligningen for 
    den nye sløjfe opstilles. De to strømme fra de tidligere sløjfer 
    skal begge indgå i denne ligning.
    \item Sløjfe teknikken; først laves en KVL-ligning for hver sløjfe 
    indeholdende en strømforsyning. Herefter afbrydes 
    strømforsyningerne. Den sidste KVL-ligning er sløjfen, der kan 
    laves når, strømforsyningerne er „fjernet“. Når „vejen“ gennem 
    kredsløbet er fundet, sættes strømforsyningerne ind igen, og KVL 
    ligningen opstilles.
  \end{enumerate}
\end{itemize}

Here you see the resulting list with the very last point stepping outside the margin

Here you see the resulting list with the very last point stepping outside the margin.

So my big question is: "How do I make it align as the rest does? Have I overlooked something? Is this normal?"

4
  • That is because TeX, I think, does not recognise that word. Therefore, it treats it as a single word. In reality, the margin is not broken, but it is simply following GB inputs ;-). Mar 5, 2019 at 21:18
  • I compiled your code with XeLaTeX, there is no problem.
    – user31034
    Mar 5, 2019 at 21:24
  • 2
    As always it is a good idea to post a full minimal example, not a sniplet. Missing T1 (if under pdflatex) and missing Danish hyphenation patterns are quite important here.
    – daleif
    Mar 5, 2019 at 21:44
  • 2
    Also remember that latex will generally not hyphen word containing a hyphen. In Danish we have many such words, so under Danish babel we can use "- to get a hyphen that allows the rest of the word to be hyphenated.
    – daleif
    Mar 5, 2019 at 21:46

2 Answers 2

1

It's because Latex doesn't accept your letters. Just add \usepackage[T1]{fontenc} after declaring the class

Don't forget to add that UTF-8 encoding is used by writing this: \documentclass[utf8]{article}. It's not obligatory to be the class article, but you must specify [utf8].

2
  • Again edited. Don't -1 because of trivial things like that, please, I'm here since yesterday. Also, if he was loading the package, he wouldn't have that problem. The weird margin is caused by the fact that there are errors when it's building the PDF. I had an OT1 error while compiling. I tried it. I had the same result as OP. I solved the OT1 and the margins are respected.
    – Vinccool96
    Mar 5, 2019 at 21:52
  • 1
    T1 did the trick. Thanks Mar 7, 2019 at 9:02
0

Especially when writing in a language other than English, it's an excellent idea to load the babel package with a suitable language option (here: danish, right?). That way, you'll be working with the language-appropriate hyphenation patterns. (LaTeX may be forgiven for not knowing how to hyphenate the word strømforsyningerne if it's assumed to be an English-language word.) It's also a good idea to load the microtype package.

If you use pdfLaTeX, please also be sure to load the fontenc package with the option T1.

The following screenshot was compiled under LuaLaTeX and the Calibri sans-serif font.

enter image description here

\documentclass{article}
\usepackage[danish]{babel} 

\usepackage{ifluatex}
\ifluatex
   \usepackage{fontspec}
   \setsansfont{Calibri} % or some other suitable sans-serif font
   \usepackage{luatexbase} % see https://tex.stackexchange.com/a/476742/5001
\else
   \usepackage[T1]{fontenc}
   \usepackage[utf8]{inputenc} % not necessary if your TeX distribution is recent
\fi
\usepackage{microtype}  % optional
\setlength\textwidth{10.75cm} % chosen by trial and error...

\begin{document}
\sffamily

\begin{itemize}
  \item Hver uafhængig sløjfe tildeles en sløjfestrøm i kredsløb, der 
  indeholder $N$ sløjfer.
  \item Hvis kredsløbet kun indeholder uafhængige forsyninger, 
  opstilles N lineært uafhængige KVL-ligninger, en for hver sløjfe. 
  Hvis der findes afhængige forsyninger behandles disse som uafhængige, 
  og ligningen for afhængigheden opstilles.
  \item Hvis der findes forsyninger i kredsløbet, der indgår i mere end 
  én sløjfe, kan én af følgende to teknikker anvendes.
  \begin{enumerate}
    \item Supermesh; strømforsyningen „fjernes“, og der laves en ny 
    sløjfe af de to tidligere sløjfer. Hernæst skal KVL-ligningen for 
    den nye sløjfe opstilles. De to strømme fra de tidligere sløjfer 
    skal begge indgå i denne ligning.
    \item Sløjfe teknikken; først laves en KVL-ligning for hver sløjfe 
    indeholdende en strømforsyning. Herefter afbrydes 
    strømforsyningerne. Den sidste KVL-ligning er sløjfen, der kan 
    laves når, strømforsyningerne er „fjernet“. Når „vejen“ gennem 
    kredsløbet er fundet, sættes strømforsyningerne ind igen, og KVL 
    ligningen opstilles.
  \end{enumerate}
\end{itemize}  


\end{document}
1
  • T1 did the trick. Thanks Mar 7, 2019 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.