Editorial Update/Images

From Legislation Community Editorial Wiki
Jump to navigation Jump to search

Introduction

We have a tool to help us with amendments involving images, which can be used to substitute existing images and insert new images. The image tool is accessed via the “Update Image” button in the website preview. For some scenarios, we may need to check the affected provision out in XMetaL and manipulate the image tagging before we can use the image tool to carry out the amendment (for example for unequal substitutions of images, or where a new image is being inserted on its own). For other amendments to images, such as omissions or textual amendments, we cannot use the image tool and need to carry out the amendment manually. We aren't able to make textual amendments to images and instead need to use an explanatory F-note to describe the amendment to users.

Amendments to images that can be carried out using the Image Tool

We can now insert and substitute images using the Editorial Image Tool in the website Preview. The most common images we deal with are formulae and forms. Where, following an amendment in XMetaL, an expected image does not appear as part of the inserted/substituted text when we preview it, or where we simply need to substitute an existing image within a provision, we can now access the image update functionality by clicking on an “Update image” button which will appear in the Preview page in the location of the image. The instructions for using the image update functionality are laid out in the sections below.

Before you use the Image Tool - make sure that the correct PiT is in place in the timeline (and other reminders)

WARNING: For update tasks involving multiple PiTs, where we have edited Forms images (especially where we are doing several actions, such as inserting, substituting or repealing multiple forms at a specific PiT), the editorial system sometimes gets confused about their start dates and mixes up old and new images a few PiTs further down the line. So, firstly, always check that you have used the timeline resolver to make sure the correct PiT is in place before you start using the image tool to edit the Forms. Secondly, once you have edited Forms images submit for early review at that PiT. The reviewer can then review and publish them and the update feed on publishing will hopefully stabilise the start dates for the images. The update can then be re-allocated back to the editor to carry on with the remaining update.

Also note:

1. If your amendment only involves substituting an existing image within a provision that otherwise stays the same, don't forget to make sure that the PiT for that amendment is showing on the timeline before you carry out the substitution, otherwise you will substitute the image in a previous PiT. Use the timeline resolver to add in the PiT you are working before you substitute the image.


2. When you use the image tool to carry out an insertion or substitution of an image and the amendment only affects that image and not the surrounding text, you do not need to insert any square brackets for the amendment but you will need to make sure you insert an F-note for the amendment in a suitable location.

3. The image tool was developed to work with existing image tagging structures. If your amending document includes an image or form that has been tagged in an unconventional way, such as with ukl:IncludedDocument tagging, the image tool cannot currently be used to insert the form or other image as the tagging will not be recognised by the Tool. The form or other image will be missing after you have carried out your amendment and you will need to refer it to TSO in the usual way to get the image or form added.


What to do if the “Update image” button or image itself is missing from Preview

If the “Update image” button is missing from your provision when you preview it, you can click on "Image Data View" in the left hand menu in the preview to display it in the Image Data view:

Image data view.png

If the “Update image” button or the image itself still doesn't appear in the preview, it may be that the ukl:Image tags are enclosed by either ukl:Span tags, or ukl:IncludedDocument tagging (see screenshots below).

To remedy this, select and drag the ukl:Image tags out of the enclosing ukl:Span or ukl:IncludedDocument tags and delete that tagging. For example:

In XMetaL, from this:

Image missing 1.png


To this:

Image missing 4.png


In Preview, from this:

Image missing 2.png
Image missing 3.png

To this:

Image missing 5.png

How to upload an image if the ‘fetch custom provision’ function fails

If you are unable to upload an image because the ‘fetch custom provision’ function doesn't work (you may get an internal error), you can upload the image manually as follows:

1. Save the amending image into your files;

2. Open the update image page and there’s a new option ‘Upload image’:



Upload Image.png

3. Browse to where you saved the image and then press upload.

How to insert or substitute images using the Image Tool

Image is contained within a newly inserted or substituted provision

Example: Substitution of a provision which includes two formulae

From the Update Details page, select the Preview provision button. You will see the formatted version of the newly substituted provision. Select the first Update Image button:


Image tool 1.png

You will be taken to the Image Data Update page:

Image tool 2.png

