Problem with alt tags in author view
-
- Posts: 24
- Joined: Fri Apr 05, 2013 11:01 pm
Problem with alt tags in author view
I have a lengthy manual with a lot of inlinemediaobject's. I'd like to add alt tags for this. I've noticed an annoying thing in Oxygen however. When I add an alt tag to an inlinemediaobject element, the alt text causes a linebreak in author mode and the tag appears on its own line. Since these appear in the middle of paragraphs (and there are so many of them), it makes reviewing text in author mode kind of annoying.
Is there a way to change this behavior, so that the alt tag doesn't add linebreaks in author mode (or is just not displayed)?
Is there a way to change this behavior, so that the alt tag doesn't add linebreaks in author mode (or is just not displayed)?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Problem with alt tags in author view
Post by alex_jitianu »
Hello,
The culprit is this rule from {oxygenInstallDir}/frameworks/docbook/css/docbook.css which marks the element as being a block:
What you have to do is edit this rule and replace the display property to either display:inline or display:none. I'm not sure why we marked the alt element as being a block... I'll add an issue for us to also change the default so that it doesn't break the text flow.
Best regards,
Alex
The culprit is this rule from {oxygenInstallDir}/frameworks/docbook/css/docbook.css which marks the element as being a block:
Code: Select all
alt {
display:block;
font-size:small;
background-color:#FFFFEE;
color:inherit;
text-align:center;
}
Best regards,
Alex
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with alt tags in author view
Hi,
Just to update this thread, in Oxygen 15.1 the <alt> element is usually styled as an inline element thus not breaking the flow of text.
Regards,
Radu
Just to update this thread, in Oxygen 15.1 the <alt> element is usually styled as an inline element thus not breaking the flow of text.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Re: Problem with alt tags in author view
Hello,
I've noticed that this (or something very similar) is back in 16.1.
I'm putting alt elements for images and I've noticed that, if I specify a width attribute for the image, that seems to affect the line width for the alt text in Author view. As a result, in the case of narrow images (such as a toolbar button), I end up with alt text consisting of one word per line in English and one character per line in Japanese.
As the OP mentioned, it makes for difficult reading.
I had a look at the css mentioned above. It says:
so I assume that's OK.
Any other way round this (besides not setting a width attribute)?
And by the way, in the previous setting in the css, I noticed this:
Just wondering if that missing "t" is significant.
Cheers,
Eddie.
I've noticed that this (or something very similar) is back in 16.1.
I'm putting alt elements for images and I've noticed that, if I specify a width attribute for the image, that seems to affect the line width for the alt text in Author view. As a result, in the case of narrow images (such as a toolbar button), I end up with alt text consisting of one word per line in English and one character per line in Japanese.
As the OP mentioned, it makes for difficult reading.
I had a look at the css mentioned above. It says:
Code: Select all
alt {
display:inline;
font-size:small;
background-color:#FFFFEE;
color:inherit;
}
Any other way round this (besides not setting a width attribute)?
And by the way, in the previous setting in the css, I noticed this:
Code: Select all
equation,
informalequaion {
display:block;
margin: 1em 0.5em;
}
Cheers,
Eddie.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with alt tags in author view
Hi Eddie,
So you are using Docbook 5, right? And what version of Oxygen are you using?
The informalequaion you found in the CSS is indeed a typo and we'll fix it.
If you are not using informal equations it probably is not related to your problem.
Could you paste a small XML fragment with your <mediaobject> image reference and the way in which you specify the width on the image? Also maybe give us a screenshot? You can also contact us using support@oxygenxml.com directly.
I tried to reproduce the issue using an image reference like:
but for me the alternate text width was larger than the displayed image width.
Regards,
Radu
So you are using Docbook 5, right? And what version of Oxygen are you using?
The informalequaion you found in the CSS is indeed a typo and we'll fix it.
If you are not using informal equations it probably is not related to your problem.
Could you paste a small XML fragment with your <mediaobject> image reference and the way in which you specify the width on the image? Also maybe give us a screenshot? You can also contact us using support@oxygenxml.com directly.
I tried to reproduce the issue using an image reference like:
Code: Select all
<mediaobject>
<alt>THIS IS long text</alt>
<imageobject>
<imagedata fileref="images/drive-properties.jpg"
width="100"/>
</imageobject>
</mediaobject>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Re: Problem with alt tags in author view
Hello,
I'm not using DocBook, just Author 16.1. We have an in-house PDF/HTML output tool that requires image height and width specs. These are set with the standard DITA height and width attributes, like this:
I'll send a couple of example images.
Eddie.
I'm not using DocBook, just Author 16.1. We have an in-house PDF/HTML output tool that requires image height and width specs. These are set with the standard DITA height and width attributes, like this:
Code: Select all
<choice>ツールバーの<image href="../images/insert-comment.gif" height="29" width="31">
<alt>コメントの追加ボタン</alt>
</image>をクリックします。</choice>
Code: Select all
<choice>Click this button <image href="file:insert-comment.gif" height="29" width="31">
<alt>Image of Insert Comment toolbar button</alt>
</image>on the toolbar.</choice>
Eddie.
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Re: Problem with alt tags in author view
Apologies - I've now realised why you asked me about DocBook!
I found this thread by googling for Author and alt tags and so I didn't realise it was posted under DocBook.
Sorry,
Eddie.
I found this thread by googling for Author and alt tags and so I didn't realise it was posted under DocBook.
Sorry,
Eddie.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with alt tags in author view
Hi Eddie,
Thanks for the screenshots, I now understand the problem and I understand you are using DITA.
Indeed the CSS used to style DITA content for visual editing looks at the width attribute set on the image and enforces the width on the entire image element, meaning also the <alt> element inside the image. I added an issue for this on our issues list in order to see how we could handle this better from the CSS.
In the meantime if you open the CSS:
OXYGEN_INSTALL_DIR\frameworks\dita\css_classed\topic.css
it has inside it two selectors:
which you could comment out and replace with:
in order to avoid setting the width on the entire image element.
Regards,
Radu
Thanks for the screenshots, I now understand the problem and I understand you are using DITA.
Indeed the CSS used to style DITA content for visual editing looks at the width attribute set on the image and enforces the width on the entire image element, meaning also the <alt> element inside the image. I added an issue for this on our issues list in order to see how we could handle this better from the CSS.
In the meantime if you open the CSS:
OXYGEN_INSTALL_DIR\frameworks\dita\css_classed\topic.css
it has inside it two selectors:
Code: Select all
*[class~="topic/image"]{
content: attr(href, url);
}
*[class~="topic/image"][placement="inline"] {
display: inline;
width:attr(width, length);
height:attr(height, length);
}
Code: Select all
*[class~="topic/image"]:before{
content: attr(href, url);
}
*[class~="topic/image"][placement="inline"]:before {
display: inline;
width:attr(width, length);
height:attr(height, length);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Re: Problem with alt tags in author view
Hello,
Thanks for the answer and the workaround - it works fine.
FYI: I noticed while messing around with the settings that, if "placement" is set to "break", the "width" and "height" settings are ignored when displayed in Author. (Whereas, if "placement" is set to "inline", the image is resized according to the "width" and "height" settings.)
Cheers,
Eddie.
Thanks for the answer and the workaround - it works fine.
FYI: I noticed while messing around with the settings that, if "placement" is set to "break", the "width" and "height" settings are ignored when displayed in Author. (Whereas, if "placement" is set to "inline", the image is resized according to the "width" and "height" settings.)
Cheers,
Eddie.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with alt tags in author view
Hi Eddie,
You are right.
You should try to split the selector I gave you:
in two like:
so that the width and height attributes apply no matter if the image placement is inline or break.
Regards,
Radu
You are right.
You should try to split the selector I gave you:
Code: Select all
*[class~="topic/image"][placement="inline"]:before {
display: inline;
width:attr(width, length);
height:attr(height, length);
}
Code: Select all
*[class~="topic/image"]:before {
width:attr(width, length);
height:attr(height, length);
}
*[class~="topic/image"][placement="inline"] {
display: inline;
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with alt tags in author view
Hi Eddie,
Sorry about this, on the image:before selector you should also have the image reference like:
The trick is to try and show the image before the <image> element and to impose the width limitations only on that before pseudo content so that other elements inside the <image> element like <alt> can have plentry of display space available.
Regards,
Radu
Sorry about this, on the image:before selector you should also have the image reference like:
Code: Select all
*[class~="topic/image"]:before {
width:attr(width, length);
height:attr(height, length);
content: attr(href, url);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service