I'm looking to write a fictional description/discussion by a 'scholar' of an alien race for an RPG, but I can see this being handy elsewhere.

I'd like to put his 'notes' in the margins of some text he's found/is writing.

I've seen what \marginpar{margin text} can do:

enter image description here

but I'm more after this kind of margin note:

enter image description here

How could I do that with LaTex?


1 Answer 1


Here is my very unsatisfactory attempt at this, but perhaps someone can use this to come up with a real solution. This just requires way too much tweaking of the paramaters to control the location of the comment text.

enter image description here


Further Enhancements:

  • Replace font of the notes
  • More automatic placement of the comments


\usetikzlibrary{calc,fit, decorations.pathmorphing}

% https://tex.stackexchange.com/questions/39296/simulating-hand-drawn-lines
    \state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance,auto corner on length=1mm,]{
        {% From
        {%  Control 1

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}


    O{}% #1 = draw options for the referenced word
    O{}% #2 = draw options for the comment
    O{}% #3 = draw options for the connecting line
    m  % #4 = left \tikzmark name
    m  % #5 = left \tikzmark name
    m  % #6 = comment
    \begin{tikzpicture}[overlay,remember picture,decoration=penciline, thick]
        \node [shape=rectangle,inner sep=0, draw=blue, ,rounded corners=2pt, fit={(#4.south) ($(#5.north)+(0,0.75ex)$)}, decorate, #1] (Source) {};
        \node at ($(#4)!0.5!(#5)$) [blue, font=\itshape, rounded corners=5pt, decorate, #2] (Label) {#6};
        \draw [draw=red, decorate, #3] (Label) to (Source);

Lorem ipsum dolor sit amet, \CommentText{ConsecA}{ConsecB}{consectetur} adipiscing elit. Fusce mollis ullamcorper augue. Cras ut bibendum est. Nullam mauris lectus, imperdiet eget interdum quis, vestibulum quis orci. 
\CommentPar[draw=brown][draw=red, shift={(1.0cm,2.0cm)}, rotate=40, text width=2cm, align=center][out=-110, in=10, distance=0.1cm,->]{ConsecA}{ConsecB}{~~~Did you  \\ mean~~ \\ consecutive??}

Ut tellus odio, rhoncus at blandit nec, tempor malesuada nunc. In id euismod odio. Ut lobortis varius pellentesque. Proin molestie \CommentText{estA}{estB}{est} dolor, eu tristique enim. Nulla facilisi. Curabitur pharetra sem eget sem volutpat sed sollicitudin mauris interdum. Nullam iaculis leo vitae tellus mattis aliquam. \CommentText{MexicanA}{MaxicanB}{Maecenas} metus odio, mollis ac posuere vitae, pulvinar ut orci. Nullam porta, dolor vel ornare gravida, leo mauris tempor metus, eu dignissim eros neque quis justo.

\CommentPar[brown][color=blue, shift={(0.75cm,0.1cm)}, rotate=-50][draw=none]{estA}{estB}{Yes!!}

\CommentPar[brown][text width=3cm, color=violet, shift={(6.7cm,-1.5cm)}, rotate=-65][brown, out=225, in=-80, distance=0.7cm, ->]{MexicanA}{MaxicanB}{Seriously that is how you spell Mexican??}

Nulla massa nisl, tempus sit amet scelerisque ac, vulputate quis ligula. Sed a neque vel enim ultrices ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In hac habitasse platea dictumst. Quisque tincidunt pretium est, vitae ornare urna varius et.  
  • 1
    this is great, nice work!
    – cmhughes
    Oct 25, 2012 at 15:10
  • I'd love to try this, but I'm struggling to 'install' xparse.sty ..... Nov 4, 2012 at 12:55
  • 2
    @Pureferret: Can't really help without some information as to what the problem is, error messages, what you tried, etc. i am guessing that you are probably on an older distribution. I'd recommend installing TeXLive 2012 and go from there. If you still have a problem with installation you should ask a new question. Nov 4, 2012 at 18:27
  • @PeterGrill I've go the latest ubuntu. but I'm not sure about tex, I'll give it an update, and if it doesn't work, then yes, I'll ask a new question. Thanks! Nov 4, 2012 at 19:10
  • 1
    @Pureferret: TeXLive 2012 is packaged with Ubuntu 12.10 (the latest at the time of writing), and xparse.sty comes with the texlive-latex-recommended package.
    – krlmlr
    Dec 10, 2012 at 20:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .