How to align a number to the right in Jupyter notebook math mode - formatting

Apologies if this is a stupid question, but I searched a lot and couldn't find out how to do this. In math mode if I'm trying to write the equations
$$x=2 x=3$$
How do I align the x=3 to the right side of the page? I tried \hfill but it didn't seem to do anything. Thanks!

Placing right-align text with markdown code is not possible. However, if you add a \tag{xx}, i.e. for equation number, you get the tag's content on the right side. And the the equation in the center. For example:-
$$x=2 x=3 \tag{2.a}$$
You get something like: x=2 x=3 (2.a)
To get what you want, you need to use HTML code instead. For example, write this code:
<div style='text-align: right'><em>x=2 x=3</em></div>
in a markdown cell and run it, you should get the result you want.

Related

Julia LatexStrings plotting text subscripts

I am using PyPlot to plot things in Julia. I want my plot label to use LateX fonts so I'm using LatexStrings.
I would like to write a variable with subscript such that the subscript is not written in italics, i.e in Latex: $z_{\text{eff}}$.
The closest I can get with LatexStrings is L"z_{eff}" however the subscript is written in italics in that case.
Is what I am looking for possible with these packages (I don't want to switch to something other than PyPlot)?
You can do
L"z_{\mathrm{eff}}"
if you don't mind using \mathrm instead of \text to make the subscript be upright and non-italic.
L"z_{\text{eff}}" works in LaTeXStrings by itself, but sending that on to PyPlot messes something up. Things like \mathtt and \rm also work, but \textnormal and \textrm don't.

Set histogram ticks/label using Syntax

Let me preface this by saying that I am a programmer by trade, but not very familiar with SPSS.
I am helping a friend set up some histogram plots using SPSS Syntax language. Using the Chart Builder, we have arrived at the code below:
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=OurVariable MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE
TEMPLATE=[
"C:\some\path\greenHistogram.sgt"].
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: OurVariable=col(source(s), name("OurVariable"))
GUIDE: axis(dim(1), label("OurVariable"))
GUIDE: axis(dim(2), label("Frequency"))
GUIDE: text.title(label("Bla bla",
"bla"))
ELEMENT: interval(position(summary.count(bin.rect(OurVariable, binStart(0.5)))),
shape.interior(shape.square))
END GPL.
As you can see, she would like to make the histogram columns green. We could not achieve that using the Chart Builder, but we could easily make a template via the Chart Editor window and apply that. This seems like a very sensible approach, as she has many charts she wants green.
She would also like to customize the y-axis labels (number of decimal places, tick "major increment" etc.). This can also be achieved using the Chart Editor and saving a template. However, this is a much more individualized edit, and making a custom template for each and every plot seems cumbersome. Is it possible to adjust these things directly in the Syntax-script which generates the plots?
In many other places there is a nice Paste-button which generates the necessacy code, but I could not find one in the Chart Editor.

Semantic mediawiki - Set propery to range of values

I'm trying to set a specific property to a non exact value, for example say that I want to define the height of a pine tree to usually between 3-80 m (according to wikipedia). Then I would like to set something like [[Has height::3-80]] (of course this doesn't work) and defining the unit to meters with "custom units". Then I would like to be able to query for example "trees that can reach the height of 70 meters" and the pine tree would be included. I've been searching and trying different angles for hours now and I can't figure it out. Tried with #set_recurring_event but that seems to be only for dates/time. Also understood how to set multiple values for a property with #arraymap but this doesn't seem to help me here. Really would appreciate help with this (it's probably very easy and right in front of me) Thx! COG
There's no such things. But you able to create template, with parameters you want. The you just use code kinda {{range|min|max|units}}. For example your range of heights looks like {{range|3|80|m}}.

How to get this sort of format using dojox TableContainer?

I need to have something like :
textbox
textbox button
checkbox
I am using the dojox.layout.TableContainer to contain the elements.
The code I wrote is in this fiddle - http://jsfiddle.net/sNACz/71/
I cant seem to get the format right. The class and age boxes are indented to the right. How can I fix this?
you can use cols to modify the number of columns of yout Table, for example 3, 6, any number you need... and tweak the labelWidth a bit : http://jsfiddle.net/sNACz/85/
I hope this helps, also note that you can play with colspans if needed too :)
TableContainer is quite flexible, as long as you do not try removing fields after it has started.
I guess in your case a cols: 2 should be enough, since you are nesting tableContainers... Play with it a bit, and do not hesitate checking the code for more possibilities (colspans etc)...

What does setTextMatrix of contentByte class in iText do?

I am using iText and am very new to it. There have been several situations where I think I could have figured out the problem with my code if I knew what I was doing - I use examples without knowing the workings behind the code, and even as I look at the source I can't figure out what the programmer was thinking.
What does setTextMatrix of contentByteArray in iText do? And how do I figure out the parameter values I need?
For example:
cb.setTextMatrix(1, 0);
The input parameters are x,y coordinates in points, unless CTM scaling was defined.
0,0 would be the bottom left of the template you are referencing.
The position is the 'baseline' of the text, rather than the top or the bottom.
Transcribed from this source:
https://sourceforge.net/p/itext/mailman/message/12855218/
first parameter sets left margin, second parameter sets bottom margin.