CCALI / a2jdat

This repo hosts the distributable production version of the A2J Document Assembly Tool (DAT). The document assembly tool is an optional piece of software used for producing pdf documents at the end of A2J Author Guided Interviews.
https://www.a2jauthor.org
Other
3 stars 1 forks source link

Extra blank space rendering after variable inserted when punctuation afterwards in DAT text templates #117

Closed JessicaFrank closed 2 years ago

JessicaFrank commented 2 years ago

When you insert a variable and there is punctuation immediately after it, the DAT is inserting an additional space.

This shouldn't be there. Here's an example.

image

First arrow shows variable inserted and no author additional space added. So sentence in editor looks like

My name is [variable]and I work on A2J Author.

A2J inserts the space after the variable. Authors can work around this by not putting a space into their sentence. However, when the variable is at the end of the sentence and punctuation follows the variable, the space is inserted and there isn't a work around for authors.

The second arrow in the above screenshot shows the sentence that was typed like:

My name is [variable].

It renders as My name is Jessica .

That looks bad and we've had author complaints about it.

Here's a text GI and text template. My Interview (4-12-2022).zip

JessicaFrank commented 1 year ago

This fix causes odd spacing when the variable is the first thing in a sentence. The left negative margin makes the variable sit too far to the left and is noticeable in the assembled document.

image

So the final fix will be to have a negative margin on the right side of the variable and the standard margin on the left. This doesn't solve the underlying issue of why variables have problems with spacing, but it "splits the baby" by leaving variables that are at the beginning of sentences looking normal and variables in the middle of sentences will appear more normal as well (especially the punctuation issue noted above). There will still be a slightly larger than normal spacing to the left of a variable in the middle of a sentence.