Technologies XML / XSL-FO / Référence / Attributs de XSL-FO / keep-with-previous
(Extrait de « XSL-FO ― Die Referenz » de Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Section de la recommandation : 7.20.5
Catégorie : 7.20 Propriétés de maintien et de saut
Description
Cet attribut interdit un saut de ligne, de colonne ou de page entre la zone marquée et la précédente. Il ne s’applique que si cette zone est définie sur l’axe Preceding-Sibling dans le document FO. Les composantes keep-with-previous.within-line, keep-with-previous.within-column et keep-with-previous.within-page précisent les types de saut. Définir keep-with-previous seul donne la même valeur aux trois composantes. Associé à une composante, keep-with-previous s’applique aux deux autres. Une priorité peut être attribuée en cas de réglage contraire, par exemple page-break-after dans la zone.
Valeurs
auto | Aucun maintien groupé n’est imposé ; les sauts sont automatiques. |
always | La zone marquée reste toujours solidaire de la zone précédente. |
Valeur numérique | Un nombre décimal positif ou un entier négatif définit une priorité. En cas de conflit, l’instruction ayant le nombre le plus élevé l’emporte. La recommandation du W3C autorise théoriquement les décimaux, arrondis à l’entier positif le plus proche. Les entiers négatifs sont aussi autorisés et seraient automatiquement ramenés à 1. |
Hérité : | oui |
Valeur par défaut : auto
Version XSL-FO : 1.0
Autorisé dans :
<fo:basic-link> , <fo:block> , <fo:block-container> , <fo:character> , <fo:external-graphic> , <fo:inline> , <fo:inline-container> , <fo:instream-foreign-object> , <fo:leader> , <fo:list-block> , <fo:list-item> , <fo:page-number> , <fo:page-number-citation> , <fo:page-number-citation-last> , <fo:scaling-value-citation> , <fo:table> , <fo:table-and-caption> et <fo:table-row>
Prise en charge :
Niveau de conformité | Antenna House | FOP | RenderX XEP | Altsoft XML2PDF | Compart DocBridge |
De base | O | P | O | O | O |
Exemple XSL-FO :
<fo:root font-size="10pt" line-height="1.2" font-family="Arial" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
0mm" page-height="148mm" page-width="105mm">
<fo:region-body margin="13mm 20mm 21mm
20mm" column-count="2"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:block text-align="justify" space-after="2em">
»Was ist mit mir geschehen?«, dachte er. Es war kein Traum. Sein Zimmer, ein
richtiges, nur etwas zu kleines Menschenzimmer, lag ruhig zwischen den vier
wohlbekannten Wänden.
</fo:block>
<fo:block text-align="justify" space-after="2em" keep-together.within-column="always">
Über dem Tisch,
auf dem eine auseinandergepackte Musterkollektion Es stellte eine Dame dar, die mit
einem Pelzhut und einer Pelzboa versehen.
</fo:block>
<fo:block font-size="20pt" font-weight="bold" space-after="2em" keep-with-previous="always">
Die Verwandlung
</fo:block>
<fo:block text-align="justify" space-after="2em" keep-together.within-column="always">
Es stellte eine
Dame dar, die mit einem Pelzhut und einer Pelzboa versehen.
</fo:block>
<fo:block font-size="20pt" font-weight="bold" space-after="2em" keep-with-previous="always">
Gregor Samsa
</fo:block>
<fo:block text-align="justify" space-after="2em" keep-together.within-column="always">
Es stellte eine
Dame dar, die mit einem Pelzhut und einer Pelzboa versehen, aufrecht dasaß und einen
schweren Pelzmuff, in dem ihr ganzer Unterarm verschwunden war, dem Beschauer
entgegenhob.
</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>Dans la sortie :
Page 2
Extrait de la recommandation du W3C :