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 am using dirtree to visualize a directory structure. It needs to be embedded into a float as to avoid problems when a pagebreak occours. This works fine except when loading floatrow which i use to get margin captions and more. Even just loading the floatrow package messes up dirtree. A possible solution to get these two to mate?

dirtree only: dirtree only

dirtreeand floatrow: enter image description here

Code:

  \documentclass[8pt]{scrartcl}


  \usepackage{dirtree}

  %\usepackage{floatrow}
  \usepackage{blindtext}

  \begin{document}
  \blindtext

  %\thisfloatsetup{%
  %floatwidth=\linewidth,
  %capposition=beside,
  %capbesideposition={top,right},
  %capbesideframe=yes,
  %capbesidewidth=\marginparwidth,
  %capbesidesep=quad,
  %floatrowsep=qquad}
  \begin{figure}[t]
  \dirtree{%
  .1 Experiment/.
  .2 Analysis/ \dotfill  \begin{minipage}[t]{3cm}
  Very important folder{.}\end{minipage}.
  .2 TopSecret/ \dotfill \begin{minipage}[t]{3cm}
  For your eyes only.\end{minipage}.
  .3 Awesome Plots/.
  .3 Output.txt.
  .2 File.dat.
  }
  \caption{Directory Tree}
  \end{figure}

  \blindtext

  \end{document}
share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

By default, floatrow centers the content of floats, so add objectset=raggedright to the setup of floats involving dirtree.

\documentclass[8pt]{scrartcl}


\usepackage{dirtree}

\usepackage{floatrow}
\usepackage{blindtext}

\begin{document}
\blindtext

\thisfloatsetup{%
objectset=raggedright,
%floatwidth=\linewidth,
%capposition=beside,
%capbesideposition={top,right},
%capbesideframe=yes,
%capbesidewidth=\marginparwidth,
%capbesidesep=quad,
%floatrowsep=qquad
}
\begin{figure}[t]
\dirtree{%
.1 Experiment/.
.2 Analysis/ \dotfill\begin{minipage}[t]{3cm}
Very important folder{.}\end{minipage}.
.2 TopSecret/ \dotfill \begin{minipage}[t]{3cm}
For your eyes only.\end{minipage}.
.3 Awesome Plots/.
.3 Output.txt.
.2 File.dat.
}
\caption{Directory Tree}
\end{figure}

\blindtext

\end{document}
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.