lundi 1 décembre 2014

Coordinates of corner of histogram bar


How can one get the coordinates of the top right corner of a bar in a histogram? So far, I have just tried to make the lines fit...



\begin{document}
\usepackage{tikz}
\begin{tikzpicture}
\begin{axis}[ybar, bar width=20pt,ytick=\empty,xtick=data,symbolic x coords={$c_{i1}$,$c_{i2}$,$c_{i3}$}, axis x line=bottom, axis y line=left,ymin=0, x=1.5cm, enlarge x limits=0.4]
\addplot[fill=white] coordinates{
($c_{i1}$,5)
($c_{i2}$,7)
($c_{i3}$,15)
};
\end{axis}

\draw[dashed,thick] (1.6,1.9) -- (5.1,1.9);
\draw[dashed,thick] (4.55,5.7) -- (5.1,5.7);

\end{tikzpicture}
\end{document}


example





Comma links in LTR texts in RTL arabic document


I insert an english fragment into arabic text. If there is a comma after a digit, I get surprising result. The comma goes before the number, not after.


enter image description here


The font above is "Amiri". I tested also "arabtype.ttf" from Microsoft (http://ift.tt/12cZVia) and got the same result. Therefore I consider it is not a bug, but some important feature.


Question 1, not important, just for curiosity: where can I read about this feature?


A general solution is to somehow remove script=arabic from font for LTR texts. I suspect it is a hard task.


An easy solution for this concrete problem is to add \hbox{} after the number. Then:


The question 2: are there other surprises for english text fragments when using script=arabic?


Sample code:



\documentclass[a4paper]{article}
\usepackage[RTLdocument]{bidi}

\begin{document}

\font\f="Amiri:script=arabic"
\f

\LRE{Print 42, then exit, but not.}

\LRE{Print 42: then exit: but not.}


\end{document}




KOMA class - two-column-text with content and "definitions"


A lot of (unsuccessful) research later:


I want to use KOMA-class and set a two-column document which contains an outer column for "definitions"/ "additional structure" like shown here:


http://ift.tt/12cZWTd


Is it possible to "fix" the words in outer column to a certain word/paragraph in the main text?


I wonder how this can be done (did not find anything in the internet yet) - thus no MWE so far...





The first 9 days of the month as a string


Is there a way to show the first 9 days of the month as 01, 02, 03 etc. \the\day prints 1, 2, 3 etc.





why Beamer doesn't build and produces (0 pages)


I have found a few number of threads online on this topic. However none worked, nor matched my problem. note that beamer used to work smoothly on my machine before.




  • every time I compile a .tex file with its class set to "beamer" it will yield in 0 pages.




  • I have uninstalled and re-installed MiKTeX 2.9 and yet nothing is different.




  • I have tried different editors TeXnicCenter, TeXStudio, and TeXworks.




  • log shows that it didn't find \citation or \bibdata or \bibstyle




other documents such as article, report ... etc work fine.


also, any document with amsmath package will produce 0 pages if such note is related.





Combination of arrowed list and boxes in tikzpicture


I am trying to make a figure showing some info using tikz. At first it looked OK, but after a while everything had moved so nothing was aligned. I figured that there probably is a much better way to do this, so that things cannot move around, but I have not been able to find a way to make such a list connected to boxes. Suggestions on how to make this in a better way is appreciated!



\documentclass[tikz,border=5]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\node[draw, fit={(0,0)(7,1.2)}] (Meta) at (3,0) {Metaheuristic layer};

\node[draw,align=left] (Destruction) at (0,-2) {Destruction\\heuristics};
\node[draw,align=left] (Construction) at (3,-2) {Construction\\heuristics};
\node[draw,align=left] (Local) at (6,-2) {Local search\\heurstics};

\node (toDestruction) at (0,-.6){};
\node (toLocal) at (6,-.6){};

\node (topDestruction) at (-.5,-2.315){};
\node (bottomDestruction) at (-.5,-4.68){};
\node (topConstruction) at (2.5,-2.315){};
\node (bottomConstruction) at (2.5,-5.22){};
\node (topLocal) at (5.5,-2.315){};
\node (bottomLocal) at (5.5,-4.32){};

\path[->, >=triangle 45, auto, semithick]
(toDestruction) edge (Destruction)
(Meta) edge (Construction)
(toLocal) edge (Local);

\path
(topDestruction) edge (bottomDestruction)
(topConstruction) edge (bottomConstruction)
(topLocal) edge (bottomLocal);

\node[label=right:Remove K] (RemoveK) at (-.3,-3){};
\node[align=left] (RemoveKSR) at (1.0,-3.8){Remove K\\same route};
\node[align=left] (MakeK) at (1.15,-4.78){Make K\\feasible gaps};

\node[label=right:Fill the gap] (FTG) at (2.7,-3){};
\node[label=right:K-regret] (Kreg) at (2.7,-3.6){};
\node[align=left] (Solomon) at (3.6,-4.3){Solomon\\insertion};
\node[align=left] (GNN) at (3.83,-5.5){Generalized\\nearest\\neighbour};

\node[label=right:2-exchange] (2ex) at (5.7,-3){};
\node[label=right:2-interchange] (2in) at (5.7,-3.6){};
\node[label=right:Resequence] (res) at (5.7,-4.2){};

\path[->]
(-.5,-3) edge (-.1,-3)
(-.5,-3.6) edge (-.1,-3.6)
(-.5,-4.55) edge (-.1,-4.55)
(2.5,-3) edge (2.9,-3)
(2.5,-3.6) edge (2.9,-3.6)
(2.5,-4.1) edge (2.9,-4.1)
(2.5,-5.1) edge (2.9,-5.1)
(5.5,-3) edge (5.9,-3)
(5.5,-3.6) edge (5.9,-3.6)
(5.5,-4.2) edge (5.9,-4.2);

\end{tikzpicture}
\end{document}




What is the best choice of format/package for including an animation into a powerdot presentation?


Me again :-(


System: Windows 7, MikTeX 2.9, WinEdt 7, LaTeX->Dvips->ps2pdf pipe


Trying the same animation as a year ago - just for the sake of being specific. This year I am teaching multivariable calculus so my needs will be a bit different, and this time I am aiming a bit higher.


Below you can see one animation I want to embed to a PowerDot presentation


enter image description here


It is 64 frames of GIF. Filesize about 150 kB. As we all know we cannot mix .gif and .eps (sigh), so something has to give. The animation is generated by Mathematica, so I have the options of exportin it (as well as individual frames) at least in .eps, .gif, .swf, .avi, .png formats.


Last year I managed using media9. That package is good for many a thing, but to use it I needed to convert the animation to either .swf or .mp4. And that's were the problems lie. Try as I may I was unable to get the conversion to keep the video quality. Hardly a surprise as neither of those formats is designed with compressing mathematical plots in mind. The avi-file has size 10MB at this quality, but both the swf and mp4 look cruddy in comparison - the curves look like they were first anti-aliased to 160x100 screen resolution and left at that with all the jaggies (your eyes are spared, because we cannot embed an mp4 to a question). The conversion service linked to in the previous question cannot be coerced to do lossless compression. To tell you the truth I don't know if there is anything like lossless mp4?



Are there options other than media9? This is only 64 frames (and I can compromise with a lower number). Or can you recommend a conversion program that produces higher quality mp4s from this kind of frames.



Will using the animate package help? Will that necessitate each frame to come from a separate file or can it handle an animated GIF?