title: How to deal with macro expansion and 'TeX capacity exceeded' when using write18?

text: This issue is driving me nuts. Ever since the friendly and knowledgeable people here on tex SE have guided me to doing multiple string replacements the proper way, I've been trying to incorporate that knowledge into my code — to no available so far. The difficulties are:   1. The string replacement facility uses `\noexpandarg` / `\expandafter`, which does not cooperate with `\write18` all too well, and    2. There is a nasty condition with `\write18` and/or `\input` that causes (La)TeX to throw up a `TeX capacity exceeded, sorry` message. Let's look at the M(W)E below — it is not really working as it stands, because I'm using `curl` to address a local server which is not featured here. For those who are interested: This code is intended for CoffeeXeLaTeX, an attempt to make TeX scriptable with JavaScript (and, therefore, CoffeeScript). You cannot successfully run the code below unless you have a web server at the address specified; I realize that this dependency is wholly fortuitous for the effects I want to demonstrate, and I'm willing to rewrite the example so we can take the brackets out of M(W)E. That said, I'm sure that many of you will just exclaim "Aha! Beginner's mistake!" when reading this code:               \documentclass[a4paper]{article}     \usepackage{xstring}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}               % -----------------------------------------------------------------     % URL escaping simplified;     % as per http://tex.stackexchange.com/questions/153215/how-to-do-multiple-string-replacements     \newcommand{\urlescapestep}[2]{%       \expandafter\StrSubstitute\expandafter{\x}{#1}{#2}[\x]%       }     \newcommand{\urlescape}[1]{{%       \noexpandarg%       \StrSubstitute{#1}{\%}{\%25}[\x]%       \urlescapestep{/}{\%2F}%       \urlescapestep{a}{A}% just for this test; imagine useful stuff here       \x}}          \newcommand{\escapeONE}[1]{*#1*}          \newcommand{\escapeTWO}[1]{\StrSubstitute{#1}{a}{A}}          % -----------------------------------------------------------------     % Execute a command with `\write18`:     \newcommand{\CXtempoutroute}{/tmp/CXtempout.tex}          \newcommand{\exec}[1]{%       \immediate\write18{#1 > "\CXtempoutroute"}\input{\CXtempoutroute}}          % -----------------------------------------------------------------     % `curl` commands using the string replacement commands:     \newcommand{\curlPlain}[4]{%       \exec{curl --silent --show-error #1 #2/#3#4}}          \newcommand{\curlUrlescape}[4]{%       \exec{curl --silent --show-error #1 #2/#3\urlescape{#4}}}          \newcommand{\curlONE}[4]{%       \exec{curl --silent --show-error #1 #2/#3\escapeONE{#4}}}          \newcommand{\curlTWO}[4]{%       \exec{curl --silent --show-error #1 #2/#3\escapeTWO{#4}}}          % -----------------------------------------------------------------     \begin{document}          First, let's show our three string escaping mechanisms all work under     normal circumstances:          \verb#\urlescape#: \urlescape{abc}          \verb#\escapeONE#: \escapeONE{abc}          \verb#\escapeTWO#: \escapeTWO{abc}          These do work and turn \verb#abc# into \verb#Abc#, \verb#*abc*#, and \verb#Abc#, respectively.          Now let's use the various \verb#curl*# methods:          works: \verb#\curlPlain{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}#:        \curlPlain{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}          works: \verb#\curlONE{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}#:        \curlONE{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}          throws: \verb#\curlTWO{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}#:        \curlTWO{}{127.0.0.1:8910}{foobar.tex/helo/}{abc}          \end{document}      The code as it stands throws `TeX capacity exceeded, sorry [text input levels=15]`, which would seem to indicate that TeX is recursively calling itself for too many times. During the past endless hours, I have also managed to get a `TeX capacity exceeded, sorry [input stack size=5000]`, and, significantly, that dreaded `use of StrSubstitute doesn't match its definition` errors, depending on exactly where I happened to put those magic `\edef`, `\noexpand`, `\expandafter` stuff. I fully admit that I was doing cargo cult programming, but then I also took out my vintage 1990 Taiwan edition of The TeX Book. I read Bechtolsheim, I searched the internet so often Google wants to send me a golden customer card now. I erased the experimental code and started over so I can post this question with some meaningful code; I could probably try and reconstruct some of the intermittent attempts. What I found out so far is that when TeX writes stuff to a file, it will postpone that writing because it assumes that "most of the time that is what you'll want" (not sure I can agree with that; why not write `\postpone\write18` if you really want to have it work that way?). You can make it act _now_ with `\immediate`, but since there aint no bait with no hook in TeX, this does not _exactly_ what you'd think it should, it only 'works similar in most cases'. As a programmer, I'm used to dealing with recursive function calling and delayed, asynchronous code execution in the event loop. Curiously, this knowledge is of little help to me when TeX complains:   * Where do the recursive calls take place in the above code? I cannot spot them.    * Why do i sometimes get those `stack size exceeded` errors for innocuous input files when using `\input`(i believe)?    * Why does the presence of `\noexpand` / `\expandafter` break `\write18`?    * What am I supposed to do against these symptoms (short of reading the implementation code down to the last expansion of every command inside the argument to `write18`)?    * Is all this in some way related to the issue of robust / fragile commands and 'moveable arguments'? I feel justified to ask this convoluted, huge question because my feeling after fiddling for some months with TeX (and managing to produce output, so it's worth the try) I feel that these are the convoluted, shady quarters of TeX where visitors don't like to go, where no easy transport is available, and where only the toughest can make it work at all. Which about sums up my motivation for coming up with CoffeeXeLaTeX.


title: pgfplots: use `colormap` color for `jump mark` line

text: I have a `ybar interval` pgfplot with variable width intervals. On top of each interval I am drawing a line with the interval's width (using a second plot with `jump mark left`). However, I cannot find a way to tell pgf to draw those lines in the color of the current `colormap`. Instead, they are always drawn using the color specified using `draw=`. In my rendering below, I want the red lines to be in a color representing their y-value instead:   ![bad rendering](http://i.stack.imgur.com/QhydS.png) One thing that also catches my attention is that the labels alongside the `colorbar` have nothing to do with the `y` values in my actual plot, but they should. MWE:               \documentclass{standalone}          \usepackage{filecontents}     \begin{filecontents}{data.csv}     height,width     1,884     2,5768     3,835     4,2661     5,492     6,1349     7,486     8,1117     9,498     10,854     10,0     \end{filecontents}     \usepackage{pgfplots, pgfplotstable}          \begin{document}     \begin{tikzpicture}          \begin{axis}[         ymode=log,         colorbar,     ]     \addplot[         ybar interval,         fill=cyan,         draw=none,     ] table [         col sep=comma,         create on use/xaccum/.style={             create col/expr=\pgfmathaccuma+\prevrow{width}         },         x=xaccum, y=height,     ] {data.csv};     \addplot[         jump mark left,         draw=red, %this should be a color based on the y value     ] table [         col sep=comma,         create on use/xaccum/.style={             create col/expr=\pgfmathaccuma+\prevrow{width}         },         x=xaccum, y=height,     ] {data.csv};          \end{axis}     \end{tikzpicture}     \end{document}


title: \textbackslash shows error "undefined control sequence"

text: I am typing the equation with \textbackslash inside as follows. It displays error "underfined control sequence". Can anyone explain me what the problem is? Thanks.               Here $x\in [0,\infty]^n$ \textblackslash  $\{1\}$. I got error "Undefined control sequence.          Here a \textbackslash b. This line is OK.


title: How do I turn off equation auto numbering

text: I have an equation like this:                  \begin{align}           P(A \cup B) = \sum_{\omega \in A \cup B} P(\omega) = \sum_{\omega \in A} P(\omega) + \sum_{\omega \in B} P(\omega)           = P(A) + P(B)         \end{align}      For some reason, LaTeX is automatically labeling the equation. How do I turn that off? Secondly how do I write something in LaTeX on this site. I tried enclosing in '$' but it doesn't work.


title: Problem with redefining Tabular environment with the \renewenvironment command

text: In a book I'm typesetting, I want the tabular environment to be in footnote size and the other body of the book to be in normalsize font. To do this, I've tried something like the following:               \renewenvironment{tabular}[1][t]{\footnotesize     \begin{tabular}     [#1]}{\end{tabular}\normalsize}      But I get the following error:               ! TeX capacity exceeded, sorry [save size=50000].       <to be read again>                     \relax       l.72 \centering\begin{tabular}{                                cccccc}      By the way, I'm using the tabular as below:               \begin{table}[t]     \caption{Title}\label{tab1}     \centering\begin{tabular}{cccccc}     ....     \end{tabular}     \end{table}      Have I done something wrong here? ## Edit on December 28th (another question): In the following code, if I want also to add a `\centering` command, where should I put it? I have put it before and after the `\footnotesize` but it doesn't work!               \let\oldtabular\tabular     \let\endoldtabular\endtabular     \renewenvironment{tabular}{\bgroup\footnotesize\oldtabular}%                               {\endoldtabular\egroup}


title: texinfo: Can i write non-english info files? Such as Chinese, and how?

text: The most gnu manual files use info, write a texinfo then makeinfo produce info files, it's great. Can texinfo contain non-English characters then produce non-English infos or pdfs? How can i write Chinese info manuals? What is the best solutions for non- English software manuals, documentations just one source files to info, man, html, and pdf. Thank you :)


title: Using Tikz to draw a Hash Table

text: I need to try to replicate a similar structure to this ![enter image description here](http://i.stack.imgur.com/fKGvp.png) but am a novice when it comes to tikz. I'm not sure whether to use chains, explicit node positioning, etc. And, in my experience of drawing graphs, I could never get the arrows to bend properly. This is a problem that is beyond my TeX abilities...


title: Problem with the pst-geo bundle

text: I have tried to compile the code in this example from Political map in LaTeX following the latex->dvips->ps2pdf sequence but in the very first stage (latex compilation) I got the error message               !keyval: showgrid undefined     \KV@err #1->\errmessage {keyval: #1}      I am using an updated MikTeX 2.9 installation on Windows XP. Anyone could possibly help on this issue? Thanks so much in advance.


title: Decreasing space between subsubsections

text: I use the LNCS document style for a paper. However, I find the spacing between subsubsections (ca 2 lines) very generous and would like to decrease it. How can I do this? (Note: I am not required to adhere to the LNCS formatting rules, so hacking this is okay.)               %% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[10pt,english]{llncs}     \begin{document}     \section{Section A}     \subsubsection{First.}     Lorem ipsum.     % TODO: decrease spacing here     \subsubsection{Second.}     Lorem ipsum.     \end{document}


title: Highly Customized Chapter, Section, and Subsection Headings

text: After going through some of the forum posts on custom headings and bad section breaks I am still unable to eliminate the later. I have customized my own Chapter and Section which generates "lonely" section headings (check out the MWE). I am certain that it is done wrong. Can anyone put me on the right track?               \documentclass{book}     \usepackage{fourier-orns}          \makeatletter     %%%SECTION%%%     \def\section{\MySection}     \def\MySection#1{         \vskip 3ex \goodbreak         \begingroup             \noindent                 \Large\textbf{\S\thesection$\;$\textsc{#1}}\vspace{-.5\baselineskip}\par             \noindent         \endgroup         \vskip 2\baselineskip %\goodbreak     }          %%%CHAPTER%%%     \def\@makechapterhead#1{         \vspace*{\baselineskip}         \begin{center}             {\large\sc{Chapter \thechapter}}             \par             \noindent{\centering ------\large\decoone------}                  {\huge \strut{\sc{#1}}\strut \par}         \end{center}         \vskip 70\p@     }     \makeatother          \begin{document}         \chapter{Top level}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam facilisis massa vel lacus varius dapibus. Pellentesque volutpat, tortor mattis eleifend euismod, tellus risus imperdiet dolor, id lobortis eros mi quis augue. Vestibulum eleifend congue orci id sollicitudin. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut non suscipit libero, ornare rutrum augue. Suspendisse tortor elit, sagittis quis porttitor nec, hendrerit eu velit. Aenean lacinia diam vel dui pulvinar placerat. In eget purus velit.          Cras hendrerit euismod justo ut tincidunt. Etiam ultrices, urna quis dapibus elementum, risus quam ornare nibh, nec fringilla lectus lectus in massa. Proin suscipit auctor tempor. Pellentesque elit dolor, tincidunt ut tellus eu, eleifend tristique odio. Nulla suscipit, lectus quis sollicitudin volutpat, ligula sem feugiat velit, id aliquam nunc metus at metus. Cras a libero dignissim, convallis dui et, hendrerit tellus. In tempor, nisl facilisis adipiscing consectetur, diam diam mattis nisi, ornare facilisis risus quam a sem. Etiam vel sapien in dui feugiat bibendum. Phasellus eget felis ut eros porta venenatis vel vitae ipsum.          Sed eu urna auctor, condimentum nisi id, posuere mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Maecenas eu rhoncus quam. Fusce suscipit posuere eros, sit amet laoreet nunc pellentesque ut. Suspendisse augue quam, fermentum vitae porttitor sed, mollis eu lectus. Nam ut iaculis nibh. In aliquam metus in nibh vulputate, dignissim hendrerit tellus elementum. Morbi luctus diam vel leo semper ullamcorper. Maecenas enim eros, molestie vel lorem id, sodales cursus urna. Nunc commodo dolor massa, ac aliquam orci volutpat ut. Cras lacinia tincidunt sem sit amet lacinia. Maecenas malesuada nulla sem, at dignissim lorem ornare sed. Vestibulum et lorem lacinia, elementum quam ullamcorper, fermentum ligula. Donec et dictum magna, quis pulvinar nibh. et lorem lacinia, elementum quam ullamcorper, fermentum ligula. Donec et dictum magna, quis pulvinar nibh. et lorem lacinia, elementum quam ullamcorper, fermentum ligula. Donec et dictum magna, quis pulvinar nibh.          \section{Bad Break}     Maecenas enim eros, molestie vel lorem id, sodales cursus urna. Nunc commodo dolor massa, ac aliquam orci volutpat ut. Cras lacinia tincidunt sem sit amet lacinia. Maecenas malesuada nulla sem, at dignissim lorem ornare sed. Vestibulum et lorem lacinia, elementum quam ullamcorper, fermentum ligula. Donec et dictum magna, quis pulvinar nibh               \end{document}      (Also, as a side note, how do you get compiled Latex to render here?)


title: How to rotate a pgfplot?

text: I'm trying to create a plot like this: ![Class B amplifier](http://paginas.fisica.uson.mx/horacio.munguia/aula_virtual/Cursos/Electronica/images/dance2625e.gif) So far, I arrived here: ![latex load line](http://i.imgur.com/D9uUuMd.png) With the following (minimalized) code:               \documentclass{report}     \usepackage{pgfplots}        \pgfplotsset{compat=1.8}          \begin{document}                 \begin{tikzpicture}                  \begin{axis}[                     cycle list name=color list,                     axis x line=bottom,                     axis y line=left,                 ]                      \foreach \i in {1,2,3,4,5,6} {                     \addplot+[black] coordinates{                         (0,0)                         (sqrt(\i/1.5),\i)                         (11,\i)};                    }                                         \addplot+[red] coordinates{(2,6)(10,0)};                          \end{axis}                            \begin{axis}[                     cycle list name=color list,                       axis x line=bottom,                     axis y line=left,                         xmin=-5,    xmax=10                         %axis lines=none                 ]                                 \pgftransformshift{-100}                          \addplot+[green,domain=-5:0] {sin(x*90)+3};                       \end{axis}                            \begin{axis}[                     cycle list name=color list,                       axis x line=bottom,                     axis y line=left,                         xmin=-5,    xmax=10,                         axis lines=none                 ]                                 \pgftransformrotate{30}                          \addplot+[green,domain=5:10] {sin(x/2*90)+2};                         \end{axis}                                     \begin{axis}[                     cycle list name=color list,                       axis x line=bottom,                     axis y line=left,                         xmin=-2,    xmax=10,                         ymin=0, ymax=10                         %axis lines=none                 ]                                 \pgftransformrotate{270}                          \addplot+[green,domain=0:3] {-sin(x/3*180)*8+10};                         \end{axis}                        \end{tikzpicture}     \end{document}      So, my main problem is the rotation and alignment of the sine waves. I'm not sure if what I tried is the way to go since I see no possibility to align the four different axes with each other precisely, any hint is appreciated. Edit 1: This is my underlying plot, how can I move the center of the sine plot ontop of the red dot? I would provide code but it's rather long.. ![Class B amplifier](http://i.imgur.com/khu8WwQ.png) Edit 2: Ok, got it. Some things may not seem very elegant, but maybe this can be of use for someone:               \documentclass[class=minimal,border=0pt]{standalone}     \usepackage{pgfplots}        \pgfplotsset{compat=1.8}     \usepackage{pgfplotstable}       \usetikzlibrary{patterns}     \usetikzlibrary{calc}          \begin{document}              \centering         \begin{tikzpicture}         [/pgfplots/y=8cm, /pgfplots/x=1cm] % To make sure all the plots use the same scale]                       %%               %% VOLTAGE INPUT             %%                   \begin{axis}[                 anchor=origin, % Shift the axis so its origin is at (0,0)                    rotate around={63.5:(current axis.origin)}, % Rotate around the origin                 xmin=0, ymin=0, clip=false, % We only want the positive y axis, hence `ymin=0`. `clip=false` is necessary so we can still see the negative component                 xmax=4.5, ymax=0.8,                 axis lines*=center, % Axis lines going through the origin                 xtick=\empty, ytick=\empty, % No tick marks                 enlarge y limits={upper, value=0.5}, % Make the y axis a bit longer than necessary                           axis y line=none                 ]                            \addplot [thick, blue, domain=1:4, smooth] {0.895*sin(x*120-120)} coordinate [pos=0.25] (input);                  \coordinate (aux) at (axis cs:0,0.895); % Name the coordinate on the axis for drawing the dashed lines later                     \end{axis}                  %%               %% VOLTAGE OUTPUT             %%                       \begin{axis}[                 anchor=origin, % Same as before                 rotate around={-90:(current axis.origin)},                 axis lines*=center,                 xtick=\empty, ytick=\empty,                 xmin=0, ymin=0, clip=false, % We only want the positive y axis, hence `ymin=0`. `clip=false` is necessary so we can still see the negative component                 xmax=5.25, ymax=0.8,                 hide y axis % The y axis coincides with the x axis of the previous axis, so we hide it to avoid drawing it twice                 ]                 \addplot [line join=round,thick, red, domain=2:3.62, smooth] {-0.80*sin(x*120-240)} coordinate [pos=0.45] (output); % half a sine wave                 \addplot [line join=round,thick, red, domain=3.61:4.89, smooth]   {0.2} coordinate [pos=0] (rail_volt);                  \addplot [line join=round,thick, red, domain=4.88:5, smooth] {-0.80*sin(x*120-240)}; % half a sine wave                                              \end{axis}                        %%               %% CURRENT             %%             \begin{axis}[                     anchor=origin,                     axis lines*=center,                     xtick=\empty, ytick=\empty,                     hide y axis,                     hide x axis,                     xmin=-12.25, ymin=0, clip=false, % We only want the positive y axis, hence `ymin=0`. `clip=false` is necessary so we can still see the negative component                     xmax=0, ymax=0.8,                                    enlarge x limits={upper, value=1} % Extend the axis to the right                     ]                    \addplot [smooth,thick, black, domain=-12.5:-12.38] {0.4*sin(x*120+4560)}; % Shifted half sine wave                 \addplot [smooth,thick, black, domain=-12.39:-11.11] {-0.1} coordinate [pos=0] (rail_curr); % Shifted half sine wave                         \addplot [smooth,thick, black, domain=-11.12:-9.5] {0.4*sin(x*120+4560)} coordinate [pos=0.545] (current); % Shifted half sine wave                  \addplot [smooth,thin,  black, domain=-12.75:-9.2] {0};                          \end{axis}                            \begin{axis}[                     anchor=origin,                     at={(-84,-10)},                      cycle list name=color list,  %% AXIS FORMAT                     axis x line=bottom,                     axis y line=left,                     xlabel style={at={(current axis.right of origin)},align=center,yshift=-0.5em, xshift=-3em,  anchor=north west},                     ylabel style={at={(current axis.above origin)},align=center,yshift=0em, xshift=+2.5em, anchor=north east,rotate=270},                     xlabel={$V_{DS},\;\lbrack V\rbrack$},                     ylabel={$I_{DS},$\\$\lbrack A\rbrack$},                     xtick={0,2,...,10},                                                     % {0,2,...,10} (the same as {0,2,4,6,8,10}), {0,1,2,5,8,1e1,1.5e1} (a series of coordinates)                     minor xtick={0,1,...,11},                            %%extra x ticks={22},                     ytick={0,0.1,...,0.6},                     minor ytick={0,0.05,...,0.55},                     xmin=0, xmax=12,                     ymin=0, ymax=0.55,                     %x=1cm, y=1cm,                     %legend pos=south east,                     %grid=major,                                                % /pgfplots/grid=minor|major|both|none                      height=5cm,                     width=10cm,                     axis on top,                     yticklabel style={draw=none, inner sep=0pt, outer sep=0.3333em, fill=white, text opacity=1},                     xticklabel style={draw=none, inner sep=0pt, outer sep=0.3333em, fill=white, text opacity=1}                 ]                 \pgfplotstablenew[                     create on use/x/.style={create col/expr={0+\pgfplotstablerow*0.05}},                     create on use/y/.style={create col/expr={\thisrow{x}*0+0.65}},                     columns={x,y}]                     {43}                     \ftable                 \pgfplotstablenew[                     create on use/x/.style={create col/expr={0+\pgfplotstablerow*0.05}},                     create on use/y/.style={create col/expr={0.125*(\thisrow{x})^2}},                     columns={x,y}]                     {43}                     \gtable                 % Sort the second table by the x value, from largest to smallest                 \pgfplotstablesort[sort cmp={float >}]\gsorted{\gtable}                 %\pgfplotstabletypeset\gsorted                 % Concatenate the tables -- now filledcurve contains the edge of                 % a polygon bounded by curves f and g                 \pgfplotstablevertcat{\filledcurve}{\ftable}                 \pgfplotstablevertcat{\filledcurve}{\gsorted}                      \addplot+[opacity=0.8,fill opacity=0.3,draw=none,fill=yellow,postaction={pattern=north east lines}] coordinates {(11,0.55) (12,0.55) (12,0) (11,0)};                             \addplot[fill=gray,opacity=0.7,fill opacity=0.2,draw=none,postaction={pattern=north east lines}] table {\filledcurve};                   \foreach \i in {0.1,0.2,0.3,0.4,0.5} {                     \addplot+[black] coordinates{                         (0,0)                         (sqrt(\i/0.125),\i)                         (11,\i)};                        \addplot+[black,domain=11:12] {((x-11)^4*5)+\i};                     }                         \addplot+[gray,domain=0:2.2] {0.125*x^2};                            \coordinate (rail_abs) at (axis cs:10,0); % Name the coordinate on the axis for drawing the dashed lines later                                   \addplot+[ultra thick, red] coordinates{(2,0.5)(10,0)};                  %%\node[red] at (axis cs:8.4,0.1) {\textbullet}; %(8.6666666666666666666)                        \draw[thick, black, fill=red] (axis cs:8.4,0.1) circle(1mm);                     \end{axis}                           \draw [densely dashed] (input) -- (aux); % Draw the dashed line                      \draw [densely dashed] (output) -- ($(aux)-(0,4.6)$); % Draw the dashed line                             \draw [densely dashed] (aux) -- ($(aux)-(0,4.0)$); % Draw the dashed line                      \draw [densely dashed] ($(rail_abs)-(0,0.6)$) -- (rail_volt); % Draw the dashed line                           \draw [densely dashed] (current) -- ($(aux)-(2.8,0)$); % Draw the dashed line                        \draw [densely dashed] ($(aux)-(2,0)$) -- (aux); % Draw the dashed line                           \draw [densely dashed] (rail_curr) -- ($(rail_abs)-(10.6,0)$); % Draw the dashed line                               \end{tikzpicture}     \end{document}      ![finished pic](http://i.stack.imgur.com/F36Yn.png)


title: pgfkeys computed (i.e., dynamically defined) key

text: I would like to perform some simple simulation in latex/tikz (in order to produce dynamical graphs). Say something like cellular automata, Ising model, etc. I need to store somewhere the value of variables (an array) and I tried pgfkeys. However, it does not seem to accept "computed" keys. This is a minimal example               %storing (and printing for check)       \foreach \i in {0,...,5} {          \FPrandom{\rand}\FPeval{res}{round(rand:2)};          \pgfkeys{/c/\i/.code=\res};          \draw (\i, 0)  node{\pgfkeys{/c/\i}};       }          %retrieving        \foreach \i in {0,...,5} {          \draw (\i, 0)  node{\pgfkeys{/c/\i}};       }      It says that the keys /c/0 ... are not known. I imagine that this is due to the fact that one needs to expand the "\i" inside the key BEFORE it is used but I do not know how to get it.


title: drawing with TikZ

text: I am unable to create the images (a) and (b) as shown below ![enter image description here](http://i.stack.imgur.com/uqtQf.png) The above image is borrowed from http://www.nature.com/nmat/journal/v1/n1/fig_tab/nmat715_F1.html Can someone please guide me in creating the image (a) or image (b)? Thank you.


title: Change font in pstricks

text: I'm trying to change the font inside of my pstricks code, but I can't change to the font I want to use. I'd rather use another code instead `\usefont`. This is my code:               \thispagestyle{empty}     \newgeometry{left=0cm,right=0cm,top=0cm,bottom=0cm}     \begin{pspicture}(0cm,29.7cm)     \newsavebox\IBox     \sbox\IBox{\includegraphics[height=29.7cm,width=21cm]{Capa2.eps}}     \psset{unit=1cm}     \rput[lb](-0.63,0){\usebox\IBox}          \rput(9.02,25.7){\usefont{T1}{phv}{b}{n}\fontsize{48pt}{48pt}\color{white}\selectfont $\text{Anotações Sobre o}$}          \rput(8.3,23.7){\usefont{T1}{phv}{b}{n}\fontsize{54pt}{48pt}\color{white}\selectfont $\text{Operador Nabla}$}     \end{pspicture}      I set on my document the Palatino font, but the text in pstricks I would like to use a font from here http://www.tug.dk/FontCatalogue/. Can you guys help me out?


title: How to adjust two pictures side by side in just one column of multicol environment?

text: First of all, thanks to the group member Harish Kumar because of whose advise finally I was able to fix the caption line under the figure/ float in multicol environment. This is what I then faced:               \documentclass[10pt, twoside]{book}     \usepackage[demo]{graphicx}   %%% remove demo in your file     \usepackage{multicol}     \usepackage{caption}          \begin{document}           \begin{multicols}{2}      a test file for picture inclusion along with the captions and labeling     \begin{center}      \fbox{\includegraphics[scale=0.2]{Cauchy_sequence_illustration-png}}      \captionof{figure}{Cauchy Seq1}\label{Cauchy1}      \fbox{\includegraphics[scale=0.2]{Cauchy_sequence_illustration-png}}      \captionof{figure}{Cauchy Seq2}\label{Cauchy2}      \end{center}      \end{multicols}           \end{document}      The problem is : I am willing to include two pictures "side by side" rather than up-down way. But in vain. Can anyone please help me how to do that? Thanks in advance


title: Multiple alignment without spacing

text: What is the best way of typing an equation like this? ![enter image description here](http://i.stack.imgur.com/JJW9Q.png) (The vertical red lines indicate three different alignment axes.) I have tried the following:               \begin{alignat*}{3}         \phi: Z^{X \times Y} &\to (Z^Y)^X\\                        f     &\mapsto \phi(f): X &&\to Z^Y\\                                                x &&\mapsto \phi(f)(x): Y &&&\to Z\\                                                                          y &&&\mapsto \phi(f)(x)(y) = f(x,y)     \end{alignat*}      But it doesn't work well.


title: How to use standard TeX fonts in XeLaTeX

text: How do I use the inbuilt LaTeX standard fonts (in this case Times for roman, Helvetica for sans serif and Courier for mono) when using XeLaTeX and fontspec? I have tried:               \documentclass[journal, a4paper]{IEEEtran}          \usepackage{fontspec}     \renewcommand\rmdefault{ptm}     \renewcommand\sfdefault{phv}     \renewcommand\ttdefault{pcr}          \begin{document}          “Touché,” \textsf{he} \texttt{said}.     \end{document}      without success. Note that I want to be able to type utf8, non-English characters directly and therefore I use fontspec.


title: use full page external image with text overlay

text: I have a pdf image that is A4 size. The document I am creating is also A4. I want to use this image as the first page of my document (basically, as the cover) and print some text (in white) over it. How can I do this? Basically, I need to override all margins for this particular page and also make sure it covers the page exactly and keeps fitting perfectly when the final document it is rendered as a pdf. Any suggestions on how to make this happen?


title: Three graphics with tables of data

text: I need to create a figure like the following. If I have the color plots saved as png images (ie. test.png, rans.png and ddes.png), what would be the best way to create this sort of graphic in LaTeX? ![example](http://i.stack.imgur.com/3Z6F0.png)


title: To wrap the external lines so that it can touch the perimeter

text: Similar to this, Wrapping a Feynman diagram in an ellipse or a circle?, I am having some in tikz problem making sure the legs of these diagrams touching the perimeter. I tried the following, but I am not quite able to do it. Will somebody kindly help me draw these kind of diagrams?               \begin{center}     \tikzset{     particle/.style={decorate, draw=black,         decoration={aspect=0.08,segment length=3pt,amplitude=3pt}}}\begin{tikzpicture}[node distance=1cm and 1.5cm]     \coordinate (e1);                              \coordinate[below left=of e1] (aux6);     \coordinate[below right=of aux6] (aux7);     \coordinate[below left=of aux7] (aux8);                              \coordinate[below=1cm of aux1] (aux);                              \draw[particle] (aux7) -- (aux6);     \draw[particle] (aux7) -- (aux8);     \draw[particle] (aux7) -- (aux);     \draw[particle] (aux7) -- (aux8);     \draw[particle] (e1) -- (aux1);     \draw[particle] (aux1) -- (e2);     \draw[particle] (e3) -- (aux2);     \draw[particle] (aux2) -- (e4);     \draw[particle] (aux1) -- node {} (aux2);     \node[draw,name path=circle,line width=3pt,circle,fit=(e1) (e4) (aux7) (aux8),inner sep=.5\pgflinewidth] {};     %\path[name intersections={of=circle and diameter, by={aux3}}];% find the intersection     \draw[particle] (aux) -- (aux3);     %\draw[particle] (aux2) -- (aux3);     %\draw[particle] (aux3) -- (aux1);     \end{tikzpicture}     \end{center}      ![I am interested in having these diagrams touching the perimeter](http://i.stack.imgur.com/zqCaM.png)


title: Problem with the zhnumber package

text: I am trying to write about numerals and the use of symbols. As an example I would like to use chinese/japanese symbols to show a multiplicative system. I have come up with the package `zhnumber` which works great for `\zhdigits` but not for `\zhnumber`. I have copied the examples from the documentation. Still I get the error: `Undefined control sequence`. Can anyone please help? Is there something wrong with the combination of fonts or other packages? I am using a mac               \documentclass[a4paper,12pt]{article}     \usepackage[utf8]{inputenc}      \usepackage[norsk]{babel}     \usepackage[T1]{fontenc}     \usepackage{parskip}     \usepackage{xeCJK}     \setCJKmainfont{STSong}     \usepackage{zhnumber}     \zhnumsetup{null,style=Traditional}          \begin{document}     \zhdigits{5} \\     \zhnumber{10}     \end{document}


title: How to change the distance between month label and calender

text: I want to know, how to decrease/increase the distance between month label and the calendar. There seem to be no "month label xshift" key. Here is an MWE to play with:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calendar}          \begin{document}          \begin{tikzpicture}[scale=.8]        \calendar (mycal) [dates=2013-01-01 to 2013-01-last, week list, month label left vertical];       \draw[red, thick] (mycal-2013-01-28) circle (7.3pt);     \end{tikzpicture}          \end{document}      With following result: ![enter image description here](http://i.stack.imgur.com/4G5wt.png)


title: makeglossaries doesn't work

text: I'm trying to run makeglossaries in TexStudio (and TexMaker). It seems that this doesn't have any effect on the glossary printed. This problem persisted after switching from windows to linux I run (which is supposed to do all the work I need :D):               pdflatex -synctex=1 -interaction=nonstopmode %.tex | makeglossaries % | pdflatex -synctex=1 -interaction=nonstopmode %.tex | bibtex %.aux | pdflatex -synctex=1 -interaction=nonstopmode %.tex | pdflatex -synctex=1 -interaction=nonstopmode %.tex | txs:///view      on something like that:               \documentclass[     12pt,     BCOR=10mm,     listof=totoc,     bibliography=totoc     ]     {scrbook}      \usepackage{mathptmx}      \usepackage[]{inputenc}     \usepackage{parskip}     \usepackage[british]{babel}     \usepackage{amsmath,amssymb,amstext}     \usepackage{graphicx}     \usepackage{tabularx}     \usepackage{fancyhdr}     \usepackage[bookmarksopenlevel=section]{hyperref}     \usepackage[toc, xindy, nonumberlist]{glossaries}     \usepackage{cite}     \usepackage{multicol}     \usepackage{listings}     \usepackage[svgnames]{xcolor}     \usepackage{tikz} %enables diagram painting     \usetikzlibrary{backgrounds}     \usepackage[font=footnotesize,labelfont=bf]{caption}     \usepackage{float}%enables force position for images     \loadglsentries[main]{07_glossary/glossary.tex}  %load glossary file              % Bibliography     \bibliographystyle{acm}               % Glossary     \makeglossaries     \setglossarystyle{list}          \begin{document}          \selectlanguage{british}          ...               \twocolumn     \printglossaries          ...          \end{document}      The first time I run my custom "makeglossaries" it build me a glossary with content, but since then it won't include any changes. Does anyone know what I'm doing wrong? Greetings hornhaut EDIT: In 07_glossary/glossary.tex there are entries like:               \newglossaryentry{sdk}{         type=\acronymtype,          name={SDK},         first={Software Development Kit (SDK)},         description={A Software Development Kit consists out of tools and applications needed to enable functions of a certain type of software},         plural={SDKs},         firstplural={Software Development Kits (SDKs)}         }      The entries are all the same (I always copied this entry end changed name, description, sometimes removed plural and firstplural and double checked if I've used the commas correctly)


title: biblatex: How to omit "p." at \cite?

text: I'm using `\cite[1]{A01}`. The result is > Author 2001, p. 1 The desired result is > Author 2001, 1 How do I achieve that? I'm aware of biblatex: How to remove the parentheses around the year in authoryear style?, biblatex authoryear-icomp: How to change parenthesis to [asdf 1985], and Biblatex, author-year, square brackets but they're not exactly my issue. Minimal example:               \documentclass{scrartcl}     \usepackage[backend=biber,style=authoryear-comp]{biblatex}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     \end{filecontents}          \bibliography{\jobname.bib}          \begin{document}          \cite[1]{A01}          \end{document}


title: How to change page display with biblatex?

text: I am using `biblatex` with `style=authoryear-icomp` and German settings. My citation show like this: `(Thomas 2011b, S. 143)` I just want to change the `S.` (for page) with `:`, thus it would read: `(Thomas 2011b:143)`. How to do so? Here is my setup:               \usepackage[     backend=biber,     style=authoryear-icomp,     ]{biblatex}          \usepackage{polyglossia}     \setmainlanguage{german}


title: beamer and blocks with rounded corners

text: My aim is to get rounded corners without shadows ergo I used the following command \setbeamertemplate{blocks}[rounded][shadow=false] but it seems like that this option affects the footnotes as well, i.e. the footnotes behaves like footnotes in a "column"-environment (i.e. the appear in the box and are numbered with letters instead of numerals) is this bug in the beamer class? Exp.               \documentclass{beamer}      \usetheme{boxes}     \usecolortheme{crane}     \setbeamertemplate{blocks}[rounded][shadow=false] %      \begin{document}     \begin{frame}     \begin{block}{This is a block}     ddd\footnote{test test}     \end{block}     \end{frame}     \end{document}


title: Why does XeTeX differ from pdfTeX?

text: I understand that XeTeX was written to handle UTF-8 input better than pdfTeX. However, it seems to process documents in a slightly different way. That is, documents that don't use special fonts or need UTF-8 encoding still compile differently from the two engines. This site contains many questions along the lines of "How do I get XeTeX to do _xyz_ ?", where _xyz_ is something that works fine with pdfTeX. I understand that XeTeX and pdfTeX _do_ handle internals differently; my question is "Do they _have_ to?" Is it possible to have XeTeX handle fonts/input differently, but once this is accomplished, it handles everything else exactly the same way as pdfTeX? Or is the issues of input encoding and fonts so fundamental that things necessarily have to be different, and workarounds must constantly be made to match outputs from the different engines?


title: Change Sectional Skip Conditioned on Text Existing or not Before Sectional Division

text: I have a simple document layout with a main heading for the title, and the possibility of starting the first sectional unit (with a standard `\section` command) right after the title -- meaning, with no preliminary typeset text --, or after some introductory text following the title. I'd like to change the vertical skip that the `\section` command adds before the title of the sectional unit depending on whether there is some introductory text or not. Generally, I use the `titlesec` package facilities in this context, but I'm not committed to any package in particular. My issue boils down to defining some test for the existence of that preliminary text before the sectional unit. How can I do this? `TeX`, `LaTeX2e` or `LaTeX3/expl3` solutions would all be welcome.


title: Best layout for figures padding

text: This is a bit off-topic, but I think there may be people here that has already dealt with this doubt. When including a typical 2D plot, we usually put a label on the left border. My question is: do you usually add a symmetric padding, so that the figure appears actually centred in the text? This is a document with two figures —the first one has been added a symmetric padding, while the second one has no padding at all: ![MWE result](http://i.stack.imgur.com/bb6Sy.png) Which of both is the best option, according to classical laying-out rules?


title: Inserting text in the image between two columns

text: How do I insert an image from text in two columns so that the text go around the picture?![enter image description here](http://i.stack.imgur.com/juSeF.png)


title: How can I make axis lines connected and make axis be over the plot?

text: I've just put a lot of effort in the following tikz image for Wikiepdia (see commons link): ![enter image description here](http://i.stack.imgur.com/sWU9b.png) However, there are two small things that I can't get fixed:   1. When you look at the bottom left corner where the two axes meet you notice that those lines are not connected. How do I get them connected?   2. The red plot lies on the axis. How can I get the axes over the plot? ## Source               \documentclass[varwidth=true, border=5pt]{article}     \usepackage[active,tightpage]{preview}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{arrows,positioning}      \usepackage{helvet}     \usepackage[eulergreek]{sansmath}          \pgfmathdeclarefunction{gauss}{2}{%       \pgfmathparse{1/(sqrt(2*pi*#2))*exp(-((x-#1)^2)/(2*#2))}%     }     % to be used: \gauss(mean)(variance)          \pgfplotsset{     tick label style = {font=\sansmath\sffamily},     every axis label/.append style={font=\sffamily\footnotesize},     }          \begin{document}     \begin{preview}     \tikzstyle{plotA}=[ultra thick,red!90!black]     \tikzstyle{plotB}=[ultra thick,cyan!50!black]     \begin{tikzpicture}         \begin{axis}[             width=13.5cm,             height=8.625cm,             % Grid             grid = major,             % size             xmin= 0,     % start the diagram at this x-coordinate             xmax= 125,   % end   the diagram at this x-coordinate             ymin= 0,     % start the diagram at this y-coordinate             ymax= 0.045, % end   the diagram at this y-coordinate             % Legende             legend style={                 font=\large\sansmath\sffamily,                 at={(0.5,-0.18)},                 anchor=north,                 legend cell align=left,                 legend columns=-1,                 column sep=0.5cm             },             % Ticks             tick align=inside,             minor tick style={thick},             scaled y ticks = false,             xtick={40,70,80},             ytick=\empty,             % Axis             axis lines = middle,             axis line style = very thick,             xlabel=$x$,             x label style={at={(axis description cs:0.5,0)},                            anchor=north,                            font=\boldmath\Large},             ylabel=$f(x)$,             y label style={at={(axis description cs:0,0.5)},                            anchor=south,                            rotate=90,                            font=\boldmath\Large},             ]                  \coordinate (plotAcoord) at (axis cs:70,0.024);             \coordinate (plotAcoordY) at (axis cs:0,0.024);             \draw[plotA,thick, dashed](plotAcoord -| plotAcoordY) -- (plotAcoord);                  \coordinate (plotBcoord) at (axis cs:70,0.0004);             \coordinate (plotBcoordY) at (axis cs:0,0.0004);             \draw[plotB,thick, dashed](plotBcoord -| plotBcoordY) -- (plotBcoord);                  \node[above right=0cm and 0cm of plotAcoordY,color=red!90!black] (f1y) {$f_{I}(70)$};             \node[above right=0cm and 0cm of plotBcoordY,color=cyan!50!black] (f2y) {$f_{II}(70)$};                  % Plots of the distributions             \addplot [domain=0:120,samples=200,plotA] {gauss(80,100)};             \addplot [domain=0:120,samples=200,plotB] {gauss(40,100)};                  % Mark points             \addplot+[plotA,                       samples at={70},                       mark=*,                       mark options={scale=1, fill=red!90!black}] {gauss(80,100)};             \addplot+[plotB,                       samples at={70},                       mark=*,                       mark options={scale=1, fill=cyan!50!black}] {gauss(40,100)};             \coordinate (a) at (axis cs:70,0.024);             \draw[black,thick](a |- current plot begin) -- (a);                  % Add labels            \node[plotA,above] at (axis cs:102,0.03){\Large $\mathcal{N}(80, 100)$};            \node[plotB,above] at (axis cs:20,0.03){\Large $\mathcal{N}(40, 100)$};           % \addlegendentry{$\mu=80,\enskip \sigma^2 = 100$}           % \addlegendentry{$\mu=40,\enskip \sigma^2 = 100$}         \end{axis}      \end{tikzpicture}     \end{preview}     \end{document}


title: Javascript LaTeX to HTML interpreter?

text: Is there a possibility to 'render' latex code with your browser? I have some *.tex files which I would like to render a HTML version of (with HTML-navigation, hyperlinks, etc). However - running some tex2html converter everytime is quite annoying, especially since I use a lot of special packages that are not supported by most converters I tried so far, so I would need to post-process the files everytime I change something in my source document, which happens very often. What I would really like to have is a javascript library that parses a TeX file and renders an HTML webpage from it using DOM. It doesn't need to be complete in the sense that all CTAN packages are supported, but it should be extendable in the sense that I can plug in my own javascript code to render some self-defined environments and commands. So what I'm looking for is a javascript to HTML interpreter. Is there such a thing, or would I need to write something up myself? PS: I know about MathJax, which does an excellent job at rendering math, but I would like to render whole documents, including preamble and custom command definitions.


title: How can I position a node in the center of an arbitrary path

text: \documentclass{article}          \usepackage{lmodern}     \usepackage{tikz,times}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}[scale=.3]         \draw [thick] (0,6) rectangle (18,4) node [pos=.5] {like this};              \draw [thick] (0,2) -- (18,2) -- (18,0) -- (0,0) -- cycle;         %\draw [thick] (0,2) -- (18,2) -- (18,0) -- (0,0) -- cycle node [pos=.5] {A};              \draw [thick] (0,-3) -- (4, -3) -- (5, -5) -- (-1, -5) -- (3, -4) -- cycle;         %\draw [thick] (0,-3) -- (4, -3) -- (5, -5) -- (-1, -5) -- (3, -4) -- cycle node [pos=.5] {B};     \end{tikzpicture}     \end{document}      In this document i have three paths. the first is a simple rectangle where positioning a node in the center is easy (`node [pos=.5] {like this}`). However when it comes to doing this for any path i am unable to do it. How do i get a node that is centered. Optionally, one that is also inside the path, though this would not be as important.


title: List of listing (using tcblistof) vertical spacing, group by chapter

text: I'm currently trying to set the vertical spacing within `\tcblistof` command. The template which causes my problems can be found here: https://github.com/ManuelRauber/LaTeX-Template At first here are some screenshots showing my problem. The table of contents shows what I want to have for all my listings: The caption of chapters are grouped together and between the chapters there is a bit more space. This is completely fine. ![Table of contents](http://i.stack.imgur.com/2EsmB.png) The same is for the list of figures and the list of tables (lof as example). Chapters are grouped together and minimal space between the captions within a chapter. ![List of figures](http://i.stack.imgur.com/7K0Dk.png) The problems are my list of listings. Created by the following code (see the GitHub link for a complete example or here http://tex.stackexchange.com/a/124688/15907):               % by Thomas F. Sturm (http://tex.stackexchange.com/a/124688/15907)     \newtcblisting[auto counter,number within=section,       list inside=mypyg]{listingsbox}[3][]{%       listing only,title={Listing \thetcbcounter: #3},       list entry={\protect\numberline{\thetcbcounter}#3},       enhanced,breakable,drop fuzzy shadow,myminted/#2,#1}          \begin{document}          \tcblistof[\addchap*]{mypyg}{Codeverzeichnis}      This is the output: ![List of listings](http://i.stack.imgur.com/3my84.png) I tried the solution found here: tcblistof, book class and vertical spacing. But that didn't work for me (and I changed the patchcmd to use addchap instead of chapter). What do I need to do to get the `\tcblistof` to group the entries by chapter (and get minimals spacing within in chapter)?


title: Vertical space between horizontal lines

text: I have defined a macro for 2 closely spaced horizontal lines,               \newcommand{\myline}{\par\noindent%      \rule{\linewidth}{1.5pt} \\[-0.80\baselineskip]%     \rule{\linewidth}{0.8pt}}      Now I noticed that when putting it at different places in the text and at different environments, results in a slightly different vertical spacing between them. Is it possible to fix the spacing between them? (regardless of the line spacing in the environment they are inside) **Edit:** also when defining a linespace in definite units, it still depends on the font. For example:               \documentclass[a4paper,10pt,english]{article}     \usepackage{babel}     \usepackage{blindtext}          \newcommand{\myline}{\par\noindent%      \rule{\linewidth}{1.5pt} \\[-9pt]%     \rule{\linewidth}{0.8pt}}          \begin{document}         \noindent \blindtext         \myline          \begin{quotation}         \small \myline     \end{quotation}          \end{document}


title: How does one change the math style to one of the "primed" styles?

text: **Background**   TeX typesets each portion of a mathematical expression in one of 8 styles:   1. display,   2. display',   3. text,   4. text',   5. script,   6. script',   7. scriptscript, or   8. scriptscript'. Knuth calls them, D, D', T, T', S, S', SS, and SS', respectively. TeX transitions between styles for subscripts, superscripts, and for the numerators and denominators of fractions (`\above`, `\atop`, `\over` and their `\...withdelims` variants). Four of these style are well known via `\displaystyle`, `\textstyle`, `\scriptstyle`, and `\scriptscriptstyle`. The other four are less known (in fact, I don't think I've seen any reference to them outside of the TeXbook). They are almost the same as the corresponding nonprimed style except that superscripts are typeset a bit farther down. One simple way to see the difference is to look at the output of (the plain TeX document)               $${\atop x^y}{\atop\textstyle x^y}$$     \bye      The reason these differ is that TeX starts the math display in style D. It typesets the numerator in style T and the denominator in style T'. The `\textstyle` causes TeX to typeset the denominator in style T instead. **Question** How can one force TeX to go into one of the primed styles? As the example above illustrates, even when TeX is in one of the primed styles, it moves to the nonprime variant with `\textstyle` (similarly for the other three). **Motivation**   This can be important when building vertical boxes in math mode. For example, see my answer to changing the shape of a fraction for a case where this is needed. # Follow up question Is there a way to check if the current style is cramped? I thought about putting `X^X` in a `\vcenter` and comparing its height to the current style as determined by `\mathchoice`, but this doesn't work because `\vcenter` doesn't give you a box.


title: Xelatex and hyperref to file

text: I would like to add link to video in the same folder where pdf document is stored. There is code:               \documentclass[a4paper,10pt]{article}          \usepackage{hyperref}          \begin{document}          \href{run:film.mp4}{Movie}          \end{document}      When I compile it with PDFLatex, then everything is okey, I click the link in PDF document and video player starts to play the movie. But when I compile it with Xelatex, then when I click this link in PDF document, there is written that:               path/file:film.mp4 No such file.      The problem is that word "file:" is inserted before file name. How to solve this problem?


title: PSTricks insert logo

text: I am using PSTricks with `beamer`. I couldn't insert logo (`MU.jpg`), but it works if I'm not use `pstricks` package. So what can I do if I also need to use `pstricks` package?


title: Creating Bezier surfaces using procedural graphics

text: Are there any package for LaTeX that can create Bezier surfaces? I mean a actual existing function that takes matrices as arguments and generates the surface, not a function written by myself.


title: Moderncv package with multicols set vertical space

text: I am currently finishing my CV using the moderncv package. To save space I decided to fit all my interests in a multicol environment with 4 columns nested inside an itemize environment. Unfortunately, I get an additional white line after the multicol package that forces my CV to reach 3 pages. I am already using the command               \setlength{\multicolsep}{0pt}       globally and this deleted the vertical white space before the multicol environment, but after I still get an additional white line. Here's the code I'm using:               \documentclass[11pt, a4paper,sans]{moderncv}          % MODERNCV THEME     \moderncvstyle{classic}     \moderncvcolor{blue}     \renewcommand{\familydefault}{\rmdefault}          % CHARACTER ENCODING     \usepackage[utf8]{inputenc}          % ADJUST THE PAGE MARGINS     \usepackage[scale=0.75]{geometry}          \usepackage{microtype}     \DeclareMicrotypeSet[protrusion]{myset}{             encoding = T1,             family = {sf*,rm*},             font = {T1/tt*/m/n/*,                         T1/tt*/m/it/*} }     \UseMicrotypeSet[protrusion]{myset}          \moderncvicons{awesome}% New icons fontawesome          \usepackage{textcomp}% Adds star as a birthday symbol          \usepackage{multicol}%Usage: \begin{multicols}{2}     \setlength{\multicolsep}{0pt}%Takes space before and after the multicolumn          \newcommand{\localtextbulletone}{\textcolor{color1}{$\vcenter{\hbox{\tiny$\bullet$}}$}}%Changes Item List bullet size and color     \renewcommand{\labelitemi}{\localtextbulletone}%Sets the new bullet type          \begin{document}          \section{Languages}          \cvitemwithcomment{Italian}{Mothertongue}{}     \cvitemwithcomment{English}{Advanced}{European Level: C1; IELTS: 7.5}     \cvitemwithcomment{Spanish}{Intermediate}{Self Assesment: B1}     \cvitemwithcomment{Portuguese}{Basic}{Self Assesment: A2}          \section{Interests}     \cvitem{}{     \begin{itemize}     \item Item 1 (Long item, Long item)\vspace{0.67pt}     \begin{multicols}{4}         \item Item 2         \item Item 3         \item Item 4         \item Item 5         \item Item 6         \item Item 7         \item Item 8         \item Item 9     \end{multicols}     \end{itemize}     }          \section{Referees}     \end{document}      and this is the output:![enter image description here](http://i.stack.imgur.com/m6NAc.png) As you can see the vertical spacing after the interests section is higher than the spacing in between the languages and interests section. Also,               \usepackage{enumitem}      is not an option since it completely modifies all the spaces. Is there any way I can delete this additional vertical space?


title: LATEX: How to represent root(2)^root(2)

text: In latex, how would one represent `\math{sqrt{2} ^ sqrt{2}}` (or `root(2)^root(2)`? I tried to respresent it as I did above, but there is an error "! Missing { inserted."


title: different color for section titles and pages in toc

text: I am using the linktoc=all option in hypersetup. I would like the chapter/section titles also clickable in my table of contents, but I want the linkcolor only applied on the page numbers in the toc and the text remain black (although clickable). Anybody knows a simple way to do so?!


title: Draftwatermark Draft not in Italics

text: I have installed the `draftwatermark` package, but 'DRAFT' comes horizontaly in my document, not in diagonal. The same happens with the `draftcopy` package. Furthermore, modifying the `angle` option in either package only changes the vertical position of the DRAFT mention. Can anybody help? * * * Additional information from the questioner, moved from an 'answer' to here               MiKTeX Problem Report     Message: Some PostScript specials could not be rendered.     Data: Error: /undefined in pgfo     Operand stack:        --nostringval--   PermitFileReading   --nostringval--   PermitFileWriting   --nostringval--     Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1914   1   3   %oparray_pop   1913   1   3   %oparray_pop   1897   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--     Dictionary stack:        --dict:1166/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--   --dict:95/300(L)--     Current allocation mode is local     MiKTeX GPL Ghostscript  9.00: Unrecoverable error, exit code 1          Source: Libraries\MiKTeX\Dvi\Ghostscript.cpp     Line: 372     MiKTeX: 2.9     OS: Microsoft Windows XP Professional Service Pack 3 (build 2600)     Invokers: explorer/WinEdt     SystemAdmin: yes     PowerUser: no     Root0: C:\...\MiKTeX\2.9     Root1: C:\...\MiKTeX\2.9     Root2: C:\...\MiKTeX\2.9     Root3: D:\...\MiKTeX 2.9     UserInstall: C:\...\MiKTeX\2.9     UserConfig: C:\...\MiKTeX\2.9     UserData: C:\...\MiKTeX\2.9     CommonInstall: D:\...\MiKTeX 2.9     CommonConfig: C:\...\MiKTeX\2.9     CommonData: C:\...\MiKTeX\2.9)


title: Memoir class top margin varies throughout the document. It needs to be 1" exactly throughout

text: This is the pagestyle stuff shown for ToC only, others are similar:               \makepagestyle{toc}       \makeevenfoot{toc}{}{\thepage}{}       \makeoddfoot{toc}{}{\thepage}{}     \DoubleSpacing       \makeevenhead{toc}{CHAPTER}{}{Page}       \makeoddhead{toc}{CHAPTER}{}{Page}      This is I believe the main table creation code:               \let\oldtoc\tableofcontents     \renewcommand{\tableofcontents}{\clearpage\pagestyle{toc}\oldtoc}          \renewcommand{\contentsname}{TABLE OF CONTENTS}     \renewcommand{\listfigurename}{LIST OF FIGURES}     \renewcommand{\listtablename}{LIST OF TABLES}     \renewcommand*{\tocheadstart}{\vspace*{-\topfiddle}}     \renewcommand*{\aftertoctitle}{\thispagestyle{plain}%       \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}     \renewcommand*{\cftchapterfont}{\normalfont}     \renewcommand*{\cftchapterpagefont}{\normalfont}     \renewcommand*{\cftchapterleader}{%       \cftchapterfont\cftdotfill{\cftchapterdotsep}}     \renewcommand*{\cftchapterdotsep}{\cftdotsep}     %\renewcommand*{\cftchaptername}{CHAPTER~}     %%% no extra space before the entry     \setlength{\cftbeforechapterskip}{0pt plus 0pt}     %% no extra 'chapter' space in LoF/LoT     \renewcommand*{\insertchapterspace}{}      This is what is in my `.tex` file. Basic:               \newpage     \pagestyle{toc}     \tableofcontents*     \listoftables   % if you have any tables     \listoffigures  % if you have any figures     \mainmatter     \pagestyle{toc}     \addtocontents{toc}{\cftpagenumbersoff{chapter}}     \addcontentsline{toc}{chapter}{CHAPTER}     \addtocontents{toc}{\cftpagenumberson{chapter}}      ![](http://i.stack.imgur.com/N0j8V.jpg)


title: Proper spaces with verbatim

text: there is following code:               \begin{verbatim}     pc:~$ ls     folder1                Documents         folder2        New Folder  folder3     folder4444             Downloads         folder5        Pictures    Templats     \end{verbatim}      And the output is:               folder1             Documents       folder2       New Folder  folder3     folder4444             Downloads         folder5        Pictures    Templats      The thing is, that words in output are shifted. However when I use verbatim*, everything is all right, but there is ␣ character. It seems like spaces are not the same width as letters. How to output text with proper spaces? Or is there some other good method to print terminal output? Edited: Full code:               \documentclass[12pt,openany]{report}          \usepackage{xltxtra}     \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{color}     \usepackage{polski}     \usepackage{titlesec}     \usepackage{listings}     \usepackage{hyperref}     \setromanfont[Mapping=tex-text]{Linux Libertine O}          \begin{document}          \begin{verbatim}     pc:~$ ls     fffffff                Documents         gggggggggggg   New Folder  hhhhh     jjjjjjjjjjjjjjj        eeeeeeeee         kkkk           Pictures    Templates     Desktop                xxxxx             ccccccccccccc  Public      dddddd     bbbbbbbbbbbbbbbbbbbbb  fffffffffeeeeeee  jjjjj          qqqqqqqqqq  sssww     \end{verbatim}          \end{document}


title: How to fill an area interval under a gaussian

text: I want to know if it's possible to fill an area interval (i.e from -0.2 to 0.2) under a gaussian curve, more exactly just an interval under this curve, using PSTricks. ![enter image description here](http://i.stack.imgur.com/gXOb9.png) I'm using `pst-func`, `pst-plot`, `pst-math`, `pstricks-add` packages also. Based on `pst-func` package               \psset{yunit=4cm,xunit=3}     \begin{pspicture}(-2,-0.2)(2,1.4)     \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0]     \psaxes[Dy=0.25]{->}(0,0)(-2,0)(2,1.25)     \uput[-90](6,0){x}\uput[0](0,1){y}       \rput[lb](1,0.75){\textcolor{red}{$\sigma =0.5$}}       \rput[lb](1,0.5){\textcolor{blue}{$\sigma =1$}}       \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{(x-\mu)^2}{2\sigma{}^2}}$}       \psGauss[linecolor=red, linewidth=2pt, fillcolor=red!40,fillstyle=solid,opacity=0.5]{-2.95}{2.95}%       \psGaussI[linewidth=1pt]{-2}{2}%     %  \psGauss[linecolor=cyan, mue=0.5, linewidth=2pt]{-1.75}{1.75}%     %  \psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75}     \end{pspicture}      Edited: I tryed this code:               \psset{yunit=4cm,xunit=3}     \begin{pspicture}(-2,-0.2)(2,1.4)       \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0]       \psaxes[Dy=0.25]{->}(0,0)(-2,0)(2,1.25)       \uput[-90](6,0){x}\uput[0](0,1){y}       \rput[lb](1,0.75){\textcolor{red}{$\sigma =0.5$}}       \rput[lb](1,0.5){\textcolor{blue}{$\sigma =1$}}       \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{(x-\mu)^2}{2\sigma{}^2}}$}       \psGauss[linecolor=red, linewidth=2pt]{-2.95}{2.95}%       \psGaussI[linewidth=1pt]{-2}{2}%        \pscustom[fillstyle=solid,fillcolor=red!30]{%         \psGauss[linewidth=1pt,nue=5]{0.5}{1}%         \psline(1,0)(0.5,0)}     \end{pspicture}      And I would like to know if it's possible to close the loop line (psline), that start over the curve and lay down on axis "x". From 0.5 to 1 over the curve, then 1 to (1,0) and to (0.5,0). Seem's that is missing a part from (0.5,0) to (0.5,curve). There is a way to fill this line ? Thanks again!!


title: No simple UTF8 support in latex?

text: The following should look good in your browser, AND compile in Latex looking beautiful right?               \documentclass{article}     \usepackage[utf8]{inputenc}     \begin{document}     UTF-8 test:     \begin{verbatim}     logic:  not:¬             and: ∧  nand:⊼             or: ∨   nor:⊽             inequal to, xor:≢,≠,⊻,⊕     equal to: ≡,=     Set logic:  ∪,∩,⊊,⊋,⊆,⊇,⊈,⊉,≡          avoid useage of non-specific: ⊂,⊃,⊄,⊅     Set Membership:∈,∉,∌,∋,∅     assignment ≔≕     predicate logic:∃,∄,∀,∴,∵     regex: /|\.⋆^?+(){,}[]     Arrows: ↖↑↗⇖⇑⇗             ←↔→⇐⇔⇒⇕↕             ↙↓↘⇙⇓⇘             ↚↮↛⇍⇎⇏     numbers:ℕatural={0,1,2,3, … ∞}, ℤintegers,             ℚ=rational, ¬ℚ=irrational,             ℝeal, ±∞, ℂomplex     size: ≤,≥,<,>,≮,≯,≰,≱,≪,≫,≢,≠,≡,=     Greek Alphabet:     ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣ ΤΥΦΧΨΩ     αβγδεζηθικλμνξοπρσςτυφχψω     Game:     Chess symbols:♚♛♜♝♞♟♔♕♖♗♘♙     Playing card symbols:♠♣♥♦ 23456789JQKA     miscellaneous:°∙■□▪▫○●☇     \end{verbatim}     \end{document}      Currently(2010 Dec 12 with latest ubuntu with all updated packages) I get the following error: `! Package inputenc Error: Unicode char \u8:**"insert random char here"** not set up for use with LaTeX.`


title: Mastheads/banners in Beamer

text: After a long search on the internet, I can't seem to find a solution to the following problem: I need to created a beamer presentation. The organization that is funding me wants me to have their banner at the top of every slide. Is there an easy way to do this?


title: Starting an enumerate of an enumerate on next line?

text: What I'm trying to do is to make my enumerates look like this               a)         i) answer         ii) answer     b) answer      Currently, I'm using               \begin{enumerate}     \item \hfill \\         \begin{enumerate}[a)]         \item         \item         \end{enumerate}     \end{enumerate}      but it looks like there are 2 empty lines when I do this, instead of one.               a)                   i)      I have tried a lot of spacing commands, but I couldn't get them to work (new to LaTeX). So, Is there a way to do this? or should i just put them all on the same line? I know its easier but I think it looks weird.


title: Biblatex: define custom style or modify existing?

text: The style I need citations in seems so far removed from the provided Biblatex styles that I'm unsure whether it's best to extensively modify an existing style or write a custom one; and not too sure how exactly to go about doing either. Full citations are to go in footnotes; no bibliography. _Ibid._ to be used where appropriate, but not op cit. Here is what I need: ARTICLE: First mention: > Allen Carlson, `Nature and Positive Aesthetics’, _Environmental Ethics_ 6 > (1984), 5–34, at 33–4. Subsequent (if not _Ibid._ ): > Carlson, `Nature and Positive Aesthetics’, 33-4. (NB: only volume, no number) BOOK: First mention: > Donald Worster, _Nature’s Economy: A History of Ecological Ideas_ (2nd edn, > Cambridge: Cambridge University Press, 1994), 471. Subsequent: > Worster, _Nature’s Economy_ , 19–38. INBOOK and INCOLLECTION: First mention: > Charles Shah Pittendrigh, `Adaption, Natural Selection, and Behavior’, in > Anne Roe and George Simpson (eds), _Behavior and Evolution_ (New Haven: Yale > University Press, 1958), 390–416, at 400. Subsequent: > Pittendrigh, `Adaption, Natural Selection, and Behavior’, 392. Advice gratefully received! EDITS: Additions: Document MWE:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[bibstyle=verbose-ibid, citestyle=BJA,     usetranslator=true, ibidpage=true]{biblatex}     \bibliography{natural_aesthetics.bib}     \begin{document}     \footcite[37]{Godlovitch1994}     \footcite[37]{HumeSOT}     \footcite[37]{berleant2005}     \footcite[37]{Carroll1993}     \footcite[37]{Godlovitch1994}     \footcite[37]{HumeSOT}     \footcite[37]{berleant2005}     \footcite[37]{Carroll1993}     \end{document}      MWE bib file:               @BOOK{Berleant2005,     title = {Aesthetics and Environment},     publisher = {Ashgate},     year = {2005},     author = {Arnold Berleant},     location = {Aldershot}     }     @INCOLLECTION{Carroll1993,     author = {Noel Carroll},     title = {On Being Moved By Nature: Between Religion and Natural History},     booktitle = {Landscape, Natural Beauty and the Arts},     publisher = {Cambridge University Press},     year = {1993},     editor = {Salim Kemal and Ivan Gaskell},     pages = {244-266},     location = {Cambridge}     }     @INBOOK{HumeSOT,     pages = {134--149},     title = {Of The Standard of Taste},     publisher = {Ward, Lock and Bowden},     year = {1875},     author = {David Hume},     bookauthor = {David Hume},     booktitle = {Essays Literary, Moral, and Political},     location = {London}     }     @ARTICLE{Godlovitch1994,     author = {Stan Godlovitch},     title = {Icebreakers: Environmentalism and Natural Aesthetics},     journal = {Journal of Applied Philosophy},     year = {1994},     volume = {11},     pages = {15-30},     number = {1}     }      BJA.cbx in process of modification: took the advice to append things to verbose-ibid.cbx : my additions and requests at end.               % $Id: BJA.cbx,v 1.0 $          \ProvidesFile{BJA.cbx}     [\abx@cbxid $Id: BJA.cbx, v 1.0 $]          \RequireCitationStyle{verbose-ibid}          \AtEveryCitekey{       \clearfield{number}} %removes journal number for articles          \renewbibmacro{in:}{%       \ifentrytype{article}{}{%       \printtext{\bibstring{in}\intitlepunct}}} % removes in for articles               \DeclareFieldFormat{postnote}{at #1}% replaces p and pp with at in page refs     \DeclareFieldFormat{multipostnote}{at #1}% replaces p and pp with at     \DeclareFieldFormat{pages}{#1} %omits pp in article etc     \renewcommand*{\newunitpunct}{\addcomma\space} %comma space between units          %for book: put (edition, location: publisher, year)          %for article, inbook, incollection: single quotes round titles          % for inbook, incollection: editors names (eds), title, (edition, location: publisher, year)          % for inbook, incollection: no punctuation after in               \endinput


title: how to put subfigures in several rows

text: basically i need something like rowspan option in html table. I want that an figure 3 and figure 4 occupy three rows, I need a layout something like this: |figure 1 | figure 2 |               |               |   |figure 5 | figure 6 | figure 3 | figure 4 |   |figure 7 | figure 8 |               |               |   how i can get this layout?


title: How to make calligraphic numbers available with `unicode-math`?

text: I use xits-math.otf with `unicode-math` with XeLaTeX. It defines calligraphic upper case letters, but I need calligraphic lower case letters and especially numbers as well. I tried this:               \documentclass{minimal}     \usepackage[math-style=TeX, bold-style=TeX]{unicode-math}     \usepackage{fontspec}          \setmathfont[StylisticSet=0]{xits-math.otf}     \setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}          \newfontfamily\mathc[Path=/usr/share/texlive/texmf-dist/fonts/type1/public/mathabx-type1/]{mathc10.pfb}          \begin{document}         $\mathcal{mathcal ABC 123}$ \\         $\mathbfcal{mathbfcal ABC 123}$ \\         \mathc{mathc10.pbf abc ABC 123 !@\$\%\&}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7mh6L.png) This gives me the uppercase `\mathcal` and `\mathbfcal` letters, but as you can see, the lowercase letters and numbers, are just the standard italic and upright symbols, respectively. In that example, I made an extra font definition using `fontspec` to get access to the calligraphic font used with `mathabx`. With that, I _can_ access the symbols, but not by using `\mathcal`, which is quite inconvenient, but the most inconvenient with this workaround, is that it doesn't work in math mode. I have to use `\text{\mathc{3}}` to get a calligraphic '3', which is isn't really an option. Also, no bold calligraphic symbols, which I don't really need, but it feels like something's missing. A while ago, I asked here how to get the "mathc10" font while using `MnSymbol`. I don't use `MnSymbol` anymore, but I tried the solution anyway:               \documentclass{minimal}          \usepackage[math-style=TeX, bold-style=TeX]{unicode-math}     \usepackage{fontspec}          \setmathfont[StylisticSet=0]{xits-math.otf}     \setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}          \DeclareFontFamily{OT1}{mathc}{}     \DeclareFontShape{OT1}{mathc}{m}{n}{ <-> mathc10 }{}     \DeclareMathAlphabet\mathcal{OT1}{mathc}{m}{n}          \newfontfamily\mathc[Path=/usr/share/texlive/texmf-dist/fonts/type1/public/mathabx-type1/]{mathc10.pfb}          \begin{document}         $\mathcal{mathcal ABC 123}$ \\         $\mathbfcal{mathbfcal ABC 123}$ \\         \mathc{mathc10.pbf abc ABC 123 !@\$\%\&}     \end{document}      ![enter image description here](http://i.stack.imgur.com/LamQY.png) This kinda creates a new problem, while solving another: I have now access to calligraphic numbers with `\mathcal` \- although no bold version - but now the letters are gone. I'm thinking I might need a different OTF font for the `\mathcal` and `\mathbfcal` ranges, but I don't know which one, and I don't know if that's actually the best solution. Again, what I need is:   * calligraphic letters   * calligraphic numbers   * accessing them with `\mathcal` Nice to have:   * calligraphic bold version of letters and numbers


title: Vector images rasterized when converting to PDF? (XeTeX)

text: I've been using LyX with vector images in *.eps format for the longest time. Now I've moved to a new machine (a mac), tried to get the same work environment back, and ran into this problem: **Creating pdf's from the original LyX document, all my nice vector images are being converted to low resolution rasterized images.** It seems like this is somehow related to XeTeX, since when I don't use XeTeX, everything looks just fine. Am I missing some package? Is there some LyX option that's misconfigured? **Edit:** Just noticed something important: in the folder containing the *.eps images, low resolution pdf images are being created. Looks like the *.eps is being converted to a rasterized pdf. Very strange.


title: Two equation numbers within one set of brackets

text: The following outputs two equations side-by-side, with the equation number after each equation:               \begin{minipage}{.5\linewidth}     \begin{equation}      x = y     \end{equation}     \end{minipage}%     \begin{minipage}{.5\linewidth}     \begin{equation}       y = z     \end{equation}     \end{minipage}      ![](http://i.stack.imgur.com/pt3Bx.png) I would like to see if it looks better if the two equations stay in the same position, but with the (1) removed and the (2) becoming (1, 2) to reflect the numbers of both equations (in an assumed respective order). Is this possible? I have searched but have only found questions asking if it is possible to only have one equation number for two equations. I want something similar to this, but displaying both equation numbers and only one set of brackets.


title: How to left-align using eqnarray in latex

text: Now, first of all let me get something clear: I do not ask for any reasons why `align` is btter than `eqnarray`. All I ask is a simple way to make this work, using eqnarray (It's obviously possible, but I'm not sure how).               \begin{eqnarray}~\label{eqn07}     \begin{tabular}{llll}     $\Psi_{1}(x,\lambda)$ & = & & $ U(x,\lambda)e_{1} $ \cr     &   & & \cr     \end {tabular}     \end {eqnarray}      Yet after compiling it, I get the equation centered, instead of left-aligned. I've tried to insert `\left{ ... \right}` , but it wouldn't even build, and I just had many errors popping up. Could someone tell me a simple way to do so, wihout using `\begin{align}`. I do want to use `\begin{eqnarray}` (I've got my own reasons why).


title: Onslide in tabularx produces vertical space

text: I have a tabular in a `beamer` presentation of which I want to uncover its contents using `\onslide`. In `tabularx` (or in `tabular` with a `p`-column) this produces a peculiar vertical white space in the `X`-column. Any ideas about where it comes from and/or how to work around it? Here is the code I used:               \begin{tabularx}{\textwidth}{|l|X|}     \hline     First line & A very long sentence that takes up more than one line because of its length\\     \onslide<2->{Second line} & \onslide<2->{A slightly longer sentence that takes up more than one line because of its length} \\     \hline     \end{tabularx}      Or with a `p`-column:               \begin{tabular}{|l|p{0.7\textwidth}|}     \hline     First line & A very long sentence that takes up more than one line because of its length\\     \onslide<2->{Second line} & \onslide<2->{A slightly longer sentence that takes up more than one line because of its length} \\     \hline     \end{tabular}


title: list of figures doesn't appear

text: I am using WinEdt7 and writing my thesis as a report class. I need to add `\listoffigures`, but whenever I write `\listoffigures` in my `.tex`, the program gives me an error which says > "..missing }" in one of my figure codes. But when I delete `\listoffigures`, it works well. Of course there is no "list of figures" page. Here my main code showing how I write my figure codes:               \documentclass[12pt,oneside]{report}     \usepackage{listings}     \usepackage{tocloft}     \usepackage{setspace}     \usepackage[left=1.5in, right=1in, top=1in, bottom=1in, includefoot, headheight=13.6pt]{geometry}     \usepackage{parskip}     \usepackage{graphicx}     \usepackage{graphics}     \setlength{\parskip}{12pt}     \usepackage{tocloft}     \renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts     \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}          \begin{document}     \setlength{\parskip}{12pt}     \doublespacing     \titlepage{\textbf{\centerline {THE "... MODES"}     \centerline {OF A THREE .. LATTICE}}}          \noindent\rule{15cm}{0.4pt}\\          \centerline {A Dissertation}     \centerline {Submitted to}     \centerline {the AAAA University Graduate Board}               \noindent\rule{15cm}{0.4pt}\\          \centerline {In Partial Fulfillment}     \centerline {of the Requirements for the Degree of}     \centerline {Doctor of Philosophy}          \noindent\rule{15cm}{0.4pt}\\          \centerline {by}     \centerline {AAAA}     \centerline {August 2014}          someone,department          \addcontentsline{toc}{chapter}{ABSTRACT}     \pagenumbering{roman}     \doublespacing     \chapter*{\center  ABSTRACT}     In this thesis...          \addcontentsline{toc}{chapter}{ACKNOWLEDGEMENTS}     \chapter*{\center ACKNOWLEDGEMENTS}     .....          \newpage     \addcontentsline{toc}{chapter}{DEDICATION}     \chapter*{\large To my family}               \newpage     \addcontentsline{toc}{chapter}{TABLE OF CONTENTS}     \renewcommand\contentsname{\centerline {TABLE OF CONTENTS}}     \tableofcontents          \listoffigures          \renewcommand{\cfttabfont}{Table     }     \listoftables           %         \begin{figure}[!h]           \centering           \includegraphics[width=0.6\textwidth]{NeutronAAA}           \caption{(Color on line) Summary of lattice dynamics measured in NaI along the [111] direction, showing the phonon dispersion curves measured at 90 K (dashed lines) and 555 K (red lines), including a dispersionless local mode (ILM) that appears in the gap between the branches of acoustic and optic phonons. [From AAA {\it et al.} (2013).]\label{BBBB}}         \end{figure}         %     \end{document}      I am writing my whole thesis chapters in one `.tex` file (I know it is shameful), so I tried to copy first main lines. The error message is: > "[3] [4] [5] [6] (C:Users\pc-f\Desktop\Thesis\AAThesis.toc) > > (C:Users\pc-f\Desktop\Thesis\AAThesis.lof) > > ! Missing } inserted. > > 1.4 ... hes the corner of the Brillouin zone.}}{20} > > ?" This is my suspect figure code;               %     \begin{figure}[!ht]       \centering       \includegraphics[width=1.\textwidth]{DOSQ}       \doublespacing       \caption{The frequency dependence of the two-phonon creation density of states $\rho^{(+,+)}_{\underline{Q}}(\omega)$ (in units of $\omega_0^{-1}$), for various values of the center of mass momentum $\underline{Q}$, (in units of $\pi/a$). (Top Left Panel) For momentum $\underline{Q}$ along the x-axis. (Top Right Panel) For momentum transfers $\underline{Q}$ along the (1,1,0) axis. (Bottom Panel) For $\underline{Q}$ along the diagonal of the Brillouin zone. It is seen that the density of states peaks up at the upper edge of the two-phonon creation continuum as the center of mass momentum $\underline{Q}$ approaches the corner of the Brillouin zone.}\label{DOSQ}     \end{figure}     %      Do you think something wrong?


title: Large bibliography and local entries - Macro

text: I'm working on a (very) large document and I'd prefer to define my biblio entries as close as possible to the text I'm working on. Therefore, I'm using the "filecontents" package, to define separate files, and a counter as a suffix. After a first pass using Latex, I only have to merge the entries into a single file - using MSDOS copy /b %WORKDIR%\biblio.* .\biblio.bib - before calling biber and executing LaTeX again. The following code is working.               \documentclass[]{article}          \usepackage[autostyle]{csquotes}     \usepackage{lipsum}     \usepackage[backend=biber,doi=false,url=true,eprint=true,style=ieee]{biblatex}     \usepackage[]{hyperref}     \hypersetup{colorlinks=true}          \usepackage{filecontents}     \newcounter{BibFileCount}     \addbibresource{biblio.bib}          \begin{document}          \stepcounter{BibFileCount}\begin{filecontents}{biblio.\arabic{BibFileCount}}     @article{kastenholz,       author       = {Kastenholz, M. A. and H{\"u}nenberger, Philippe H.},       title        = {Computation of methodology\hyphen independent ionic solvation                       free energies from molecular simulations},       journaltitle = jchph,       date         = 2006,       subtitle     = {I. The electrostatic potential in molecular liquids},       volume       = 124,       eid          = 124106,       doi          = {10.1063/1.2172593},       langid       = {english},       langidopts   = {variant=american},       indextitle   = {Computation of ionic solvation free energies},       annotation   = {An \texttt{article} entry with an \texttt{eid} and a                       \texttt{doi} field. Note that the \textsc{doi} is transformed                       into a clickable link if \texttt{hyperref} support has been                       enabled},     }     \end{filecontents}          \stepcounter{BibFileCount}\begin{filecontents}{biblio.\arabic{BibFileCount}}     @article{sigfridsson,       author       = {Sigfridsson, Emma and Ryde, Ulf},       title        = {Comparison of methods for deriving atomic charges from the                       electrostatic potential and moments},       journaltitle = {Journal of Computational Chemistry},       date         = 1998,       volume       = 19,       number       = 4,       pages        = {377-395},       doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},       langid       = {english},       langidopts   = {variant=american},       indextitle   = {Methods for deriving atomic charges},       annotation   = {An \texttt{article} entry with \texttt{volume},                       \texttt{number}, and \texttt{doi} fields. Note that the                       \textsc{doi} is transformed into a clickable link if                       \texttt{hyperref} support has been enabled},     }     \end{filecontents}              Lorem ipsum dolor sit amet~\supercite{kastenholz}.         At vero eos et accusam et justo duo dolores et ea rebum~\supercite{sigfridsson}.              \printbibliography      \end{document}      However, when trying to create a macro, the creation of my entries fails (the created file is empty). I suspect that the biblio entries are interpreted by LaTeX before being passed as a macro argument, and I don't know how to prevent that. So, this code is wrong:               \newcounter{BibFileCount}     \newcommand{\addbiblioref}[1]{       \stepcounter{BibFileCount}       \begin{filecontents}{biblio.\arabic{BibFileCount}}       #1       \end{filecontents}       }          \addbiblioref{     @book{massa,       author       = {Werner Massa},       title        = {Crystal structure determination},       date         = 2004,       edition      = 2,       publisher    = {Spinger},       location     = {Berlin},       langid       = {english},       langidopts   = {variant=british},       annotation   = {A \texttt{book} entry with an \texttt{edition} field},       }     }      Any idea to help me? Thanks in advance.


title: Strange behaviour of \iftoggle inside tikzpicture

text: I want to set flag from inside of decoration which I want to check outside of the decoration. I set the flag (call `\toggletrue{}` or `\togglefalse{}`) but when I check this flag it always false. For MWE I define a new decoration that do nothing except set the flag. Apply this decoration to the circle. And then check the flag.               \documentclass{standalone}          \usepackage{etoolbox}     \usepackage{tikz}     \usetikzlibrary{decorations}          \makeatletter          \newtoggle{toggletest}          \pgfdeclaredecoration{custom decoration}{initial}{%       \state{initial}[         width=+0pt,         next state=final,         persistent precomputation={%           \toggletrue{toggletest}         }       ]{}            \state{final}{}     }          \makeatother          \begin{document}     \begin{tikzpicture}          \draw [       postaction={%         decorate,         decoration={%           custom decoration         }       }     ] (0,0) circle (2cm);          \iftoggle{toggletest}{%       \draw [green] (0,0) circle (1cm);     }{%       \draw [red] (0,0) circle (1cm);     }          \end{tikzpicture}          \end{document}      It should draw green circle if `toggletest` is true and red one otherwise. But it draw always red one. What I am doing wrong?


title: No hyperlink for server name part of multi email text

text: I am trying to have something like `{name1, name2}@server.com` where `name1` and `name2` have hyperlinks of `name1@server.com` and `name2@server.com`. This is my code:               \usepackage{hyperref}          \{\href{mailto:name1@server.com}{name1}     \href{mailto:name2@server.com}{name2}\}@server.com      but in the out put, `}@server.com` has also a link which is `}@server.com`. The only solution I found for this is to have a space between `}` and `@` which I don't like it. Is there anyway to disable the hyperlink for `@` so that the output would be `{name1, name2}@server.com` where `name1` and `name2` have hyperlinks of `name1@server.com` and `name2@server.com`?


title: listing package error

text: I am using listing package for inserting code snippets in my thesis in several chapters of my thesis. I use the following style to insert code snippets :                  \lstset{emph={sensors, string}, emphstyle={\color{blue}\bfseries\emph},      caption={Code snippet of the building automation domain.}, escapechar=\#,       label=vocabDSL}         \lstinputlisting{code-snippet/extract-vocabsec.txt}       I am getting the following errors. My compilation indicates error at   this code location `\lstinputlisting{code-snippet/extract-vocabsec.txt}`               Pdflatex> Argument of \lst@for has an extra }     pdflatex> <inserted text>     pdflatex>   \par     pdflatex> l.140 ...isting{code-snippet/extract-vocabsec.txt}     pdflatex>     pdflatex> Runaway argument?     pdflatex> ! Paragraph ended before \lst@for was complete     pdflatex> <to be read again>     pdflatex>   \par     pdflatex> l.140 ...isting{code-snippet/extract-vocabsec.txt}     pdflatex>       for reference, I have added following header of my main compilation document.               \documentclass[twoside,12pt]{Classes/aesm_edspia}          \usepackage{listings}     \usepackage{xcolor}          \definecolor{name}{rgb}{0.5,0.5,0.5}     \definecolor{javared}{rgb}{0.6,0,0} % for strings     \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments     \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords     \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc          \lstset{ %     %language=Java,                 % choose the language of the code     basicstyle=\ttfamily,     % the size of the fonts that are used for the code     keywordstyle=\color{javapurple}\bfseries,     stringstyle=\color{javared},     commentstyle=\color{javagreen},     morecomment=[s][\color{javadocblue}]{/**}{*/},     numbers=left,                   % where to put the line-numbers     numberstyle=\tiny,              % the size of the fonts that are used for the line-numbers     stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered     numbersep=5pt,                  % how far the line-numbers are from the code     backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}     showspaces=false,               % show spaces adding particular underscores     showstringspaces=false,         % underline spaces within strings     showtabs=false,                 % show tabs within strings adding particular underscores     tabsize=2,                      % sets default tabsize to 2 spaces     captionpos=b,                   % sets the caption-position to bottom     breaklines=true,                % sets automatic line breaking     breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace     escapeinside={\%*}{*)}          % if you want to add a comment within your code      }           \begin{document}          \end{document}      extract-vocabsec.txt file contains the following code               regions:  #\label{vocab:regions-start}#         Building: integer;         Floor: integer;         Room: integer;  #\label{vocab:regions-end}#     structs:                  #\label{vocab:structs-start}#         BadgeDetectedStruct    #\label{vocab:badgedetectedstructs-start}#             badgeID: string;             timeStamp: long;   #\label{vocab:badgedetectedstructs-end}#         TempStruct            #\label{vocab:tempstruct-start}#             tempValue: double;             unitOfMeasurement: string;  #\label{vocab:structs-end}#     resources:            sensors:                        #\label{vocab:sensors-start}#             BadgeReader                 #\label{vocab:badgereader-start}#                  generate badgeDetected: BadgeDetectedStruct;  #\label{vocab:badgereader-end}#              TemperatureSensor               #\label{vocab:tempsensor-end}#                 generate tempMeasurement: TempStruct;  #\label{vocab:sensors-end}#         actuators:                   #\label{vocab:actuators-start}#             Heater                 #\label{vocab:heater}#                 action Off();      #\label{vocab:action-end}#                 action SetTemp(setTemp: TempStruct);   #\label{vocab:actuators-end}#         storages:       #\label{vocab:storages-start}#             ProfileDB   #\label{vocab:profile-start}#                 generate  profile: TempStruct accessed-by badgeID: string;  #\label{vocab:storages-end}#         userinterfaces:   #\label{vocab:ui-start}#             EndUserGUI   #\label{vocab:endusergui-start}#                 command Off();  #\label{vocab:command-off}#                 action DisplayData(displayTemp: TempStruct);    #\label{vocab:displaydata}#                      request profile(badgeID);    #\label{vocab:profile-ui}#


title: Texmaker's internal PDF-viewer keeps file handler to .pdf open and hinders subsequent compilings

text: after updating to Texmaker 4.0.4 today, I am no longer able to compile my PDFs more than once per Texmaker session. I need to quit Texmaker and run it again to compile again. The error I get is the same, as when you try to compile, but have the file opened in Adobe Reader for example. I am using the internal PDF-viewer and have not changed any Texmaker settings. To compile my work I use the quick build feature set to run pdflatex and view pdf. I did not have this problem before.


title: Book Class: Instructor's Guide

text: I am currently an undergraduate student finishing my bachelor's in mathematics. For my Complex Analysis course, my instructor personally chose me to create an Instructor's Guide for the course. The professor wants me to create the guide using a Book Document Class on LaTex. I only have about five months of experience with LaTex. Most of the document classes I have worked with are articles and beamers. The Instructor's Guide is like a mini book you can say. Every topic in lecture will be a chapter. Like a book, I will need a preface, table of contents, a glossary, etc. The professor told me I could actually have the chapters on a separate tex. document and just import them to my "master" file. Since I am still fairly new to LaTex, I was hoping someone could help me into the right direction: whether it be on what usepackages I should use, or suggestions about the layout of the Guides. Thank you for your time and Thanks in Advance for your feedback.


title: XY matrix tampering with footnote counter

text: Typesetting the following MWE:               \documentclass[a4paper]{report}     \usepackage[all]{xy}     \usepackage{mathtools}          \begin{document}     \arabic{footnote}     $$\arabic{footnote}\xymatrix{\arabic{footnote}0\overset{\arabic{footnote}\addtocounter{footnote}{+1}\arabic{footnote}}{=}\arabic{footnote}H_1(U\cup V)\ar[r]^{\partial} & H_0(U\cap V}\arabic{footnote}.$$     \arabic{footnote}\addtocounter{footnote}{+1}\arabic{footnote}     \end{document}      yields: ![enter image description here](http://i.stack.imgur.com/IR3kL.png) Why does the `footnote` counter change inside the `xymatrix` and then in the `\overset`?


title: Beamer poster error

text: So I'm using `beamerthemeI6dv.sty` on ShareLaTeX the `beamer` poster template. I keep getting this error that `\setbeamerfont{footline}{fg=white, size=\normalsize}` and `\setbeamerfont*{example title}{size=\large,series=\bf,bg=i6colorscheme1,fg=white}` have errors, but I'm not seeing what's wrong with them. ShareLaTeX says that `fg` and `bg` aren't defined, yet the lines before them which have the same variables aren't marked errors. Also when I tried to compile, on the poster `.tex` file it says that `\begin{document}` was an error, which I also don't understand. One more question, how can you format the poster so that it's made for a standard tri-fold poster board?


title: Labelling lists and equations at odds

text: I have a section where I describe lists with: `\renewcommand{\labelenumi}{\arabic*{enumi}.}` and equations with: `\renewcommand{\theequation}{\labelenumi-\arabic{equation}}` So of course, my equation numbering ends up looking like: 1.-1 But I would prefer to both label my lists 1., 2., and 3. and my equations 1-1, 1-2, & 1-3. Is there a way to do this? mwe:               \documentclass[fleqn]{book}     \usepackage{enumitem}          \begin{document}          \textbf{PROBLEMS}     \renewcommand{\labelenumi}{\arabic*{enumi}.}     \renewcommand{\theequation}{\labelenumi-\arabic{equation}}          \begin{enumerate}[label=\arabic*.]     \setcounter{equation}{0}     %%1%%     \item Consider:          \begin{equation}\label{eq: 5.1.1}     a \times b = c     \end{equation}          \begin{equation}\label{eq: 5.1.2}     a = \sqrt{bc}     \end{equation}          \setcounter{equation}{0}     %%2%%     \item  Another problem.     \end{enumerate}     \end{document}