No space between three-digit table number and title in List of Tables (KOMA-script) [duplicate]


How to get chapterthumbs match their chapter titles in KOMA-Script?


This is an add-on question to a previous one on chapterthumbs. Please consider the MWE below, the chapterthumbs are not matching the chapter titles (Discussion should appear instead of Materials & Methods), so how to:

Objectives

  • Match chapterthumbs with their chaptertitle — answered
  • Activate chapterthumb on Abstract/Bibliography in the MWE — answered
  • Suppress chapterthumb on curriculum vitae in the MWE — answered
  • The advancement of the thumbs should cover the whole right edge of the page – answered!

MWE

documentclass{scrbook}
usepackage{chapterthumb}%
usepackage{etoolbox}%
usepackage{nameref}%
lohead[putchapterthumb]{putchapterthumb}
addtokomafont{chapterthumb}{bfseries}

%
letLaTeXStandardChapterchapter%
renewcommand*{chapterthumbformat}{refcommand{chapter::title::numbervalue{chapter}}}%

makeatletter

newcounter{totalchaptercounter}%

newrobustcmd{WriteChapterTitleToAux}[1]{%
refstepcounter{totalchaptercounter}%
immediatewrite@auxout{%
stringnewlabel{chapter::title::numbervalue{totalchaptercounter}}{{thesection}{thepage}{unexpanded{#1}}{}}
}% End of writing to AUX file
}%

newrobustcmd{refcommand}[1]{%
nameref*{#1}%
}%

newcommand{chapter@noopt}[1]{%
WriteChapterTitleToAux{#1}%
LaTeXStandardChapter{#1}%
}%

newcommand{chapter@opt}[2][]{%
WriteChapterTitleToAux{#2}%
LaTeXStandardChapter[#1]{#2}%
}%


newcommand{unstarredchapter}{%
@ifnextchar[{chapter@opt}{chapter@noopt}%
}%

newcommand{starredchapter}[1]{%
LaTeXStandardChapter*{#1}
}%



renewcommand{chapter}{%
@ifstar{starredchapter}{unstarredchapter}%
}%

%=====================Bibliography=============================
usepackage{biblatex}
usepackage{filecontents}
begin{filecontents}{jobname.bib}
@article{rand_objective_1971,
    title = {Objective criteria for the evaluation of clustering methods},
    volume = {66},
    issn = {01621459},
    url = {http://www.jstor.org/discover/10.2307/2284239?uid=3737864&uid=2&uid=4&sid=21103234673533},
    doi = {10.2307/2284239},
    pages = {846},
    number = {336},
    journaltitle = {Journal of the American Statistical Association},
    shortjournal = {J Amer Statist Assoc},
    author = {Rand, William M.},
    urldate = {2013-12-18},
    date = {1971-12},
    keywords = {Comparing partitions, Rand, statistics}
}

@article{hubert_comparing_1985,
    title = {Comparing partitions},
    volume = {2},
    issn = {0176-4268, 1432-1343},
    url = {http://link.springer.com/article/10.1007/BF01908075},
    doi = {10.1007/BF01908075},
    pages = {193-218},
    number = {1},
    journaltitle = {Journal of Classification},
    shortjournal = {J Classif},
    author = {Hubert, Lawrence and Arabie, Phipps},
    urldate = {2013-12-18},
    date = {1985-12-01},
    langid = {english},
    keywords = {{ARI}, Comparing partitions, Consensus indices, Measures of agreement, Measures of association, statistics, Statistics, general}
}   
end{filecontents}
addbibresource{jobname.bib}
%==================================================
title{Title of the Dissertation}
author{Author Name} 
publishers{Faculty Name}

begin{document}
maketitle
frontmatter
pagestyle{plain}%
tableofcontents %chapterthumb:no
chapter{Acknowledgements} %chapterthumb:no
chapter{Abstract}dots
clearpage
mainmatter
pagestyle{scrheadings}
chapter{Introduction}dots
Sample text here cited parencite{hubert_comparing_1985}, which is different from textcite{rand_objective_1971}.

chapter{Materials & Methods}dots 
chapter{Results}dots 
chapter{Discussion}dots
backmatter
printbibliography[heading=bibintoc]
clearpage%
pagestyle{plain} % Or any other user defined style
chapter*{Curriculum Vitae} %chapterthumb:no
end{document}

MWE Output
enter image description here

Note

  • chapterthumb is not yet supported by TexLive2013, and hence should be manually installed

  • The chapterthumb.sty v0.1 was used in the above MWE and not the updated v0.2 package on windows 7 platform.

chapter no newpage and headings


I have a document (scrbook class), in which I want some chapters not to start on a new page. I therefore defined the following:

%define a chapter that does not add space at the top of the page
usepackage{etoolbox}
makeatletter
letchapterNoSpacechapter 
patchcmdchapterNoSpace{if@openrightcleardoublepageelseclearpagefi}{}{}{}
patchcmd{chapterNoSpace}{thispagestyle{plain}}{thispagestyle{fancy}}{}{}
makeatother

This does nearly what I want. However, there are three problems:

  1. I need to add a new paragraph before any chapterNoSpace command, or it will put the chapter directly on the same line as the last text.

  2. On the page where the chapter starts, I am missing my headers.

  3. If the command coincides with a new page, the headers are missing on the page before and there is a spurious vskip before the heading, which looks odd.

I added a minimal script below.

documentclass[11pt, a4paper, twoside, openany]{scrbook}
%headers
usepackage{fancyhdr}pagestyle{fancy}
renewcommand{chaptermark}[1]{markboth{thepart. #1}{}}
renewcommand{sectionmark}[1]{markright{thepart.thechapter. #1}}
fancyhf{}
fancyhead[LE,RO]{thepage}
fancyhead[LO]{rightmark}
fancyhead[RE]{leftmark}
fancypagestyle{plain}{fancyhead{}renewcommand{headrulewidth}{0pt}}

%Define a chapter that doesn't start on new page
usepackage{etoolbox}
makeatletter
letchapterNoSpacechapter 
patchcmdchapterNoSpace{if@openrightcleardoublepageelseclearpagefi}{}{}{}
%renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
%patchcmdchapterNoSpace{chapterheadstartvskip}{vspace{1cm}}{}{}
patchcmd{chapterNoSpace}{thispagestyle{plain}}{thispagestyle{fancy}}{}{}
makeatother
begin{document}
part{Part 1}
chapter{Normal chapter 1}
text text text text text text
chapter{Normal chapter 2}
text text text text text
chapterNoSpace{Chapter on same page 1}
text text text

chapterNoSpace{Chapter on same page 2 with line brake above}
text text text
chapter{Normal chapter 3}
text text text

end{document}

Any suggestions?

Redefine figure counter with scrbook


I am using the scrbook (KOMA Script) class, as this MWE shows:

documentclass[11pt,a5paper,twoside,BCOR=8mm,DIV=12,headings=normal,open=right]{scrbook}
usepackage[ngerman]{babel}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}

usepackage{chngcntr}

begin{document}
part{Introduction}
chapter{Lorem ipsum}

counterwithout{figure}{chapter}

begin{figure}[h!]
    My figure here.
    caption{My caption}
end{figure}
end{document}

It’s working, by and large, with one exception: The caption reads

Abbildung 1.: My caption

Notice the superfluous dot before the colon? It’s clearly due to using parts; if I stick to chapters and sections only it’s formatted as intended.

Any bright ideas?

Frame/Box around chapter-, section-headings,


Does anyone know how to put a frame around chapter and section-headings? I’m using Koma-Script (scrbook) but there it’s rather difficult to find a solution …

Now I found the package ‘titlesec’. I think it must be possible to solve my problem with it but unfortunately I don’t get it.

Here’s a little code-example with some (hanging!) chapter and section’s where I want a frame around …

documentclass[oneside,openright,BCOR=5mm,paper=a4,fontsize=11pt]{scrbook}

usepackage[T1]{fontenc}
usepackage[latin1]{inputenc}
usepackage[ngerman]{babel}
usepackage[automark]{scrpage2}
usepackage{xcolor}

usepackage{geometry}
geometry{a4paper, top=35mm, left=30mm, right=60mm, bottom=25mm, headsep=15mm, footskip=12mm}

usepackage[demo]{graphicx}
usepackage{textpos}
usepackage{blindtext}
usepackage{lipsum}
usepackage{titlesec}

usepackage{mparhack}

setlength{marginparwidth}{3.2cm}
setlength{marginparsep}{0.7cm}
setheadwidth[0pt]{textwithmarginpar}
setfootwidth[0pt]{head}

titleformat{chapter}[hang]{}{parbox{1.5cm}{thechapter}}{0pt}{}{}
titleformat{section}[hang]{}{parbox{1.5cm}{thesection}}{0pt}{}{}
titleformat{subsection}[hang]{}{parbox{1.5cm}{thesubsection}}{0pt}{}{}
titleformat{subsubsection}[hang]{}{parbox{1.5cm}{thesubsubsection}}{0pt}{}{}

begin{document}

chapter{Lorem ipsum}
One
section{dolor}
Two
subsection{amet}
Three

end{document}

I also added an image where you can see the result that I want to get … but unfortunately don’t know either how to manage. That's how it should look like

On the other hand I’ve already a solution by redefining makechapterhead and defining a new Section (capital ‘s’) for framed section headings. Unfortunately I neither wasn’t able to add the ‘spacing’ between chapter/section-number and chapter/section-heading in this redefinitions nor to redefine section in the way that I don’t have to use this new command ‘Section’ :(

renewcommandsection{@startsection{section}{1}{z@}%
  {-0.0ex @plus -1ex @minus -.2ex}%
  {2.3ex @plus.2ex}%
  {ifnum scr@compatibility>@nameuse{scr@v@2.96}setlength{parfillskip}{z@
      plus 1fil}fi
    raggedsectionnormalfontsectfontsize@section}%
}

renewcommand@@makechapterhead[1]{
    begin{mdframed}[linewidth=0.0pt, innerleftmargin=0, innerrightmargin=0, innertopmargin=2pt, innerbottommargin=0, backgroundcolor=lightgray]
  {%
    setlength{parindent}{z@}setlength{parfillskip}{fill}%
    normalfontsectfontnobreaksize@chapter{}%
    if@chapterprefix
      let@temparaggedsection
    else
      let@tempa@hangfrom
    fi
    @tempa{ifnum c@secnumdepth >m@ne%
        if@mainmatter
          if@chapterprefix
            expandaftersize@chapterprefix
          else
            expandaftersize@chapter
          fi
          {chapterformat}%
          if@chapterprefix
            size@chapterprefix{}endgrafnobreakvskip.5baselineskip
          fi
        fi
      fi
    }%
    {raggedsection interlinepenalty @M size@chapter{#1}par}}%
  nobreak
    end{mdframed}
    vspace*{0.5baselineskip}
}


newcommandSection[2][]{begin{mdframed}[linewidth=0.5pt, innerleftmargin=0, innerrightmargin=0, innertopmargin=2pt, innerbottommargin=2pt, linecolor=gray, skipabove=24pt]%
  ifxrelax#1relaxsection{#2}elsesection[#1]{#2}fi
  end{mdframed}}

It would be great if someone could help me!
Thank you in advance and greetings from Austria.


There’s the picture I mentionned below: The headings should be at the same position.

– Code Example for @Herbert –

documentclass[oneside,openright,BCOR=5mm,paper=a4,fontsize=11pt]{scrbook} 

usepackage[T1]{fontenc} 
usepackage[latin1]{inputenc} 
usepackage[ngerman]{babel} 
usepackage[automark]{scrpage2} 
usepackage{xcolor} 

usepackage{geometry} 
geometry{a4paper, top=35mm, left=30mm, right=60mm, bottom=25mm, headsep=15mm, footskip=12mm} 

usepackage[demo]{graphicx} 
usepackage{textpos} 
usepackage{blindtext} 
usepackage{lipsum} 

usepackage{mparhack} 

setlength{marginparwidth}{3.2cm} 
setlength{marginparsep}{0.7cm} 
setheadwidth[0pt]{textwithmarginpar} 
setfootwidth[0pt]{head} 

begin{document} 

pagestyle{scrheadings} 
clearscrheadfoot 

pagenumbering{Roman} 
cfoot[hspace{10.5cm}today]{hspace{10.5cm}today} 
ofoot[pagemark]{pagemark} 

chapter{Lorem ipsum} 
lipsum[1-3] 
newpage 

pagenumbering{arabic} 
setcounter{page}{1} 
clearscrheadfoot 

ifoot[% 
  {% 
     par% sonst gibt es eine Warnung 
     begin{textblock*}{0mm}(0.78paperwidth,-0.25paperheight)% 
    includegraphics[scale=0.30, angle=90]{demo} 
    end{textblock*} 
  }% 
]{% 
   {% 
     par% sonst gibt es eine Warnung 
     begin{textblock*}{0mm}(0.78paperwidth,-0.25paperheight)% 
    includegraphics[scale=0.30, angle=90]{demo} 
    end{textblock*} 
   }% 
}% 
cfoot[hspace{10.5cm}today]{hspace{10.5cm}today} 
ofoot[pagemark]{pagemark} 

chapter{Super} 
blindtext 
par 
blindtext 

end{document} 

— @Herbert

In the code example before there has to be included usepackage{titletoc} and the following code block before begin{document}:

titlecontents{chapter}[2.5cm]{addvspace{0.5cm}bfseries}{contentslabel{3.5cm}}{hspace*{-1.5cm}}{hfillcontentspage}[addvspace{0.25cm}]
titlecontents{section}[2.5cm]{small}{contentslabel{3.5cm}small}{}{titlerule*[0.12cm]{.}contentspage}
titlecontents{subsection}[2.5cm]{small}{contentslabel{3.5cm}small}{}{titlerule*[0.12cm]{.}contentspage}
titlecontents{subsubsection}[2.5cm]{small}{contentslabel{3.5cm}small}{}{titlerule*[0.12cm]{.}contentspage}

In the Latex-Body the table of contents is going to be printed by using tableofcontents. So far so good, now – with all redefinitions of chapter section etc., the table of contens looks like enter image description here

… but, it should look like (this result I get without the redefinitions) enter image description here

KOMA-script modify part* page


My document has parts and *parts. I redefined the part to print only a decorated number, that’s working fine. Now I need part* to print a decoration using the same style as part. part*{} ships out an empty page, which makes sense because it must not have a line for a part number. I can more or less do it by hand, using clearpage and putting just the decoration on the page. But then both the horizontal and the vertical alignment of the decorations come out different to the part page layout. How can I make part* print my decoration on the part page?

Note: I don’t have a table of contents, so that’s not a concern.

documentclass[open=any]{scrbook}
usepackage{adforn}
usepackage{graphicx}
usepackage{lipsum}

renewcommand*{thepart}{arabic{part}}
renewcommand*{partformat}{adforn{21}~thepart~adforn{49}}
renewcommand*{partpagestyle}{empty}

begin{document}
part{}
lipsum

clearpage
begin{centering}
vspace*{fill}
Hugeadforn{21}adforn{11}adforn{49}
vfill
end{centering}
clearpage

lipsum

part*{}

lipsum

end{document}

Lower page number for selected pages


Is there a possibility to lower the page number at a single page where a large figure (float) with a height nearly pageheight is positioned?
So the command must probably be used inside the figure environment?
How can that easily be achieved in the KOMA classes?

Here an example:
First Page with the large figure and where the page number should be lowered to be below the figure, second Page with small figure and usual/normal position of page number

documentclass{scrreprt}
usepackage[demo]{graphicx}

begin{document}

begin{figure}
centering
includegraphics[height=24cm]{name}
end{figure}

pagebreak

begin{figure}
centering
includegraphics[height=10cm]{name}
end{figure}

end{document}

Page range in TOC chapter entry in scrbook


I asked the question KOMA: Page range in TOC chapter entry

Answer linked to Chapterwise page range in the TOC

But i do not get the result for the following code…

documentclass{scrbook}
usepackage{lmodern}% for sans-serif plus bold plus italic


usepackage{tocstyle}
usetocstyle{standard}
usetocstyle{nopagecolumn}

settocstylefeature[0]{leaders}{hfill}%
settocstylefeature{pagenumberhook}{itshape~}

usepackage{blindtext}

makeatletter
newifif@chap@enddc
  @chap@enddctrue
letltx@@chapter@chapter
renewcommand{@chapter}[2][]{%
ltx@@chapter[#1]{#2}
expandafterlabel{chap:thechapter}
}
letltx@toctableofcontents
renewcommand{tableofcontents}{%
ltx@toc
letltx@chapterchapter
renewcommand{chapter}{%
expandafterlabel{prenextchap:thechapter}
ltx@chapter
}}
letltx@enddocumentenddocument
renewcommand{enddocument}{%
if@chap@enddcexpandafterlabel{prenextchap:thechapter}fi
ltx@enddocument
}
defchaprange{expandafterpageref{chap:thechapter}--expandafterpageref{prenextchap:thechapter}}
letltx@addcontentslineaddcontentsline
defCR@addcontentsline#1#2#3{%
  addtocontents{#1}{protectcontentsline{#2}{#3}{chaprange}}
}
defToggleChaprange{letaddcontentslineCR@addcontentsline}
defBypassChaprange{letaddcontentslineltx@addcontentsline}
defBreakChaprange{%
  expandafterlabel{prenextchap:thechapter}
  letaddcontentslineltx@addcontentsline
  @chap@enddcfalse
}
letltx@sectionsection
renewcommand{section}[2][]{%
BypassChaprange
ifrelaxdetokenize{#1}relax
  ltx@section{#2}
else
  ltx@section[#1]{#2}
fi
ToggleChaprange
}
makeatother

begin{document}
tableofcontents
ToggleChaprange
blinddocument
BreakChaprange
clearpage
addcontentsline{toc}{chapter}{References}
null
appendix
chapter{Additional Content}

end{document}

enter image description here

Page range is printed for subsections also….

koma-scrlttr2: bottom margin is immense, how to reduce?


I’m really struggling with what seems like it should be a simple layout question for KOMA scrlttr2.

I simply cannot find any way to get the bottom margin of a letter to be anything less than 2 inches. I’ve browsed through the KOMA documentation. I certainly understand the authors’ wish for users to understand the principles of proper page layout for publication. However, a letter is not for publication. A bottom margin of 2-3 cm may be too small for publication, but it’s entirely reasonable for a letter.

So I think it should be a fairly simple question, but the documentation provides pounds of theory but nothing like a simple answer.

First I tried the geometry package, but the “bottom” property had no effect. Scrlttr2 still insists on breaking the page about 2 inches above the page boundary.

Then I saw that typearea is recommended for KOMA scripts. The width parameter of areaset clearly takes effect, but the height parameter does not.

usepackage[headexclude,footexclude,landscape]{typearea}
areaset{6.5in}{11in}

I’m sure there must be a way to do this. There’s plenty of room on the page for the content. It’s just that scrlttr2 is refusing to let me use that space.

Full page image as title page


Background

Wrote a technical manual in LyX. The technical manual currently has two parts:

  • Cover image (PDF)
  • Manual text (PDF)

Problem

When merging the two PDF files (with GhostScript or other software tools), there are a number of issues:

  • Bookmarks (lost in merging)
  • Colours (obvious changes)
  • PDF tags (lost in merging)

I would rather include the cover page image as a full page (no margins) at the start of the manual and have LyX (LaTeX) generate the front page when it creates the PDF. In this fashion, the cover page and the manual text need not be merged as a separate step.

Question

How do you instruct LaTeX to generate a full page image as the first page in a PDF using KOMA-Script?

Update

Using the pdfpages package produces the following result:

Image

Note the white space above and below the image. The white space is removed using the following:

includepdf[fitpaper]{cover}

Update

Part of the preamble contains:

% Resize figures that are too wide for the page.
letoldincludegraphicsincludegraphics
renewcommandincludegraphics[2][]{%
  graphicsformat{%
    oldincludegraphics[width=ScaleIfNeeded,#1]{#2}%
  }%
}

The full preamble is at: http://pastebin.com/qHKEDPeU

The error message is:

!pdfTeX error: pdflatex (file cover.pdf): cannot find image file

The file ch_02.lyx and test.latex are in the same directory. The file test.latex is the document in Martin’s post. The file test.latex can find the file cover.pdf, yet the file ch_02.lyx cannot find the file. Both use the following code:

includepdf[fitpaper]{cover.pdf}

Update

The most minimal LyX example that produces the problem:

#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
lyxformat 345
begin_document
begin_header
textclass scrbook
begin_preamble
usepackage{pdfpages}
end_preamble
use_default_options false
language english
inputencoding utf8
font_roman lmodern
font_sans helvet
font_typewriter courier
font_default_family default
font_sc false
font_osf false
font_sf_scale 100
font_tt_scale 100

graphics default
float_placement H
paperfontsize default
spacing single
use_hyperref true
pdf_bookmarks true
pdf_bookmarksnumbered false
pdf_bookmarksopen false
pdf_bookmarksopenlevel 1
pdf_breaklinks false
pdf_pdfborder false
pdf_colorlinks false
pdf_backref false
pdf_pdfusetitle true
papersize letterpaper
use_geometry false
use_amsmath 2
use_esint 1
cite_engine basic
use_bibtopic false
paperorientation portrait
secnumdepth 3
tocdepth 3
paragraph_separation indent
defskip medskip
quotes_language english
papercolumns 1
papersides 1
paperpagestyle default
bullet 0 5 11 -1
bullet 1 5 24 -1
bullet 2 0 0 -1
tracking_changes false
output_changes false
author "" 
author "" 
end_header

begin_body

begin_layout Standard
begin_inset ERT
status collapsed

begin_layout Plain Layout


backslash
includepdf[fitpaper]{cover.pdf}
end_layout

end_inset


end_layout

begin_layout Standard
Test
end_layout

end_body
end_document

Thank you!

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam