12

Alignment of dedication page in the document class article.

\documentclass[a4paper,12pt]{article} 
\usepackage[paper=a4paper,left=30mm,right=20mm,top=25mm,bottom=30mm]{geometry}
    \newenvironment{dedication}
        {\vspace{6ex}\begin{quotation}\begin{center}\begin{em}}
        {\par\end{em}\end{center}\end{quotation}}
\begin{document}
\begin{dedication}
\hspace{4cm}
\vspace*{9cm}{Dedicated to google and wikipedia.}
\end{dedication}
\end{document}

The alignment is moving horizontally but not vertical. Am i missing something here?

Using Texmaker in Linux.

egreg
  • 1,121,712
rnish
  • 147
  • 1
  • 2
  • 5

2 Answers2

27

Probably a different approach is better. Choose yourself the proportion of white space at the top and the bottom (here it's 1:3).

\documentclass[a4paper,12pt]{article}
\usepackage[paper=a4paper,left=30mm,right=20mm,top=25mm,bottom=30mm]{geometry}

\newenvironment{dedication}
  {\clearpage           % we want a new page
   \thispagestyle{empty}% no header and footer
   \vspace*{\stretch{1}}% some space at the top 
   \itshape             % the text is in italics
   \raggedleft          % flush to the right margin
  }
  {\par % end the paragraph
   \vspace{\stretch{3}} % space at bottom is three times that at the top
   \clearpage           % finish off the page
  }

\begin{document}
\begin{dedication}
Dedicated to google and wikipedia  
\end{dedication}
\end{document}

For producing the image below, I added the showframe option to geometry.

enter image description here

egreg
  • 1,121,712
6

As this is the first Google result for "latex dedication", I'd like to contribute a simpler way for dedications in Latex, which I adapted from here:

\newpage \vspace*{8cm}
% Sets a PDF bookmark for the dedication
\pdfbookmark{Dedication}{dedication}
\thispagestyle{empty}
\begin{center}
  \Large \emph{Dedicated to google and wikipedia}
\end{center}