Text FormattingHelp, text is centered through the report

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
MichaelNoe
Posts: 1
Joined: Sat Aug 22, 2015 2:50 pm

Help, text is centered through the report

Post by MichaelNoe »

Hi every one hope you can help me. I got an asignment I have to submit the day after tomorow and the text is centered all the way down through the report. Hope sombody can help?

Code: Select all

% !TeX encoding = UTF-8
\documentclass[a4paper,11pt,dvipsnames,oneside,openright]{memoir} % twoside så kapitel starter i højre 	

\usepackage[utf8]{inputenc}		%	Input æ,ø,å
\usepackage[danish]{babel}		%	Dansk
\usepackage[T1]{fontenc}		%	Output æ,ø,å

\usepackage{ragged2e,anyfontsize}
\usepackage{fixltx2e}
\usepackage{lastpage}

\usepackage{graphicx}
\newsubfloat{figure}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{flafter}
\let\newfloat\relax
\usepackage{float}

\usepackage{amsmath,amssymb,amsfonts,stmaryrd} 
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage{siunitx}						% \si{enhed} og \SI{tal}{enhed}
\sisetup{output-decimal-marker = {,}}

\usepackage{natbib}

\usepackage{listings}

\usepackage[shortlabels]{enumitem}

\usepackage{pdfpages}
\pdfoptionpdfminorversion=6
\pretolerance=2500

%         DEFINITIONER OG EKSEMPLER

\usepackage[amsmath,framed]{ntheorem}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{tikz}
\definecolor{MyColor1}{RGB}{255,245,245}
\definecolor{MyColor2}{RGB}{220,20,60}

\mdfdefinestyle{EksempelLayout}{ %
	outerlinewidth 		= 2,%
	roundcorner 		= 10pt,%
	leftmargin 			= 20,%
	rightmargin 		= 20,%
	backgroundcolor 	= blue!3,%
	outerlinecolor 		= blue!25,%
	innertopmargin 		= \topskip,%
	splittopskip 		= \topskip,%
	ntheorem 			= true,%
	align				= left,%
}
\mdfdefinestyle{DefnLayout}{ %
	outerlinewidth 		= 2,%
	innerlinewidth		= .5,%
	roundcorner 		= 10pt,%
	leftmargin 			= 20,%
	rightmargin 		= 20,%
	backgroundcolor 	= MyColor1,%
	innerlinecolor		= black,%
	outerlinecolor 		= MyColor2,%
	innertopmargin 		= \topskip,%
	splittopskip 		= \topskip,%
	ntheorem 			= true,%
	align				= right,%
}
\mdtheorem[style = DefnLayout]{defn}{Definition}
\mdtheorem[style = EksempelLayout]{ex}{Eksempel}

%		Nomenklarturliste
\definecolor{light-gray}{gray}{0.80}
\definecolor{light-gray2}{gray}{0.90}

%     Layout 

\newcommand{\figurewidth}{0.6\linewidth}
\numberwithin{equation}{section}

% ¤¤ Marginer ¤¤ %
\setlrmarginsandblock{3.5cm}{2.5cm}{*}		% \setlrmarginsandblock{Indbinding}{Kant}{Ratio}
\setulmarginsandblock{2.5cm}{3.0cm}{*}		% \setulmarginsandblock{Top}{Bund}{Ratio}
\checkandfixthelayout 						% Oversaetter vaerdier til brug for andre pakker

%	¤¤ Afsnitsformatering ¤¤ %
\setlength{\parskip}{0mm}          			% Afstand mellem afsnit ved brug af double Enter
\linespread{1,1}							% Linie afstand

% ¤¤ Litteraturlisten ¤¤ %
\bibpunct[,]{[}{]}{;}{a}{,}{,} 
\bibliographystyle{BibTeX/harvard}

% ¤¤ Indholdsfortegnelse ¤¤ %
\setsecnumdepth{subsection}		 			% Dybden af nummerede overkrifter (part/chapter/section/subsection)
\maxsecnumdepth{subsection}					% Dokumentklassens graense for nummereringsdybde
\settocdepth{subsection} 					% Dybden af indholdsfortegnelsen

% ¤¤ Lister ¤¤ %
\setlist{
	topsep=2pt,								% Vertikal afstand mellem tekst og listen
	itemsep=-1ex,								% Vertikal afstand mellem items
} 

% ¤¤ Visuelle referencer ¤¤ %
\definecolor{MyLinkcolor}{RGB}{0,0,0}
\definecolor{MyCitecolor}{RGB}{0,0,0}
\definecolor{MyUrlcolor}{RGB}{70,60,140}

\usepackage[colorlinks]{hyperref}			% Danner klikbare referencer (hyperlinks) i dokumentet.
\hypersetup{colorlinks = true,				% Opsaetning af farvede hyperlinks (interne links, citeringer og URL)
	linkcolor = MyLinkcolor,
	citecolor = MyCitecolor,
	urlcolor = MyUrlcolor
}

% ¤¤ Opsaetning af figur- og tabeltekst ¤¤ %
\usepackage[width=\figurewidth]{caption}
\captiondelim{: }
\hangcaption
\setlength{\belowcaptionskip}{0pt}

% ¤¤ Opsaetning af listings ¤¤ %

\definecolor{commentGreen}{RGB}{148,0,211}
\definecolor{stringPurple}{RGB}{0,250,154}

