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'm using Book (KOMA-Script), By default, the footnote runs roughly from left margin to the right margin of the page, I used the following to control the left margin:

\deffootnote[8em]{8em}{8em} {\textsuperscript{\thefootnotemark}}

Result is as following:

right margin

I wondered if there is a way to control the right margin of the footnote? or in another word, the length of the footnote itself? i.e. 2em spacing to the right margin of the page?

share|improve this question
    
What document class are you using? –  egreg Oct 2 '12 at 16:35
    
I'm using Book (KOMA-Script). –  Shi Yuan Oct 2 '12 at 16:36
add comment

1 Answer 1

up vote 4 down vote accepted

Do you really mean 2em from the right margin of the page?

\documentclass{scrbook}
\usepackage{lipsum}

\deffootnote[8em]{8em}{8em} {\textsuperscript{\thefootnotemark}}

\makeatletter
\@ifdefinable{\org@makefntext}{%
  \let\org@makefntext\@makefntext
  \renewcommand*{\@makefntext}{%
    \ifthispageodd{%
      \setlength{\hsize}{\dimexpr\paperwidth-\oddsidemargin-1in-2em}%
    }{%
      \setlength{\hsize}{\dimexpr\paperwidth-\evensidemargin-1in-2em}%
    }%
    \org@makefntext
  }%
}
\makeatother

\begin{document}
\lipsum[1] Hello\footnote{\lipsum[2]}
world.\footnote{\lipsum[3]} \lipsum[4]
\end{document}

2em to the right margin of the page

If you have meant 2em to the right margin of the text body, then the redefinition of \@makefntext simplifies to:

\documentclass{scrbook}
\usepackage{lipsum}

\deffootnote[8em]{8em}{8em} {\textsuperscript{\thefootnotemark}}

\makeatletter
\@ifdefinable{\org@makefntext}{%
  \let\org@makefntext\@makefntext
  \renewcommand*{\@makefntext}{%
    \addtolength{\hsize}{-2em}%
    \org@makefntext
  }%
}
\makeatother

\begin{document}
\lipsum[1] Hello\footnote{\lipsum[2]}
world.\footnote{\lipsum[3]} \lipsum[4]
\end{document}

2em to right margin of text body

share|improve this answer
    
How can this be achieved while using the article class? –  azetina Oct 2 '12 at 22:51
    
\deffootnote and \isthispageodd are features of KOMA-Script, but the trick with the redefinition of \@makefntext and setting \hsize remains the same for class article. –  Heiko Oberdiek Oct 2 '12 at 23:03
    
Its ok. I figured it out. I will delete my comments. If you can as well. –  azetina Oct 2 '12 at 23:25
    
amazing, works like a charm. thanks so much! –  Shi Yuan Oct 3 '12 at 11:08
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.