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.

2
  • 2
    Try to use \vspace*{6ex}.
    – Sigur
    Mar 16, 2013 at 21:19
  • @rnish Have you considered to accept any answer here? I thin egrep's answer is very good. Nov 23, 2016 at 21:38

2 Answers 2

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

6
  • I get such an output pasteboard.co/1xn5gUam9.png Is that a purpose to have it the bottom? Is it a standard? I think the much white space is a Honourable space. - - Please, add an output to your answer. Nov 23, 2016 at 21:34
  • 1
    @Masi I added it (with showframe to clearly mark the page boundaries).
    – egreg
    Nov 23, 2016 at 21:52
  • Why is your output that way but my output wrong? - - Is this necessary \usepackage[paper=a4paper,left=30mm,right=20mm,top=25mm,bottom=30mm]{geometry}? Nov 23, 2016 at 22:13
  • @Masi Not at all; those were the settings of the OP.
    – egreg
    Nov 23, 2016 at 22:16
  • But how can you include the dedication at such location? Why is my location so different? - - Maybe some complication. Any workaround? Nov 23, 2016 at 22:40
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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .