The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

The method in the source below suffers two defects: Like the answer https://tex.stackexchange.com/a/512752/13492, the toc links for each of Short Contents and Detailed Contents send us below the header of the other. In each of the two toc's, there are entries for both Short Contents and Detailed Contents. Ideally, as the original post requests, self-...


1

As I'm on my way how this is probably the best I can do right now. I have removed things that are irrelevant to this question. This is just using the fact that under hyperref each toc line is five tokens, so if we insert a macro that sometimes does nothing and sometimes eats the next 5 tokens, then we get what we want. What I do not like about this one, is ...


3

The periods are not inserted through \thesection and similar. In the following code I only left the relevant parts. \documentclass[12pt,a4paper,oneside,final]{amsbook} \usepackage{etoolbox} \usepackage{blindtext} \numberwithin{section}{chapter} \makeatletter % remove the period from the toc \renewcommand{\tocsection}[3]{% \indentlabel{\@ifnotempty{#2}{\...


2

I'd drop the \frontheads and \backheads and define a proper main style and activate it in the preamble. The main problem is your psmarks: \makepsmarks{main}{% \createmark{chapter}{both}{shownumber}{}{\enspace} % use both not left \createmark{section}{right}{shownumber}{}{\enspace} \createplainmark{toc}{both}{\contentsname} \createplainmark{lof}{...


1

Here are two versions of your table in which I vertically centered ID using the \thead command from the makecell package: \documentclass{article} \usepackage[abbreviations=true,per-mode=symbol]{siunitx} \usepackage{booktabs} \usepackage{makecell} \begin{document} \begin{table} \caption{Specific Acid Added to Samples} \label{Acid_Added} \centering \begin{...


0

The multirow package allows you to vertically fuse cells together. Once it has been loaded in your preamble, you can use the command \multirow{<number of cells to fuse>}{<width>}{<content>}. Note that you can replace the width with a * to respect the given cell width.


1

In your MWE replace: \createmark{section}{right}{shownumber}{\@secapp}{\ } by \createmark{section}{right}{shownumber}{Section }{\ } You tried a \@secapp to imitate \@chapapp, but the \@chapapp is special in that its value will change whether or not an Appendix is being set or a normal Chapter; it is an internal LaTeX macro. There is no need for such ...


1

The amsaddr package does \@mkboth{\@nx\shortauthors}{\@nx\shorttitle} and so if you don't specify the \shortauthors, the first argument would be empty and amsart substitutes it with \shorttitle. A simple solution is to use the optional argument to \author: \documentclass{amsart} \usepackage[foot]{amsaddr} \title{Title} \author[Me]{Me} \address{Somewhere ...


0

In case you want to remove the header entirely (e.g. because you do not use headers in the rest of the file), just add \renewcommand\bibsection{} to the preamble. This should work in all templates working with natbib, such as iopart (IOP) for example.


2

By default chapter pages use page style plain. \ihead, \ohead etc. have a optional argument for the content on plain pages. If the content is the same on both plain and scrheadings pages, you can use the starred version, eg \ohead*{\pagemark} is a short version of \ohead[\pagemark]{\pagemark}. I would suggest to use \pagemark for the page number in header ...


0

Another solution is from the documentation. http://www.pirbot.com/mirrors/ctan/macros/latex/contrib/koma-script/doc/scrguide.pdf and this link: https://golatex.de/renewcommandchapterpagestyle-t3048.html \documentclass[chapterprefix=true, 12pt, a4paper, oneside, parskip=half, listof=totoc, bibliography=totoc, numbers=noendperiod]{scrbook} \usepackage{...


1

OK, I found the solution. \ohead command has {} for default pages and [] for the chapter start pages. According to the manual it has another meaning but it does what I want: \documentclass[chapterprefix=true, 12pt, a4paper, oneside, parskip=half, listof=totoc, bibliography=totoc, numbers=noendperiod]{scrbook} \usepackage{blindtext} \usepackage[automark,...


1

Add \addtopsmarks{headings}{}{ \createmark{chapter}{left}{shownumber}{}{. \ } } \pagestyle{headings} Remember the last line to have the changes merged into the page styles currently in use


1

Ok I found part of the answer - the command \pagestyle{fancy} needs to be set before \begin{appendices} and it works fine!


0

The rule above the text can be removed by \renewcommand*\headrulewidth{0pt}. To reduce the top margin decrease the value of geometry option top and add option nohead. \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{parskip} \usepackage{...


0

Here is a solution with the standard report class and, of course titlesec (I had to replace fontawesome, which isn't installed on my system, with fontawesome5): \documentclass{report} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[a6paper, margin=20pt, bottom=34pt, footskip=24pt, showframe]{geometry} \usepackage{fontawesome5} \usepackage{...


0

Because this post was about titlesec and I am told it would conflict with Koma-script, I'm using a standard class. Putting everything together, here's the closest I get to the spec. <> and () are just to see how titleformat works. \documentclass{report} \usepackage{fontawesome} \usepackage{expl3} \usepackage[ paper=a6paper, layout=a6paper, centering, ...


1

Do not use packages titlesec and titleps with KOMA-Script classes. They are not compatible (even if the example works with the current versions). So here is a suggestion without these packages: \documentclass[a6paper, DIV=20, ]{scrreprt} \usepackage{fontawesome} \usepackage[T1]{fontenc} \usepackage{lastpage} \usepackage{lipsum} % Dummy Text \usepackage[...


0

An up-front comment: I think it's perfectly acceptable to suppress the printing of the page number on the pages with overly-tall tables -- as long as there aren't a lot of such pages. To suppress the printing of the page number on an ad-hoc basis, just issue a suitable \thispagestyle{empty} directive for the page in question. If, instead, you prefer to ...


1

This is as simple as adding \renewcommand{\sectionmark}[1]{\markboth{\MakeUppercase{#1}}{}} to your preamble. By default, \sectionmark - the macro responsible for setting the mark associated with \section - resembles this: \newcommand{\sectionmark}[1]{% \markboth{% \MakeUppercase{% \ifnum\c@secnumdepth>\z@ \thesection \...


0

The workaround that I create is change the \newgeometry to force the value of variables that wasn't changed at the second time that the macro was called. \apptocmd\newgeometry{% \paperwidth=297mm \paperheight=210mm \textwidth=702.78308pt \linewidth=\textwidth \hsize=\textwidth \columnwidth=\textwidth ...


0

You can use xpatch to automatically add \addtheorem to the Theorem environment. \documentclass{article} \textheight7cm % MWE only, I assume \usepackage{fancyhdr} \usepackage{amsthm} \newtheorem{Theorem}{Theorem} \newcommand*{\theoremname}{Theorem}% used in \ifx \newcommand*{\theoremlist}{Theorem}% reserve global name \newcommand{\addtheorem}{\ifx\...


2

I would use another order of sorting the three rows. In the following MWE I used your table build with tabularx and an special column type C with sorting order lCr. Please see the following MWE (important code changes are marked with <========): \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{lipsum,graphicx,fancyhdr,xcolor} \...


2

It is easier to get centred vertical rules if you add additional column: \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{lipsum,array,fancyhdr,xcolor} \newcommand{\footertext}{% \color{gray}\small\setlength\tabcolsep{0pt}% \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}r >{\vline}c r >{\vline}c r@{}} UiT Norges Arktiske ...


2

Probably you are more satisfied with the following solution using tabular*. (Red lines in the screenshot are from the showframe package): \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{lipsum,graphicx,fancyhdr,xcolor} \newcommand{\footertext}{% \color{gray}\small\setlength{\tabcolsep}{0pt}% \begin{tabular*}{\textwidth}{@{\extracolsep{\...


12

biblatex Here is a solution for biblatex. We can (ab)use the mark mechanism, each entry sets the marks and then the header grabs \rightmark and \leftmark, which contain the first and last reference number on each page. \documentclass[british]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage{csquotes} \usepackage[...


Top 50 recent answers are included