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 the tufte-latex document class with LyX and would like to adjust the positions of some "footnotes" in my document by specifying an offset. I understand that I can do this manually by replacing the footnote that appears in LyX (which generates \footnote{...} in the source) with the code

\sidenote[][<offset>]{...}

but am wondering whether there is a way to do this through the LyX UI so that I don't have ERT cluttering up the document (yes, I know; but that's what LyX is for). Many environments and commands in LyX provide simple ways to add options in this way (e.g. enumitem lets you add options with Insert > Short Title) but I don't see how to do it for footnotes.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You could write a module looking roughly like this:

#\DeclareLyXModule{Sidenotes}
#DescriptionBegin
#Inserts sidenotes in the output.
#DescriptionEnd
# Author: Florian Rubach

Format 11

InsetLayout sidenote
    LyXType               custom
    LabelString           "Sidenote"
    LatexType             command
    LatexName             sidenote
    Decoration            classic
    LabelFont
      Color               cyan
      Size                Small
    EndFont
    MultiPar              false
    OptionalArgs          2
    Preamble
        \RequirePackage{sidenotes}
    EndPreamble
End

Save this to a file named sidenotes.module, put it in your lyx user directory under the folder layouts (on win7 something like C:\Users\YOURNAMEHERE\AppData\Roaming\LyX2.0\layouts, can be seen by pressing help>about LyX in the main menu).

Then, you need to reconfigure LyX via Tools>reconfigure and restart it.

You can then add the new module via Document>Settings>Modules.

Inserting a sidenote works then by pressing Insert>Custom>Sidenote. Unfortunately, it does not accept optional arguments right now, which can otherwise be inserted the lyx way via Insert>short title. I'll inquire about this.

share|improve this answer
1  
Inquiring at the lyx mailing lists resulted in the answer, that optional arguments are currently only supported for styles, not for InsetlLayouts... –  Florian Rubach Mar 1 '12 at 7:11
    
Thanks. This seems to do exactly what the Tufte class already does. –  raxacoricofallapatorius Mar 1 '12 at 17:25

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.