Replies: 10 comments 34 replies
|
You miss the 'area' attribute with NextRow, so it works on the default area, not text. You have several possibilities here. Your XPath is syntactically correct, but it does not work as expected. For example You can do this within a Output/Text or around Output/Text, this is a matter of taste (and the grid). I prefer to make the grid (y size) the height of the main text font so I don't get ugly gaps with multiple Output commands (they always choose the free row). But in the example this is a bit difficult since the height of the heading is not 18pt. Here is a modified version of your code. Feel free to ask questions! <?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.xsd" type="application/xml" schematypens="http://http://www.w3.org/2001/XMLSchema"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- PAGE SIZE & TRACE OPTIONS -->
<SetGrid nx="20" height="18pt" />
<Trace grid="yes" textformat="no" objects="yes" />
<Pageformat width="8.5in" height="11in" />
<!-- FONTS -->
<LoadFontfile name="TeXGyreHeros-Regular" filename="texgyreheros-regular.otf" />
<LoadFontfile name="TeXGyreHeros-Bold" filename="texgyreheros-bold.otf" />
<LoadFontfile name="TeXGyreHeros-Italic" filename="texgyreheros-italic.otf" />
<LoadFontfile name="TeXGyreHeros-BoldItalic" filename="texgyreheros-bolditalic.otf" />
<DefineFontfamily fontsize="14" leading="18" name="paragraph">
<Regular fontface="TeXGyreHeros-Regular" />
<Italic fontface="TeXGyreHeros-Italic" />
<Bold fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="16" leading="18" name="subtitle">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="20" leading="24" name="title">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineTextformat name="firstpar" alignment="justified" indentation="0pt" column-padding-top=".125in" />
<DefineTextformat name="par" alignment="justified" indentation=".5in" column-padding-top=".125in" />
<DefineTextformat name="subtitle" margin-top="18pt"></DefineTextformat>
<DefineTextformat name="nohyphen" alignment="rightaligned" hyphenate="no" />
<!-- MASTER -->
<Pagetype name="body" test="true()">
<Margin inner=".5in" outer=".25in" top=".35in" bottom=".75in" />
<PositioningArea name="text">
<PositioningFrame width="{sd:number-of-columns() -5}" height="{sd:number-of-rows() -3}" row="2" column="4" />
</PositioningArea>
<AtPageCreation>
<PlaceObject row="1" column="1">
<Rule length="{sd:number-of-columns() -1}" rulewidth="1pt" color="black" direction="horizontal" />
</PlaceObject>
</AtPageCreation>
</Pagetype>
<Record element="data">
<ForAll select="section">
<Output area="text">
<Text>
<Paragraph fontfamily="title">
<Value select="title" />
</Paragraph>
</Text>
</Output>
<ForAll select="subsection">
<Output area="text">
<Text>
<Paragraph fontfamily="subtitle" textformat="subtitle">
<Value select="subtitle" />
</Paragraph>
<ForAll select="p">
<!-- firstpar on the first paragraph and par on all subsequent paragraphs -->
<Paragraph fontfamily="paragraph" textformat="{ if (position() = 1) then 'first' else ''}par">
<Value select="." />
</Paragraph>
</ForAll>
</Text>
</Output>
</ForAll>
</ForAll>
</Record>
</Layout> |
|
Hi Patrick, yes I have another question actually... Now I'd like that a special word is displayed with a different font inside a frame. This node is inside the <p>The website will be used as showcase of the <ps>PS</ps> and as a gate to the current ordering platform.</p>And this how I tried to modify you example using [...]
<ForAll select="p">
<!-- firstpar on the first paragraph and par on all subsequent paragraphs -->
<Paragraph fontfamily="paragraph" textformat="{ if (position() = 1) then 'first' else ''}par">
<Value select="." />
<Span>
<Fontface fontfamily="subtitle">
<Value select="ps" />
</Fontface>
</Span>
</Paragraph>
</ForAll>
[...]However the node rather than flushing within the text is duplicated and pushed at end as "another" paragraph: Not sure about I should address it... 😟 Thanks... 🙏 |
|
For simple instructions, the following works: <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Stylesheet>
ps {
color: red;
}
</Stylesheet>
<Record element="data">
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="."></Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout>data.xml <data>The quick brown fox <ps>jumps</ps> over the lazy dog.</data> |
|
CSS is really limited and only expanded on demand. So you know your task ;-) I have just tried <Stylesheet>
ps {
font-family: subtitle;
color: red;
}
</Stylesheet>which gave me errors. So don't expect too much. |
|
Here is the template, unfortunately I can't share the data this time... <?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.xsd" type="application/xml" schematypens="http://http://www.w3.org/2001/XMLSchema"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- PAGE SIZE & TRACE OPTIONS -->
<SetGrid nx="20" height="13pt" />
<Trace grid="yes" textformat="no" objects="no" />
<Pageformat width="8.5in" height="11in" />
<!-- FONTS -->
<LoadFontfile name="TeXGyreHeros-Regular" filename="texgyreheros-regular.otf" />
<LoadFontfile name="TeXGyreHeros-Bold" filename="texgyreheros-bold.otf" />
<LoadFontfile name="TeXGyreHeros-Italic" filename="texgyreheros-italic.otf" />
<LoadFontfile name="TeXGyreHeros-BoldItalic" filename="texgyreheros-bolditalic.otf" />
<DefineFontfamily fontsize="14" leading="18" name="paragraph">
<Regular fontface="TeXGyreHeros-Regular" />
<Italic fontface="TeXGyreHeros-Italic" />
<Bold fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="10" leading="12" name="intro">
<Regular fontface="TeXGyreHeros-Italic" />
</DefineFontfamily>
<DefineFontfamily fontsize="16" leading="18" name="subtitle">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="20" leading="24" name="title">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="10" leading="10" name="header">
<Regular fontface="TeXGyreHeros-Italic" />
</DefineFontfamily>
<DefineTextformat name="header" alignment="rightaligned" hyphenate="no" />
<DefineTextformat name="intro" alignment="leftaligned" column-padding-top=".125in" hyphenate="no" border-bottom="1pt" />
<DefineTextformat name="firstpar" alignment="justified" column-padding-top=".125in" />
<DefineTextformat name="par" alignment="justified" indentation=".25in" column-padding-top=".125in" />
<DefineTextformat name="title" alignment="leftaligned" break-below="no" />
<DefineTextformat name="subtitle" margin-bottom="0pt" margin-top="14pt" break-below="no" />
<!-- MASTER -->
<Pagetype name="body" test="true()">
<Margin inner=".5in" outer=".25in" top=".75in" bottom=".75in" />
<!-- TEXT AREA -->
<PositioningArea name="text">
<PositioningFrame width="{sd:number-of-columns() -3}" height="{sd:number-of-rows() -5}" row="2" column="3" />
</PositioningArea>
<AtPageCreation>
<PlaceObject row="-0.1" column="3">
<Rule length="{sd:number-of-columns() -3}" rulewidth="1pt" color="black" direction="horizontal" />
</PlaceObject>
<PlaceObject row="2" column="2">
<Rule length="{sd:number-of-rows() -5}" rulewidth="6pt" color="black" direction="vertical" />
</PlaceObject>
</AtPageCreation>
<AtPageShipout>
<PlaceObject row="-1" column="1">
<Textblock width="{sd:number-of-columns() -1}">
<Paragraph fontfamily="header" textformat="header">
<Value select="$title" />
</Paragraph>
</Textblock>
</PlaceObject>
</AtPageShipout>
</Pagetype>
<!-- STYLE -->
<!-- "LIST-STYLE-POSITION: OUTSIDE;"
IS NOT RECOGNIZED, C. -->
<Stylesheet>
ps {
color: red;
text-decoration: underline;
}
ul {
list-style: none;
list-style-position: outside;
padding-left: 0;
padding-bottom: 3pt;
}
ul li::before {
content: "•";
color: gray;
display: inline-block;
width: 2em;
}
ol {
list-style-type: upper-roman;
list-style-color: gray;
padding-left: 2em;
padding-bottom: 100pt;
}
ul li::before {
color: gray;
display: inline-block;
width: 2em;
}
ol li::before {
color: gray;
display: inline-block;
width: 2em;
}
</Stylesheet>
<!-- BODY -->
<Record element="data">
<ForAll select="section">
<SetVariable variable="title" select="title" />
<SetVariable variable="title-box" select="sd:current-row('text'))" />
<PlaceObject row="{$title-box}" column="1">
<Box width="1.5" height="5" background-color="white" />
</PlaceObject>
<Output area="text">
<Text>
<Paragraph fontfamily="title">
<Value select="title" />
</Paragraph>
</Text>
</Output>
<Output area="text">
<Text>
<Paragraph fontfamily="intro" textformat="intro" padding-right="4">
<Value select="intro" />
</Paragraph>
</Text>
</Output>
<ForAll select="subsection">
<SetVariable variable="subtitle-box" select="sd:current-row('text') + 2.7" />
<!-- I WOULD CREATE A LEFT BORDER FOR EACH PARAGRAPH BUT I COULDN'T
FIND HOW, THUS I AM PLACING A WHITE BOX THE SIMULATE A BREAK
POINT; THE LINE IS DESIGNED BY THE MASTER, C. -->
<PlaceObject row="{sd:current-row('text')}" column="1" allocate="no" clipatmargin="yes">
<Box width="2" height="1" background-color="white" />
</PlaceObject>
<!-- THIS DRAWS A CIRCLE NEXT TO THE SUBTITLE;
HOWEVER WHEN "BREAK_BELOW" IS ACTIVE IS
TWEAKING THE POSITION SO THE CIRCLE CAN'T
FOLLOW THE SUBTITLE IF THE LATTER SLIPS ONTO
ANOTHER PAGE, C.-->
<PlaceObject row="{$subtitle-box}" column="2">
<Circle radiusx="10pt" radiusy="10pt" />
</PlaceObject>
<!-- IMAGE IS READ HERE -->
<Message select="concat('img: ', img/@file)" />
<Output area="text">
<Text>
<Paragraph fontfamily="subtitle" textformat="subtitle">
<Value select="subtitle" />
</Paragraph>
<ForAll select="p">
<!-- firstpar on the first paragraph and par on all subsequent paragraphs -->
<Paragraph fontfamily="paragraph" textformat="{ if (position() = 1) then 'first' else ''}par">
<Value select="." />
</Paragraph>
</ForAll>
</Text>
</Output>
<!-- [PERSONA NOTE]
IMAGES DON'T FLUSH ACROSS THE TEXT (<p></p>)
MUST BE A SEPARATED SUBSECTION -->
<ForAll select="img">
<PlaceObject area="text">
<Image file="{@file}" margin-top=".125in" margin-bottom=".125in" />
</PlaceObject>
</ForAll>
</ForAll>
<NextRow rows="1.5" area="text" />
</ForAll>
</Record>
</Layout> |
|
You can't do this with your approach. The publisher doesn't support this at the moment. You want automatic (break-below=no) text flow, but need manual object placement (the circles and lines). Therefore you need to do all placements by yourself. To get a page break at the purple section, you need to put see which line you are in and insert a page break if for example you have only 6 lines or so left. (Which is not a perfect solution, but it might work). With this, you can place the circles accordingly. Yellow: what do you mean with inside and outside CSS? Padding and margin? I will need to take a look at this. |
|
Hi Patrick, This is 99,9% done, I was able to fix all my issues but two that I can't figure out what I am doing wrong, in the code are marked as To recap:
Lastly, I'd like to release this code as opensource on my spaces, which license do you recommend for Publisher XML layout files? Thanks... 🙏 <?xml version="1.0" encoding="UTF-8"?>
<!--
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="C:\Program Files\speedata-publisher\share\schema\layoutschema-en.xsd" type="application/xml" schematypens="http://http://www.w3.org/2001/XMLSchema"?>
-->
<?xml-model href="/usr/share/speedata-publisher/schema/layoutschema-en.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="/usr/share/speedata-publisher/schema/layoutschema-en.xsd" type="application/xml" schematypens="http://http://www.w3.org/2001/XMLSchema"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en" xmlns:sd="urn:speedata:2009/publisher/functions/en" xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- PAGE SIZE & TRACE OPTIONS -->
<SetGrid nx="20" height="13pt" />
<Trace grid="no" textformat="no" objects="no" gridlocation="foreground" />
<Pageformat width="8.5in" height="11in" />
<!-- FONTS -->
<LoadFontfile name="TeXGyreHeros-Regular" filename="texgyreheros-regular.otf" />
<LoadFontfile name="TeXGyreHeros-Bold" filename="texgyreheros-bold.otf" />
<LoadFontfile name="TeXGyreHeros-Italic" filename="texgyreheros-italic.otf" />
<LoadFontfile name="TeXGyreHeros-BoldItalic" filename="texgyreheros-bolditalic.otf" />
<DefineFontfamily fontsize="14" leading="18" name="paragraph">
<Regular fontface="TeXGyreHeros-Regular" />
<Italic fontface="TeXGyreHeros-Italic" />
<Bold fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="12" leading="14" name="para-toc">
<Regular fontface="TeXGyreHeros-Regular" />
<Italic fontface="TeXGyreHeros-Italic" />
<Bold fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="10" leading="12" name="intro">
<Regular fontface="TeXGyreHeros-Italic" />
</DefineFontfamily>
<DefineFontfamily fontsize="16" leading="18" name="subtitle">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="20" leading="24" name="title">
<Regular fontface="TeXGyreHeros-Bold" />
</DefineFontfamily>
<DefineFontfamily fontsize="10" leading="10" name="header">
<Regular fontface="TeXGyreHeros-Italic" />
</DefineFontfamily>
<DefineTextformat name="header" alignment="centered" hyphenate="no" />
<DefineTextformat name="intro" alignment="leftaligned" column-padding-top=".125in" hyphenate="no" border-bottom="1pt" />
<DefineTextformat name="firstpar" alignment="justified" column-padding-top=".125in" />
<DefineTextformat name="par" alignment="justified" indentation=".25in" column-padding-top=".125in" />
<DefineTextformat name="title" alignment="leftaligned" break-below="no" />
<DefineTextformat name="cover" alignment="centered" break-below="no" hyphenate="no" />
<DefineTextformat name="subtitle" margin-bottom="0pt" margin-top="14pt" break-below="yes" />
<!-- MASTER -->
<!-- MASTER: COVER -->
<Pagetype name="cover" test="sd:current-page() = 1">
<Margin left="1in" right="1in" top="2in" bottom="3.5in" />
<AtPageCreation>
<PlaceObject row="1" column="2">
<Frame framecolor="black" rulewidth="2pt">
<Box width="{sd:number-of-columns() - 2}" height="10" background-color="white" />
</Frame>
</PlaceObject>
<PlaceObject row="2" column="1">
<Box width="{sd:number-of-columns()}" height="8" background-color="white" />
</PlaceObject>
<PlaceObject row="25">
<Table stretch="max">
<Tr align="center">
<Td>
<!-- WRAPPED CONTENT -->
<Table padding="5pt" stretch="no" fontfamily="paragraph" width="{sd:number-of-columns() - 6}">
<Columns>
<Column width="1*" />
<Column width="1*" />
</Columns>
<Tr align="center">
<Td>
<Paragraph>
<Value>Authors:</Value>
<B>
<Value>Author 1, Author 2</Value>
</B>
</Paragraph>
</Td>
<Td>
<Paragraph>
<Value>Revision:</Value>
<B>
<Value>May 5, 2025</Value>
</B>
</Paragraph>
</Td>
</Tr>
<Tr align="center">
<Td colspan="2">
<Paragraph>
<B>
<Value>Your department... </Value>
</B>
</Paragraph>
</Td>
</Tr>
<Tr align="center">
<Td colspan="2" padding-top="15pt">
<Image file="logo.pdf" maxwidth="2in" />
</Td>
</Tr>
</Table>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageCreation>
</Pagetype>
<!-- MASTER: BODY -->
<Pagetype name="body" test="sd:current-page() > 1">
<Margin inner=".5in" outer=".25in" top=".75in" bottom=".75in" />
<!-- TEXT AREA -->
<PositioningArea name="text">
<PositioningFrame width="{sd:number-of-columns() -3}" height="{sd:number-of-rows() -5}" row="2" column="3" />
</PositioningArea>
<AtPageCreation>
<SetVariable variable="title-header" select="Table of Content" />
<PlaceObject row="-0.1" column="3">
<Rule length="{sd:number-of-columns() -3}" rulewidth="1pt" color="black" direction="horizontal" />
</PlaceObject>
<PlaceObject row="2" column="2">
<Rule length="{sd:number-of-rows() -5}" rulewidth="6pt" color="black" direction="vertical" />
</PlaceObject>
</AtPageCreation>
<AtPageShipout>
<PlaceObject row="-1" column="3">
<Textblock width="{sd:number-of-columns() -3}">
<Paragraph fontfamily="header" textformat="header">
<Switch>
<Case test="sd:current-page() = 2">
<Value>Table of Content</Value>
</Case>
<!-- ISSUE: IS NOT READING $title-header FOR SOME PAGES -->
<Case test="string-length($title-header) = 0">
<Message select="concat('T2: ', $title-header)" />
<Copy-of select="$title-header" />
<Value>*** I am not reading: $title-header ***</Value>
</Case>
<Otherwise>
<Value select="concat($title-count,'. ',$title-header)" />
</Otherwise>
</Switch>
</Paragraph>
</Textblock>
</PlaceObject>
<PlaceObject column="3" row="{sd:number-of-rows() -1}">
<Table border-collapse="collapse" width="{sd:number-of-columns() - 3}" stretch="max">
<Tr minheight="20pt" align="center">
<Td>
<Image width="1in" file="logo.pdf" />
</Td>
</Tr>
<Tr align="center">
<Td padding-top="10pt">
<Paragraph fontfamily="intro" color="black">
<Switch>
<Case test="sd:current-page() <= 2.5">
<Message select="'don't print page number'" />
</Case>
<Otherwise>
<Value>[ </Value>
<Value select="sd:visible-pagenumber(sd:current-page())" />
<Value> ]</Value>
</Otherwise>
</Switch>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageShipout>
</Pagetype>
<!-- STYLE -->
<Stylesheet>
ps {
color: gray;
text-decoration: underline;
}
ul {
list-style: none;
list-style-position: outside;
padding-left: 0;
padding-bottom: 3pt;
}
ul li::before {
content: "•";
color: gray;
display: inline-block;
width: 2em;
}
ol {
list-style-type: upper-roman;
list-style-color: gray;
padding-left: 2em;
padding-bottom: 100pt;
}
ul li::before {
color: gray;
display: inline-block;
width: 2em;
}
ol li::before {
color: gray;
display: inline-block;
width: 2em;
}
</Stylesheet>
<DefineMatter name="frontmatter" label="lowercase-romannumeral" />
<DefineMatter name="bodymatter" label="decimal" resetbefore="yes" />
<!-- COVER -->
<Record element="data">
<ProcessNode select="*" />
<SetVariable variable="title-header" select="title" />
<Message select="concat('T3: ', $title-header)" />
<ClearPage pagetype="cover" />
<PlaceObject row="4" column="2">
<Textblock width="{sd:number-of-columns() - 2}">
<Paragraph fontfamily="title" textformat="cover">
<Value select="Cover/Title" />
</Paragraph>
<Paragraph fontfamily="intro" textformat="cover">
<Value select="Cover/Headline" />
</Paragraph>
</Textblock>
</PlaceObject>
<ClearPage matter="frontmatter" />
<!-- TABLE OF CONTENT -->
<SetVariable variable="toc-title-count" select="1" />
<PlaceObject area="text">
<Table padding="4pt" border-collapse="separate" width="{sd:number-of-columns() - 3}" stretch="max">
<Tr minheight="20pt">
<Td>
<Paragraph fontfamily="title" color="black">
<Value>Table of Content</Value>
</Paragraph>
</Td>
</Tr>
<ForAll select="section">
<Tr top-distance="10pt">
<Td>
<Paragraph fontfamily="para-toc" color="black">
<B>
<Value select="concat($toc-title-count,'. ')" />
<Value select="title" />
<HSpace leader=" . " />
<Value select="sd:pagenumber(title)" />
</B>
</Paragraph>
</Td>
</Tr>
<SetVariable variable="toc-subtitle-count" select="1" />
<ForAll select="subsection">
<Switch>
<Case test="not(empty(subtitle))">
<Tr>
<Td padding-left="24pt">
<Paragraph fontfamily="para-toc" color="black">
<Value select="concat($toc-title-count,'.',$toc-subtitle-count,' ')" />
<Value select="subtitle" />
<HSpace leader=" . " />
<Value select="sd:pagenumber(subtitle)" />
</Paragraph>
</Td>
</Tr>
<SetVariable variable="toc-subtitle-count" select="$toc-subtitle-count + 1" />
</Case>
<Otherwise>
<Message select="'Subtitle missing as expected'" />
</Otherwise>
</Switch>
</ForAll>
<SetVariable variable="toc-title-count" select="$toc-title-count + 1" />
</ForAll>
</Table>
</PlaceObject>
<!-- ISSUE: IT SHOULD LET STARTING THE PAGE NUMBER WITH 1 INSTEAD OF iii -->
<ClearPage matter="bodymatter" />
<!-- BODY -->
<!-- add a number for each section -->
<SetVariable variable="title-count" select="1" />
<ForAll select="section">
<SetVariable variable="title-header" select="title" />
<SetVariable variable="title-box" select="sd:current-row('text')" />
<PlaceObject row="{$title-box}" column="1">
<Box width="1.5" height="5" background-color="white" />
</PlaceObject>
<Output area="text">
<Text>
<Paragraph fontfamily="title">
<Value select="concat($title-count,'. ',title)" />
</Paragraph>
<Action>
<Mark select="title" />
</Action>
</Text>
</Output>
<Output area="text">
<Text>
<Paragraph fontfamily="intro" textformat="intro" padding-right="4">
<Value select="intro" />
</Paragraph>
</Text>
</Output>
<SetVariable variable="subtitle-count" select="1" />
<ForAll select="subsection">
<SetVariable variable="subtitle-box" select="sd:current-row('text') + 2.7" />
<Switch>
<Case test="@nocircle = 'false'">
<PlaceObject row="{sd:current-row('text')}" column="1" allocate="no" clipatmargin="yes">
<Box width="2" height="1" background-color="white" />
</PlaceObject>
<PlaceObject row="{$subtitle-box}" column="2">
<Circle radiusx="10pt" radiusy="10pt" />
</PlaceObject>
</Case>
<Case test="@nocircle = 'true'">
<Message select="concat('TEST ', @nocircle, ': Will **not** draw any graphics')" />
</Case>
</Switch>
<Output area="text">
<Text>
<ForAll select="subtitle">
<Paragraph fontfamily="subtitle" textformat="subtitle">
<Action>
<Mark select="." />
</Action>
<Value select="concat($title-count,'.',$subtitle-count,' ',.)" />
</Paragraph>
</ForAll>
<ForAll select="p">
<!-- firstpar on the first paragraph and par on all subsequent paragraphs -->
<Paragraph fontfamily="paragraph" textformat="{ if (position() = 1) then 'first' else ''}par">
<Value select="." />
</Paragraph>
</ForAll>
</Text>
</Output>
<Switch>
<Case test="not(empty(subtitle))">
<SetVariable variable="subtitle-count" select="$subtitle-count + 1" />
</Case>
</Switch>
<!-- [PERSONAL NOTE]
IMAGES DON'T FLUSH ACROSS THE TEXT (<p></p>)
MUST BE A SEPARATED SUBSECTION -->
<ForAll select="img">
<PlaceObject area="text">
<Table stretch="max" padding="15pt">
<Tr minheight="15pt" />
<Tablerule break-below="no" rulewidth="2pt" color="gray" />
<Tr align="center">
<Td>
<Image file="{@file}" margin-top=".125in" margin-bottom=".125in" />
<Paragraph>
<Value select="@caption" />
</Paragraph>
</Td>
</Tr>
<Tablerule break-below="no" rulewidth="2pt" />
<Tr minheight="15pt" />
</Table>
</PlaceObject>
</ForAll>
<ForAll select="sub-break">
<Switch>
<Case test="@break = 'yes'">
<ClearPage />
</Case>
</Switch>
</ForAll>
</ForAll>
<!-- increase by one the number of the section -->
<SetVariable variable="title-count" select="$title-count + 1" />
<NextRow rows="1.5" area="text" />
<Switch>
<Case test="pagebreak/@break = 'yes'">
<ClearPage />
</Case>
</Switch>
</ForAll>
</Record>
</Layout> |
|
Hi Patrick I cleaned up the layout and the fake data, I am going to publish all in the following posts. Here is the fake logo I used for the dummy content, I am sharing it as svg to convert in PDF, this svg code is released as |
|
This is very cool. May I put this into the examples repository (with a readme containing the link to this discussion, your GitHub user name and the license information)? |
|
See https://github.com/speedata/examples/tree/master/user/cicorione If you want any changes, just tell me. Thank you very much! |


Uh oh!
There was an error while loading. Please reload this page.
Hi Patrick,
I am doing a presentation with Publisher, it is part of my demo, however I believe that I really didn't get how to work with streaming text. 😖
The text doesn't flush as it is in the data: the titles are all together; the paragraphs became a big one block. 🤦♂️
I'd like also to understand how can I separate paragraphs to each other since I can't control the cursor into the the
outputtag cause thenexrowcommand is totally ignored.Any recommendation or paragraph to read is welcomed, I already checked into the examples is there where I noticed you are using the
outputcommand, perhaps I need to skim across them again and again until I get it...Meanwhile this the basic layout I designed:
This the fake data...
All reactions