Tag Info

New answers tagged

1

May be that what the OP is looking for is simply a version of, say, the center environment which prohibits page breaks above and below itself; this is easy to accomplish. For example, the following MWE defines an environment named centernopagebreaks that locally redefines the appropriate parameters and then invokes the center environment. Note: While ...


1

You can do this just with commands from memoir. If you are using a standard class nextpage offers some additional convenience commands, such as \cleartoevenpage[], which work similarly to those defined by memoir. Here, \cleartoevenpage[] is used in a redefinition of memoir's \clearforchapter: \documentclass{memoir} \usepackage{kantlipsum} ...


0

Based on previous answers and comments, here is the solution I use with Pandoc 1.15. Specific command line options : --listings -H header.latex Specific header.latex file content : \BeforeBeginEnvironment{lstlisting}{\par\noindent\begin{minipage}{\linewidth}} \AfterEndEnvironment{lstlisting}{\end{minipage}\par\addvspace{\topskip}}


1

Despite the penalties @davidcarlisle mentions, I find I often get troublesome lone headings and dangly bits in complex documents, particularly where subheadings follow higher level headings without intervening text. One way is to use needspace, defining how much space is required on the page before a heading of a particular level can be set. Perhaps along ...


2

If you really need to do this, you want \addpenalty rather than \penalty just as you used \addvspace rather than \vspace. \documentclass{article} \usepackage{titlesec} \usepackage{etoolbox} \newcommand\thmbegin{\par\addvspace{.5em plus .2em minus .1em}% \addpenalty{-1000}} \newtheorem{thm}{Theorem} \AtBeginEnvironment{thm}{\thmbegin} \interlinepenalty=1000 ...


1

You can encapsulate the minted environment into a breakable tcolorbox environment. This allows to use some options from the tcolorbox package to influence the breaking. The minimal effect of the following code is that at least one line will be broken to the next page, if any. Since that may be not pleasing enough, I encluded an option enlargepage ...


0

Here is another, less elegant, solution playing around with the definition of \par. As pointed out in the comments this isn't so straightforward because all sorts of things end up calling \par. \documentclass{article} \let\realpar\par% save the real \par % make \mypar insert page breaks but only *after* restoring the % real value of \par and then revert ...


0

Possible duplicate question: Force pagebreak after every sentence/paragraph As is proposed in answer to the linked question, you can set \parskip to any size between \textheight and 29.5\textheight, to gain the desired effect. \documentclass{article} \usepackage{lipsum} \parskip = \textheight \begin{document} \lipsum[1-30] \end{document}


0

If possible, you could use the package listings instead of minted. It provides lots of options to customize the listings style. And in case of a page break, it puts the last line of the code block on the next page. \documentclass{scrartcl} \usepackage{blindtext} \usepackage{xcolor} \definecolor{dkgreen}{rgb}{0,.6,0} \definecolor{ltblue}{rgb}{.0,.4,.6} ...


1

[expunged original answer] Ok. Your new MWE shows another level of difficulty and a promise of future complications. What you need is a full-fledged two column baseline grid. I think your best bets are grid, gridset and ConTeXt.


3

Your style uses a supertabular, which seems to break a bit to early. You could try the style "long" instead. You could additionally enlarge the page with \enlargethispage{2\baselineskip} before \printglossaries.


2

You do not say why Ulrike Fischer's suggestion does not solve your problem in either your original document or the MWE. Switching to long solves the problem for the MWE when I test. So I'm guessing that you do not like the different positioning of the tabular. But this does not mean the problem isn't solved. It just means that solving it has created a new ...


1

Here is version that uses @touhami's hook, but provides more automation: \documentclass{report} \usepackage{lipsum} \makeatletter \newif\if@appendix \g@addto@macro\appendix{\@appendixtrue} \let\ltx@outputpage\@outputpage \def\@outputpage{% \if@appendix \@twosidetrue\@mparswitchtrue \ltx@outputpage \else \@twosidefalse\@mparswitchfalse ...


5

here is a solution \documentclass{book} \usepackage{lipsum} \makeatletter \let\old@outputpage\@outputpage \def\@outputpage{\old@outputpage\shipout\vbox{}} \@twosidefalse \@mparswitchfalse \makeatother \begin{document} \lipsum[1-70] \makeatletter \let\@outputpage\old@outputpage \@twosidetrue \@mparswitchtrue \makeatother \lipsum[1-70] \end{document}


1

The best way to cope with formatting of section titles is to use a macro with one argument in the last argument to \titleformat. Color specifications should only go in this auxiliary macro. Here is an example. \documentclass{article} \usepackage{fontspec} \usepackage{titlesec} \usepackage{xcolor} \usepackage{lipsum} % Title/Heading Formatting % SECTION ...


2

Just as with your specification for \section, you can move all the printing commands into the final argument. This then allows you to color them with \textcolor. In your example you then get on page two, rather a page break between the section commands. \documentclass{article} \usepackage{fontspec} \usepackage[explicit]{titlesec} \usepackage{xcolor} ...


2

This uses the titlesec package to build on David's suggestion and converts the use of \newenvironment to \newcommand since you want a command rather than an environment judging by the syntax you wish to use. \documentclass[12pt]{report} \usepackage{titlesec} \titleformat{\section}[block]{\centering\bfseries\sffamily\large}{\thesection}{0pt}{}{} ...


4

latex headings include code to prevent a page break until a couple of lines after a heading, so it best to define this as an unnumbered heading: \documentclass[a5paper]{book} \usepackage{geometry} \usepackage{lipsum} \makeatletter \newcommand{\character}{% \@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus ...


1

Add \vfil before the center environment in your command: \documentclass[a5paper]{book} \usepackage{geometry} \usepackage{lipsum} \newcommand{\character}[1]{% \vfil \begin{center} \textsc{#1} \end{center} } \begin{document} \character{Alice} \lipsum[2] \character{Bob} \lipsum[2] \character{Charles} \lipsum[2] \character{David} \lipsum[2] ...


3

Here is a quick demo of linking R and LaTeX using the 'knitr' package. This has been run on Windows 8.1, with MikTeX 2.9, and TeXmaker 4.4.1 as the IDE. The following code is saved as knit02.Rnw (and this is case sensitive). With the package 'knitr' installed in R 3.1.3 you run the command: knit("knit02.Rnw"). This will generate the file 'knit02.tex' ...


3

You can still use a longtable as this: \documentclass[12pt,english,nohyper]{tufte-handout} \usepackage{longtable} \begin{document} \begin{longtable}{cc p{1em} cc} \cline{1-2} \cline{4-5} & vals& & & vals\\ \cline{1-2} \cline{4-5} a & 3.39& & a & 3.39\\ b & 4.35& & b & 4.35\\ c & 6.16& ...



Top 50 recent answers are included