LyXTable caption left-justified (really all of it)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Horstmann2010
Posts: 2
Joined: Thu Jan 13, 2011 11:06 pm

Table caption left-justified (really all of it)

Post by Horstmann2010 »

Hi everybody,
I would like to place the caption of the table left-justified above the table. I know this is possible wiht option nooneline. But I use it the second line of a long caption starts not exakt on the left; like here:

Code: Select all

Table 1.1: Name of the table is very, very, very, very, very, very, very, very,  
           very, very, very, very, very long.
But I hope to get this result:

Code: Select all

Table 1.1: Name of the table is very, very, very, very, very, very, very, very,  
very, very, very, very, very long.
I'm using Lyx(1.6) and document class book(koma-script).
Best regards
Horstmann
Last edited by Horstmann2010 on Fri Jan 14, 2011 12:04 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table caption left-justified (really all of it)

Post by localghost »

The hanging indent for captions is the default setting in this class(es). Eliminate this indentation as described in Section 3.6.6 (Tables and Figures, p. 108ff) of the KOMA Script manual (English version).

Code: Select all

\setcapindent{0pt}
Since I don't use LyX, I have absolutely no idea where this is to be inserted.


Best regards and welcome to the board
Thorsten
Horstmann2010
Posts: 2
Joined: Thu Jan 13, 2011 11:06 pm

Table caption left-justified (really all of it)

Post by Horstmann2010 »

Perfect! That's it. Next time I will read documentation more carefully. Cheers, Horstmann

Attention: it works only in combination:

Code: Select all

\usepackage[nooneline]{caption} 
% or for LYX user put captions=nooneline in: document -> preference -> documentclass  
\setcapindent{0em} 
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Table caption left-justified (really all of it)

Post by sommerfee »

Horstmann2010 wrote:Attention: it works only in combination:

Code: Select all

\usepackage[nooneline]{caption} 
% or for LYX user put captions=nooneline in: document -> preference -> documentclass  
\setcapindent{0em} 
If it only works this way then your caption package is outdated and especially not adapted to the KOMA Script document classes (yet). So I strongly recommend updating your LaTeX system.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table caption left-justified (really all of it)

Post by localghost »

Horstmann2010 wrote:Perfect! That's it. Next time I will read documentation more carefully. Cheers, Horstmann

Attention: it works only in combination:

Code: Select all

\usepackage[nooneline]{caption} 
% or for LYX user put captions=nooneline in: document -> preference -> documentclass  
\setcapindent{0em} 
For basic caption settings in KOMA Script you almost don't need the caption package. The below example works with the current version and should do what you're after (even in LyX).

Code: Select all

\documentclass[%
  captions=nooneline,
  captions=tableabove,
  ngerman
]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\setcapindent{0pt}
\setkomafont{caption}{\small}
\setkomafont{captionlabel}{\bfseries}

\begin{document}
  \begin{table}[!ht]
    \caption{The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.}
    \rule{6.4cm}{3.6cm}
  \end{table}
\end{document}
Post Reply