Select the radio button for the first formula and then select the Update Affected Image button. You will be taken back to the preview version of the amended provision where the new formula is displayed.

You should then repeat the same process for the second formula, by first selecting the Update Image button, then selecting the radio button for the second formula on the Image Data Update page and then selecting the Update Affected Image button. This will result in the formatting of the images for both formulae in the amended provision:


Image tool 3.png


Amendment exclusively substitutes an existing image

Before you start, make sure that the PiT for your amendment is showing on the timeline, otherwise you will substitute the image in a previous PiT. Use the timeline resolver to add in the PiT you are working before you substitute the image.


1. From the preview of the provision, select the Update Image button:


Image tool 4.png
Image tool 4a.png


2. On the Image Data Update page, select the radio button of the image to be substituted:


Image tool 5.png


3. Next, select the Update Affected Image button:


Image tool 6.png


4. You will be returned to the amended document where the image is displayed.


Image tool 7.png


5. Check the provision out in XMetaL and insert an F-note for the substitution (using the relevant task to generate the annotation) in a suitable location, for example in a Schedule consisting entirely of forms, the F-note would be placed at the top level:


Image Fnote position.png

What to do if the affecting image is missing from the Image Data Update page

Example 1: One amending image is missing

In the preview of the amended provision, select the Update Image button.


Image tool 9.png


You will be taken to the Image Data Update page, however the affecting image is missing, and you will not be able to select the Update Affected Image button:


Image tool 10.png


