Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\fig ... \fig* usage cases #123

Open
cmahte opened this issue Jul 18, 2021 · 1 comment
Open

\fig ... \fig* usage cases #123

cmahte opened this issue Jul 18, 2021 · 1 comment

Comments

@cmahte
Copy link

cmahte commented Jul 18, 2021

I long time ago I suggested there are multiple use cases for the fig tag, and requested a slight expansion of the official \fig ... \fig* definition to cover these use cases.

I've implemented the following uses from a fork of USFM 2.4, but It would be nice if the current USFM spec included these arguments: inline, relative x-dim and y-dim, and wrap

My implementation:

Type Code
Centered in column \pc \fig Description (xdim x ydim)|URL| col ||||\fig*
Centered in all columns \pc \fig Description (xdim x ydim)|URL| span ||||\fig*
Start of Paragraph with wrap \m \fig Description (xdim x ydim)|URL| col ||||\fig*
End of 1st line with wrap \pr \fig Description (xdim x ydim)|URL| col ||||\fig*
Inline as a character \fig Description (xdim x ydim)|URL| inline ||||\fig*

Example SFM

Example Output

Project folder with images

**Notes
wrap is currently implemented on the preceeding paragraph. It more appropriately deserves a boolean (true/false) argument within the tag. I've implemented this way to acheive the closest representation with current USFM implementation.

x-dim and y-dim are currently passed directly through to Libre-Office, so current values are anything allowed in Libre-Office (units, percent, and "auto"). However, the current import into LibreOffice is buggy, so it doesn't work as specified exactly. The proper usage in USFM should be relative only, as that doesn't require many tweaks for different outputs (that is a percentage of the placement argument (col, span, inline). Col and span are relative to the width, whereas inline is relative to the text height.

@mhosken
Copy link

mhosken commented Oct 25, 2021

See https://github.com/sillsdev/ptx2pdf/blob/master/docs/documentation/figures.md for details on what ptxprint has done with \fig. Mins you this is in USFM 3. But there is also how various USFM2 fields are interpretted in conversion to USFM3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants