Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 25 13:54

    pgundlach on develop

    Test for object height calculat… Regenerate qa PDFs The new --s… Version 3.9.5 (compare)

  • Feb 25 07:40
    pgundlach closed #246
  • Feb 25 07:40

    pgundlach on develop

    Fix off by one error calculatin… (compare)

  • Feb 24 19:18
    pgundlach edited #246
  • Feb 24 19:18
    pgundlach milestoned #246
  • Feb 24 19:18
    pgundlach assigned #246
  • Feb 24 19:18
    pgundlach labeled #246
  • Feb 24 19:18
    pgundlach opened #246
  • Feb 24 13:29
    pgundlach closed #245
  • Feb 24 13:29

    pgundlach on develop

    Add parameters to xslt call Pl… B: normalize-space() does not h… D: page x of y: code de->en (compare)

  • Feb 17 14:34
    pgundlach milestoned #245
  • Feb 17 14:34
    pgundlach labeled #245
  • Feb 17 14:34
    pgundlach assigned #245
  • Feb 17 14:34
    pgundlach opened #245
  • Feb 15 17:42
    pgundlach milestoned #244
  • Feb 15 17:42
    pgundlach assigned #244
  • Feb 15 17:42
    pgundlach labeled #244
  • Feb 15 17:42
    pgundlach opened #244
  • Feb 15 09:08

    pgundlach on master

    Parameters for the json2xml tra… (compare)

  • Feb 14 16:22

    pgundlach on develop

    Additional way to call run_saxo… Version 3.9.4 (compare)

Patrick Gundlach
@pgundlach
No news for Atom yet. I belive that the underlying package https://atom.io/packages/linter-autocomplete-jing is broken, as other packages based on it don't work either
Patrick Gundlach
@pgundlach
@/all Good news for Atom-users. When you update the linter-autocomplete-jing package, autocompletion and linting works again.
iclukas
@iclukas
@pgundlach Happy New Year! Could you comment on #184, please? I think I could fix this easily.
Patrick Gundlach
@pgundlach
BTW: next week is XML Prague. Official site: http://www.xmlprague.cz/ and my blog entry: https://blog.speedata.de/2019/01/30/xmlprague2019/ - There will be a speedata session on Thursday
Patrick Gundlach
@pgundlach
New stable version (3.6.0) available for download https://download.speedata.de/
iclukas
@iclukas
@pgundlach That’s great, a lot of bugfixes! It looks like the docs are outdated, though. Also, I hope to find some time to contribute again soon.
iclukas
@iclukas
@pgundlach Hi Peter, have there been any changes in the table code? I have trouble updating to the latest release, as it crashes on a (admittedly messed up) table. I’m still trying to figure out what exactly is wrong with table. The crash occurs on line 3164 of publisher.lua: attempt to index local 'tmp' (a nil value)
Patrick Gundlach
@pgundlach
@iclukas Which version have you used before? Are you using rotation in table cells? This happens with text that is right aligned, so I am just guessing.
iclukas
@iclukas
It’s 3.5.9 -> 3.6.1 Yes, there are right-aligned columns in the table, but no rotation. The layout is rather complicated, so it’s not easy to create a test file. Sorry for calling you Peter btw., autocorrect was here...
Michael Dovgal
@michaelDovgal

Good day @pgundlach
Have a quick question about URL object as I'm kind of struggling with docs

Is it possible to make something like <a href='url'> text </a> with URL object?

