LaTeX forum ⇒ Text FormattingHelp, text is centered through the report

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

Help, text is centered through the report

Postby MichaelNoe » Sat Aug 22, 2015 2:55 pm

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?
  1. % !TeX encoding = UTF-8
  2. \documentclass[a4paper,11pt,dvipsnames,oneside,openright]{memoir} % twoside så kapitel starter i højre
  3.  
  4. \usepackage[utf8]{inputenc} % Input æ,ø,å
  5. \usepackage[danish]{babel} % Dansk
  6. \usepackage[T1]{fontenc} % Output æ,ø,å
  7.  
  8. \usepackage{ragged2e,anyfontsize}
  9. \usepackage{fixltx2e}
  10. \usepackage{lastpage}
  11.  
  12. \usepackage{graphicx}
  13. \newsubfloat{figure}
  14. \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
  15. \usepackage{flafter}
  16. \let\newfloat\relax
  17. \usepackage{float}
  18.  
  19. \usepackage{amsmath,amssymb,amsfonts,stmaryrd}
  20. \usepackage{mathtools}
  21. \usepackage{textcomp}
  22. \usepackage{siunitx} % \si{enhed} og \SI{tal}{enhed}
  23. \sisetup{output-decimal-marker = {,}}
  24.  
  25. \usepackage{natbib}
  26.  
  27. \usepackage{listings}
  28.  
  29. \usepackage[shortlabels]{enumitem}
  30.  
  31. \usepackage{pdfpages}
  32. \pdfoptionpdfminorversion=6
  33. \pretolerance=2500
  34.  
  35. % DEFINITIONER OG EKSEMPLER
  36.  
  37. \usepackage[amsmath,framed]{ntheorem}
  38. \usepackage[framemethod=TikZ]{mdframed}
  39. \usepackage{tikz}
  40. \definecolor{MyColor1}{RGB}{255,245,245}
  41. \definecolor{MyColor2}{RGB}{220,20,60}
  42.  
  43. \mdfdefinestyle{EksempelLayout}{ %
  44. outerlinewidth = 2,%
  45. roundcorner = 10pt,%
  46. leftmargin = 20,%
  47. rightmargin = 20,%
  48. backgroundcolor = blue!3,%
  49. outerlinecolor = blue!25,%
  50. innertopmargin = \topskip,%
  51. splittopskip = \topskip,%
  52. ntheorem = true,%
  53. align = left,%
  54. }
  55. \mdfdefinestyle{DefnLayout}{ %
  56. outerlinewidth = 2,%
  57. innerlinewidth = .5,%
  58. roundcorner = 10pt,%
  59. leftmargin = 20,%
  60. rightmargin = 20,%
  61. backgroundcolor = MyColor1,%
  62. innerlinecolor = black,%
  63. outerlinecolor = MyColor2,%
  64. innertopmargin = \topskip,%
  65. splittopskip = \topskip,%
  66. ntheorem = true,%
  67. align = right,%
  68. }
  69. \mdtheorem[style = DefnLayout]{defn}{Definition}
  70. \mdtheorem[style = EksempelLayout]{ex}{Eksempel}
  71.  
  72. % Nomenklarturliste
  73. \definecolor{light-gray}{gray}{0.80}
  74. \definecolor{light-gray2}{gray}{0.90}
  75.  
  76. % Layout
  77.  
  78. \newcommand{\figurewidth}{0.6\linewidth}
  79. \numberwithin{equation}{section}
  80.  
  81. % ¤¤ Marginer ¤¤ %
  82. \setlrmarginsandblock{3.5cm}{2.5cm}{*} % \setlrmarginsandblock{Indbinding}{Kant}{Ratio}
  83. \setulmarginsandblock{2.5cm}{3.0cm}{*} % \setulmarginsandblock{Top}{Bund}{Ratio}
  84. \checkandfixthelayout % Oversaetter vaerdier til brug for andre pakker
  85.  
  86. % ¤¤ Afsnitsformatering ¤¤ %
  87. \setlength{\parskip}{0mm} % Afstand mellem afsnit ved brug af double Enter
  88. \linespread{1,1} % Linie afstand
  89.  
  90. % ¤¤ Litteraturlisten ¤¤ %
  91. \bibpunct[,]{[}{]}{;}{a}{,}{,}
  92. \bibliographystyle{BibTeX/harvard}
  93.  
  94. % ¤¤ Indholdsfortegnelse ¤¤ %
  95. \setsecnumdepth{subsection} % Dybden af nummerede overkrifter (part/chapter/section/subsection)
  96. \maxsecnumdepth{subsection} % Dokumentklassens graense for nummereringsdybde
  97. \settocdepth{subsection} % Dybden af indholdsfortegnelsen
  98.  
  99. % ¤¤ Lister ¤¤ %
  100. \setlist{
  101. topsep=2pt, % Vertikal afstand mellem tekst og listen
  102. itemsep=-1ex, % Vertikal afstand mellem items
  103. }
  104.  
  105. % ¤¤ Visuelle referencer ¤¤ %
  106. \definecolor{MyLinkcolor}{RGB}{0,0,0}
  107. \definecolor{MyCitecolor}{RGB}{0,0,0}
  108. \definecolor{MyUrlcolor}{RGB}{70,60,140}
  109.  
  110. \usepackage[colorlinks]{hyperref} % Danner klikbare referencer (hyperlinks) i dokumentet.
  111. \hypersetup{colorlinks = true, % Opsaetning af farvede hyperlinks (interne links, citeringer og URL)
  112. linkcolor = MyLinkcolor,
  113. citecolor = MyCitecolor,
  114. urlcolor = MyUrlcolor
  115. }
  116.  
  117. % ¤¤ Opsaetning af figur- og tabeltekst ¤¤ %
  118. \usepackage[width=\figurewidth]{caption}
  119. \captiondelim{: }
  120. \hangcaption
  121. \setlength{\belowcaptionskip}{0pt}
  122.  
  123. % ¤¤ Opsaetning af listings ¤¤ %
  124.  
  125. \definecolor{commentGreen}{RGB}{148,0,211}
  126. \definecolor{stringPurple}{RGB}{0,250,154}
  127.  
  128. \lstset{language=Matlab, % Sprog
  129. basicstyle=\ttfamily\scriptsize, % Opsaetning af teksten
  130. keywords={for,if,while,else,elseif, % Noegleord at fremhaeve
  131. end,break,return,case,
  132. switch,function},
  133. keywordstyle=\color{blue}, % Opsaetning af noegleord
  134. commentstyle=\color{commentGreen}, % Opsaetning af kommentarer
  135. stringstyle=\color{stringPurple}, % Opsaetning af strenge
  136. showstringspaces=false, % Mellemrum i strenge enten vist eller blanke
  137. numbers=left, numberstyle=\tiny, % Linjenumre
  138. extendedchars=true, % Tillader specielle karakterer
  139. columns=flexible, % Kolonnejustering
  140. breaklines, breakatwhitespace=true, % Bryd lange linjer
  141. }
  142.  
  143. % ¤¤ Navngivning ¤¤ %
  144. \addto\captionsdanish{
  145. \renewcommand\appendixname{Appendiks}
  146. \renewcommand\contentsname{Table Of Contents} %Indholdsfortegnelse
  147. \renewcommand\appendixpagename{Appendiks}
  148. \renewcommand\appendixtocname{Appendiks}
  149. \renewcommand\cftappendixname{\appendixname~} % Skriver "Appendiks" foran appendiks i indholdsfortegnelsen
  150. % \renewcommand\cftchaptername{\chaptername~} % Skriver "Kapitel" foran kapitlerne i indholdsfortegnelsen
  151. }
  152.  
  153. % ¤¤ Kapiteludssende ¤¤ %
  154. \definecolor{color}{rgb}{0, 0, 0}
  155.  
  156. \newif\ifchapternonum
  157.  
  158. \makechapterstyle{Michael}{
  159. \renewcommand\beforechapskip{0pt}
  160. \renewcommand\printchaptername{}
  161. \renewcommand\printchapternum{}
  162. \renewcommand\printchapternonum{\chapternonumtrue}
  163. \renewcommand\chaptitlefont{\fontfamily{pbk}\fontseries{m}\fontshape{n}\fontsize{38}{35}\selectfont\raggedright\color{color}}
  164. \renewcommand\chapnumfont{\fontfamily{pbk}\fontseries{l}\fontshape{sc}\fontsize{2.5cm}{0in}\selectfont\color{color}}
  165. \renewcommand\printchaptertitle[1]{%
  166. \noindent
  167. \ifchapternonum
  168. \begin{tabularx}{\textwidth}{X}
  169. {\let\\\newline\chaptitlefont ##1\par}
  170. \end{tabularx}
  171. \par\vskip -2.5mm \hrule
  172. \else
  173. \begin{tabularx}{\textwidth}{Xl}
  174. {\parbox[b]{\linewidth}{\chaptitlefont ##1}} & \raisebox{0pt}{\chapnumfont \thechapter}
  175. \end{tabularx}
  176. \par\vskip0mm \hrule
  177. \fi
  178. }
  179. }
  180.  
  181. \chapterstyle{Michael}
  182.  
  183. % ¤¤ Sidehoved ¤¤ %
  184.  
  185. \makepagestyle{AAU}
  186. \makepsmarks{AAU}{%
  187. \createmark{chapter}{left}{shownumber}{}{. \ }
  188. \createmark{section}{right}{shownumber}{}{. \ }
  189. \createplainmark{toc}{both}{\contentsname}
  190. \createplainmark{lof}{both}{\listfigurename}
  191. \createplainmark{lot}{both}{\listtablename}
  192. \createplainmark{bib}{both}{\bibname}
  193. \createplainmark{index}{both}{\indexname}
  194. \createplainmark{glossary}{both}{\glossaryname}
  195. }
  196. \nouppercaseheads % Ingen Caps oenskes
  197.  
  198. \makeevenhead{AAU}{Michael Noe Christiansen}{}{\leftmark} % Definerer lige siders sidehoved (\makeevenhead{Navn}{Venstre}{Center}{Hoejre})
  199. \makeoddhead{AAU}{\rightmark}{}{James Cook University} % Definerer ulige siders sidehoved (\makeoddhead{Navn}{Venstre}{Center}{Hoejre})
  200. \makeevenfoot{AAU}{\thepage}{}{} % Definerer lige siders sidefod (\makeevenfoot{Navn}{Venstre}{Center}{Hoejre})
  201. \makeoddfoot{AAU}{}{}{\thepage} % Definerer ulige siders sidefod (\makeoddfoot{Navn}{Venstre}{Center}{Hoejre})
  202. \makeheadrule{AAU}{\textwidth}{0.5pt} % Tilfoejer en streg under sidehovedets indhold
  203. \makefootrule{AAU}{\textwidth}{0.5pt}{1mm} % Tilfoejer en streg under sidefodens indhold
  204.  
  205. \copypagestyle{AAUchap}{AAU} % Sidehoved for kapitelsider defineres som standardsider, men med blank sidehoved
  206. \makeoddhead{AAUchap}{}{}{}
  207. \makeevenhead{AAUchap}{}{}{}
  208. \makeheadrule{AAUchap}{\textwidth}{0pt}
  209. \aliaspagestyle{chapter}{AAUchap}
  210. \pagestyle{AAU}
  211.  
  212. % EQUATIONS MED AUTO REF
  213. \usepackage{cleveref}
  214.  
  215.  
  216. %---------------------------
  217. %- MAKRO -
  218. %---------------------------
  219. %\newcommand*\Trans{\includegraphics[width=0.3cm,height=1.5ex]{Pic/Trans}}
  220. %
  221. %\newcommand*\Spole{\includegraphics[width=0.5cm,height=1.5ex]{Pic/Spoletegn}}
  222.  
  223. \newcommand{\Con}{\dashv \vdash}
  224.  
  225. \newcommand{\degree}{$^\circ$}
  226.  
  227. \renewcommand{\cite}[1]{\citep{#1}}
  228.  
Attachments
Capture.PNG
Picure of how it looks
Capture.PNG (19.85 KiB) Viewed 1518 times
Preamble.tex
My preamble
(7.58 KiB) Downloaded 111 times

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Aug 22, 2015 3:02 pm

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: 9501
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Aug 22, 2015 5:23 pm

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
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests