samedi 29 novembre 2014

How to configure WinEdt/MikTeX/ps2pdf to use a new version of Ghostscript when converting ps->pdf?


System: Win7, WinEdt 7.0, MikTeX 2.9


In order to include animations into my powerdot slide sets I was instructed to use the animate package. Installing that was no problem. Also I have my animation in 64 .eps-files. LaTeX compiles it all right. DviPS does its magic all right (I think, see below).


However, whenever I click ps2pdf within WinEdt I get this error message



Ghostscript version >=9.15 required.



Can't say I was surprised to here about that as the animate package manual warns about this.


Ok, so I download and install a new version of Ghostscript. Doesn't help. I download and install a new version of Ghostview as well to be safe. This helped in the sense that in Ghostview preview I can see that the animation is shown correctly (ok, the box is a bit overfull, but RTFM should help with that). But ps2pdf still complains.


Time to start checking other things. WinEdt-> Options-> Execution Modes has a tab titled Ghostscript. WTF? that still has the old path? Fix that path. Go to control panel. Uninstall Ghostscript 8.63. Does not help!


Where does this old Ghostscript come from? Does MikTeX/ps2pdf have their private version of Ghostscript somewhere that I cannot uninstall? Why doesn't WinEdt step in? What's the point of it having this path configured, if the system does not use that version of GS?


I guess it shows that I'm mostly clueless about how WinEdt and MikTeX co-operate. Most of the time they work together splendidly, but now??


Should I have installed a 32-bit version of GS? Win 7 is 64-bit, but may be the rest of my LaTeX system needs the 32-bit version.



Can anyone diagnose the problem/shed any light on this?






What is the difference between \usepackage{mcode} and \usepackage{listings} for MATLAB codes?


I know there is available in the MATLAB Central File Exchange site the mcode.sty package, which allows to put MATLAB codes into TeX files.


http://www.mathworks.com/matlabcentral/fileexchange/8015-m-code-latex-package


However, there is also available in LaTeX a package called listings.sty, which I guess does pretty much the same thing.


http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings


What is the difference between them? Are there any advantages or disadvantages?


Thanks in advance.


Francesco.-





configure dash length in circuitikz


I'm trying to manually set the dash length while using \usepackage{circuitikz}. I only know about the options \draw[dashed] or \draw[densely dashed] . But how can I get the dashes even shorter? Or even punctuated, something like "\draw[punctuated]".


Here's an example of my code:



\documentclass [a4paper,11pt,oneside]{scrbook}
\usepackage[left=2.5cm,right=2.5cm,top=3.5cm,bottom=3.5cm]{geometry}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[european, siunitx]{circuitikz}
\usepackage{siunitx}
\usepackage{graphicx, pgf, listings, units, hyperref}
\usepackage{float}
\restylefloat{figure}
\usepackage{amsmath}
\usepackage{bm}
%-------------------------------------------
\begin{document}
%-------------------------------------------
\begin{figure}[H]
\centering
\begin{circuitikz}[>=latex]
%--------------BASE CIRCUIT & CELLS-------
\draw
(0,0) -- (5.75,0)
;
\draw[thick]
(5.75,0)
-- (5.75,-0.25)
-- (6.25,-0.25)
-- (6.25,0.25)
-- (5.75,0.25)
-- (5.75,0)
;
\draw
(6.25,0) -- (12,0)
-- (12,1)
to[C, l=$\text{C}_{\text{x}}$] (6,7)
to[C, l=$\text{C}_{\text{n}}$] (0,1)
-- (0,0)
;
\draw[dashed]
(9.5,3.5) -- (10.5,4.5)
(9.5,5.5)-- (8.5,4.5)
;
\draw
(9.5,5.5)
to[pC, l={\tiny{Elko}}] (10.5,4.5)
;
%
\draw[densely dashed] % This part is supposed to be with shorter dashes
(10.5,4.5) -- (11.5,5.5)
(10.5,6.5) -- (9.5,5.5)
;
\draw
(10.5,6.5)
to[empty diode, l={\tiny{Varicap}}] (11.5,5.5);
;
%
\end{circuitikz}
\caption[\LaTeX: test]{test}
\label{fig:test}
\end{figure}
%------------------------
\end{document}


Is this possible? Thanks for any help! greets





Centering a Poem using Verse package


I'm trying to center a poem on my document and I'm using the verse package to include line numbers on the poem. Here is my code:



