0

my code is

\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}

this is result:

enter image description here

6
  • 2
    You have specified \raggedleft which is the opposite of what you want. Try \raggedright. – barbara beeton Feb 25 '19 at 15:51
  • @barbarabeeton I want it to be placed on the right side of the page, and the content I want to be aligned to the left – x-rw Feb 25 '19 at 15:57
  • 2
    To get a uniform indentation on the left, you can specify \leftskip=<dimen>\parindent=0pt where <dimen> is the amount of space you want on the left (e.g., 2cm). This is plain TeX notation, not LaTeX, but it should work. – barbara beeton Feb 25 '19 at 16:02
  • @barbarabeeton the example i put in the figure in red letters – x-rw Feb 25 '19 at 16:04
  • 1
    Yes, that's what I gave the code for. It should be replace the \raggedleft in your code. – barbara beeton Feb 25 '19 at 16:13
2

The code you post specifies \raggedleft, which is the opposite of what you want. \raggedright is what you should be using.

You also want a uniform indentation on the left. Replace the instruction \raggedleft in your code by the following:

\leftskip=2cm
\raggedright
\parindent=0pt

Replace the 2cm in this code by the width of the indentation that you want.

This code is in "plain TeX" style, not LaTeX, but it should work with no problem, although some LaTeX users would prefer a LaTeX-specific formulation.

The reason I was trying to answer in comments is that I don't currently have the ability to test; I don't like to provide untested answers.

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.