Re: package mdframed –> boxes su due pagine

#78215
franen
Partecipante
    Up
    0
    Down
    ::


    Mi piace lavorare con esempi minimi compilabili…
    `\documentclass{book}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{mdframed}
    \usepackage{lipsum}
    \usepackage{multicol}
    \usepackage{needspace}
    \usepackage{xcolor}
    \newcounter{citazione}
    \newenvironment{citazione}
    {\needspace{3\baselineskip}
    \begin{mdframed}[linewidth=2,
    backgroundcolor=black!15,
    skipbelow=\baselineskip,
    skipabove=\baselineskip, everyline = true]
    \refstepcounter{citazione}
    }
    {\par\noindent\hrulefill\par\end{mdframed}}
    \begin{document}
    \lipsum[1-4]
    %\needspace{3\baselineskip}
    \begin{citazione}
    \hrulefill~ Niklas (mayor)~\hrulefill\par
    \begin{multicols}{2}
    \noindent
    \textit{Ich habe nicht gemeint, dass es jetzt schon soweit ist.
    Dazu praktiziert man das [das politische Gewicht] in Moment auch noch zu wenig,
    aber ich glaube es nicht, dass wir so in dieser Form wie es jetzt besteht überhaupt kein politisches Gewicht haben. [\dots]
    Wir, in kleinste Erfahrung [von sechs Gemeinden, die eine Region aufgebaut haben], haben auch unser politisches Gewicht
    in die Waagschale werfen können. Darum wäre verfänglich zu sagen, dass eine Allianz von mehr als 200 Gemeinden kein politisches Gewicht hätten, das glaube ich nicht. (Niklas, Bürgermeister)}
    \columnbreak

    \noindent
    I did not say that it is already like that. At the moment, we still exert [this political weight] too little,
    but I do not think that in this form as it is now we do not have any political weight. [\dots] Our small experience
    [of six municipalities which joined in a regional administration] shows that we could already increase our political weight thanks to that.
    For that reason, I do not think that an alliance composed by more than 200 municipalities does not have any political weight. (Niklas, mayor)
    \end{multicols}
    \end{citazione}
    \end{document}`
    Qui \needspace non fa nulla (né se messo nella definizione dell’ambiente, né se messo prima di aprire l’ambiente). Ma non mi saltano fuori numeri indesiderati.
    Come diceva Enrico è questione di sfortuna, credo che la soluzione migliore sia la modifica manuale: aggiungi una riga al testo in modo che tutta al cornice cada in una nuova pagina, metti un \pagebreak… insomma, quanto descritto nel capitolo sulla revisione finale nell’Arte. Tutto questo solo alla fine di tutto, quando sarai certa di non dover inserire altro testo, tabelle e figure che potrebbero stravolgere l’impaginazione.

    Fran

    Go to top