3

I want to align left my text after two words like image given below. How can i fix the problem? Thank you.

Referance Image

\documentclass[12pt]{report}
\usepackage[hidelinks]{hyperref}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[turkish,english,shorthands=:!]{babel}
\usepackage{apacite}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
\usepackage{epigraph}
\usepackage{graphicx}
\usepackage{float}
\usepackage{mathptmx} 
\usepackage[titletoc,title]{appendix}
\usepackage{afterpage}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}
\usepackage{url}
\usepackage{indentfirst}
\usepackage{tikz}               
\usetikzlibrary{positioning}    
\usepackage{longtable} 
\usepackage{lipsum} 




\begin{document}

\thispagestyle{plain}
\phantomsection
\begin{center}
    Yüksek Lisans Tezi\\
    \singlespacing %\doublespacing
    \addcontentsline{toc}{chapter}{ÖZET}
    {\fontsize{12pt}{12pt}\selectfont \textbf{\MakeUppercase{Özet}}}\\
    \vspace{\baselineskip}
    THESIS NAME\\
    \singlespacing
    Writer's Name\\
    \singlespacing
    Teknik Üniversitesi\\
    Fen Bilimleri Enstitüsü\\
    A Anabilim Dalı\\
    Danışman: Dr. John DOE\\
    2019, 100 (Tez Sayfa), 5 (Ek Sayfalar)
\end{center}

%%% Özet
\par Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\\
\singlespace
\noindent \textbf{Anahtar Kelimeler} :Ullamco Laboris Nisi, Aliquip, Commodo, Consequat, Duis, Aute, Irure Dolor Reprehenderit, Voluptate, Velit, Vsse, Cillum, Dolore Deu Fugiat, Nulla, Pariatur, Excepteur, Sint, Occaeca Cupidatat, Proident
\clearpage


\end{document}
4

This answer probably makes little sense in 2018, but anyway…

Torbjørn T.’s answer is very good (I’ve upvoted it), but LaTeX users who are aware of what actually goes on inside the innards of the underlying TeX engine probably can’t help remarking that it puts an unnecessary burden on the typesetting engine itself. Indeed, the tabularx environment works by repeatedly typesetting each “X-column” several times until it reaches the desired result; now, it is true that in this case the environment is capable of guessing the correct width of the unique X-column in the first try, typesetting the column itself only once (as one can prove by experiment), and that Torbjørn’s solution can therefore be regarded as an automated version of Fran’s that doesn’t require to indicate manually the width of the \parbox; it is true that, even if this were not the case, with the speed of today’s (and also of yesterday’s…) computers the overburden imposed by the use of tabularx would anyhow be of no significance at all; but again, users acquainted with the underlying TeX engine know very well that it embodies a mechanism explicitly devoted to obtaining this effect (which is called hanging indentation in the typesetting world) as an integrant part of one of its most basic routines, the paragraphing algorithm. A solution that exploits this mechanism could therefore be of some interest, at least from the point of view of elegance. After all, if The TeXbook reminds us, on p. 208, that

aesthetics are more important than efficiency,

what should be said of something that combines aesthetics and efficiency?

(Note that the present solution is also clearly superior in the management of the interline glue, a topic we don’t want to discuss here; moreover, it allows page breaks in the middle of the indented paragraphs, which could be a Good Thing or a Bad Thing, depending on the circumstances.)

In the code below, we define:

  • a command named \mySingleParHangFrom, which can be used to typeset a single paragraph with hanging indentation; normal margins will resume when this single paragraph ends;

  • an environment named myHangFrom, which should be used if you want to typeset several paragraphs with hanging indentation; this hanging indentation will last until the end of the environment.

The code:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\makeatletter

