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 build a document with notes (like footnotes) on margins. I found help on LaTeX community and now my preamble looks like that:

\documentclass{book}

\usepackage{marginnote}
\renewcommand*{\marginfont}{\footnotesize}
\newcounter{mynote}
\newcommand{\mynote}[2][0]{
\refstepcounter{mynote}
\mbox{\textsuperscript{\themynote}}
\marginnote{\mbox{\textsuperscript{\themynote}}\hspace{0pt}#2}[#1\baselineskip}
\newcommand{\mybr}{-\\}

Everything works pretty well except automatic hyphenation. I need to divide words manually by using \mybr{}. I prefer ragged notes, but justified could be too, if automatic hyphenation works only like this.

share|improve this question
add comment

2 Answers

TeX doesn't hyphenate the first word in a paragraph. You can write a \hspace{0pt} before it, then TeX takes this as first word.

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{marginnote}
\usepackage[ngerman]{babel}
\usepackage{ragged2e}
\renewcommand*{\raggedleftmarginnote}{\RaggedLeft}
\renewcommand*{\raggedrightmarginnote}{\RaggedRight}
\newcommand\Marginnote[1]{\marginnote{\hspace{0pt}#1}}

\begin{document}
foo\Marginnote{Mülltonnenentsorgungsprogramm}
\end{document}
share|improve this answer
    
Leo Liu, Herbert, thanks a lot! ragged2e works perfect! –  kotsport Feb 11 '11 at 8:29
add comment

This would help:

\usepackage{marginnote}
\usepackage{ragged2e}
\renewcommand*{\raggedleftmarginnote}{\RaggedLeft}
\renewcommand*{\raggedrightmarginnote}{\RaggedRight}

See manuals of marginnote and ragged2e for more information.

share|improve this answer
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.