How to add a blank caption for a figure in AsciiDoc - asciidoc

I have an AsciiDoc page which has a number of images. I am converting this into html via antora.
On my AsciiDoc page, some of the images have a caption and some do not.
For the images with a caption, the first one is named "Figure 1. Some interesting caption", then the second one is named "Figure 2. Some fascinating caption" and so on. In fact, the "Figure 1", "Figure 2" text is added automatically by Antora. In AsciiDoc itself, the markup is as follows:
.Some interesting caption;
image::images/image1.png
.Some fascinating caption;
image::images/image2.png
However, now I have a third image which has no caption to display. I would like this image to simply read "Figure 3". However, I do not know how to do this. The only thing I could come up with is to put some character after the "." symbol just above it (I chose a semi-colon), as follows:
.;
image::images/image3.png
This produces "Figure 3;" once converted into html.
It's better than nothing, but I would like to be able to use, for example, a whitespace character, instead of the semi-colon, so that I could simply produce text that reads "Figure 3 " (with an invisible whitespace character that nobody can see). Unfortunately, if I try to do that, the whitespace is ignored and I just see the '.' character in the generated html.

You can use an attribute for the non-breaking space: {nbsp}
For example:
.Some interesting caption;
image::images/image1.png[]
.Some fascinating caption;
image::images/image2.png[]
.{nbsp}
image::images/image3.png[]
Note that I added square brackets to each image macro invocation, because those lines are just text with them. And, there doesn't need to be a blank line between the caption and its associated image.

Related

How to center text in ZPL language?

I have the following code which I print a label with the information of a product. But I have the problem that the product name is not centered. It happens to me that if the name is very long, it goes outside the limits of the label and does not appear. What I want is for the name to start from the center and expand along the label and if it exceeds the limits to continue writing on the next line.
I would appreciate any help
^XA
^CF0,30
^FO150,30^FDNombre del Producto^FS
^CF0,60
^FO200,90^FDPrecio^FS
^FX Third section with bar code.
^BY2,2,50
^FO170,180^BC^FD1234789^FS
^XZ
NOTE: This only works if you are using dots as the unit of measurements (this is the default but specified as ^MUd in the example below). If mm is used (^MUm) the center-thingy does NOT work properly (tested on labelary.com and Zebra S4m).
Use ^FB to define a Field Block. From the manual:
The ^FB command allows you to print text into a defined block type
format. This command formats an ^FD or ^SN string into a block of text
using the origin, font, and rotation specified for the text string.
The ^FB command also contains an automatic word-wrap function.
You could view this example at labelary.com or tryit out yourself:
^XA
^MUd
^LH10,10
^CF0,50
^GB500,500,10^FS
^FO0,50 ^FDNormal^FS
^FO0,150 ^FB500,,,L ^FDLeft^FS
^FO0,250 ^FB500,,,C ^FDCenter^FS
^FO0,350 ^FB500,,,R ^FDRight^FS
^XZ

Spacing issue between letters while converting Word to PDF on Windows

I am having a word document(docx) of urdu text in Jameel Noori Nastaleeq Font. And in word its showing 10 pages file but after exporting into PDF its showing 11 pages pdf file becuase every letter contains extra space.
Can anyone please provide information ?
Edited:
Please download the file from
File
It has to do with the XML formatting of Word. When any text is pasted into Word (while the font is Jameel Noori Nastaleeq) Word places extra formatting in between the words. That formatting shows fine in Word however in when the file is converted into PDF the extra space becomes visible. When the text is merely typed in Word, the formatting is applied to entire paragraphs rather than words. That is why a typed document doesn't contain the extra spaces.

ZPL data printing at label

I have to print data from DATA_FIELD that can contain between 5 to 50 characters
and label can fit just 20 letters
due i have right to left spelling words i have to print always top 20 letters from right other wise ill loose 1st words of customer name and its usually most important because contains name of the customer
for example i have a code
^FO40,240^A#N,40,40,E:DAVIDBD.FNT
^FD%%Depositor%%
^FS
thats depositor name is:
i dont know why its so long name -- can be variable
and i have to print always last 20 letters as:
its so long name --can be variable
will be happy to get any tips or help
Regards
There really isn't much ZPL can do to help. ZPL is really a page description language, not a programming language.
You will need to process the string to the correct length before adding it to your label code. If you are not using a mono spaced font, then you will have to accommodate for the variable character width.
If you are using a monospaced font you simply have to know how many characters will fit in the area you are trying to print.
If you can wrap text, you might make use of the Use the ^FB – Field Block command in the manual

Inserting Vertical Space in Pandoc Markdown

Is it possible to insert a extra vertical space using Pandoc flavored Markdown? Something that would show up as a blank line in a Word document or a <br> in HTML or \vspace in LaTeX. Or anything equivalent?
My problem is that I don't want a title for my reference list, but this puts my references too close to the preceding paragraph in both Word and in LaTeX.
One way to do it is to insert a paragraph containing just a nonbreaking space.
You can use either of these forms in pandoc:
\_ (where "_" signifies a space)
For pdf, do the following (replace the s with space): \s\s

Position of Text in a TextBox

Hi I have a textbox containing some text. I am looking to replicate the red spelling mistake squiggle type behaviour.
Using WinAPI I can
draw the squiggle between 2 points.
find out the height and width of
the word to be "squiggled".
What is the api call (or perhaps the methodology if it is more than a single api call) to find the position of that word in the text box so that I can position the sqiggle undeneath it.
Also, what are the messages I need to trap to ensure that the squiggle is redrawn. I'm currently only using WM_PAINT, which obviously isn't good enough.
EDIT (3 Sept 2012):
FYI, Here's where I got to so far. Needs a lot of refining but shows basic principles
https://gist.github.com/3607272
Many thx
S
What might work is using an auto-sized label. Make sure the fonts in the label and textbox are identical.
Detect the number of rows that are before the sentence containing the misspelled word.
Fill the label caption with the number linefeeds (vbcrlf) you got from question 1.
Append the words from the misspelled line (up to the misspelled word) to the labels caption.
The label size should now be identical with the beginning of the misspelled word.
Example text:
This is my first line.
And my second line.
And over here i have my mispeled word.
Label caption output should be (ignore the dots, they are empty lines):
.
.
And over here i have my
The labels height and width should match the position in the textbox, unless you have scrollbars. If the textbox has borders then you should add a fixed value to the height and width to get an exact match.

Resources