\newcommand*\mySingleParHangFrom[1]{%
    \par
    \@hangfrom{\textbf{#1}\enspace}%
    \ignorespaces
}

\newenvironment*{myHangFrom}[1]{%
    \par
    \addpenalty{-\@lowpenalty}%
    \addvspace\bigskipamount
    \def\par{% first half of "\@setpar"
        {\@@par}%
        \hangafter \z@
        \def\par{{\@@par}}%
    }%
    \def\@par{{\@@par}}% second half of "\@setpar"
    \@hangfrom{\textbf{#1}\enspace}%
    \ignorespaces
}{%
    \@@par
    \addpenalty{-\@lowpenalty}%
    \addvspace\bigskipamount
}

\makeatother



\begin{document}

Some text before the labeled material: it ought to be long enough to show where
the right margin lies.

\bigskip

\mySingleParHangFrom{Sample label:}
This paragraph has the desired hanging indentation.
Note that \emph{no space} should be used at the end of the argument of the
\verb|\mySingleParHangFrom| command.
But how do we tell \LaTeX\ where to stop the hanging indentation?
Well, we do so simply by ending the paragraph.

\bigskip

As you can see, normal margins resume when we start a new paragraph.  Of course,
this entails that the \verb|\mySingleParHangFrom| cannot be used when we want
the hanging indentation to last across several paragraphs; for this, the
\texttt{myHangFrom} environment is provided.  Note that this environment
automatically adds some amount of vertical space above and below its contents.

\begin{myHangFrom}{Sample label:}
    Note that \emph{no space} should be used at the end of the argument of the
    \texttt{myHangFrom} environment.  Some more text, and even more.
    At this point, \( \verb|\hangindent| = \texttt{\the\hangindent} \)
    and \( \verb|\hangafter| = \number\hangafter \).

    As you can see here, all subsequent paragraphs inside
    the \texttt{myHangFrom} environment have hanging indentation too, but this
    time the indentation starts at the first line: this is because, now,
    \( \verb|\hangafter| = \number\hangafter \)
    (while \( \verb|\hangindent| = \texttt{\the\hangindent} \),
    the same as before).

    \medskip

    You are allowed to insert vertical space between the paragraphs without
    interfering with this feature.

    A fourth paragraph, which is just two lines long. 
    (Is it?  Yes, \emph{now} it is!)

    And a fifth.
\end{myHangFrom}

Some text after the labeled material.  As expected, the normal margins are again
in force at this point.

\end{document}

The output it produces:

Output of the above code

For further explanations, see The TeXbook, p. 102–103.

| improve this answer | |
5

You could use a tabularx from the package with the same name. enter image description here

\documentclass[12pt]{report}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[turkish,english,shorthands=:!]{babel}
\usepackage{apacite}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
\usepackage{epigraph}
\usepackage{graphicx}
\usepackage{float}
\usepackage{mathptmx} 
\usepackage[titletoc,title]{appendix}
\usepackage{afterpage}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}
\usepackage{url}
\usepackage{indentfirst}
\usepackage{tikz}               
\usetikzlibrary{positioning}    
\usepackage{longtable} 
\usepackage{lipsum} 
\usepackage{tabularx} % <-- added





\begin{document}

\thispagestyle{plain}
\phantomsection
\begin{center}
    Yüksek Lisans Tezi\\
    \singlespacing %\doublespacing
    \addcontentsline{toc}{chapter}{ÖZET}
    {\fontsize{12pt}{12pt}\selectfont \textbf{\MakeUppercase{Özet}}}\\
    \vspace{\baselineskip}
    THESIS NAME\\
    \singlespacing
    Writer's Name\\
    \singlespacing
    Teknik Üniversitesi\\
    Fen Bilimleri Enstitüsü\\
    A Anabilim Dalı\\
    Danışman: Dr. John DOE\\
    2019, 100 (Tez Sayfa), 5 (Ek Sayfalar)
\end{center}

%%% Özet
\par Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\\
\singlespace
\noindent
\begin{tabularx}{\linewidth}{@{}lX@{}}
\textbf{Anahtar Kelimeler}: & Ullamco Laboris Nisi, Aliquip, Commodo, Consequat, Duis, Aute, Irure Dolor Reprehenderit, Voluptate, Velit, Vsse, Cillum, Dolore Deu Fugiat, Nulla, Pariatur, Excepteur, Sint, Occaeca Cupidatat, Proident
\end{tabularx}
\clearpage


\end{document}
| improve this answer | |
1

Without any package, you can use a \parbox:

\documentclass{article}
\usepackage{lipsum,parskip} % only for the mwe
\begin{document}

\lipsum[2]

\noindent{\bfseries Anathar Kelimeler:}\hfill
\parbox[t]{.7\linewidth}{\lipsum[11]}

\lipsum[4]

\end{document}
| improve this answer | |

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.