How can I place images side-by-side in restructured text? - restructuredtext

Is there a way to put 2 different images on the same "line", so, side-by side?
I know there is the :align: option, but if I put two images, the first with :align: left and the second with :align: right it doesn't work, because the latter is put in another paragraph.

I used substitution definitions:
|pic1| any text |pic2|
.. |pic1| image:: img1.png
:width: 45%
.. |pic2| image:: img2.png
:width: 45%

.. list-table::
* - .. figure:: ../_static/1repren.png
Fig 1. Representations
- .. figure:: ../_static/5transparency.png
Fig 2. Transparency
* - .. figure:: ../_static/9ele.png
Fig 3. Electrostatics
- .. figure:: ../_static/11R3D.PNG.png
Fig 4. R3D

You want the images to be part of the same paragraph and you want them to split the width of the screen so do something like this:
.. image:: im1.jpg
:width: 50 %
.. image:: im2.jpg
:width: 50 %
This doesn't exactly work, there will be some spacing between the 2 images which will put the total width >100%. A simple workaround is setting the widths to 49%. Doing so, below is the output with the unformatted image above to compare:
RenderedImages
More reading: reST docs on Images

To make this snippet (mentioned above by #fiona) work you need to declare | pic | before referencing it.
.. |pic1| image:: img1.png
:width: 45%
.. |pic2| image:: img2.png
:width: 45%
|pic1| any text |pic2|

Try this:
.. class:: center
This text is centered

Related

Opacity Levels in Android Studio

I’ve searched and I haven’t found a way to get a certain level of transparency in a colored button while the text of the button is 100% visible.
There has been options to get certain levels of transparency in a button, but the text also becomes transparent and that’s not what I want.
Any pointers?
Do do it in code, you can use:
yourButtonName.getBackground().setAlpha(int alpha)
where alpha is an int between 0 and 255.
Do do it in XML, you would add something like this to your button attributes:
android:background="#8000FF00"
This would yield a 50% opaque green color.
To better understand how we arrive at the code "#8000FF00" , look here.
:)

One item went to second line

enter image description here
In menu when I added Contact Item .. it went to second line
Does anyone had the same problem?
There might not be enough space for all the menu items. You can fix this by:
1. reduce the gap
2. reduce the font size
3. Increase the space for menu

triple caption over image are work bad

I have some problem. I tried to position the title over the image
first title (cat1) can be small or long
second title (cat 2) juste after the first title
third title (after the 2nd title to right)
these title must be on inline
see my demo jsfiddle http://jsfiddle.net/cyphos/jntea/]
thank you for your response
As I understand it, how you accomplish this depends on what you are OK with creating. If you can specify the width of each element, then it isn't a problem to accomplish. You could then simply specify widths for both the left and right elements, then position the center one directly in between. See this fiddle as an example:
CSS only Fiddle
This uses the box-sizing border-box model to simplify things. Read this for clarification
basically:
.cta1 {left:0;width:150px;}
.cta2 {left:150px;right:150px;}
.cta3 {right:0;width:150px;}
OR
if you want these items to be dynamic, you will need to use Javascript/jQuery to get the width of the elements and then set the left and right properties of the center one accordingly. An example in jQuery
jQuery based fiddle
var cat1Width = $('.cat1').width();
cat1Width = cat1Width + 26; //26 being a pixel measure of the padding of the element
$('.cat2').css('left', cat1Width);
With this, you will have to then add the padding values to the cta1Width variable, as jQuery does not return a width value that includes the padding. Either do this manually (by adding the pixel value yourself), or you can also extract the padding width with the jQuery see this thread for info

Wordpress Gantry - how to split up mainbody in 2 ?

Gantry for wordpress question :
Ive fallen in love with Gantry - wordpress theme, its really smooth and configuarable. I dont use it as a base for a blog but instead a simple webpage.
But have one problem that i cant figure out, i can configure all elements like the header, logo, navigation, etc. and splut them up in several elements.
But Content ( the pages ) will always show as one full width element in the middle, what i really would like to do is to split up the main body into 2 "tables" whereas content only shows in ex. a 400 pixel widht box, and then have a picture shown pr. page in the remaining est. 300 pixels on the right.
In the gantry settings menu i can go in and adjust "mainbody" but it just doesnt seem to work for content at all nomatter what i set it to and dont know how to be able to add an element to it as "mainbody" is not a widget you can configure.
Hope someone can help - thanks alot.
There is no way you can split main component into two positions, however you can use sidebars or you can use main-body-top and main-body-bottom positions last two can be splitted up to the 3 exact same positions ... my best advice would be that u use sidebars .. which widths and positions you can then manage in the theme settings.

ASP:Menü: complete Menu margin?

I have a ASP:Menü in vertical style.
The MainItem is only 1 Button, deisgned by a Image (no text, pure image).
The ChildItems are normal Text.
Here is a very high zoomed screenshot: http://s2.imgimg.de/uploads/UnbenanntesBild661673a8png.png
Now, beacuse of the image, the childItems look very... strange, because the ChilItems begin, where the button is not there (very hard to explain, sorry).
I want to have the child menü begins at the pixel the button beginns after the white seperator in the image.
So, I want to move the whole childItems 2-4px to the right, how I can do this?
You need to add a left rule to the style of the sub-item, similar to the following:
.subitem
{
...
left: 1px;
...
}
You will need to figure out the exact spacing for yourself, as you have not included the actually styling for me to test with.

Resources