# Tag Info

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 ...

6

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. ...

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} ...

2

\FloatBarrier of package placeins could be put before \begin{lstlisting} to output the pending floats before the long listing that should not be interrupted by floats.

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: ...

0

It seems that something like \let\orig@description\description \def\description{\orig@description \let\orig@par\par \def\par{\orig@par\nopagebreak[4]}} works for me. (I could go to \nopagebreak – without the optional argument – but there may be situations when the page break may be the better option after all.) I'm not enthusiastic about the minipage ...

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 = ...

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} ...

0

There are a couple ways to approach this. Which one you use will depend on your layout priorities and how much you know about your content. You could just use a really big hammer: \begin{samepage} % poem title stuff % music % extra verses \end{samepage} That should be pretty self explanatory. You wrap the content that needs to stay on the ...

0

An alternative to the accepted answer that doesn't require a new theorem environment name is the following: \documentclass{article} \usepackage{amsthm} \usepackage{lipsum} \usepackage{needspace} \newtheorem{theorem}{Theorem} \let\ORGtheorem\theorem \def\theorem{% \Needspace*{3\baselineskip} \ORGtheorem } \let\ORGendtheorem\endtheorem \def\endtheorem{% ...

0

Solved by using the Float Package: \documentclass[journal,twoside]{IEEEtran} \usepackage[spanish,english]{babel} \usepackage{circuitikz} \usepackage[justification=centering]{caption} \usepackage{float} \begin{document} \title{Minimal Working} \maketitle \begin{figure}[H] \centering \includegraphics[scale=0.2444]{MultiplierSimulationI.png} \caption{\small ...

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{ ...

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 ...

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

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 ...

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

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 ...

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 ...

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 ...

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 ...

3

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 ...

2

When you use the twocolumn option, the only possible way for switching to a one column format is starting a new page. You might use the multicol package, instead, but probably the best strategy for the problem you're trying to solve is using the todo or fixme packages.

1

It will never happen if you do not put the blank line (which is equivalent to a paragraph break in TeX/LaTeX) between the section command (i.e., \section{Heading}) and the text that follows it. Instead of what you have typed, including a blank line, viz., \section{Heading} Here is some text after the heading. type \section{Heading} Here is some text ...

Top 50 recent answers are included