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.

If I load both longtable (ltxtable) and floatrow, then \sffamily is ignored and the table is typeset in roman. If I disable floatrow everything works as expected. floatrows \RawFloats command does not work here as a solution. I had only error messages when I inserted it.

Here is the example code:

\documentclass[]{scrbook}

\usepackage{ltxtable} %
\usepackage{filecontents} %
\usepackage{floatrow}
\usepackage{caption} %

\listfiles

\begin{document}

% Creation of the table in a separate file
\begin{filecontents}{content/longtable.tex}
\begin{longtable}{>{\itshape}l*{2}{X}}
\captionabove{longtable tabular with tabularx columns} \\
  \hline
  title & title \\ \hline
\endhead
  \hline
\endlastfoot
description   & content & \\
\end{longtable}
\end{filecontents}

% Loading of the table from the separate file
{
  \small\renewcommand{\arraystretch}{1.4}\sffamily
  \LTXtable{\textwidth}{content/longtable.tex}
}
\end{document}

Which results in the following

enter image description here

Any idea how to get the sans serif font in the table back?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The floatrow package controls the font of float object contents and also of longtables, so you'll have to add \floatsetup[table]{font=sf} to your preamble (and may remove \sffamily from the redefinition of \arraystretch). See section 3.1.2 of the manual for details.

\documentclass[]{scrbook}

\usepackage{ltxtable} %
\usepackage{filecontents} %
\usepackage{floatrow}
\floatsetup[table]{font=sf}
\usepackage{caption} %

\listfiles

\begin{document}

% Creation of the table in a separate file
\begin{filecontents}{longtable.tex}
\begin{longtable}{>{\itshape}l*{2}{X}}
\captionabove{longtable tabular with tabularx columns} \\
  \hline
  title & title \\ \hline
\endhead
  \hline
\endlastfoot
description   & content & \\
\end{longtable}
\end{filecontents}

% Loading of the table from the separate file
{
  \small\renewcommand{\arraystretch}{1.4}
  \LTXtable{\textwidth}{longtable.tex}
}
\end{document}

enter image description here

EDIT: Should you also want to change the caption fonts, use the \captionsetup macro provided by the caption package:

\captionsetup[table]{labelfont=sf,font=sf}

enter image description here

share|improve this answer
    
It works that way - but I wonder if this was a good design decisions. I think of floatrow as a caption and figure/tabular alignment tool that provides float extension. And it can causes problems in normal latex code if the floatrow extensions are not used... –  Matthias Pospiech Jan 15 '12 at 13:10

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.