Jump to content

Recommended Posts

Posted

I need to prepare a Publisher Document with hundrets of Endnotes (IDML-import) for online use....

With find&replace I can find every endnote by searching the textstyle "Endnote". But before and after every endnote I had to enter some textcomand. 

For example:

This is1 a text.-> This is<endnote>1</endnote> a text.

Is it possible to do this with find&replace? Finding is not the problem. But is it possible with RegEx to add text before and after the endnote? I just know that RegEx is a strong tool - but I don´t know to work with it 😞

Thx for help!!

Posted

Since APub has that Find & Replace panel, see therefor ...

... try out in the replace text field to add a <before> and <after> text which then surrounds your find term.

☛ 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

Posted
25 minutes ago, Eisbar said:

<before>

That was of course just meant as a placeholder for whatever you wanted to write there as a replace text. - So you say you can't add any text before the found endnote in a replace run?

☛ 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

Posted

Hello, @Eisbar,

If your note uses a format or style, simply replace the format or style with your sequence:

 

 

 

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Posted
9 minutes ago, Eisbar said:

original text: "This is1 a text."

what I need: ""This is<endnote>1</endnote> a text."

But, do you need every 1 replaced that way? Or every is1 replaced? Or every occurrence of any word immediately followed by a 1 (with no space) replaced?  Or any word immediately followed by a single digit? 

You need a general statement of the input and output text to construct a regular expression, not just one example.

 

 

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

You could try :

search = 

your textstyle endnote

replace =

<endnote>$0</endnote>

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Posted
6 hours ago, Eisbar said:

I need to prepare a Publisher Document with hundrets of Endnotes (IDML-import) for online use....

Not having access to the Adobe document means we can't really troubleshoot this. 

Are the note superscripted numbers actually 1, 2, 3 etc or are they markers? I don't know if IDML import converts the Markers to actual text or not. Are the Markers (1, 2, 3, etc) a separate Character Style or part of the overall Paragraph Style for the notes?

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

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

Posted

Laurent32 - thx for your idea. I will try it later! And report...

Old Bruce: The endnote are just superscripted numbers actually 1, 2, 3 (with a textstyle). They are not are part of a Paragraphstye - I mean they are text in a paragraph which has a style. But they have the textstyle by whom I can find very easy every endnote!

Posted
4 hours ago, laurent32 said:

You could try :

search = 

your textstyle endnote

replace =

<endnote>$0</endnote>

this is not working 😞

the result is exactly this: "<endnote>$0</endnote>"

Posted
13 minutes ago, Eisbar said:

this is not working 😞

the result is exactly this: "<endnote>$0</endnote>"

Please show us a screenshot of your Find and Replace panel in Publisher.

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

Thanks. You need something in the Find field if you're going to use $0, as otherwise you won't have a regular expression search.

You can try using .* and see if it works. There are, however, some forum discussions about problems using that search term successfully. So it might not work.

Perhaps, given that you're only looking for numbers, it would by better to try \d+ or \d+? instead.

And, as another alternative if those don't work, you could try (\d+) in the find and then use $1 or \1 instead of $0 in the replace field.

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

You could try v2 :

search = \d+

+ your textstyle endnote

replace =

<endnote>$0</endnote>

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Posted

I have one more challenge!
All words or phrases in italic must be preceded by a <i> and followed by a </i>.
I tried it with the regex "." This works insofar as it finds all characters that have the text attribute italic. But it is found letter by letter and each letter is preceded by an <i> and then a </i>.
Is there an expression to tell publisher: all related words are to be considered as a unit?

Posted
2 minutes ago, Eisbar said:

I have one more challenge!
All words or phrases in italic must be preceded by a <i> and followed by a </i>.
I tried it with the regex "." This works insofar as it finds all characters that have the text attribute italic. But it is found letter by letter and each letter is preceded by an <i> and then a </i>.
Is there an expression to tell publisher: all related words are to be considered as a unit?

.*? would be one commmon way.

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Posted

You could try :

Search = \w+

+ the style you're looking after

Replace = <i>$0</i>

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Posted

You can try, if you have a text style dedicated to italics :

Search = empty

+ character style italics

Replace = <i>$0</i>

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Posted
1 hour ago, Eisbar said:

can I avoid this? see screenshot!

You could then search for </i> <I> and replace with just the space.

4 hours ago, Eisbar said:

All words or phrases in italic must be preceded by a <i> and followed by a </i>.

It really depends if the spaces are also styled italic. As you said the text is coming in from an IDML file there is no guarantee that they are.

If the spaces are italic then I would use for find: With the italic option from the silly little cog wheel's Format choice.

(.+?)

and then use the following for the replace:

<I>\1</i>

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

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

Posted
2 hours ago, Eisbar said:

can I avoid this? see screenshot!

My version using .*?  should not have that problem.

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

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.