Adding latex element to oxygen with DITA DTD specialization

Post here questions and problems related to editing and publishing DITA content.
Sitrakar
Posts: 23
Joined: Tue Jan 24, 2023 5:40 am

Adding latex element to oxygen with DITA DTD specialization

Post by Sitrakar »

For our online help, we are using Latex to write our equation. To do that we go on Text editor mode and we use the foreign element :

Code: Select all

<p><foreign outputclass="embed-latex">L' = {L}{\sqrt{1-\frac{v^2}{c^2}}}</foreign></p>
.
This is not straight forward for our team, since most our team work in author mode.
I'm new with the DITA DTD specialization, and I'd like to know is there a way to create an element Latex in DITA, like Uicontrol, with DITA DTD specialization?
Best regards,
Sitraka
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding latex element to oxygen with DITA DTD specialization

Post by Radu »

Hi Sitraka,

I am not sure why you are switching to the text editing mode. You can insert a DITA foreign element by pressing ENTER in the Author visual editing mode. You can also use the Attributes side view to set an attribute to the DITA "foreign" element.

It takes time to create a DITA specialization and also all your DITA topic DTDs would need to be changed to refer to the specialized DTDs:
https://www.xiruss.org/tutorials/dita-specialization/

I would suggest to you an alternative:

With a DITA framework customization you can add for example to the content completion window in Oxygen an action named "latex". When the action is invoked it can insert "<foreign outputclass="embed-latex">" in the document.

https://blog.oxygenxml.com/topics/custo ... etion.html

The custom action can also use Oxygen editor variables like ${ask} to show a dialog to the end user asking them to paste the Latex equation in the dialog.
https://www.oxygenxml.com/doc/versions/ ... ables.html
So the custom action could attempt to insert something like:

Code: Select all

<foreign outputclass="embed-latex">{ask('Please paste Latex equation here', generic, 'default')}</foreign>
Or as an alternative you can define a code template in the Oxygen Preferences->"Editor / Content Completion / Code Templates" page. A code template has a name and can insert an XML fragment. All defined code templates appear when pressing ENTER in the Author visual editing page.

https://blog.oxygenxml.com/topics/all_a ... 43_h5d_pkb

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Sitrakar
Posts: 23
Joined: Tue Jan 24, 2023 5:40 am

Re: Adding latex element to oxygen with DITA DTD specialization

Post by Sitrakar »

Thanks Radu for the answers.
I will try your suggestions.
Best regards,
Sitraka
Post Reply