Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want one particular line to exceed the margin like this...

    My text
    My text
 My special Text.
    My text.
 My special text.

How can I achieve this?

I have tried to use

\reversemarginpar
\marginpar{My} special text

But it adds the 'My' on the left edge of the page. Thanks.

share|improve this question
    
Are each of the lines a paragraph in your example? Or do they form part of the same (single) paragraph? –  Werner Jan 11 '12 at 21:32
add comment

1 Answer

up vote 6 down vote accepted

As a start-of-a-paragraph "undent", this is easily achieved using a \makebox[0pt][r]{..} alignment:

enter image description here

\documentclass{article}
\begin{document}
\setlength{\parindent}{0pt}
My text. \par
My text. \par
\makebox[0pt][r]{My }special Text. \par
My text. \par
\noindent\llap{My }special text.
\end{document}

This sets the text in a box of width 0pt (avoiding overfull \hboxes) and right-aligned, pushing it into the left margin. You could also use \llap, which does the same, but you need to "start" the paragraph first before this takes effect.

It would also be possible to allow this "undent" mid-paragraph.

share|improve this answer
    
It worked as I expected. Thank you. May ask, what does setlength do? I tried without it, that also worked.. My text is like this <\textbf{\emph{\makebox[0pt][r]{MY}1: example text> –  Droid-Bird Jan 11 '12 at 21:46
1  
A paragraph is typically indented with \parindent (default is 15pt). Using \setlength{\parindent}{0pt} kills this indent so all paragraphs start flush with the left margin. I used this merely to illustrate the "undentation". In you code, I would probably use \makebox[0pt][r]{\textbf{\emph{My }}}. In other words, set the box last (on the outside). –  Werner Jan 11 '12 at 21:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.