0

I have the following code generated, with my preamble here, and here's just some of the text in it. Below the code I'll show a screenshot of how it looks once compiled.

%Setup og layout pakker
\documentclass[danish,a4paper,12pt]{article}
\usepackage[danish]{babel}
\usepackage{a4wide}
\usepackage{graphicx}
\usepackage{fancyhdr}
    \pagestyle{fancy}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\author{Johan V. Dinesen}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{titlesec}
\pagenumbering{arabic}
\usepackage{parskip}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{afterpage}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{scrextend}
\usepackage{paralist}
\usepackage[bottom]{footmisc}
\usepackage{wrapfig}
\usepackage{subfigure}

%Matematik pakker
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{pgf,tikz}
    \usetikzlibrary{arrows}
\usepackage{pgfplots}
    \pgfplotsset{compat=newest} 
\usepackage{mathrsfs}
\usepackage{amsmath}
\everymath{\displaystyle}

%Kommandoer og setups

\renewcommand{\baselinestretch}{1.5}

%For at ændre på referencer, links osv.
\hypersetup{
      colorlinks,
     linkcolor={white!20!black},
     citecolor={blue!50!black},
      urlcolor={blue!80!black}
}

% To make figures alone on a page less likely
    \renewcommand{\topfraction}{0.85}
    \renewcommand{\textfraction}{0.1}
    \renewcommand{\floatpagefraction}{0.75} 

% Header
    \fancyhead[L]{Aalborg Katedralskole}
    \fancyhead[R]{Johan V. Dinesen} 
    \fancyhead[C]{\today}

%Ændring af længde efter sections
    \titlespacing{\section}{0pt}{*0}{*0}
    \titlespacing{\subsection}{0pt}{*0}{*0}
    \titlespacing{\subsubsection}{0pt}{*0}{*0}

%Sidehoved og margen
    \newlength\FHoffset
    \setlength\FHoffset{0cm}
    \addtolength\headwidth{0\FHoffset}
    \setlength{\parindent}{0em}
    \setlength{\parskip}{1em}
    \geometry{
     a4paper,
     total={150mm,400mm},
     left=2.5cm,
     top=3.5cm,
    right=2.5cm,
    bottom=3cm,
    headheight=1cm
     }


\begin{document}

\Large \centering \textbf{Enzymer}

\flushleft
\normalsize

\textbf{Forklar ved hjælp af \textit{figur 1}, hvilke organisker stoffer og bindinger, der spaltes af Savinase.} \par
Af \textit{figur 1} ses det hvordan at et protein spaltes igennem optagelsen af vand af enzymet Savinase. Enzymet spalter substrates peptidbindinger i midten, hvilket resulterer i at der opnås to produkter, henholdsvis en aminosyre og en \color{red} HVAD HER? \color{black}. Da en hydrolase er et enzym, som katalyserer en hydrolyse af en kemisk binding under optagelse af vand, kan det konkluderes at Savinase tilhører EC3, og er derved selv en hydrolase. Endvidere da hydrolysen foregår i et enzym, er der tale om proteolyse, og savinase er derved en protease. En protease spalter da peptidbindinger, og binder derved aminosyrer sammen i polypeptid kæder, som det også ses i \textit{figur 1}.

\end{document}

enter image description here

As you can see there is no hyphenation done, and I can't for the life of me see what I've done in my preamble which removes auto hyphenating. Thank you in advance.

  • Your text is flushed to the left, not justified. Do you want the default (justified wit hyphenation) or ragged text with hypenation? – Johannes_B Jan 24 '16 at 8:43
  • 1
    Unrelated: You know that LaTeX can create headings for you an even count figures and return the counter values of specified figures? Doing all by hand can lead to inconsistent output. – Johannes_B Jan 24 '16 at 8:44
  • @Johan To track down issues like this, try to reduce your code step by step while recompiling to see if the problem persists. Cf here meta.tex.stackexchange.com/questions/228/… – Florian Jan 24 '16 at 8:48
  • Thank you - still a bit new to LaTeX, so I'm still getting better at streamlining my code :) - Thanks for the link, I'll have a look at it. – Johan D. Jan 24 '16 at 9:13
3

Edit: \flushleft changes the line breaking to ragged right without hyphenation. Remove it if you want a text with justified margins. If your text is supposed to be ragged right you can get hyphenation from the ragged2e-package.

\centering has to be used inside brackets to limit its scope. You can avoid the problem altogether if you use \maketitle for you titling.

  • 2
    It's \flushleft that causes the trouble – egreg Jan 24 '16 at 8:41
  • @egreg Yes, you obviously right! Sorry that was too quick. \centering has to be limited anyway. – Florian Jan 24 '16 at 8:43

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.