Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorslifty
    • CommentTimeMay 15th 2012
     
    I wish there was a guide or wiki somewhere, but for now forum questions will have to do!

    I'm trying to export figures with captions from Ulysses to LaTex. I see the Floating Figure which has an "end" of

    }
    \caption{@caption@} \label{@label@}
    \end{center}
    \end{figure}

    I assume that @@ implies it will look somewhere for something, but I'm not quite sure what that somewhere or something is. Any help is greatly appreciated!
    •  
      CommentAuthorgoetz
    • CommentTimeMay 15th 2012 edited
     

    Admittedly, the documentation for the placeholders (i.e., the strings between @@) is a bit hidden. If you open the Help and go to the documentation for the LaTeX export, you will find a small section at the end called Inline Styles and Markers, which explains how to add floating figures to your documents (in the paragraph "Key to Graphic in Notes"). Basically, you need to format your note containing the floating image as follows:

    key-image-width-caption
    

    and enclose this formatting in the start/end tags of your image Inline Style. Thus, if the Inline Style tags for images are [[ and ]], you would insert [[key-image-width-caption]] (the width parameter is optional). In the regular text in the editor, you only need to add [[key]] at the position where the floating figure should be inserted. For key, you can use an arbitrary string (without whitespace) such as "img1", "overview" or "JamesJoyce".
    During export, the placeholder @caption@ is replaced by the caption in the note and @label@ is replaced by the key.

    •  
      CommentAuthorslifty
    • CommentTimeMay 17th 2012
     
    Awesome :) Thanks!

    I'm noticing that Ulysses always seems to insert a ref() above the figure...

    For instance:


    \ref{safe}
    \begin{figure}
    \begin{center}
    \includegraphics[width=153mm]{Interfaces2}
    \caption{An example of safe mode} \label{safe}
    \end{center}
    \end{figure}


    I don't actually want the \ref to be there but can't seem to figure out where it is being added... Any thoughts?
    •  
      CommentAuthorgoetz
    • CommentTimeMay 17th 2012
     

    The \ref{} tag is inserted at the location where you inserted the Inline Style referencing the Note (which contains the figure). For instance, if you write inside a paragraph

    ... For a depiction of the problem at hand see Fig. [[img1]].

    then \ref{img1} will be inserted at the location where [[img1]] was and the actual floating figure (\begin{figure}...\end{figure}) will be inserted after the paragraph. Unfortunately, there is no way around the insertion of \ref{}. The idea is that the image is referenced in the text and the floating figure is the inserted afterwards.
    I've updated the Ulysses help regarding this matter, hopefully things are more clear now.

    •  
      CommentAuthorslifty
    • CommentTimeMay 18th 2012 edited
     
    Thanks for the information!

    I'd like to suggest that for future versions this feature might be better off tweaked to remove the forced insertion of ref. For instance the ref{img} could be removed from the code and added to the publish rule template, meaning the user could remove it easily if desired.

    The current implementation presumes a specific use of floating figures (and seems to be abnormal in the sense that Ulysses is usually very good at allowing you to control what it outputs; this is an odd case where it's forcing something!). I just want my figure to appear in a specific location, and every time I export I now need to go through and remove the lingering refs :(