Patrick Gundlach
@pgundlach
@michaelDovgal Hi. Does this help? https://doc.speedata.de/publisher/en/commands-en/a.html
Michael Dovgal
@michaelDovgal
@pgundlach oh... yes, thank you! somehow I missed it.
and thank you for as usual a quick answer. appreciate it!
Joerg
@jorg.l_gitlab
Hallo Patrick,
als LaTeX-Fan habe ich speedata entdeckt, und ich bin nach einigen kurzen Versuchen begeistert. Aber leider ist sogleich eine erste Frage aufgetreten, die ich im Handbuch nicht erklärt fand.
Es gibt die Funktion sd:format-string, die mit den printf-Formatierungen kompatibel ist. Ich möchte damit nun Euro-Beträge formatieren.
<Value select="sd:format-string(Betrag,'%.2f' €)"/>
Leider erhalte ich als Dezimaltrenner immer den Punkt. Wenn ich die deutsche Schreibweise mit Komma wollte, müsste ich z. B. an LuaTeX setlocale("de_DE") übergeben. Wie mache ich das in speedata?
Patrick Gundlach
@pgundlach
Hallo @jorg.l_gitlab - Locales werden ignoriert. Es gibt die Funktion sd:format-number(), mit der Zahlen formatiert werden können. Hilft das? (https://doc.speedata.de/publisher/de/xpathfunktionen/)
Joerg
@jorg.l_gitlab
Das ging aber schnell :-)
sd:format-number() habe ich schon probiert. Der Code sieht dann etwas „umständlich“ aus:
<Value select="sd:format-number(sd:format-string(Betrag,'%.2f'),'.',',')"/>
Ich wollte halt alles mit den printf-Formatierungen erledigen.
Patrick Gundlach
@pgundlach
@jorg.l_gitlab Das ist richtig so. Du hast recht, dass das etwas umständlich ist. Ich möchte nur keine Locale-Abhängigkeit, die immer schwer zu debuggen ist.
Joerg
@jorg.l_gitlab

Naja, damit kann ich gerade noch so leben.
Auch eine Locale-Abhängigkeit haben die Datumsfunktionen aus Lua (os.date). Ist daran gedacht, diese (zumindest in der engl. Variante) mit den entsprechenden Formatierungsparametern zu unterstützen?

Noch eine andere Frage: Im Beispiel „runningsum“ ist die Ausgabe einer Summe in der Fußzeile einer Tabelle beschrieben. Die fertigen Summen werden aber alle direkt aus der Datei data.xml geholt. Gibt es eine einfache Möglichkeit, die Summe direkt im zu erstellenden Dokument zu berechnen?

Patrick Gundlach
@pgundlach

@jorg.l_gitlab Ich habe derzeit keine Pläne, os.date etc. zu unterstützten. Eher das, was es bei XPath in dieser Richtung gibt, wobei ich gerade da keinen Überblick habe.

Zu runningsum: klar, kann man die Daten auch dynamisch berechnen. Du musst nur die Variable _last_tr_data zu jeder Zeile neu setzen.

raymondns
@raymondns
Hello, is there an easy way to handle date formatting? For example, the date 2019-09-20 (YYYY-MM-DD) can this be converted to 09/20/2019 (MM/DD/YYYY)?
Patrick Gundlach
@pgundlach
@raymondns actually there is none. I usually do that in an extra step before layout (with xslt). But you could add an issue to the bug tracker.
You could tokenize the string and re-build it.
Mihail-Cosmin Munteanu
@MihailCosmin
Hello, is there any way of knowing the final number of pages the PDF will have from the start of the printing process?
I need to write the page numbers as "Page 1 of 10"
iclukas
@iclukas
No, how could you? There’s a description in the docs using two passes. https://doc.speedata.de/publisher/de/kochbuch/seitexvony/
But! You can use <SavePages> to create virtual pages. You can count them with sd:count-saved-pages and write Page X of Y on the virtual pages before putting them in your final pdf with <InsertPages>.
Mihail-Cosmin Munteanu
@MihailCosmin

Thanks, that works, sorry I missed it.
On another topic, is there any way to deal with situations like the below one?
I've been searching around but can't find any starting point at least.

<para> Please refer to the <link address="page12">Chapter 1</link> for a brief history of the <tool>hammer</tool> and more details about its usage. </para>

