Jump to content
You must now use your email address to sign in [click for more info] ×

Support for Mathematics


Recommended Posts

I do not know whether Affinity Publisher has, or will have, a special facility for typesetting mathematics.

However, on this computer at least, if one uses the font Times New Roman and then uses

Text

Glyph Browser

and then where it says All, use the arrow at the right of that panel to open the drop down menu, then there is a section labelled Mathematical Operators and there are characters such as the integral sign, the summation sign and the root sign and those can be inserted in a document.

Arial also has those symbols.

The Unicode Standard also has some more complicated symbols, such as double integral, but fewer fonts support more than just the basic ones.

Mathematics is often typeset using italic type.

So one could probably be able to typeset many mathematical formulae in Affinity Publisher using Times New Roman italic, and maybe needing to have a few text frames one over the other to be able to do things like the limits of integrals. 

In the old days Word 97 used to have a section for setting mathematical formulae, but I think that it produced an image rather than using characters directly.

William

 

 

Until December 2022, using a Lenovo laptop running Windows 10 in England. From January 2023, using an HP laptop running Windows 11 in England.

Link to comment
Share on other sites

25 minutes ago, mac_heibu said:

You can export the result as a PDF and place it in Affinity publisher:

 

I have to choose the equation and use Edit > Copy As... > then choose PDF from there. Export only gives me the graph. Neat trick though, hope I can remember it in five years. [smiley face emoticon]

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

  • 4 months later...

Apple Grapher always slightly reminds me to good old NeXTstep EqB ...

EquationBuilder.jpg.cbac9cad53f355066e0128eede8a88f3.jpg

... due to the formula input style. Though AFAI recall EqB those days only supported PNG and EPS, where the later was mostly the way to go on NS, what it lacked was a quicker formula LaTeX based input/type in method.

Nowadays there are a bunch of such tools commercial and freeware, most of these support MathML with LaTeX style inputs and can export to different bitmap and vector (SVG, PDF, EPS) formats. - Some common quite good online tools in this regard are ...

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Usually not, though in this case EqB was a third party software from Lighthouse Design (DE, EN), which were once acquired by Sun Microsystems instead. Thus Apple's Grapher seems to have other roots.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

Any update on Affinity creating Mathematics equations in its own software? I use a PC and have been making fraction equations especially in Microsoft and then snipping them in as images. I hope the equation feature can be brought into Affinity soon.

Link to comment
Share on other sites

  • 3 months later...

I tried importing PDF output from a latex file for finalising the document. With features like text flow etc, I thought Publisher will be useful.  But all the equations go haywire, the subscript and superscripts get disturbed etc.

These are supposed to be matrices.  You can see what happens to the enclosing brackets.  They have become small. image.png.2aa26fd25572caf95a2b938d8e8a42ef.png

Is there any work around for this?

Are there any plans of supporting mathematics in the future versions?

Link to comment
Share on other sites

There is this drawing programme called IPE(Open source, available for windows, mac and linux). It is available here:

https://ipe.otfried.org/

It allows the entry of latex code in drawings. It runs latex, parses the output and inserts mathematics as an image, which can be edited again. The image can be saved as XML, PDF or PNG. It will be nice if serif offers some such thing in publisher. People who desperately want to insert mathematics in publisher can live with having to install latex separately which is anyway free.

Link to comment
Share on other sites

For block display mathematical expressions I create SVG files using an external tool, then place the SVG images in Publisher.  This workflow is not ideal, but it is predictable and controllable.  For expressions simple enough to run inline with the text, I use (a large number of) character styles, glyphs chosen from several fonts, and many small spaces, basically typesetting the expressions by hand using Publisher's tools.  This is tedious, but ultimately more convenient than creating external SVGs and trying to flow them with the text.

Currently, I am using MathML Formulator from Hermitech Labs (www.mmlsoft.com) to create my SVG files, but there are many alternatives.  I find that I have to import these into Publisher and reduce to 75% scale to match font sizes properly.

Link to comment
Share on other sites

  • 7 months later...
On 4/28/2022 at 2:58 PM, sfriedberg said:

glyphs chosen from several fonts, and many small spaces, basically typesetting the expressions by hand

Sfriedberg, would you have the time to explain a little how you get super- and sub-scripts to work. I'm only trying to use them for simple chemical formulae with + and - signs to indicate charges, but find when I edit character styles in the Edit Text Style panel, and choose
Typography > Figures > Figure position > Subscript,
that this has almost no effect on the character to which the setting is applied, no matter which font I've tried - Symbol, Avenir, Arial. Please, could you help me with this. 

MacBook Pro, Retina, mid-2015, macOS Monteray, RAM: 16 GB, CPU Quad-Core Intel Core i7, 2,8 GHz. Monitor: 27" (3840 × 2160) DELL U2723QE 

Link to comment
Share on other sites

48 minutes ago, GuyMiklos said:

how you get super- and sub-scripts to work. I'm only trying to use them for simple chemical formulae with + and - signs to indicate charges, but find when I edit character styles in the Edit Text Style panel, and choose
Typography > Figures > Figure position > Subscript,
that this has almost no effect on the character to which the setting is applied, no matter which font I've tried - Symbol, Avenir, Arial.

@sfriedberg will probably have more info for you, but I'll mention one thing: Those options under Typography work only for characters where the font itself supplies super- and/or subscript forms of the glyph. Most fonts are very limited in their support for those OpenType features. For those fonts, you need to use the super- or subscript options in Positioning and Transforms, instead. The option there creates a faux or false super- or subscript, by shrinking the character and moving it up or down, and this works with any character. Or, alternatively, you can manually shrink the character (perhaps to 80% of its size) and shift the baseline a bit up or down.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

