Tag Info

Hot answers tagged

8

The \pagebreak command works differently when given inside a paragraph or when between paragraphs (that is, with a blank line before it). In your case, the second \pagebreak belongs to the paragraph having the text Want this to be page ii, but it appears as 1 instead and it will have effect only after the paragraph has been broken into lines, which ...


8

I introduce \widow which uses the \widowpenalty to prevent a hanging single line (unless the whole paragraph only took a single line). You insert \widow as the last word of the paragraph. In this way, it doesn't apply to your whole document, but is applied locally to resolve a local problem. This same approach applies outside of mdframed, as well. ...


6

Frames with listings package are known to be problematic. I've created a new environment mylisting with tcolorbox that reproduces your \lstset but has not those problems. MWE \documentclass[UKenglish,a4paper,11pt]{report} \usepackage{babel} %% Adjustments \addtolength{\topmargin}{-1\baselineskip} \addtolength{\textheight}{4\baselineskip} \pretolerance = ...


6

First of all, the definition of rubrique, being a new environment, lacks the ending part... Then, it is defined with a tabular inside it, which is not allowed to break into pages. The solution may be to load the package longtable \usepackage{longtable} and to substitute tabular with longtable in the definition of rubrique: ...


6

Double column floats always go on the next page at the earliest (they can't be placed on the current page as the first column may already have been set full height, so in a real document you just need to move the figure* environment earlier in the source, so that it is seen before the text that ends on that page. In the rare cases that you want the float at ...


6

The toc line is styled by the code you showed: if you changed chapter to section it would be styled like a section in the table of contents you can switch openright styles in your frontmatter using \csname @openrightfalse\endcsname and \csname @openrighttrue\endcsname


5

You don't want dmath, but simply \begin{quote}\raggedright $<long and unreadable formula>$ \end{quote} You might want to turn this into a personal environment: \newenvironment{longformula} {\begin{quote}\raggedright$} {$\end{quote}} so you just need to type \begin{longformula} <long and unreadable formula> \end{longformula} Example ...


4

An experiment I can summarize my findings on this question. Try to avoid using footnotes. Sometimes it doesn't look right even if you put a lot of efforts to properly typeset them and still the paper is difficult for people to read. There is a fine method, just convert your footnotes to sectionnotes or endnotes. There is even a package for it named ...


4

I can offer a solution based on tcolorbox version 2.80 (2014/03/31) released just this day where a \lstinline wrapping is provided with help of xparse. Instead of using the new macro \RenewTotalTCBox from version 2.80 you can also some variation of my answer to How do I create a verbatim box with \newtcbinputlisting? with version 2.72. To adapt your ...


3

You can use the very powerful tcolorbox package that supports listings. Here's an example, the frame can be customized in various ways. I used the optional argument to the danlisting environment just to show that you use it for passing options to lstlisting. The environment is breakable across pages. \documentclass[UKenglish,a4paper,11pt]{report} ...


3

Use a figure environment to keep picture and caption together, and to let the picture float. Without figure (if you don't want it to float), use a minipage environment to prevent a page break between picture and caption. No floating can result in bad page breaks though, such as much whitespace at the end of the previous page. Other possibilities: samepage ...


2

According to the LaTeX/Floats, Figures and Captions page on wikibooks figure* and table* by default "can be placed only at the top of a page or on their own page". Since LaTeX doesn't want to start the document with a float, and it can't place it at the bottom, it drifts to the next page where it is placed at the top. The dblfloatfix package solves this ...


2

You can adopt this answer given by Karl. In case if you want the section to stay in the current page as a whole, you may use \addtocontents{toc}{\protect\enlargethispage{\baselineskip}} % here Change \baselineskip suitably. Code: (adopted from linked answer): \documentclass[12pt]{book} \begin{document} \tableofcontents \chapter{Chapter} ...


1

This provides both a semi-automatic and a fully automatic solution to the problem... In all cases, it is "automatic" in that all the mdframe parameters necessary to create the color padding are taken directly from the environments without user intervention. If the user opts for the "semi-automatic" solution form, it allows them to manually invoke a macro ...


1

An experiment This approach of breaking vertical boxes helped me. I tried to figure out how many lines I am dealing with in a block. I am usually using the lineno package for that and its \linelabel and \lineref commands. These commands are similar to their \label and \ref counterparts. I am able to get a number of lines using this method. If I need a ...


1

Here follows a minimal working example: \documentclass[a4paper,11pt,twoside,openright]{memoir} \setlrmargins{*}{*}{1} \setulmargins{*}{*}{1} \checkandfixthelayout[nearest] \usepackage{color} \usepackage{xcolor} \usepackage{titletoc} \settocdepth{subsection} \setsecnumdepth{subsection} \makeatletter \def\@endpart{ ...



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