\section{Poem}
\poemtitle{Another Day}
\begin{verse}[\versewidth]
\poemlines{2}
\begin{altverse}
having the low down blues and going \\
into a restraunt to eat.\\
you sit at a table.\\
the waitress smiles at you.\\
she's dumpy. her ass is too big.\\
she radiates kindess and symphaty.\\
live with her 3 months and a man would no real agony.\\
o.k., you'll tip her 15 percent.\\
you order a turkey sandwich and a\\
beer. the man at the table across from you\\
has watery blue eyes and\\ a head like an elephant.\\
at a table further down are 3 men\\
with very tiny heads\\
and long necks\\
like ostiches.\\
they talk loudly of land development.\\
why, you think, did I ever come\\
in here when I have the low-down\\
blues?\\
then the the waitress comes back eith the sandwich\\
and she asks you if there will be anything\\
else?\\
snd you tell her, no no, this will be\\
fine.\\
then somebody behind you laughs.\\
it's a cork laugh filled with sand and\\
broken glass.\\
\vspace{0.4cm}
you begin eating the sandwhich.\\
\vspace{0.4cm}
it's something.\\
it's a minor, difficult,\\
sensible action\\
like composing a popular song\\
to make a 14-year old\\
weep.\\
you order another beer.\\
jesus,look at that guy\\
his hands hang down almost to his knees and he's\\
whistling.\\
well, time to get out.\\
pivk up the bill.\\
tip.\\
go to the register.\\
pay.\\
pick up a toothpick.\\
go out the door.\\
your car is still there.\\
and there are 3 men with heads\\
and necks\\
like ostriches all getting into one\\
car.\\
they each have a toothpick and now\\
they are talking about women.\\
they drive away first\\
they drive away fast.\\
they're best i guess.\\
it's an unberably hot day.\\
there's a first-stage smog alert.\\
all the birds and plants are dead\\
or dying.\\
\vspace{0.4cm}
you start the engine.
\end{altverse}
\end{verse}


This yields the following:


Snip 1 Snip 2


I want it to be centered like the poem title...could this be fixed?





Why am I suddenly getting a "compile error" on Writelatex and how do I stop it?


I started writing a lab report using Writelatex and it was working fine for a few weeks and I added images etc.


Then one day I tried adding a new image and got a "compile error" and couldn't insert the image, and I tried inserting the images I had already inserted into the new part and they wouldn't work either.


I could write text and it would appear in the template.


Now I just logged onto writelatex and my template isn't showing up on the right and it still says "compile error".


Why is there this compile error and how can I get rid of it?


I'm on mac if that helps.





Drawing and labeling the sides and angles of a right triangle


The following code instructs TikZ to draw a right triangle AQP with a right angle at Q. I mark the length of line segment AQ by y. How do I rotate by 90 degrees the letter y so that it is upright? I would like to draw a line segment perpendicular to PA from A to the line containing the leg PQ, and I would like to label that point of intersection R.



\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}


\begin{document}



\begin{tikzpicture}[dot/.style={fill,circle,inner sep=1.5pt}]
\path
(80:5) node [dot,label=above left:$A$]{} coordinate (A)
(80:7) coordinate (a)
(20:9) coordinate (B)
(20:11) coordinate (b)
(0:0) node[dot,label=below left:$P$]{} coordinate(P)
(-100:1)coordinate (e)
(-160:1) coordinate (f);

\path coordinate (Q)at($(P)!(A)!(B)$) node at (Q)[dot,label=below:$Q$]{} ;
\draw[<->] (a)--(e);
\draw[<->, name path=kline] (f)--(b) node[below right]{$k$}; % First line for intersection

\draw[purple!70!black,dashed] (A)--(Q);
\tkzMarkRightAngle(A,Q,P);

\draw ($(P)!3mm!90:(A)$)--($(A)!3mm!-90:(P)$)coordinate(u); % Note here the invisible point u, where uA is normal to pA at point A
\draw[|<->|] ($(P)!-7mm!90:(Q)$)--node[fill=white,sloped] {$x$} ($(Q)!-7mm!-90:(P)$);
\draw[|<->|] ($(Q)!-3mm!90:(A)$)--node[fill=white] {$y$} ($(A)!-3mm!-90:(Q)$);

\tkzMarkAngle[size=0.75cm,color=cyan,mark=||](B,P,A);
\tkzMarkAngle[size=1cm,color=cyan,mark=|](P,A,Q);

\path [name path=ARline] (u)--($(A)!-10cm!(u)$); % Second line for intersection
\path [name intersections={of = ARline and kline, by=R}];
\draw (A)--(R)node[dot,label=below:$R$]{};
\tkzMarkRightAngle(R,A,P);
\end{tikzpicture}

\end{document}




How can I justify the text under the picture?


\begin{frame}

\frametitle{Kísérletek III.}

\begin{reference}{3mm}{92.75mm}

physicsworldarchive.iop.org

\end{reference}

Federico Capasso et al.

\begin{columns}

\begin{column}{0.4\textwidth}

\includegraphics[width=4.5cm,clip]{capasso_setup.jpg}

\label{fig:capsetup}

\textcolor{blue}{5. ábra.}

A kísérlet sematikus rajza.

\end{column}

\begin{column}{0.4\textwidth}

\includegraphics[width=5cm,clip]{capasso_graph.jpg}

\label{fig:capgraph}

\textcolor{blue}{Fig.6.}

A mikrofabrikált torziós szerkezet (A) és a torziós rúd (B) mikroszkópos felvétele.

\end{column}

\end{columns}

\end{frame}


enter image description here