\lstset{language=Matlab,					% Sprog
	basicstyle=\ttfamily\scriptsize,		% Opsaetning af teksten
	keywords={for,if,while,else,elseif,		% Noegleord at fremhaeve
		end,break,return,case,
		switch,function},
	keywordstyle=\color{blue},				% Opsaetning af noegleord
	commentstyle=\color{commentGreen},		% Opsaetning af kommentarer
	stringstyle=\color{stringPurple},		% Opsaetning af strenge
	showstringspaces=false,					% Mellemrum i strenge enten vist eller blanke
	numbers=left, numberstyle=\tiny,		% Linjenumre
	extendedchars=true, 					% Tillader specielle karakterer
	columns=flexible,						% Kolonnejustering
	breaklines, breakatwhitespace=true,		% Bryd lange linjer
}

% ¤¤ Navngivning ¤¤ %
\addto\captionsdanish{
	\renewcommand\appendixname{Appendiks}
	\renewcommand\contentsname{Table Of Contents} 				%Indholdsfortegnelse	
	\renewcommand\appendixpagename{Appendiks}
	\renewcommand\appendixtocname{Appendiks}
	\renewcommand\cftappendixname{\appendixname~}			% Skriver "Appendiks" foran appendiks i indholdsfortegnelsen
	%	\renewcommand\cftchaptername{\chaptername~}				% Skriver "Kapitel" foran kapitlerne i indholdsfortegnelsen
}

% ¤¤ Kapiteludssende ¤¤ %
\definecolor{color}{rgb}{0, 0, 0}

\newif\ifchapternonum

\makechapterstyle{Michael}{
	\renewcommand\beforechapskip{0pt}
	\renewcommand\printchaptername{}
	\renewcommand\printchapternum{}
	\renewcommand\printchapternonum{\chapternonumtrue}
	\renewcommand\chaptitlefont{\fontfamily{pbk}\fontseries{m}\fontshape{n}\fontsize{38}{35}\selectfont\raggedright\color{color}}
	\renewcommand\chapnumfont{\fontfamily{pbk}\fontseries{l}\fontshape{sc}\fontsize{2.5cm}{0in}\selectfont\color{color}}
	\renewcommand\printchaptertitle[1]{%
		\noindent
		\ifchapternonum
		\begin{tabularx}{\textwidth}{X}
			{\let\\\newline\chaptitlefont ##1\par} 
		\end{tabularx}
		\par\vskip -2.5mm \hrule 
		\else
		\begin{tabularx}{\textwidth}{Xl}
			{\parbox[b]{\linewidth}{\chaptitlefont ##1}} & \raisebox{0pt}{\chapnumfont \thechapter}
		\end{tabularx}
		\par\vskip0mm \hrule
		\fi
	}
}

\chapterstyle{Michael}

% ¤¤ Sidehoved ¤¤ %

\makepagestyle{AAU}
\makepsmarks{AAU}{%
	\createmark{chapter}{left}{shownumber}{}{. \ }
	\createmark{section}{right}{shownumber}{}{. \ }
	\createplainmark{toc}{both}{\contentsname}
	\createplainmark{lof}{both}{\listfigurename}
	\createplainmark{lot}{both}{\listtablename}
	\createplainmark{bib}{both}{\bibname}
	\createplainmark{index}{both}{\indexname}
	\createplainmark{glossary}{both}{\glossaryname}
}
\nouppercaseheads											% Ingen Caps oenskes

\makeevenhead{AAU}{Michael Noe Christiansen}{}{\leftmark}	% Definerer lige siders sidehoved (\makeevenhead{Navn}{Venstre}{Center}{Hoejre})
\makeoddhead{AAU}{\rightmark}{}{James Cook University}		% Definerer ulige siders sidehoved (\makeoddhead{Navn}{Venstre}{Center}{Hoejre})
\makeevenfoot{AAU}{\thepage}{}{}							% Definerer lige siders sidefod (\makeevenfoot{Navn}{Venstre}{Center}{Hoejre})
\makeoddfoot{AAU}{}{}{\thepage}								% Definerer ulige siders sidefod (\makeoddfoot{Navn}{Venstre}{Center}{Hoejre})
\makeheadrule{AAU}{\textwidth}{0.5pt}						% Tilfoejer en streg under sidehovedets indhold
\makefootrule{AAU}{\textwidth}{0.5pt}{1mm}					% Tilfoejer en streg under sidefodens indhold

\copypagestyle{AAUchap}{AAU}								% Sidehoved for kapitelsider defineres som standardsider, men med blank sidehoved
\makeoddhead{AAUchap}{}{}{}
\makeevenhead{AAUchap}{}{}{}
\makeheadrule{AAUchap}{\textwidth}{0pt}
\aliaspagestyle{chapter}{AAUchap}
\pagestyle{AAU}

%        EQUATIONS MED AUTO REF
\usepackage{cleveref}


%---------------------------
%-         MAKRO           -
%---------------------------
%\newcommand*\Trans{\includegraphics[width=0.3cm,height=1.5ex]{Pic/Trans}}
%
%\newcommand*\Spole{\includegraphics[width=0.5cm,height=1.5ex]{Pic/Spoletegn}}

\newcommand{\Con}{\dashv \vdash}

\newcommand{\degree}{$^\circ$}

\renewcommand{\cite}[1]{\citep{#1}}

Attachments
Picure of how it looks
Picure of how it looks
Capture.PNG (19.85 KiB) Viewed 2854 times
Preamble.tex
My preamble
(7.58 KiB) Downloaded 218 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Help, text is centered through the report

Post by Johannes_B »

Welcome,


the preamble itself is pretty useless, we would need to see compilable code to say anything. I bet you just have \centering somewhere without putting it in the right group.

Simple algorithm to quickly find the source of trouble
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Help, text is centered through the report

Post by Stefan Kottwitz »

Hi Michael,

welcome to the forum!

Also I think it's not caused by the preamble, but in the text. Perhaps have a look at that place, where the centering actually starts. Does it in the very first section?

Stefan
LaTeX.org admin
Post Reply