As you can see <para> element has also text and XML child elements alternating.
For the <link> I would like to create a link using <A>
For the <tool> I would like to create a marker.
Is there any way to achieve this in speedata?

Patrick Gundlach
@pgundlach
@MihailCosmin There is currently no way that I am aware of to handle this. You need to transform it into something like
<data>
    <para>
        <val>Please refer to the </val>
        <link address="page12">Chapter 1</link>
        <val>for a brief history of the </val>
        <tool>hammer</tool>
        <val>and more details about its usage. </val>
    </para>
</data>
... and build the structure of a href=... and marker yourself
Mihail-Cosmin Munteanu
@MihailCosmin

@pgundlach That sounds quite complex, these were just some examples, but there are many many more situations, this would mean we should create a pre-processing program to adjust the XML to these requirements.

Something else I noticed, regarding the internal links to a PDF page, the attribute "link" of the <A> element can only be text.
It would be better if this attribute would allow X-path expressions. Because at the moment the link destination has to be hardcoded in the layout. In many cases you can generate the link and the destination with variables.

Patrick Gundlach
@pgundlach

@MihailCosmin For the first issue: I usually use a preprocessing stage when I get input from some source that I can't control. The publisher comes with Saxon 9 and you can call it with the lua script.

The second issue is quite easy to solve: include your xpath into curly braces, such as link="{ xpath expression }"

Mihail-Cosmin Munteanu
@MihailCosmin
I already had used the curly braces in other places... didn't realize what was their purpose :)
Thanks
Patrick Gundlach
@pgundlach
Usually test=... and select=... take XPath expressions, everything else not.
Mihail-Cosmin Munteanu
@MihailCosmin
Hello, Is there any way to create change bars on the left or right side of paragraphs?
https://help.adobe.com/en_US/framemaker/2019/using/using-framemaker-2019/frm_reviewandcollaborate_re-change-bars.html
Patrick Gundlach
@pgundlach

@MihailCosmin Good question. Depending on how you output paragraphs / text it could be possible now...

If you output a paragraph one by one with PlaceObject or Output, you can ask for the current frame and line number and draw the rules yourself. If you place multiple objects in one go, you are out of luck in the current version.

Mihail-Cosmin Munteanu
@MihailCosmin
For PlaceObject I managed to do it like this, but <Output> can have only <Text> as child, how can I insert <Rule> inside ?
Am I missing something ?
Patrick Gundlach
@pgundlach
@MihailCosmin No, you are not missing anything, Output has only Text as the child. You would have to save the current position and calculate the change bars yourself (sd:current-row('areaname'))
Mihail-Cosmin Munteanu
@MihailCosmin

This worked well for text paragraphs, but for table rows it won't work, right? For each row I get the row the whole table was output.
I think this is what you meant with "If you place multiple objects in one go, you are out of luck in the current version."

Will there be a solution in the next version?

Patrick Gundlach
@pgundlach
@MihailCosmin for table rows this will not do, right. You can only get the boundaries for the whole table.
I don't know how a solution(interface) would look like.
Mihail-Cosmin Munteanu
@MihailCosmin

Found a workaround for the moment. Works quite well.
For each table row I add first an extra <td> with no borders that has and empty paragraph.
I check if the row (from the data) should have a change bar, then output the extra <td> with a border on the left side.

The change bar is a bit more inside the page than the text ones, but it's satisfactory for now.

Mihail-Cosmin Munteanu
@MihailCosmin
Hello,
I think there is an issue with the hyphenate attribute of the DefineTextFormat.
I have it set to hyphenate ="no", yet wherever I have text like "20-12-2019" it can happen that I have 20- on one line and the rest -12-2019 on the next line.
I have also tried to set hyphenate ="yes" and hyphenchar ="ß" yet it keeps splitting anywhere I have dashes.
Is there anyway I can set it up so it won't split where I have dashes in different rows?
Patrick Gundlach
@pgundlach
Have you tried <Nobreak>?