Tag Info

Hot answers tagged

13

The package zref-totpages can deliver the total number of pages and with expl3 we have a powerful number crunching system. \documentclass[12pt,paper=a4]{scrbook} \usepackage{scrpage2} \usepackage{blindtext} \usepackage{zref-totpages} \usepackage{xparse} \usepackage{xcolor} \ExplSyntaxOn \NewDocumentCommand{\percentage}{} { \int_compare:nTF { \ztotpages ...


11

\documentclass{scrartcl} \usepackage{xparse} \usepackage{scrlayer-scrpage} \cfoot{\percentpagemark} \AtEndDocument{\label{last-page}} \ExplSyntaxOn \NewDocumentCommand \percentpagemark { } { \int_set:NV \l_tmpa_int { \value{page} } \int_set:NV \l_tmpb_int { \pageref{last-page} } \fp_eval:n { round( 100*\l_tmpa_int/\l_tmpb_int , 2 ) } \, \% ...


8

LaTeX's standard classes use \MakeUppercase to convert the letters of section titles to uppercase. The conversion does not know about arguments, math, ... Workarounds: The letter "g" can be hidden inside a macro, e.g.: \documentclass{article} \usepackage{amssymb} \DeclareRobustCommand{\mathfrakg}{\mathfrak{g}} \pagestyle{headings} \begin{document} ...


8

Package fancyhdr puts the elements of the footer into a \parbox[t]. At the beginning You are using \color{...}. It does not start a new paragraph, thus the first top element of the \parbox[t] is the color whatsit (\special). It is aligned with the base line of the other entries. A then goes below the color whatsit. Solution: The color whatsit should go into ...


7

Another approach, with page counters and usage of calculator package. The percentage is calculated via \CalculatePercentage[]{}{}, where the first optional argument contains the number of digits for round off, the 2nd argument is the designed for the current page number and the 3rd argument holds the total number of pages. I used a different approach, ...


5

I'd say that you could use \thispagestyle{plain}. Using \thispagestyle{empty} would remove the page number.


4

LaTeX puts the skip registers \@fptop and \@fpbot at the top and bottom of float columns/pages and \@fpsep between them. The default values are: \setlength\@fptop{0\p@ \@plus 1fil}% = 0pt plus 1fil \setlength\@fpsep{8\p@ \@plus 2fil}% = 8pt plus 2fil \setlength\@fpbot{0\p@ \@plus 1fil}% = 0pt plus 1fil That means, the floats are vertically centered on ...


4

Use the textcase package: \documentclass{article} \usepackage{amssymb} \usepackage[overload]{textcase} \pagestyle{headings} \begin{document} \section{Test $\mathfrak{g}_2$} \end{document} However, the best is to avoid the dreaded automatic uppercasing done by the standard classes, which is, in my opinion, the biggest flaw in their design. When headers ...


4

Here is a suggestion using \markboth \newcommand\Chapter[2]{\chapter [#1\hfil\hbox{}\protect\linebreak{\itshape#2}]% {#1\\[2ex]\Large\itshape#2}% \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}% } Code: \documentclass{book} \usepackage{lmodern} \newcommand\Chapter[2]{\chapter [#1\hfil\hbox{}\protect\linebreak{\itshape#2}]% ...


4

Since version 3.12 KOMA-Script provides the options footheight – equivalent of the headheight option for the footer footlines – specify number of lines of the footer instead of the height (default is 1.25), equivalent of the option headlines (provided since v3.00, default 1.25). If used in combination with the scrpage2 successor scrlayer-scrpage which ...


4

This is possible using the flowfram package. One simple version is as follows: \documentclass{article} \usepackage{flowfram} \newflowframe{\textwidth}{0.4\textheight}{0pt}{0.6\textheight}[main] \newdynamicframe*{\textwidth}{\baselineskip}{0pt}{0.5\textheight}[headers] \newflowframe{\textwidth}{0.4\textheight}{0pt}{0pt} ...


3

use ... \usepackage{layout} \begin{document} \layout ... and you'll see what length you have to modify.


3

Your first header is too high and this causes fancyhdr to increase the header height from the second page on. You can fix it by pretending the first header has no height: \documentclass[10pt,twocolumn]{IEEEtran} \usepackage{graphicx} \usepackage{authblk} %============== For header and footer \usepackage{fancyhdr} \pagestyle{fancy} % -------- Normal ...


3

I'm not sure what do you mean by empty but if you are looking for the normal layout without the text of the header you can add this pagestyle to your preamble: \fancypagestyle{FooBar}{% \fancyhead{} \renewcommand{\headrulewidth}{1pt} } and then start your sections by declaring \section{Second Section}\thispagestyle{FooBar} This will give you ...


3

Because the question doesn't include the word LaTeX, I can show the non-LaTeX solution. The first task (percent of total page) is simple with opmac's \lastpage: \input opmac \openref \footline={\rm\thefontsize[10]\hfil\the\pageno\ / \dopercent\pageno of\lastpage\hfil} \def\dopercent #1of#2{\ifnum#2=0 ??\else \tmpdim=#1 pt \multiply\tmpdim by10 ...


2

As your chapter is starred, you will have to use the command \chaptermark{} here. As this chapter is chapter 0, it would result in CAPÍTULO 0. RESUMO I redefined the chaptermark Command in order to get just "RESUMO" in case, the chapter is 0 or smaller. You may adapt this to your needs. I used the \MakeUppercase{} as this seems to be the default in ...


2

You can make the choice automatic, by adding some code to \section \documentclass[12pt, titlepage, onecolumn, a4paper]{article} \usepackage{fancyhdr} \usepackage{chngcntr} \usepackage{xparse} \usepackage{lipsum} %% for dummy text \pagestyle{fancy} \renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark \fancyhf{} \fancyhead[L]{\leftmark} ...


2

For each mark there are three variables set by TeX: \botmark, \firstmark and \topmark. While \leftmark uses \botmark (the last set mark on the current page) \rightmark uses \firstmark (the first set mark on the current page). But you want to use the \topmark which is the last mark of the previous page. Based on the definition of \rightmark in latex.ltx ...


2

Maybe you can redefine your chapters and sections? \documentclass{book} \usepackage{lipsum} \newcommand\mychapter[1]{\chapter*{#1}% \addcontentsline{toc}{chapter}{\protect\numberline{}#1}% \def\rightmark{#1}} \newcommand\mysection[1]{\section*{#1}% \addcontentsline{toc}{section}{\protect\numberline{}#1}% \def\leftmark{#1}} \begin{document} ...


2

Use \starfootnote as defined below: \documentclass{article} \newcommand{\starfootnote}[1]{{% \renewcommand{\thefootnote}{*}% \footnotetext{#1}}} \begin{document} \[ a \stackrel{*}{\leq} b \] \footnote{Regular footnote.} \starfootnote{Star footnote.} \footnote{Another regular footnote.} \starfootnote{Another star footnote.} \end{document} It ...


2

It seems you're using biblatex, so I removed the call to natbib from classicthesis-config.tex and added some commands to the preamble: \documentclass[ twoside, openright, titlepage, numbers=noenddot, headinclude, footinclude=true, cleardoublepage=empty, fontsize=11pt, ngerman, american, ]{scrbook} \input{classicthesis-config} ...


2

The contents of \leftmark and \rightmark is determined by the commands \markboth and \markright, that usually are issued by sectioning commands such as \chapter or \section. There is an additional level, though. When you do \chapter{Title}, among other things LaTeX issues \chaptermark{Title}; similarly \section{Title} and \subsectiontitle issue ...


2

Put into the preamble (Document->Preferences->Preamble) \let\ps@plain\ps@headings if you are using the pagestyle fancy then write \let\ps@plain\ps@fancy or define \fancypagestyle{plain}{<settings>} See documentation of package fancyhdr. The pagestyle for the first page of a chapter is preset to plain.


2

As you are using a starred chapter command \chapter*{} no header mark gets set. Therefore, LaTeX does not know, what to write and uses the previous header text. You will have to tell the starred chapter or section the header-title as follows. % arara: pdflatex \documentclass[french ]{report} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{babel} ...


2

If you define a short title for your section or chapter, the classicthesis format takes this as your header text as well. With the command \sectionmark{} (and similarly \chaptermark{}) you are able to define a custom header version of your title. In this case, you are forced to use it in order to restore the original title writing. % arara: pdflatex % ...


2

In the right hand pages, the header shows the section name, which is empty. You can change the behavior inside the appendices environment with \appendixpage \begin{appendices} \fancyhead[RO]{\slshape \leftmark}


1

classicthesis loads scrpage2. You can use \automark[chapter]{part} \renewcommand{\partmark}[1]{\markboth{\spacedlowsmallcaps{#1}}{}} Code: \documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty, BCOR=5mm,paper=a4,fontsize=10pt]{scrbook} \usepackage{lipsum} ...


1

You can define two different page styles: one for the TOC, LOF and LOT and another for the main text. \documentclass{report} \usepackage{fancyhdr} \fancypagestyle{front}{% style for TOC, LOF, LOT \fancyhf{} \renewcommand{\headrulewidth}{0pt} \cfoot{\thepage} } \fancypagestyle{main}{% style for the mainmatter \fancyhf{} ...


1

Here is something that might be used as a building block so see it as a proof of concept. \documentclass[a4paper]{memoir} \usepackage{kantlipsum,graphicx} % picture syntax with std units \usepackage{picture,calc,xcolor} \usepackage{eso-pic} \makeatletter \makechapterstyle{hmm}{% \renewcommand\chapterheadstart{} \renewcommand\printchaptername{} ...


1

I tried phfaist's answer and it worked. But for future record, I also happened to find a fast way of doing it: In order to change the color of the Contents section, one can also do the following: \renewcommand\contentsname{\textcolor[cmyk]{1,0,0,0}{Contents}}\tableofcontents Apparently, I use the babel package and it did not clash with the ...



Only top voted, non community-wiki answers of a minimum length are eligible