To locate the affecting image, you need to enter the affecting document’s URL (including affecting provision) in the Fetch Custom Provision box on the Image Data Update page (in this example, the URL is https://www.legislation.gov.uk/uksi/2018/425/regulation/5):


Image tool 11.png


The affecting image should then appear on the Image Data Update page, and you will be able to select the radio button to the right of the new formula and then select the Update Affected Image button:


Image tool 12.png


You will be returned to the preview of the amended provision with the new image formula having replaced the old image formula and you can proceed with the next step of the amendment. In this instance the amendment was exclusively to substitute the image formula without any text, so insertion of an F-Note in XMetal was necessary, with the F-note reference being placed just before the substituted formula (note there are no square brackets needed in this scenario):


Image tool 13.png

See also this example of the substitution of a whole Schedule containing an image:

https://www.legislation.gov.uk/uksi/1991/2749/schedule/2/1995-01-01

The image (which was initially missing after the Schedule substitution was carried out) was successfully inserted using the method described in this section.

Example 2: Two amending images are missing

1. From the provision preview, select the first Update Image button:


Image tool 14.png


2. You will be taken to the Image Data Update page where the affecting images are missing. To locate the affecting images, you need to enter the affecting document’s URL (including affecting provision) in the Fetch Custom Provision box on the Image Data Update page. In this example, the affecting provision for both images is:

https://www.legislation.gov.uk/uksi/2016/257/regulation/23/made#regulation-23


Image tool 16.png


3. Once the Fetch Custom Provision button is selected, the options of the new images from the affecting provision are displayed. Select the appropriate radio button for the first image and then select the Update Affected Image button.


Image tool 17.png


4. You will be taken back to the updated amended provision preview, where the first formula has been substituted:


Image tool 18.png


5. Next, repeat this process for the second image by selecting the second Update Image button. You will again be taken through to the Image Data Update page. Again, paste the URL of the amending document into the Fetch Custom Provision box.


Image tool 20.png


6. Select the appropriate radio button for the second image and then select the Update Affected Image button.


Image tool 22.png


7. You will be returned to the updated amended provision preview, with both formulae now having been substituted:


Image tool 23.png


8. You can then proceed with the next step of your amendment, as appropriate. In this instance the amendment was exclusively to substitute the image formulae without any text, so insertion of F-Notes in XMetal was necessary, with the F-note reference being placed just before each substituted formula (note there are no square brackets needed in this scenario).


Image tool 24.png


Example 3: Substitution of forms in a Schedule

1. On 1/4/2010, four forms within Schedule 4 of the affected document were substituted. The Update Image button for the first image in the Schedule of the affected document document was selected to get to the Image Data Update page, however the affecting images were missing:


Images schedule forms sub 2.png


2. The amending provision URL was pasted into the Custom Utility Provision box and the Fetch Custom Provision button selected.

https://legislation.gov.uk/uksi/2010/671/schedule/1


Images schedule forms sub 2a.png


3. The affecting provision images were then displayed on the Image Data Update page:


Images schedule forms sub 3.png


4. The radio button of the first image was selected and the Update Affected Image button was selected and the form was substituted. Steps 1-4 were then repeated for each affecting image until each image was substituted. The Schedule was then checked out in XMetaL and F-notes for the form substitutions were added at the top of the Schedule:


Images schedule forms sub.png


Insertion of new images

If you need to insert a new image into an affected provision, the “Update Image” button will be missing from the preview because there is no tagging for the image in the affected provision yet. You will need to insert the appropriate tagging to make the “Update Image” button appear in the preview, and you will then be able to insert the new image using the “Update Image” button.

See, for example, the insertion of Forms 8A, 8B in 1962 c. 14, Sch. 5 Pt. 7 on 16.12.2010:

https://www.legislation.gov.uk/apni/1962/14/schedule/5/part/VII


Inserting tagging to create an “Update Image” button

To insert the tagging in the “Plain text” view, you should:

1. Check out the appropriate Provision or Parent level in XMetaL and toggle the view to “Plain text” view:


Plain text view.png


2. Insert the tagging below into the appropriate place. It is important to give a unique number code that does not already exist within the document. In this case <r10001>:

<P>

<Text></Text>

</P>

<Figure><r10001><Image/>

</Figure>


Note that a set of <P> and <Text> tags is also inserted before the image tagging in order to be able to also include the commentary reference for the amendment at a later stage.


3. Check the affected provision back in.

After check-in, the Editorial System will have added further attributes to the tagging and the “Plain text” view should now correspond to the tagging structure below;

<P>

<Text><Text>

</P>

<Figure Orientation="portrait" ImageLayout="vertical">

<Image ResourceRef="r10001" Height="auto" Width="auto"/>

</Figure>


Note that it is also perfectly possible to also do this exercise in the “Tagging” view within XMetaL instead:

1. Insert a <ukl:P> and a <ukl:Figure> tag from the Element list in the appropriate place:


Tagging view A2.png


This will result in the insertion of the following tagging, which you will need to populate with the relevant commentary ref and ResourceRef attribute:


Tagging view A1.png


Note that a set of <P> and <Text> tags is also inserted before the image tagging in order to be able to also include the commentary reference for the amendment at a later stage.


2. To set the ResourceRef attribute, position the cursor between the ukl:Figure tags and go into the Attribute Inspector and type the unique image reference code, in this instance r10001, into the ResourceRef cell. See below:


Tagging view 2.png


3. Check the affected provision back in.


Once you have inserted the tagging, either using the “Plain text” or “Tagging view”, after checking the provision back in from XMetaL, the “Update Image” button should appear in the Preview of the provision. See below:


Image update.png


Note: if there are other images already present in your affected provision, it is possible to make the “Update Image” button appear in preview by copying and pasting another set of image tagging already present in the affected provision, but you will need to make sure that you amend the attributes to a different ResourceRef:

  • Check the affected provision out in XMetaL.
  • Copy a set of existing image tagging from elsewhere in your affected provision and paste it where you need the new image to go.
  • Make sure you amend the ResourceRef attribute to a new reference number that hasn't already been used in your document, e.g. r10001.
  • Check the affected provision back in.
  • Preview your amendment and use the image tool to insert the new image, using the “Update Image” button that should have appeared where you pasted the image tagging.
See also the guidance on Changing the size of an image.

Inserting the new image using the newly created “Update Image” button

1. Select the “Update Image” button to be taken through to the Image Data Update page:


Insert Image.png


  • Insert the amending document’s URL into the cell next to the Fetch Custom Provision button, then select that button:


Insert Image 2.png


  • You will be taken to a screen in the Image Directory, where you can select the relevant image that needs to be inserted using the appropriate radio button:


Insert Image 3.png


  • Select the Update Affected Image button. You will be taken to a preview of the amended provision showing the image that has now been inserted into the document:


Insert Image 4.png


See also the guidance on Changing the size of an image.

Inserting a commentary annotation for the insertion of a new image

To insert a commentary annotation, check out the amended provision in XMetaL.

  • Position the cursor within the previously inserted ukl:P and ukl:Text tags and select the relevant task from the Resource Manager. From the top menu select Legislation - Non-textual Amendments – Insert Commentary, which will insert an F-note reference and annotation:


Tagging view.png


Plain text view equivalent:

Insert Image 5.png


After check-in, when you preview the amended provision it should now display the newly inserted image and commentary annotation, for example:


Image Insertion 3.png

Substitutions that involve inserting new images

Unequal substitutions of images

Less for more

This might occur where, for example, a form made up of two images is substituted and the new version is made up of only one image. We can use the Image Tool to substitute in the new form and we then need to remove the tagging for the second image:

  • Substitute the first image using the image tool as normal.
  • Check the provision out in XMetaL and delete the second set of image tagging.
  • Check back in and preview your amendment.
More for less

This might occur where a form is substituted, and the new version is made up of more images than the previous version.

  • Substitute the first image using the image tool as normal.
  • Check the provision out in XMetaL and copy the new image tagging and paste it in as many times as there are new images to be inserted.
  • Check back in and preview your amendment.
  • Use the update image tool to update the images to the correct versions.

Image substituted for text

If text gets substituted by an image, the existing text needs to be replaced by image tagging, and the image can then up inserted using the image tool in the usual way.

In this example, EUR 2009/1071, Annex 3, which was entirely made up of text was substituted by an image:

https://www.legislation.gov.uk/eur/2009/1071/annex/III/2013-07-01

The affecting provision contained an image, which replaced all the text within the Annex:

https://www.legislation.gov.uk/uksi/2019/708/schedule/1/2020-12-31


Text subs by image 1.png


To carry out the amendment, the first step is to check out the affected provision in XMetaL, and strip out the entire contents of the ukl:ScheduleBody tagging, leaving just the opening and closing ukl:ScheduleBody tags in place.

The image tagging is then copied and pasted into here from the affecting document (in this case, ukl:Figure and ukl:Image tags, but note that image tagging may vary in different affecting documents):


Text subs by image 2.png 


Next, the annotation is generated by positioning the cursor within the Annex ukl:Number tagging, the relevant task is selected in the Resource Manager, and an F-note reference was inserted by selecting Legislation - Non-textual Amendment - Insert Commentary on the menu bar at the top of the page. This generates the annotation, i.e.:

Annex 3 substituted (31.12.2020) by The Licensing of Operators and International Road Haulage (Amendment etc.) (EU Exit) Regulations 2019 (S.I. 2019/708), reg. 1(1), Sch. 1; 2020 c. 1, Sch. 5 para. 1(1)

The affected provision is then checked back in and previewed, where the Update Image button is now available (because the image tagging is now present in the affected provision), and the image is inserted in the usual way from the Image directory.

If you carry out an amendment like this, and the Update Image button doesn’t appear in the affected provision preview, choose the Image Data View from the Edit View on the left-hand navigation bar. See below.


Text subs by image 3.png


This should give you the display for the Update Image button to enable you to access the Image directory and insert the image in place of the affected text.

Amendments to images that can't be carried out with the Image Tool

Omission of an image

If an amendment requires that an image is omitted, the tagging for the image should be repealed and the image replaced with a dotty line with an F-note:

Image omitted 1.png

Image omitted 2.png

In this example, the forms are located within a Schedule paragraph that has been tagged as a ukl:P1Group, and it was possible to include the dotty line in the XML as follows:


Repeal of a form 3.png


Alternatively, where the image is not contained in a paragraph with its own set of tagging, but is located directly in the ukl:ScheduleBody, a set of ukl:P tags containing the dotty line followed by a non-breaking space and F-note reference may be inserted at the appropriate place, and the existing image and it's tagging can be removed. For example:


Repeal of a form.png


Repeal of a form 2.png


If you are unsure how to do this, contact a Review Editor and they can ask TSO to do the amendment if neccessary.

Textual amendments to images

Images that we can't edit

If an image is not being wholly inserted or substituted, but there are textual amendments being made to the details of forms, maps, diagrams, etc. that are held as image files, we are unable to edit the image files ourselves. Instead, Update Editors should manually insert an F-note annotation in a suitable position, at Provision/Part/Schedule/ level, in relation to the form/map/diagram tagging and provide a more explanatory annotation using the drafter’s text.

See Annotation Conventions - textual amendments to images for examples of the form of words to use in the F-note.

A suitable position for the F-note reference might be within the <ukl:Number> tags of the Schedule that contains the form, or within the <ukl:Title> tags of the form if available (see examples below). The Element List window will show you whether it is possible to insert a <ukl:CommentaryRef> tag in your chosen location.

S.I. 2013/3156, Sch. para. 23:

Image amendment 1.png

Image amendment 2.png

S.S.I. 2018/155:

Image amendment 3.png

If the amendments are more complex or so large that it seems unfeasible to include details in the annotation, then we could summarise the amendments in the annotation rather than giving verbatim text, but there should still be a more explanatory F-note than usual. If you have any difficulty formulating such an annotation, consult a Review Editor.

See also Annotation Conventions - textual amendments to images.

Images that we can edit

Amending images for formulae that are tagged in MathML

Formulae are often tagged in MathML tagging that needs to be rendered as an image to be displayed on the website. To make amendments to formulae that are tagged in MathML, we can amend the MathML in XMetaL and then copy the MathML into the MathML Central website where the MathML can be rendered as an image, which can then be saved and imported back into the affected provision using the “Update Image” button. As well as making amendments to formulae, this method can also be used to improve the quality of images, see example below.

Note:

  • Before making any amendments to a formula, make sure you are working in the correct PiT, otherwise you could end up amending the wrong version.
  • Some entities (e.g. multiplication, minus and divide symbols) don’t render correctly when the image is generated, in which case we need to enter the entity code.
  • Some of the text of formulae may need to be amended to italics using the Mathvariant attribute.


Step 1: check out the affected provision that contains the formula you are amending

If you need to substitute a whole formula, you will need to get the MathML for the substituted version of the formula from the affecting provision (you can use “Download Amending Document” if you don’t have the task available in the Resource Manager).

Step 2: amend the MathML in the affected provision

In your affected provision, you will see the formula in MathML tagging where you can amend any of the text that needs to be amended according to your amendment, you can also check that any text that needs to render in italics has the correct mathvariant attribute:

Formulae A1.png

In this example, the text “PRS” needed to be amended to “WS”, which was done by clicking inside the <math:mi> tagging that contained the text “PRS” and amending it:

Formulae A2.png

If you need to substitute a whole formula, copy the <math:math> tagging from the affecting provision and paste it over the MathML of the formula you are substituting in the affected provision (selecting the <math:math> tagging).

Step 3: Export the MathML to the MathML website

Once you have made your amendments to the formula, you should copy the MathML so that you can import it into the MathML Central website.

If you click on the first <math:math> tag, it should highlight all the MathML for you. Don’t click on the ukl:Formula tags though:

Formulae A3.png

Note: if selecting the <math:math> tagging doesn't work, select the tagging within the <math:math> tagging

In your web browser, go to this website:

https://www.mathmlcentral.com/Tools/FromMathML.jsp


Paste the MathML into the “EnterMathML” box of the mathmlcentral website (just paste it over the existing contents):

Formulae 1.png

Step 4: use the MathML website to generate an image from the MathML

To preview the image that the website will generate from this formula, first you will need to make sure that the delivery option “Embed in page” is selected under “Advanced Settings” above the “Generate” button (if you need to change the setting in the dropdown box, remember to click “save” before clicking “close” in the top right of the box when you are finished):

Formulae 7.png

Click the “GENERATE” button to preview your image, the image will appear below the line where it says “results”:

Formulae 6.png

You may see that the image has rendered incorrectly, with symbols and letters instead of the correct maths entitites. You will need to correct these errors by replacing them with the relevant entity code:

Symbol Entity code
÷ &divide;
× &times;
- &#x002D; or &minus;
&sum;
£ &#x00A3;

Note: using the entity code - for a minus sign gives you a slightly longer minus sign (which is often used on the website):

Formulae 12.gif


You may also need to adjust the font size. You can adjust the font size by clicking on “Advanced Settings”:

Formulae 7.png

The font size should be 18. You shouldn’t need to adjust the image size or make any other amendments here. Remember to click “save” before clicking “close” in the top right of the box when you are finished.

Step 5: save the image

Once your image has correctly rendered, go back to “Advanced Settings“ and select the delivery option “Save to File” rather than “Embed in page”, remembering to click “save” before clicking “close” in the top right of the box. Then go back and click the “Generate” button and the file will be saved to your “Downloads” folder.

You can use the default image name, because the editorial system will rename it in any case when you upload it to the affected provision, or you can change the image name if it will help you identify it when you come to upload it to the Affected Provision.



Step 6: check the affected provision back in and upload the newly created image in preview

Go back to XMetaL and check the affected provision back in. Then preview the affected provision and click on the ‘Update Image’ button:

Formulae 9.png

Scroll to the bottom where it says ‘Upload Image’:

Formulae 10.png

Browse to the location of the image you saved at Step 5 and click ‘Upload’. Your new image should be uploaded in place of the existing image:

Formulae 11.png

Step 7: insert the F-note for the amendment

Once you have updated the formula as required by the amendment, you will also need to insert an explanatory F-note in a suitable location to annotate the amendment, see F-note reference F2 in the above example, which links to the following commentary:

F2	Reg. 128F(2)(b)(i): in the formula, “WS” substituted for “PRS” (17.12.2024) by The Judicial Pensions (Amendment) Regulations 2024 (S.I. 2024/1358), regs. 1(1), 24(a)


https://www.legislation.gov.uk/uksi/2017/522/regulation/128F

You will need to check the affected provision back out in XMetaL, insert the F-note and check back in before previewing the updated image and annotation.

List of common entity codes
Symbol Entity code
÷ &divide;
× &times;
- &#x002D; or &minus;
&sum;
£ &#x00A3;

Note: using the entity code - for a minus sign gives you a slightly longer minus sign (which is often used on the website):

Formulae 12.gif

Mathvariant attribute

The text in formulae is often in italics, but this isn’t always captured in the MathML. If you need to italicise any text, you can amend the mathvariant attribute in XMetaL before you copy the MathML Central website:

Formulae 13.png


Example where generating an image from MathML improved the quality of the image

Existing image was indistinct:

Formulae 14.png

Quality was improved by generating new image from MathML using the MathML Central website:

Formulae 15.png

Changing the size of an image

The size of an image is set in the “height” and “width” attributes of the ukl:Image element. See in the Attribute Inspector in XMetaL:


Image size 2.png


In plain text view:


Image size.png


If you are inserting new tagging to create an “Update Image” button, these attributes will be set to “auto”. If you decide to copy and paste existing image tagging to create a new “Update Image” button, note that the “height” and “width” attributes will be those of the image tagging you have copied, which may not be suitable for the image you need to insert using the “Update Image” button that will appear in preview.

If you do need to change the size of an image, you can delete the values for these attributes in the Attribute Inspector or remove them in the plain text view before checking your provision back in. If your newly inserted image still looks the wrong size, you can copy the “height” and “width” attributes of the image tagging in the affecting provision.

Changing the size of the font in a formula

If there are issues with font size in a formula (for example an oversized formula), we can also resolve this by amending the “height” and “width” attributes in the ukl:Image element.

This is usually found in the Versions elements at the bottom of the XML fragment where the Version id corresponds to the AltVersionRefs attribute value for the Formula.

It is tempting to use pixels as a unit, but this will be invalid to the schema and you should use points (pt).

You will need to calculate the correct width/height ratio from the given image size in pixels and convert this to points:

  • There are 72 points to an inch
  • Modern screen resolution is 96 dpi

Therefore a formula to calculate this is

points = (pixels * 72) / 96

We can use an online calculator to do some of these sums - see https://simplecss.eu/pxtoems.html.

Related Pages

See Retained EU Legislation Update - Missing images in the website preview

Handy MathML tutorial online: https://www.math-it.org/Publikationen/MathML.html