使用 \begin{BVerbatim} 在 \begin{center} 中插入分页符

使用 \begin{BVerbatim} 在 \begin{center} 中插入分页符
\documentclass[12pt] {article}
\usepackage{amsmath}
\usepackage[breakable]{tcolorbox}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\def\baselinestretch{2.0}
\usepackage{tocloft}
\def\toright#1{\leavevmode\unskip\nobreak\hfill\penalty13 
    \null\nobreak\hskip1em plus1fill\hbox{#1}}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\newcommand\mydotfill{\cftdotfill{\cftdotsep}}
\setlength{\textwidth}{18cm} \setlength{\textheight}{21cm}
\setlength{\evensidemargin}{-0.15cm}
\graphicspath{ {images/} }
\setlength{\oddsidemargin}{-0.15cm}
\begin{document}
    \textbf{Output:}\\
    \verb|Enter the first side: 1|\\
    \verb|Enter the second side: 1|\\
    \verb|Enter the third side: 1|\\
    \verb|Roots are complex|\\
    \verb|Roots are -0.500000000000000 + 0.866025403784439*I ,-0.5000000000000|\\ 
    \verb|00 - 0.866025403784439*I|
    \begin{tcolorbox}[rounded corners,colback=white]
        \textbf{Note:} Here we use \textit{float} to consider the variables as real. We can also use \textit{int} for integer variables.
    \end{tcolorbox}
\subsection{Nested if else statement}
It is always legal in SageMath to nest \textit{if-else} statements, which means you can use one \textit{if} or \textit{if-else} statement inside another \textit{if} or \textit{if-else} statement(s). The syntax for a nested \textit{if-else} statement is as follows:
\begin{center}
\begin{BVerbatim}
    if condition:
       if condition:
          block of code
       else:
          block of code
    else:
       if condition:
          block of code
       else:
          block of code 
\end{BVerbatim}
\end{center}    
\end{document}

如何将环境内容带center至上一页?

相关内容