Responder1
Uma opção é você usar \marginnote
domarginnote
pacote; usando o pacote de geometria você pode alterar marginparsep
(a separação entre a nota marginal e o texto normal) e/ou marginparwidth
a largura reservada para a nota:
\documentclass[12pt]{article}
\usepackage[marginparsep=25pt]{geometry}
\usepackage{blindtext}
\usepackage{marginnote}
\usepackage{xcolor}
\newcommand\KeyWord[1]{%
\marginnote{\parbox[t]{\marginparwidth}{\raggedright\small \textcolor{red}{#1}}}}
\reversemarginpar
\begin{document}
\KeyWord{Key note}\blindtext
\end{document}
O resultado:
Responder2
Basta adicioná-lo.;-)
\documentclass{article}
\newcommand{\KW}[1]{%
\par % ensure vertical mode
\leavevmode % start a paragraph
{\setbox0=\lastbox}% remove the indentation box
\makebox[0pt][r]{\textbf{#1}\hspace{2em}}% print the keyword
\hspace*{\parindent}% add the parindent
\ignorespaces
}
\begin{document}
This paragraph has no keyword, it has some boring text just to
make it wrap across a couple of lines.
\KW{key word}
This paragraph has a keyword, it has some boring text just to
make it wrap across a couple of lines.
\end{document}
Responder3
Aqui está uma interface de valor-chave que permite ajustar a sep
aração, o font
e color
:
\documentclass{article}
\usepackage[nopar]{lipsum}
\usepackage{xcolor,xkeyval}
\makeatletter
\define@cmdkey{KW}{sep}{}
\define@cmdkey{KW}{color}{}
\define@cmdkey{KW}{font}{}
\newcommand{\KeyWord}[2][]{%
\par\noindent
\setkeys{KW}{#1}%
\makebox[0pt][r]{\textcolor{\cmdKV@KW@color}{\cmdKV@KW@font #2}\hspace*{\cmdKV@KW@sep}}%
\hspace*{\parindent}\ignorespaces
}
\makeatother
\newcommand{\KeyWordsetup}[1]{\setkeys{KW}{#1}}%
\AtBeginDocument{\KeyWordsetup{font=\bfseries,color=red,sep=\marginparsep}}% defaults
\begin{document}
\KeyWord{Key note}\lipsum[1]
\KeyWord[sep=20pt]{Key Note}\lipsum[2]
\KeyWord[font=\itshape,color=blue!50]{KEY NOTE}\lipsum[3]
\KeyWordsetup{font=\slshape,color=red,sep=\marginparsep}%
\KeyWord{Key note}\lipsum[4]
\end{document}