13 hours ago, GuyMiklos said:

explain a little how you get super- and sub-scripts to work

OK.  I have a hierarchy of character styles rooted at Math, whose properties are Font: Cambria; Font Weight: Normal; Italic: On; Font width: Normal.  My Base font size is 12pt.

One of the child styles of Math is Math Subscript, whose properties are Math + Font Size: 10pt; Baseline advance: -2pt.  Math Superscript is very similar: Math + Font Size: 10pt; Baseline advance: 3pt.  As you can see, I am doing the font resizing and baseline shifting myself rather than relying on the math font's subscript and superscript features.

The hierarchy can be extended.  Two children of Math Subscript are Math Subsubscript and Math Subsuperscript, with properties Math Subscript + Font size: 8pt; Baseline advance: -4pt,  and Math Subscript + Font Size: 8pt; Baseline advance: 1pt.

It gets pretty tedious changing character styles on a character-by-character basis, but it does make it straightforward to set stuff like:

237526655_VPscreenshot012.png.6772ae86566873beab30c7c86b6f015c.png

1103502778_VPscreenshot011.png.9809db2c04fd6697f5784e4eadb3cec3.png

That 2nd example has a couple of uses of Math Subsubscript.

What you can't do in Publisher is set subscripts and superscripts directly above one another.  This is a super common thing to do in math typesetting, and you can do it with CSS (witness MathJAX's HTML-CSS output processor).  But you can't get at the needed functionality using text styles.  (Essentially, after you render a subscript string, you have to "go back to" the original position to start rendering the superscript string.)

As I've mentioned in another thread, if the font has them, you can use IPA combining diacriticals to put some useful things directly above or below a character.  This is limited by the IPA character set and specific font support for it, but has been a big help in one document I am preparing.  Other Unicode sets of combining diacriticals could also be used, too, if your font supports them.

It seems very unlikely that the Affinity team will take on mathematical typesetting anytime soon.  And I would argue that they should not invest resource in that, when they could be investing resources in a plugin architecture where character sequences could be directed out of the Affinity document, through an external program and then fed back into the Affinity document layout, with at least the positioning capabilities offered by CSS.  Then somebody else could integrate LaTex, MathJax, or some existing math typesetter into AffPub as a plugin.  A text-diversion plugin architecture would support lots and lots of things beyond math typesetting.  For example, bibliographic databases and reference preparation.  We had text diversion facilities like this back in the 1980's when roff, nroff, and troff were the DTP tools of the scientific and technical communities.  We need to catch up to 40 years ago!  But this would mean that Affinity have to define and support an API and expose a great many features of that all-in-one file format they favor so highly.

Link to comment
Share on other sites

Thank you Walt and Sfriedberg. I didn't spot the sub-/super-script option under Positioning & Transforms. Having found the sub-super in one place, I assumed it wouldn't be found elsewhere. Moving the baseline was necessary and increasing the font size when the sub/super transform was active. I've made a character style ChemicalFormulae with two child character styles: ChemicalSubscript and ChemicalSuperscript. It now all works well enough, but for the super and subs not being permitted to occupy the same vertical alignment, but it is now so common to ignore that for the very reason that it is not supported by most non-specialist software.

The character styles are easy to apply - far less tedious than Latex.

Thank you both for your help.

Here's what the formulae look like. There will be others later in the text and thanks to you both, they will be easy to set.

 

 

Skärmavbild 2022-12-02 kl. 10.09.34.png

MacBook Pro, Retina, mid-2015, macOS Monteray, RAM: 16 GB, CPU Quad-Core Intel Core i7, 2,8 GHz. Monitor: 27" (3840 × 2160) DELL U2723QE 

Link to comment
Share on other sites

4 hours ago, sfriedberg said:

What you can't do in Publisher is set subscripts and superscripts directly above one another. 

I have a vague (and possibly incorrect) memory that adjusting kerning or tracking may help in this issue.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Yes, I was considering kerning. It would require another character style because other wise two adjacent superscripted characters would get pushed together in order to kern the first one closer to the chemical symbol. Since I have 400 pages to attend to, perhaps nearer the publishing date I might fiddle with that. The current result is good enough, I'll experiment with possible improvements if there is time. 

Thanks again.

MacBook Pro, Retina, mid-2015, macOS Monteray, RAM: 16 GB, CPU Quad-Core Intel Core i7, 2,8 GHz. Monitor: 27" (3840 × 2160) DELL U2723QE 

Link to comment
Share on other sites

5 hours ago, GuyMiklos said:

I was considering kerning. It would require another character style because other wise two adjacent superscripted characters would get pushed together in order to kern the first one closer to the chemical symbol.

I was thinking more of the case, as in your example of HPO subscript 4 superscript -2 that you would kern the 4 and the - sign.

For example:

image.png.3ccd405492d3ae61a3d30a5e4f106f42.png

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

I'm impressed. Yes that will work. I've seen two styles of writing chemical formulae. When super- and sub-scripts can be aligned as you have demonstrated, then usually the style is to swap the charge sign and the charge multiple, that way the numbers end up neatly stacked. In this case the 2 would be directly above the 4 and the minus sign to the right of the 2.  Clearly that's possible as you have shown. I'll have to consider which style of formula I'll use. 

Thank you for this.

MacBook Pro, Retina, mid-2015, macOS Monteray, RAM: 16 GB, CPU Quad-Core Intel Core i7, 2,8 GHz. Monitor: 27" (3840 × 2160) DELL U2723QE 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.