title: setbeameruncovered problem/bug?

text: I am trying to create a presentation in Beamer using two columns, one column a tikzpicture the other a list. I wish to uncover nodes in the tikzpicture at the same time as a relevant text explanation in the list column. I can do it using `\setbeameruncovered{transparent}` but the greys out the next node and text to be displayed. I wish to not have the next node/text partially visible. If I use `\setbeameruncovered{}` or comment it out altogether I get the tikzpicture incrementally appearing but the text incrementally disappearing... Anyone point out the simple error I am making? Code below...just comment out the `\setbeameruncover{transparent}` to get the disappearing text. (I know it's not the shortest example...!)               \documentclass{beamer}     \setbeamercovered{transparent}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage{times}     \usepackage[T1]{fontenc}     \usepackage{tikz}     \usepgflibrary{plotmarks}     \begin{document}     \begin{frame}{Stability of Oxidation States - Ebsworth/Oxidation State Diagrams}          \begin{columns}[t]          \begin{column}{0.5\textwidth}     \begin{exampleblock}{Oxidation State Diagram for Manganese}     \begin{tikzpicture}[scale=0.5, every plot/.style={mark=ball, ball color=blue, mark size=5pt}]     \draw[step=0.5cm,gray,very thin] (-0.1,-3.4) grid (7.4,6.4);     \draw[->] (-.5,0) -- (7.5,0)node[near end,below=0.2cm]{\tiny{Oxidation state}};     \draw[->] (0,-3.5) -- (0,6.5)node[rotate=90,midway,above=0.2cm]{$\frac{\Delta G^{\circ}}{F}$};     \foreach \x in {0cm,1cm,2cm,3cm,4cm,5cm,6cm,7cm}     \draw[thick] (\x,-2pt) -- (\x,2pt);     \foreach \y in {-3cm,-2cm,-1cm,0cm,1cm,2cm,3cm,4cm,5cm,6cm}     \draw[thick](-2pt,\y) -- (2pt,\y);     \draw (1,0) node[below]{\tiny{+1}};     \draw (2,0) node[below]{\tiny{+2}};     \draw (3,0) node[below]{\tiny{+3}};     \draw (4,0) node[below]{\tiny{+4}};     \draw (5,0) node[below]{\tiny{+5}};     \draw (6,0) node[below]{\tiny{+6}};     \draw (7,0) node[below]{\tiny{+7}};     \draw (0,-3) node[left]{\tiny{-3}};     \draw (0,-2) node[left]{\tiny{-2}};     \draw (0,-1) node[left]{\tiny{-1}};     \draw (0,0) node[left]{\tiny{0}};     \draw (0,1) node[left]{\tiny{+1}};     \draw (0,2) node[left]{\tiny{+2}};     \draw (0,3) node[left]{\tiny{+3}};     \draw (0,4) node[left]{\tiny{+4}};     \draw (0,5) node[left]{\tiny{+5}};     \draw (0,6) node[left]{\tiny{+6}};          \onslide<2->\draw plot coordinates {(0,0)};     \onslide<3->\draw (0,0) -- (2, -2.36);     \onslide<3->\draw plot coordinates {(2,-2.36)};     \onslide<4->\draw (2, -2.36) -- (3,-0.86);     \onslide<4->\draw plot coordinates {(3,-0.86)};     \onslide<5->\draw (3, -0.86) -- (4, 0.09) ;     \onslide<5->\draw plot coordinates {(4, 0.09)};     \onslide<6->\draw (4, 0.09) -- (6, 4.27) ;     \onslide<6->\draw plot coordinates {(6,4.27)};     \onslide<7->\draw (6, 4.27) -- (7, 5.17) ;     \onslide<7->\draw plot coordinates {(7, 5.17)};          \onslide<8->\draw[thick,color=red] (2,-2.36) circle (0.25cm);     \onslide<8->\draw[thick,color=red,->] (4,-2) -- (2.25,-2.5) node[near start,above right,color=red]{\tiny{Most Stable}};     \onslide<9->\draw[thick,color=red] (7,5.17) circle (0.25cm);     \onslide<9->\draw[thick,color=red,->] (5,5.5) -- (6.75,5.25) node[near start, left,color=red]{\tiny{Most Oxidising}};     \onslide<10->\draw[thick,color=red] (0,0) circle (0.25cm);     \onslide<10->\draw[thick,color=red,->] (1.5,1.5) -- (0.25,0.25) node[near start,above right,color=red]{\tiny{Most reducing}};     \onslide<11->\draw(5,4)  node[left,color=red]{\tiny{Disproportioning}};     \onslide<11->\draw[thick,color=red,->](5,4)--(5.7,4.27);     \onslide<12->\draw[thick,color=red](6,4.27) -- (7,5.17);     \onslide<12->\draw[thick,color=red](6,4.27) -- (4,0.09);     \end{tikzpicture}     \end{exampleblock}     \end{column}     \begin{column}{0.5\textwidth}     \onslide<1->\begin{exampleblock}{Calculation of $\frac{\Delta G}{nF}$}       \tiny       \begin{tabular}{l|rrrr}           Transition & $n$   & $E^0/V$ & $-nE^0/V$ & $\Sigma$ \\\hline     \onslide<2-> $\onslide<2->0$   &\onslide<2-> 0     &\onslide<2-> 0.00  &\onslide<2-> 0.00  &\onslide<2-> 0.00 \\     \onslide<3->$0\rightarrow 2$ &\onslide<3-> 2     &\onslide<3-> 1.18  &\onslide<3-> -2.36 &\onslide<3-> -2.36 \\     \onslide<4->$2\rightarrow 3$ & \onslide<4->1     &\onslide<4-> -1.50 &\onslide<4-> 1.50  &\onslide<4-> -0.86 \\     \onslide<5->$3\rightarrow 4$ & \onslide<5->1     &\onslide<5-> -0.95 & \onslide<5->0.95  &\onslide<5-> 0.09 \\     \onslide<6->$4\rightarrow 6$ & \onslide<6->2     & \onslide<6->-2.09 &\onslide<6-> 4.18  & \onslide<6->4.27 \\     \onslide<7->$6\rightarrow 7$ & \onslide<7->1     &\onslide<7-> -0.90 &\onslide<7-> 0.90  & \onslide<7->5.17 \\     \end{tabular}     \end{exampleblock}                    \onslide<1->{\begin{alertblock}{Stability}     \onslide<8->{\begin{enumerate}     \tiny     \onslide<8->\item The most stable state will have the lowest energy on the oxidation state diagram     \onslide<9->\item Any species located with high $\Delta G$ at high oxidation number will be a strong oxidising agent     \onslide<10->\item Any species located at low oxidation number and high $\Delta G$ will be a reducing agent     \onslide<11->\item Any species located on a convex section can undergo disproportionation     \end{enumerate}}     \end{alertblock}}     \end{column}       \end{columns}       \end{frame}          \end{document}


title: Question regarding a mathmode definition layout

text: I have been trying to get               S0    = 0     Si+1  =   { .... }             U { ........}             U { ... }      definition layout in LaTeX, but have been unsuccessful for hours. My main problem is that the unions have to be aligned differently than the `=`. I hope there is anyone that can help me.


title: \uppercase in \newcommand

text: I tried to use `\uppercase` in `\newcommand`:               \newcommand\universidad{My University}     \newcommand\Universidad{\uppercase{\universidad}}       When I use this I get > My University and not > MY UNIVERSITY Why? ### EDIT I can't use `\MakeUppercase` because I need use latin quote, example: ingeniería. And this latin case has problems with `\MakeUppercase`


title: customizing chapter title format in classicthesis

text: I'm using `classicthesis` and I'd like to change the formatting of the chapter title a little bit (f.e. size and color). I think I've found the according part in the classicthesis-style               % ********************************************************************     % layout of the chapter-, section-, subsection-, subsubsection-,     % paragraph and description-headings     % ********************************************************************                  \RequirePackage{titlesec}     % chapters     \ifthenelse{\boolean{@linedheaders}}%     {% lines above and below, number right     \titleformat{\chapter}[display]%                      {\relax}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}% change color to red         {\titlerule\vspace*{.9\baselineskip}\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]% change size to \huge     }{% something like Bringhurst       \titleformat{\chapter}[display]%         {\relax}{\mbox{}\oldmarginpar{\vspace*{-3\baselineskip}\color{halfgray}\chapterNumber\thechapter}}{0pt}%         {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%      }      but when I try to change color and size of the text, nothing happens.                \documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty,abstractoff, BCOR=5mm,paper=a4,fontsize=11pt,ngerman,american]{scrreprt}           \input{classicthesis-config}     \usepackage{lipsum}          \begin{document}          \pagestyle{scrheadings}     \part{Introduction}     \chapter{First chapter}     \section{First section}     \lipsum[1-18]     \end{document}


title: Rounding up decimal number using LaTeX 3

text: I would like to use LaTeX 3 to round up decimal numbers; I want something like the following: If I type               \RoundingUpFunction{2.7}      it should return               3      as output. Unfortunately, I haven't taken the time to learn the LaTeX 3 syntax yet, so if someone will show me how to define such a function (or tell me what it is if it already exists), I will much appreciate it. **Update** What I want specifically is to automate the process in this answer from Herbert: Consider the non-working code below:               \documentclass{article}          \usepackage{pst-optic,pstricks-add}     \usepackage{tikz}          \newcommand\Lens[1][]{%       \psclip{%         \psframe[linestyle=none](-\horizontal,-\vertical)(\horizontal,\vertical)       }       \rput(0,0){\lensSPH[#1]}       \endpsclip     }          \newcommand\RoundUp[1]{%       \pgfmathparse{ceil(#1)}%       \pgfmathprintnumber[int trunc]{\pgfmathresult}%     }          \begin{document}          \begin{figure}     \def\horizontal{1}     \def\vertical{1.7}      \centering       \begin{pspicture}[showgrid](-\RoundUp{\horizontal},-\RoundUp{\vertical})%                                  ( \RoundUp{\horizontal}, \RoundUp{\vertical})        \Lens[%          lensType=CVG,%          lensWidth=1,%          lensColor=BleuVerre,%          drawing=false%        ]       \end{pspicture}     \end{figure}          \end{document}      which gives the error               ! Missing number, treated as zero.     <to be read again>                         \begingroup      l.26 ...RoundUp{\horizontal}, \RoundUp{\vertical})      What I would like is to automatically calculate the coordinates for the corners of the PSTricks window, when I have the width (`\horizontal`) and height (`\vertical`) of the lens. **Update 2** If I try to use Marco Daniel's answer in the following way, it still doesn't work:               \documentclass{article}          \usepackage{pst-optic,pstricks-add}     \usepackage{xparse}          \newcommand*\Lens[1][]{%       \psclip{%         \psframe[linestyle=none](-\horizontal,-\vertical)(\horizontal,\vertical)       }       \rput(0,0){\lensSPH[#1]}       \endpsclip     }          \ExplSyntaxOn     \NewDocumentCommand {\RoundUp} { m }      {       \fp_eval:n { round+(#1) }      }     \ExplSyntaxOff          \begin{document}          \begin{figure}     \def\horizontal{1}     \def\vertical{1.7}      \centering       \begin{pspicture}[showgrid](-\RoundUp{\horizontal},-\RoundUp{\vertical})%                                  ( \RoundUp{\horizontal}, \RoundUp{\vertical})        \Lens[          lensType=CVG,          lensWidth=1,          lensColor=BleuVerre,          drawing=false        ]       \end{pspicture}     \end{figure}          \end{document}      with the error message               ! Undefined control sequence.     <argument> \LaTeX3 error:                                 Unknown fp word a.     l.28 ...RoundUp{\horizontal}, \RoundUp{\vertical})


title: Weird bug with the parallel package: paragraphs not aligned

text: With the following code...               \documentclass[draft,10pt,a5paper]{article}     \usepackage[margin=2cm]{geometry}     \usepackage{fontspec}     \setmainfont{TeX Gyre Pagella}     \usepackage{parallel}     \setlength\parindent{0pt}          \begin{document}          \section{My Section}  % kill this line and the result is OK          BAD: % or kill this line and the result is ok          \begin{Parallel}{.47\textwidth}{.47\textwidth}     \ParallelLText{Lorem ipsum dolor sit amet.}     \ParallelRText{Sed do eiusmod tempor incididunt ut labore et dolore.}     \end{Parallel}          \bigskip          GOOD:          \begin{Parallel}{.47\textwidth}{.47\textwidth}  % same as above...     \ParallelLText{Lorem ipsum dolor sit amet.}     \ParallelRText{Sed do eiusmod tempor incididunt ut labore et dolore.}     \end{Parallel}          \end{document}      I get this result: ![enter image description here](http://i.stack.imgur.com/90ZOl.png) See the blank line between "BAD" and "Lorem ipsum"? To me, it seems like a `parallel` bug. I know there are other package for typesetting parallel text, such as `paracol` or `parcolumns`, but usually I have better results with `parallel` (fewer widows for instance).


title: Wrong placement for \preto using etoolbox

text: I'm observing that the adding a text to a list of tables (or figures) through \preto from etoolbox does not work properly when the table is placed on the next page if it does not fit the page where it is set. Consider the following code               \documentclass[twoside,a4paper]{memoir}          \usepackage{etoolbox, tocloft}     \preto\figure{%       \ifnum\value{figure}=0\addtocontents{lof}{{\bfseries Chapter \thechapter\vskip10pt}}\fi     }     \preto\table{%       \ifnum\value{table}=0\addtocontents{lot}{{\bfseries Chapter \thechapter\vskip10pt}}\fi     }          \begin{document}          \cleardoublepage     \tableofcontents     \cleardoublepage     \listoftables     \cleardoublepage          \chapter{Chapter}          blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah      \\          blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah      \\          blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah      \\          blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah      \\          %blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah           \begin{table}       \begin{center}       \caption{My table's caption}         \begin{tabular}{l c c}              \hline             column 1 & column 2 & column 3 \\             \hline             r1 & r2 & r3 \\             r1 & r2 & r3 \\             r1 & r2 & r3 \\             r1 & r2 & r3 \\             \hline         \end{tabular}       \end{center}     \end{table}          \end{document}      If I left the last comment on "blah blah blah", then the list of tables reads like: > List of Tables > > Chapter 1 > > 1.1 My table's caption ... 6 If I remove the comment character, then the list of tables gets weird and it reads like > List of Tables > > 1.1 My table's caption ... 6 > > Chapter 1 If I force the table to be [h]ere it gets solved, however I prefer having tables at top. Can anyone point how to solve this issue? Thank you!


title: Get round brackets with apalike

text: When forming my bibliography, I use `\bibliographystyle{apalike}` However that leads to in text references to use square brackets. I was wondering if it is possible for me to change the brackets to round brackets?


title: Labelling edges drawn by the draw to command

text: consider the following code:               \documentclass{article}     \usepackage[version=0.96]{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,automata,petri}            \tikzset{       place/.style={         circle,         thick,         draw=blue!75,         fill=blue!20,         minimum size=6mm       },       transition/.style={         rectangle,         thick,         fill=black,         minimum width=8mm,         inner ysep=2pt         }       }                      \begin{document}          \begin{tikzpicture}[node distance=1.3cm,>=stealth',bend angle=45,auto]         \node [place] (C) []     {C};         \node [transition] (t4) [below left of=C,label=right:$t4$]     {};         \node [place] (E) [below right of=t4]     {E};         \draw [<-] (E.west) to [out=180,in=270] (t4);         \draw [<-] (C.west) to [out=180,in=90] (t4);     \end{tikzpicture}          \end{document}      I would like to add a label to the two edges I created with the draw command. I know that there have already been some questions on this site regarding the labelling of edges in Tikz (eg, here and here) but these all use a different syntax for the draw command. I know I have to create an extra node in my draw command but unfortunately I failed to find the right the position for this within the draw command and I keep getting errors. By the way, I am somewhat confused by the multiple syntactic variants of the draw command. Is there a good overview of its usage somewhere? Thanks for your help!


title: How to define a macro that calls \index?

text: I would like to define a command which calls `\index` with its argument and gives a page-formatting style, like so:               \newcommand{\defstyle}[1]{\textbf{#1}}     \newcommand{\indexdef}[1]{\index{#1|defstyle}}      Unfortunately, when I do this, index commands like               $\phi$-foo\indexdef{$\phi$-foo}     \newpage     $\phi$-foo\index{$\phi$-foo}      result in an index containing two separate entries rather than one. I can see that this is because the `.idx` file contains               \indexentry{$\phi $-foo|defstyle}{1}     \indexentry{$\phi$-foo}{2}      with an extra space in the first case. I can even guess something of where that space comes from: I've gathered that `\index` has a sort of verbatim-like behavior, which the extra indirection of `\indexdef` is suppressing just enough for something else (what?) to insert a random extra space after the `\phi` (why?). The real question is, how to fix it? I can think of two "solutions" so far. One is to just call `\index{...|defstyle}` everywhere instead of `\indexdef`. The other is to use indirection in both cases:               \newcommand{\myindex}[1]{\index{#1}}      and then use `\myindex` instead of `\index`. But both would require a search- and-replace in a long document that already uses both `\index` and `\indexdef`. Is there a solution that will let me keep both? I tried               \let\myindex\index     \renewcommand{\index}[1]{\myindex{#1}}      but this doesn't work (why not?).


title: Getting Emacs to choose between LaTeX/ConTeXt mode depending on file?

text: I have lots of LaTeX files, and my AucTeX has been set up to automatically open up all *.tex files in LaTeX-mode. But more recently I've started using ConTeXt, and for those files (which also end in .tex) I'd like to use ConTeXt- mode. Is there any way of embedding something in the file which will tell Emacs to open up the correct mode? I can start a file with, for example               -*- mode: context; -*-      which works well, but even if it's the very first line in the file, ConTeXt still parses it and writes it to the output, although it comes way before `\starttext`. Does anybody have any better suggestions? I suppose the sensible thing would be to move all ConTeXt files into one directory tree, and set up a `.dir- locals.el` file in that directory, which would tell Emacs to open up all .tex files using ConTeXt mode. But I'd still like to be able to do it on a file-by- file basis. FWIW, I'm using Linux. Thanks!


title: How to put arrows on boundary circles in the tqft package

text: I'm drawing some simple cobordisms with tikz and tqft. I would like to indicate the orientation of the incoming and outgoing circles by putting arrowheads on them. Is there a simple way to do that? Code, I'm using is e.g.               \documentclass[varwidth=true, border=2pt]{standalone}     \usepackage{tikz}     \usepackage{tqft}     \begin{tikzpicture}[tqft/flow=east]     \node[tqft, incoming boundary components=1,     outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};     \end{tikzpicture}      which produces (though in better resolution): ![A cylinder](http://i.stack.imgur.com/vX3xL.jpg) The kind of arrow I would like to have is like in this picture (only the light green part)![enter image description here](http://i.stack.imgur.com/FcyVY.png)


title: inlineMath \$...\$ not working but default \(...\) does

text: I am having issues getting a custom inlineMath format to work. I have included the MathJax CDN and then using the in-line configuration options. I can get all of the default formats to work `$$...$$`, `\\[...\\]`, and `\\(---\\)` I want to add `\$...\$` to the inlineMath formats but it is not working at all. Here is the test Tex I am using to test all formats:               \$\frac{Math}{Jax}\$      This is what is currently in my header:               <script type="text/x-mathjax-config;executed=true">         MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },             tex2jax: { inlineMath: [ ["\\$", "\\$"], ["\\(", "\\)"] ], displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], processEscapes: true, ignoreClass: "tex2jax_ignore|dno" },             TeX: {  noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } } },             messageStyle: "none"         });     </script>     <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>


title: Include eps figures in class: report

text: \documentclass[a4paper,12pt]{report}      \usepackage[paper=a4paper]{geometry}     \usepackage[draft]{hyperref}     \begin{document}     \begin{figure}         \centering         \includegraphics[scale=0.5]{graphs/power.eps}         \caption{test}         \label{fig:power}     \end{figure}     \end{document}      I used the `linux` command `epstopdf` to convert the `eps` to `pdf`. I see the `.pdf` also in the folder                305K 2013-12-13 18:48 power.eps      65K 2013-12-13 18:48 power.pdf      It still shoots this error:               ! Undefined control sequence.     l.96 \includegraphics     [scale=0.5]{graphs/power.eps}      Any idea what the problem could be?


title: What causes this large horizontal space between two sentences?

text: I have a large document based on the book documentclass with text and images, and sometimes I encounter a new sentence that has a huge space after a period. It looks like this:   ![enter image description here](http://i.stack.imgur.com/B8Y8J.png) I have attempted to make a MWE, but failed to get the problem. This problem generally occurs when I have code that has this general structure:               A sentence that explains something shown in the images.     %     \begin{figure}[!ht]     \begin{minipage}[t]{0.48\textwidth}         \includegraphics[clip=true, trim=0 0 0 0, width=0.9\linewidth, angle=0]{image}     \end{minipage}     \hfill     \begin{minipage}[t]{0.48\textwidth}         \includegraphics[clip=true, trim=0 0 0 0, width=0.9\linewidth, angle=0]{image}     \end{minipage}     \end{figure}     %     \begin{figure}[htpb]          \includegraphics[clip=true, trim=0 0 0 0, width=0.8\linewidth, angle=0]{image}      \end{figure}     %     Another sentence that continues on the explanation.      It compiles then to something like this:               A sentence that explains something shown in the images.    Another sentence that continues on the explanation.     <image><image>        <image>      What could be causing this large jump? Is there some package/option that is known to give this discrepancy? As said I've tried to compile a MWE but failed to achieve this "error". If I knew what might cause this I could re-attempt to produce an MWE.


title: Paragraph indented to absolute horizontal position.

text: I am in the following situation: I need to have some text on the first line of a paragraph indented to the normal paragraph indentation point, then I need _further text on that same line_ , as well as all subsequent lines in the paragraph, to be indented to a specific horizontal location (in my case, 2 inches). How can I achieve this? EDIT: None of the solutions take into account that I need **further text on the first line** to be indented to the same length as additional lines. Your answers get me almost there, but not quite. ![sample](http://i.stack.imgur.com/wWKgW.jpg)


title: Breaking an arrow with text in a flowchart

text: is there a way to "break" a vertical arrow by text going through it in a flowchart? I just need a gap in the arrow for the text to go through.


title: Preparing a text for conversion to LaTeX: How to convert "ejective stops" in TIPA?

text: So I'm going to convert a lengthy document from Word to LaTeX. The document is full of glottal stops like p' t' k' (in Word format) When I passed them into a LaTeX format, the ['] symbol is unreadable and makes a mess. Sure, I can replace each one one-by-one after I paste it into LaTeX, but that's a pain. Is there any other symbol equivalent to the "left hand single quotes" mark that I can use in a search-and-replace in Word?


title: Maths, functions in latex, really basic

text: I am trying to code the following; > f:X->Y   >  x|->f(x) where `->` is `\longrightarrow` and `|->` is `\longmapsto`. However, my problem is that I am unable to get the `x` directly underneath the `X`. I tried the following code:               \\* $f : X\longrightarrow Y$     \\* $\hphantom{<1>}   $x\longmapsto f(x)$\\      However this doesn't get it directly under the `X` as desired. Any help will be much appreciated.


title: Okular to play embedded videos in Beamer

text: I have been trying to play embedded videos in presentations created in `pdflatex/Beamer` in Okular. I have read this and this but to no avail! Any suggestions? The version of **Okular** being used _is 0.13.3 using KDE devlopment platform 4.7.4_. I am running **Ubuntu 11.10**. **My minimum working example is**               \documentclass[bookmarks=true]{beamer}          \setbeamertemplate{footline}[page number]     \setbeamercolor{structure}{bg=yellow, fg=black}          \usepackage[english]{babel}     % or whatever          \usepackage[utf8]{inputenc}     % or whatever          \usepackage{times}     \usepackage[T1]{fontenc}     % \usepackage{movie15}     \usepackage{multimedia}     \usepackage{fourier-orns}          %  \usepackage{caption}     \usepackage[font=scriptsize]{caption}     \usepackage{subcaption}     \captionsetup{compatibility=false}     \usepackage{amsmath,amssymb}     \usepackage[numbers]{natbib}     %\usepackage{paralist}     \usepackage{color}     \definecolor{olivegreen}{rgb}{85, 107, 47}               \begin{document}          \begin{frame}     \frametitle{Slide Title Here}     %      % \centering     % \includemovie{6.5cm}{6.5cm}{waves.avi}     \movie{6cm}{6cm}{waves.wmv}          \end{frame}          \end{document}      **My video file is uploaded here for you to download and use.** AVI file and wmv file **All I see in Okular is this:** ![enter image description here](http://i.stack.imgur.com/0HOQz.png) `:(`


title: Configure TexStudio for first use

text: I am trying to configure TexStudio for first use. If it makes any difference I downloaded Protex onto a machine running Windows-XP. Under Options Configure TexStudio on the left I click Commands when I have the following: DVI Viewer - the path includes a folder that does not exist, but it points to a file I do have (yap.exe) so I am assuming I can just change the path so that it leads to where the file actually is. Alternatively, does it make more sense to change my directory tree so that the file is where the path says it should be? PS Viewer - the path includes a folder that doesn't exist, and leads to a file I do not have (gsview32.exe). Ghostscript - the path includes a folder that doesn't exist leading to a file I do not have (gswin32.exe) Additionally, in MiKTex Maintenance Settings on the Roots tab, I notice there is nothing under Path which suggests to me that even if I got TexStudio working MikTex would not know where the files are. Is anyone able to advise how I should proceed from here?


title: How to use mod operation in latex with tikz

text: I need something similar to               \ifnum \j mod 2 = 0      **rest** of a number, but do not know how to do this in line 22.               \documentclass{article}     \usepackage{tikz}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{0pt}%          \newcommand{\grade}{         \foreach \k in {0,...,9}{             \draw[dashed] (\k,0) -- ++(0,10);             \draw[dashed] (0,\k) -- ++(10,0);         }     }          \begin{document}     \foreach \j in {1,...,9}{         \foreach \i in {1,...,9}{             \begin{tikzpicture}[y=-1cm]                 \clip[fill=white] (1,1) rectangle (10,10);                 \grade                 %animation                 \ifnum \j < 5                     \fill[blue] (\i,\j) rectangle ++(1,1);                 \else                     \fill[blue] (\j,\i) rectangle ++(1,1);                 \fi             \end{tikzpicture}         }     }     \end{document}


title: Tufte-Latex sidenote breaks indentation in alltt

text: I'm trying to the the `alltt` environment in `tufte-book`. My problem is that `\sidenote` seems to break the indentation in `alltt`.               \documentclass{tufte-book}     \usepackage{alltt}          \begin{document}          \begin{alltt}     Some text that asdfasfd  \sidenote{Side note}     some more text     \end{alltt}          \end{document}       Any suggestions?


title: Getting listings to highlight Func<x,x,x>

text: Given this image: ![enter image description here](http://i.stack.imgur.com/UNVOf.png) How would you create a `lstdefinelanguage` that would make `Func<double, double, double>` highlighted without having to add spaces after each comma?               \documentclass{book}     \usepackage{listings}     \usepackage{color}     \usepackage{xcolor}     \lstdefinelanguage{CSharp}     {           basicstyle=\ttfamily,           keywordstyle=\color{blue!60!black}\bfseries,           morekeywords={double,Func},           alsoletter={[, ]},     }          \lstset{         basicstyle=\footnotesize\ttfamily,         language=[Sharp]C,         alsolanguage=CSharp,               keywordstyle=\color[rgb]{0.0,0,1.0}\bfseries       }     \begin{document}          \begin{lstlisting}     double x = 10;     Func<double> x = 10;     Func<double, double, double> x = 10;     Func<double , double , double> x = 20;     \end{lstlisting}          \end{document}


title: Additional empty page in songbook

text: While compiling a songbook, with the songs.sty package from http://songs.sourceforge.com/, I get an additional empty page after a song, which fills the entire page. A small example where this is present is given in this gist: https://gist.github.com/2972279 In this, there is an empty page between song #2 and #3, however, if I delete song #1, the empty page is also gone. How do I get rid of this additional empty page?


title: problems "xtick","ytick", add legend... in Gaussian with pgfplots

text: I have the following code:               \documentclass[12pt,a4paper]{article}     \newcounter{conto}     \setcounter{conto}{\time}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{url}     \usepackage{amssymb}     \usepackage{ dsfont }     \usepackage[mathscr]{euscript}     \usepackage{booktabs}     \newcommand{\longto}{\longrightarrow}     \usepackage{mathrsfs}     \usepackage{amsmath}     \usepackage{graphicx}     \newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}%     \newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%     \renewcommand{\figurename}{Graph}     \pagestyle{empty}     \usepackage{pgfplots}     \pgfmathdeclarefunction{gauss}{2}{%       \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     \usepackage{eurosym}     \begin{document}          \begin{tikzpicture}     \begin{axis}[every axis plot post/.append style={       mark=none,samples=50,smooth},       axis x line=bottom,        axis y line=left,      axis x line=middle,     xlabel={\(a \in  \mathbf{Set}(\{\mathbf{mis}_i(X)\}_{i=1}^6 )\)},         ylabel={\(f_a^{\text{rel}}\)},         axis y line=middle,         xlabel={\(x\)},         ylabel={\(\mathcal{G}_{u,p}(x)\)},         every axis x label/.style={mark=none,smooth,             at={(ticklabel* cs:1.05)},             anchor=west,},         every axis y label/.style={mark=none,smooth,             at={(ticklabel* cs:1.05)},             anchor=south,},     xtick={-3,-2,-1,0,1,2,3,4,5},         ytick={0,0.2,0.4,0.6,0.8,1.0},       enlargelimits=upper] % extend the axes a bit to the right and top       \addplot {gauss(0,0.5)};       \addplot {gauss(1,0.75)};     \end{axis}     \end{tikzpicture}          \end{document}      but the output is: ![enter image description here](http://i.stack.imgur.com/mKMVi.png) How Can I do to have the output: ![enter image description here](http://i.stack.imgur.com/HCjtl.png) ?? Thanks in advance!


title: Beamer TikZ generating two slides

text: I'm trying to label an equation I have on a Beamer slide with TikZ. Here's my code:               \begin{frame}     \frametitle{Power Utility Portfolio Choice}          \tikzstyle{na} = [baseline=-.5ex]          \begin{itemize}[<+-| alert@+>]         \item Portfolio Return             \tikz[na]\node [coordinate] (n1) {};     \end{itemize}          \begin{equation*}     \begin{aligned}     & \underset{\boldsymbol w_t}{\text{maximise}}     & & \tikz[baseline]{             \node[fill=blue!20,anchor=base] (t1)                 {$\boldsymbol w_t \cdot \bar{\boldsymbol r}_t $};         } + \frac{1 - \gamma}{2}          \tikz[baseline]{                 \node[fill=red!20,anchor=base] (t2)                 {$ \boldsymbol w_t \cdot (\Sigma_t\boldsymbol w_t) $};         } \\     & \text{subject to}     & & \boldsymbol w_t \cdot \boldsymbol \iota = 1\\     &&& \boldsymbol w_t \ge 0     \end{aligned}     \end{equation*}          \begin{itemize}[<+-| alert@+>]         \item Portfolio Variance             \tikz[na]\node [coordinate] (n2) {};     \end{itemize}          \begin{tikzpicture}[overlay]             \path[->]<1-> (n1) edge [bend left] (t1);             \path[->]<2-> (n2) edge [out=0, in=-90] (t2);     \end{tikzpicture}          \end{frame}      The problem is it generates two slides, one with both references and another with just the first. Another issue is the last reference "Portfolio variance" is in red (the actual text), can I change it to black?


title: Triangular Shaped Text

text: I need something like this this: Searching around I've found only material about tables, rotated text, diagonal lines and so on. I think the solution could be something like drawing a table with no borders, only one cell, with an (invisible) diagonal line crossing it, but I'm not sure and moreover I haven't any idea about implementing it. Help would be appreciated, I'm going mad. Thanks.


title: Why is \mid so called?

text: The LaTeX commands `\mid` and `\vert` may be used to make a vertical bar. I can appreciate that `\vert` is short for vertical, but why `\mid`? Is it short for middle? and if so, middle of what?


title: Entire course with beamer

text: What, if any, support does beamer provide for making presentations that span more than one meeting. A case in point is a university course with 30 or so lecture hours, each with 20 or so frames, for a total of 600 slides. Beamer does not seem to have the `\chapter` command, and, the it seems to ignore the `\part` command.


title: erraneous text in a LaTeX tabular array created using custom macros

text: I have a `tabular` array that is based on David Carlisle's answer to Generating LaTeX tabular code during compilation. I have modified the code so that columns and rows are defined in different `\newcommand` command definitions (practically lists). `\regionlist` contains brain regions `{ABC,DEF,GHI}` and `\contrastlist` contains 'contrasts' or activities `{SLEEP,RUN,SPEAK}`. These are defined in `g_loc_contrast_tabular_def.tex`. The data for the cells is defined in `g_loc_contrast_def.tex` using `\def` macro definitions, one for each data cell of the `tabular` array, excluding the top row and the left-most column. So this particular array contains data on localized neural activity in different situations, the situations are on rows, brain regions on columns, and the data are defined by macros such as `\def\locBABCcontrastSLEEP{both ABCs during sleep}`. These definitions work fine. I have added code to replace row headers with their descriptions that are defined in `g_loc_contrast_def.tex` using `\def` macros (`\contrastdescSLEEP`, `\contrastdescRUN`, `\contrastdescSPEAK`), but I have not been able to get the visual output right. On the leftmost column, I want " **deep sleep** " on the 1st data row (2nd row), " **running marathon** " on the 2nd data row (3rd row), and " **speaking** " (all with **bold** , without quotes), but I get **LEEP deep sleep SSLEEP** ", " **UN running marathon RRUN** " and " **PEAK speaking SSPEAK** " (without quotes). The strings `RUN`, `SLEEP` and `SPEAK` are used in macro names, and when I finally found out a way to get the description in the array by using `\textbf{\newcommand\contrastdesc#1{\csname contrastdesc#1\endcsname} \contrastdesc#1}%`, the first letter of the `#1` string, that holds the row-code (`SLEEP`, `RUN` or `SPEAK`), was moved to the right side of the description string together with complete row-code string. So I'm trying to find out what is wrong with my LaTeX code to get the output right. I'm total beginner in LaTeX macros, so it might be just some basic mistake. I have tried to find a solution and to understand LaTeX macro system, but I think I understand still only a tiny bit of it. The code compiles without problems by using `latexmk --pdf main.tex`.               \documentclass[12pt]{article}          \usepackage[american]{babel}     \usepackage{graphicx}          \begin{filecontents}{g_loc_contrast_tabular_def}     \newcommand\regionlist{ABC,DEF,GHI}     \newcommand\contrastlist{SLEEP,RUN,SPEAK}          % listheadings.     \def\listheadings{%     \expandafter\xlistheadings\regionlist,\relax,}          % xlistheadings.     \def\xlistheadings#1,{%     \ifx\relax#1%     \expandafter\\\hline     \else     &\textbf{#1}%     \expandafter\xlistheadings     \fi}          % listbody.     \def\listbody{%     \expandafter\xlistbody\contrastlist,\relax,}          % xlistbody.     \def\xlistbody#1,{%     \ifx\relax#1%     \else     \textbf{\newcommand\contrastdesc#1{\csname contrastdesc#1\endcsname}     \contrastdesc#1}%     \gdef\thisrow{#1}     \expandafter\xlistdata\regionlist,\relax,%     \expandafter\hline     \expandafter\xlistbody     \fi}          % xlistdata.     \def\xlistdata#1,{%     \ifx\relax#1%     \expandafter\\     \else     &\csname locB#1contrast\thisrow\endcsname     \expandafter\xlistdata     \fi}          % preamble.     \def\preamble{\expandafter\xpreamble\regionlist,\relax,}     \def\xpreamble#1,{%     \ifx\relax#1%     \else     c%     \expandafter\xpreamble     \fi}          % tablestart.     \def\tablestart{%     \edef\temp{\noexpand\begin{tabular}{c\preamble}\noexpand\hline}%         \temp}     \end{filecontents}          \begin{filecontents}{g_loc_contrast_def}     \def\locBABCcontrastSLEEP{ both ABCs during sleeping }     \def\locBABCcontrastRUN{ both ABCs during running }     \def\locBABCcontrastSPEAK{ both ABCs during speaking }          \def\locBDEFcontrastSLEEP{ both DEFs during sleeping }     \def\locBDEFcontrastRUN{ both DEFs during running }      \def\locBDEFcontrastSPEAK{ both DEFs during speaking }          \def\locBGHIcontrastSLEEP{ both GHIs during sleeping }     \def\locBGHIcontrastRUN{ both GHIs during running }      \def\locBGHIcontrastSPEAK{ both GHIs during speaking }          \def\contrastdescSLEEP{ deep sleep }     \def\contrastdescRUN{ running marathon }     \def\contrastdescSPEAK{ speaking }     \end{filecontents}          \begin{filecontents}{g_loc_contrast_tabular}     \tiny     \begin{table}     \scalebox{0.7}{     \tablestart     \listheadings     \listbody     \end{tabular}     } % end scalebox     \caption{Caption goes here.}     \begin{enumerate}         \item Item number one.          \item Item number two.     \end{enumerate}     \end{table}     \normalsize     \end{filecontents}          \input{g_loc_contrast_tabular_def}     \input{g_loc_contrast_def}          \begin{document}          \input{g_loc_contrast_tabular}          \end{document}


title: pstricks generated image doesn't fit into page.

text: I have a pstricks image in a document like               \documentclass[12pt]{article}     \usepackage{fullpage}     \usepackage{pstricks}     \usepackage{pst-eps}     \usepackage{pstricks-add}     \usepackage{pst-node}     \usepackage{pst-tree}     \begin{document}%     \begin{TeXtoEPS}%     \begin{pspicture}(-1.5,-1.50)(7.5,3)%     \normalsize%           % tree here, sorry but confidential and big.     \end{pspicture}     \end{TeXtoEPS}      \end{document}      And I generate the ps using `latex; dvips to ps`. But it is too big to fit on the page, only the leftmost part is shown. How to make it fit??? Thanks.


title: Bundle PDF+LaTeX source and open with Preview

text: There must be a solution to the following OS X and LaTeX related problem and I think it could be interesting to a lot of people: I would like to create a new file type ".pdflatex", a document bundle, which contains a LaTeX source file and its compiled PDF such that when I double click on this file the PDF is opened in Preview (or my favorite PDF viewer). Moreover, I would like that programs like DevonThink understand this and correctly preview/show the PDF file. I want this to comfortably deal with PDF files and their LaTeX source. This should be possible in OS X but I really don't know how to do this. (A similar but less specific question was already asked in ‘Bundle’ TeX output in a directory  but there is no satisfactory answer).


title: Serious problems with tabularx table layout

text: I have some issues when creating my tables in LaTeX and really hope, that some of you could help me. My table looks like this: ![enter image description here](http://i.stack.imgur.com/eqwu7.png) Here is my coding:               \documentclass[a4paper,12pt,oneside]{article}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{shapes,arrows,positioning,calc}      \usepackage{tabu}     \usepackage{hyperref}     \usepackage{longtable}     \usepackage{array}     \usepackage{multirow,tabularx,booktabs}     \begin{document}              \begin{center}         \begin{tabularx}{0.8\linewidth}{l !{\qquad} r X r X r X r}         \toprule         & \multicolumn{3}{c}{Name1} & & \multicolumn{3}{c}{Name2}          \\ \cmidrule{2-4} \cmidrule{6-8}                   & Factor1 && Factor2 && Factor1 && Factor2\\         \midrule         Test 1 & 12 && 32 && 3 && 5 \\         Test 2 & 1234 && 234 && 334 && --- \\          \bottomrule         \end{tabularx}         \end{center}          \end{document}      If it is possible, I would like my table to look like this (there should, of course, still be a space in the line below Name 1 and Name 2): ![enter image description here](http://i.stack.imgur.com/8HJhw.png) Further questions:   1. How do I add "Note:"?   2. How do I add table name? Hope someone can help me. Thank you very much.


title: How to remove the first blank line in tabbing environment?

text: I put some texts enclosed within `tabbing`, embedded in `fbox` and `minipage`:               \fbox{%     \begin{minipage}[t]{0.48\linewidth}%     \begin{tabbing}     \quad \= \quad \= \quad \= \quad \= \quad \= \hspace{5cm} \= \\[-\baselineskip]\\      ...      ...     \end{tabbing}     \end{minipage}}\hfill      Though the first blank line `\quad \= \quad \= \quad ...` is used to determine the format, its appearance in the paper annoys me a little bit... Is there any way to do not show it in the figure?


title: How to create floats (for listings) that span multiple pages in memoir

text: For my document I need to create several 'listof' pages that all must be formatted in a uniform way. So the standard feature support from lets say the listings package is insufficient. Therefore I use the document class `memoir` and use its feature `newlistof`, `newfloat` & `newlistentry`. So far so good, but consider the following code:               \begin{ftlisting} %the float to be shown in my listoflistings     \lstinputlisting{code.file}     \caption{Code}     \label{lst:code}     \end{ftlisting}      This template compiles and behaves perfectly unless the `\lstinputlisting{}` command includes a file that needs to be split up into several pages. Suddenly either the compilation fails or the file is not split up over several pages. I found out that this problem originates from the fact that floats cannot span more than one page. When I use the `\lstinputlisting` command on its own, it splits up the file correctly in several pages. I know that there exists a partial solution consisting of manually cutting up the file by passing a firstline/lastline option to the `\lstinputlisting` command but this solution only works for the listings package. Is there a better workaround this issue? A more complete MWE:               \documentclass{memoir}     \usepackage{listings}          \lstset{language=Java,nolol}          \newlistof{listoflistings}{lol}{List of \lstlistingname{}s}     \newfloat[chapter]{ftlisting}{lol}{\lstlistingname}     \newlistentry[chapter]{ftlisting}{lol}{0}          \begin{document}     \begin{ftlisting}     \lstinputlisting{code.java}     \caption{Code}     \label{lst:code}     \end{ftlisting}     \end{document}


title: Modifing bibliography and citation display

text: I put all my references in a file `PaperBib.bib`, and call `\bibliography{PaperBib}` in the end. I have several questions:   1. For the references part, is it possible to make my own style? For instance, I want to print only `Author`, `Title`, `booktitle`, `pages`, `volume` and `year`; and ignore `note`.   2. For where I use `\cite{...}` in the paper, at the moment only a number closed by `[]` is shown to represent the reference. How could I print `[authors year]` or `[authors number`] when I want? **Edit1:** By the way, I am using `bibtex`.


title: Using XeLaTeX instead of pdfLaTeX

text: I would like to give XeLaTeX a try. I've been using pdflatex to process the following:               \listfiles          \documentclass{article}          \usepackage[backend=biber]{biblatex}          \usepackage{filecontents}          \AtEveryBibitem{\clearfield{eprintclass}}     \AtEveryBibitem{\clearfield{doiclass}}          \begin{filecontents}{\jobname.bib}               @Article{Aubert:2007sea,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Evidence for b ---> d gamma Transitions From a Sum of                   Exclusive Final States in the Hadronic Final State Mass                   Range 1.0-GeV/c**2 < M(X(d)) < 1.8-GeV/c**2}",      year      = "2007",      eprint    = "0708.1652",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      SLACcitation  = "%%CITATION = 0708.1652;%%"     }          @Article{:2010ip,      author    = "del Amo Sanchez, P. and others",      collaboration = "BABAR",      title     = "{Dalitz-plot Analysis of B0 --> D0bar pi+ pi-}",      journal   = "PoS",      volume    = "ICHEP2010",      year      = "2010",      pages     = "250",      eprint    = "1007.4464",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      SLACcitation  = "%%CITATION = 1007.4464;%%"     }          @Article{delAmoSanchez:2010rq,      author    = "del Amo Sanchez, P. and others",      collaboration = "BABAR",      title     = "{Evidence for direct CP violation in the measurement of the                   Cabibbo-Kobayashi-Maskawa angle gamma with B-+ --> D(*)                   K(*)-+ decays}",      journal   = "Phys. Rev. Lett.",      volume    = "105",      year      = "2010",      pages     = "121801",      eprint    = "1005.1096",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      doi       = "10.1103/PhysRevLett.105.121801",      SLACcitation  = "%%CITATION = 1005.1096;%%"     }          @Article{:2008ii,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Measurement of $|V_cb|$ and the form-factor slope for                   $\bar{B} \to D \ell^- \bar{\nu}_\ell$ decays on the recoil                   of fully reconstructed $B$ mesons}",      year      = "2008",      eprint    = "0807.4978",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      SLACcitation  = "%%CITATION = 0807.4978;%%"     }          @Article{:2008if,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Measurements of ${\cal B}(\bar{B}^0 \to \Lambda_{c}^{+}                   \bar{p})$ and ${\cal B}(B^- \to \Lambda_{c}^{+} \bar{p}                   \pi^-)$ and Studies of $\Lambda_{c}^{+}\pi^-$ Resonances}",      journal   = "Phys. Rev.",      volume    = "D78",      year      = "2008",      pages     = "112003",      eprint    = "0807.4974",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      doi       = "10.1103/PhysRevD.78.112003",      SLACcitation  = "%%CITATION = 0807.4974;%%"     }          @Article{Aubert:2008zh,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Measurement of D0 - anti-D0 mixing from a time-dependent                   amplitude analysis of D0 ---> K+ pi- pi0 decays}",      journal   = "Phys. Rev. Lett.",      volume    = "103",      year      = "2009",      pages     = "211801",      eprint    = "0807.4544",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      doi       = "10.1103/PhysRevLett.103.211801",      SLACcitation  = "%%CITATION = 0807.4544;%%"     }          @Article{Aubert:2008sb,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Measurement of CP Asymmetries and Branching Fractions in                   B0 -> ---> pi+ pi-, B0 ---> K+ pi-, B0 ---> pi0 pi0, B0 ---                   > K0 pi0 and Isospin Analysis of B ---> pi pi Decays}",      year      = "2008",      eprint    = "0807.4226",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      SLACcitation  = "%%CITATION = 0807.4226;%%"     }          @Article{Aubert:2008ri,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Search for B+ ---> mu+ nu mu with inclusive reconstruction                   at BaBar}",      year      = "2008",      eprint    = "0807.4187",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      SLACcitation  = "%%CITATION = 0807.4187;%%"     }          @Article{Aubert:2008ps,      author    = "Aubert, Bernard and others",      collaboration = "BABAR",      title     = "{Direct CP, Lepton Flavor and Isospin Asymmetries in the                   Decays B ---> K(*) l+ l-}",      journal   = "Phys. Rev. Lett.",      volume    = "102",      year      = "2009",      pages     = "091803",      eprint    = "0807.4119",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      doi       = "10.1103/PhysRevLett.102.091803",      SLACcitation  = "%%CITATION = 0807.4119;%%"     }          @Article{Aubert:2008fq,      author    = "Aubert, Bernard and others",      collaboration = "BaBar",      title     = "{Searches for B meson decays to phiphi, phirho,                   phifzero(980), and fzero(980)fzero(980) final states}",      journal   = "Phys. Rev. Lett.",      volume    = "101",      year      = "2008",      pages     = "201801",      eprint    = "0807.3935",      archivePrefix = "arXiv",      primaryClass  =  "hep-ex",      doi       = "10.1103/PhysRevLett.101.201801",      SLACcitation  = "%%CITATION = 0807.3935;%%"     }          \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \nocite{*}          \printbibliography          \end{document}      I have been using this message as a reference Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX. Ideally I'm looking for methods to preserve UTF-8 after the document has been processed (see my previous thread: Error message when using biber) . Could anyone give me a skeleton that I could use to fully implement the xelatex packages described in the first link? Also, I've been getting a lot of "—¿" in my finished pdf. Any idea what could be the culprit?


title: Non-English letter input/output problem

text: I use this for language               \usepackage[T1]{fontenc}       \usepackage[utf8]{inputenc}     \usepackage[english]{babel}      Sometimes, i need input some special letter, for example Ö. The language setting worked fine before, but today it report error always when I input some special letter.(I do not remember what i changed to the latex code, seems no changes about language setting). Below are snapshots for two errors. What is the problem? ![enter image description here](http://i.stack.imgur.com/nKLaV.jpg)


title: Why doesn't LaTeX include my bibtex bibliography in the references section?

text: How can I include the `.bib` file in the latex file. I have tried:               \documentclass{report}     \usepackage{natbib}     \bibilographystyle{plainnat}     \begin{document}     \include{reference}     \end{document}      Opened a new file whose chapter heading is Reference as:               \chapter{Reference}     \bibilography{Ref.bib}      This is not showing any results included in the `Ref.bib` file in bibtex. I have used `Jabref` to create a `.bib` file.


title: TikZ and fundamental domains

text: First, I'd like to apologize if this question has already been asked before. I am trying to produce an image of a fundamental domain of the action of the modular group (that is, `$PSL_2(\mathbb{Z})$`) acting on the Poincare hyperbolic plane using `TikZ`, and I was wondering if there is an easy way to go about doing that. In particular, I would like to recreate the image on pg. 33 of this text: http://www.math.ou.edu/~kmartin/mfs/ch3.pdf, or see this image from Wikipedia: ![from Wikipedia](http://i.stack.imgur.com/28e5I.png) Any help is appreciated.


title: MikTex 2.9 Installation Error: File name database capacity exceeded.

text: I am trying a complete installation of MikTex 2.9, using 64 bit installer, from a recently downloaded local package directory, all latest versions. During installation, I run across this error "File name database capacity exceeded." Does anybody know a solution to this problem. My complete log file can be viewed at http://dl.dropbox.com/u/7201872/setup-2011-06-29-20-29.txt


title: Why does compiling TikZ with latex-dvips-ps2pdf produce a much much bigger PDF than with pdflatex?

text: The following MWE simulates the problem. Compile it with `pdflatex -shell- escape`.               \documentclass[preview,varwidth,border=12pt]{standalone}     \usepackage{filecontents}          \begin{filecontents*}{common.tex}     \documentclass[tikz]{standalone}     \begin{document}     \foreach \y in {0,10,...,110}{     \begin{tikzpicture}         \shade[top color=yellow] (-2.2,-2.2) rectangle (2.2,2.2);         \shade[ball color=black] (0,0) circle (.25);         \foreach \x in {\y,\y+120,\y+240}{\shadedraw[inner color=blue,outer color=magenta] (\x:2) arc (\x:\x+60:2) -- (\x+60:.3) arc (\x+60:\x:.3) -- cycle;}     \end{tikzpicture}}     \end{document}     \end{filecontents*}               \begin{document}     \immediate\write18{latex -jobname=common-latex common}     \immediate\write18{dvips common-latex}     \immediate\write18{ps2pdf common-latex.ps}     \immediate\write18{pdflatex -jobname=common-pdflatex common}          common-latex size: \pdffilesize{common-latex.pdf}          common-pdflatex size: \pdffilesize{common-pdflatex.pdf}     \end{document}      ![enter image description here](http://i.stack.imgur.com/MIoyz.png) Why does compiling TikZ with `latex-dvips-ps2pdf` produce a much much bigger PDF than with `pdflatex`? For the given example above, the factor is about `690027 / 9263 = 74` that is extremely fantastic.


title: Repeating preactions

text: I'm trying to use multiple similar preactions. Since I would prefer to automatise that I tried to use foreach with preactions. But it appears that's not working. Let's see an example               \documentclass{minimal}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}       \draw node       [preaction={fill,transform canvas={xscale=1.03,yscale=1.03},red}]        [preaction={fill,transform canvas={xscale=1.02,yscale=1.02},green}]        [preaction={fill,transform canvas={xscale=1.01,yscale=1.01},blue}]        [text width=10em, text height=10em,circle,fill=white] {} ;     \end{tikzpicture}     \end{document}      That will produce a (ugly) node with three coloured borders. Now I know that loops exist, I may want to use ten colours and I'm a lazy guy. So how can I use foreach to avoid copying-pasting ten times the same code? I tried what seemed the most natural to me:               \draw node      \foreach \scale/\color in {1.03/red, 1.02/green, 1.01/blue} {        [preaction={draw,transform canvas={xscale=\scale,yscale=\scale},\color}]       }      [text width=10em, text height=10em,circle,fill=white] {} ;      And the compilator complains:               ERROR: Package tikz Error: A node must have a (possibly empty) label text.     l.59   \foreach                     \scale/\color in {1.03/red, 1.02/green, 1.01/blue} {      Any idea would be welcome.


title: Handling quotes inside quotes in a bibliographic field

text: I have an entry in my bib file of the form               @conference{abc,     author = "Some name",     title = ""This is inside quote" and outside quote content",     .     .     .     }      when I check this entry through jabref, I get an error saying that `= is expected but found '"'`. This is because the inside quote is not escaped. I looked into it and I found that we can allow `"` by putting it inside `{}`, like `{"}`. But if I do that I don't get `"This is inside quote" and outside quote content` as title instead I get `{"}This is inside quote{"} and outside quote content`. Can anyone please suggest me how to handle this?


title: How to use preview and animate packages together?

text: I'm used to prepare tikz graphics with `preview` or `standalone` packages to crop them. Now I've started to experiment with animations and wanted to do the same. My first test was with Alexander Grahn's answer to Animating Protocols, but as soon as I include               \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}      in its preamble, pdflatex complains with               ! Package animate Error: Contents of first frame must not have zero width.      I've found some examples prepared with `preview` but all of them use `\animategraphics` command instead of `animateinline` environment with `\multiframe` command. So my first question is, has any sense to do what I want? It is producing an animated clipped graphic to be included in another file. "No, it hasn't" can be a good answer but if it has, what am I doing wrong? Here you have the code to test it. I've also tested adding a `\usebaoundingbox` but without any succes.               \documentclass{beamer}     \usepackage{tikz}     \usepackage{animate}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \begin{document}     \begin{frame}     \begin{animateinline}[loop]{10}       \multiframe{10}{rPos=0.1+0.1}{         \begin{tikzpicture}[every node/.style={draw}]          %\useasboundingbox (-2,-2) rectangle (7,2);          \node (s) {sender};          \node (r) at (5,0) {receiver};          \path (s) -- (r) node[pos=\rPos,coordinate] (p) {};          \draw[->] (s) -- (p);         \end{tikzpicture}       }     \end{animateinline}     \end{frame}          \end{document}


title: Reference source code line in minted package

text: Does anybody know a working example, where a source code line is reference in minted? I have not found any help till now how to do this?               \begin{minted}[linenos=true]{c++}         bla bla bla bla ;   \label{myline}     \end{minted}      The above does not work, unfortunately, there is not `commandchars` or excape for latex commands only for math? Thanks for any help!!


title: How to make travel smoothly a tikz picture across a slide?

text: The beamer frame below shows a tikz circle. I would like the tikz circle to travel smoothly across the frame according to some "random" path. Can you help me with the `animateinline` environment?               \documentclass{beamer}          \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage{lmodern}     \usepackage{tikz}          \begin{document}          \begin{frame}          \begin{tikzpicture}     \node[draw, circle, fill=red] at (0, 0) {};     \end{tikzpicture}          \end{frame}          \end{document}


title: How to make a 3D Lattice?

text: How could I create a lattice like this: ![10 by 10 lattice](http://i.stack.imgur.com/JZ7f0.png) In 3D, with the ability to change the x,y and z spacing independently of each other? Any solution using any LaTeX program would be great! I have tried to do it with asymptote but it was a resounding failure. I can't make out the structure, see any grid, nor can I adjust the values independently. ![3d lattice](http://i.stack.imgur.com/ZAalQ.png) Here is the code I used:               size(200);     import graph3;     import grid3;          real L=10;     triple s;     currentprojection=orthographic(0.25,0.25,0.75);     surface site = scale3(0.314)*unitsphere;          for(int i=1;i<=L;++i)     {       for(int j=1;j<=L;++j)       {         for(int k=1;k<=L;++k)         {           s=(i,j,k);           draw(shift(s)*site,red);         }       }     }


title: Numbering equations with letter and number?

text: I need all the equations in one of the sections to be numbered as letter (R) and an ascending number (1, 2, 3...). So they look like (R1), (R2), (R3) etc. I do **not** want the number of the section/subsection to appear (not like R3.1.1, R3.1.2, R3.2.1 ...) but just an ascending number starting from the beginning of the section, for all the rest of the sections I am satisfied with LaTeX default numbering. Numbering these equations manually is not an option because while I am writing my paper I often change the order of the equations or add/remove equations from the text.


title: How to remove left header on all glossary pages?

text: I am using the glossary package for my PhD thesis. It works fine for me, but there is one little thing I want to change. On every glossary page, there is "Glossary" appear on the top left. It also appears in my reference page, since I put print the glossary before the reference. My question is how can I remove that word "glossary"? I searched around, tried this:               \fancyhead[LE,LO]{}      I intend to remove the left heading for every page. But it doesn't work. Any suggestions will be appreciated. * * * I am using the package `glossary` in my preamble I have:               \usepackage{glossary}     \makeglossary      In the text where I put my glossary page I used this command:               % this is adding my glossary into TOC     \addcontentsline{toc}{chapter}{\textmd{Glossary}}     % this is print out my glossary page     \printglossary      After the glossary I have my reference. To generate the glossary, after generating the PDF file from LyX, I have to run these commands:               makeindex phd_thesis.glo -s phd_thesis.ist -t phd_thesis.glg -o phd_thesis.gls     pdflatex phd_thesis.tex     pdflatex phd_thesis.tex      Every page on glossary and reference shows a "Glossary" on top left. I am thinking before the `\printglossary` command put some command to get rid of the left heading. I searched around, haven't find any solution yet. I am using LaTeX 2.9 and LyX 2.0.


title: Align \footnote left

text: At the moment my footnote looks like this               ²Commit-Hooks definieren was die Softwareversionierung (zum Beispiel SVN) machen soll, sobald ein       Commit passiert.      The second line just does not align to the first (C under C). I do not get what have caused this. My Code:               Commit-Hooks\footnote{Commit-Hooks definieren was die Softwareversionierung (zum Beispiel SVN) machen soll, sobald ein Commit passiert.}       Minimal Example:               \documentclass[12pt,oneside,a4paper]{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[pdftex]{graphicx}     \usepackage{natbib}     \usepackage{fancyhdr}     \usepackage[pdftex]{color}     \usepackage[pdfpagelabels]{hyperref}     \usepackage{wallpaper}          \begin{document}     Commit-Hooks\footnote{Commit-Hooks definieren was die Softwareversionierung (zum Beispiel SVN) machen soll, sobald ein Commit passiert.}      \end{document}      Any help is appreciated.


title: Conflict between UTF8 and UTF-CJK

text: I appear to be having a conflict with font encodings. I am currently using LyX 2.1.1 (under Linux Mint 17). I have Chinese text scattered throughout most chapters, but I receive the following error when exporting to PDF:               Use of \@chapter doesn't match its definition             ...ing{latin9}Pottery Production at Huizui I}      To be specific, as you can see, only the chapter title seems to generate this error. When I change the encoding to UTF8 (Document > Settings > Language), I then get an error with the Chinese text:               ...in Ancient China'' {[}\begin{CJK}{GB}{}                                      Ŵչо\end{CJK... The control sequence at the end of the top line of your error message was never \def'ed.      This was not an issue under LyX 2.0.6, though at the time I used a cumbersome ERT inset; under 2.1.1 I just change the Language to "Chinese" and change the input on my computer to Chinese as well. Clearly, the issue seems to stem from something with `\@chapter`, but I don't know why this is suddenly a problem. Unfortunately, I don't know if I can provide a MWE: this is a multi-chapter dissertation with master and child docs. Still I'm hoping some folks have some ideas that I can try out. If there are any enterprising folks that want me to send the document to look at, I am happy to do so! Edit1: Looking at the source, here is the bit causing trouble:               \usepackage{CJKutf8}          \begin{document} \begin{CJK}{UTF8}{}%          \chapter{\end{CJK}\inputencoding{latin9}Pottery Production at Huizui I}          \inputencoding{latin9}\label{chap:Chapter-4}In this chapter I analyze and discuss the primary data collected from the Huizui site and the      And later, when Chinese is used:               ...by Li Wenjie ``A Study of     the Pottery-Making Technology in Ancient China'' \begin{CJK}{GB}{}中国古代制陶工艺研究\end{CJK}\inputencoding{latin9}      using pottery in the National History Museum collection.      As you can see, the encodings seem to switch back and forth correctly, though the bit of code above               \begin{CJK}{UTF8}{}%              \chapter{\end{CJK}      Seems strange to me because `\chapter` ends up "as" CJK. Edit2: Actually, that last comment (below) is not entirely true; that unusual coding is not present when I change the encoding (Document>Settings>Language) to "Unicode (utf8)" rather than "Unicode (CJK)(utf8)". However, then the CJK text throws errors as "not found", which is still odd because in the preamble it has this code:               \usepackage[utf8]{inputenc}     \usepackage{CJKutf8}      which I would think covers the CJK text. I think LyX adds this line because it detects that I've used "Chinese" in the document. Edit 3: I have now tried a work-around based on egreg's answer below, and changed the beginning code to:               \makeatother          \begin{document}     \begin{CJK}{UTF8}{}%     \end{CJK}\inputencoding{latin9}\chapter{Pottery Production at Huizui I}          \label{chap:Chapter-4}In this chapter I analyze and discuss the primary     data collected from the Huizui site and the archaeometric analysis...      Here, `\begin{CJK}` is not incorporated into `\chapter`, but now I get an error for the Chinese text even though I have the encoding set to "Unicode (CJK)(utf8)"!! Makes me think it is actually a problem with the CJK font family as egreg points out. Not sure why mine is set to {GB} rather than {gbsm} which worked previously.


title: Prevent paragraph ending before display equation in TeX4ht

text: I'm using TeX4ht and I noticed that the displayed equations always forces the current paragraph to end. For example, if I write:               We define     \[ x = 3 \]     and continue the discussion.      I would expect only one paragraph produced, but TeX4ht produces two (one before, and one after the equation). Here is a minimal working example, to be compiled first with `latex`, then with `tex4ht`:               \documentclass{article}     \usepackage[xhtml,mathml]{tex4ht}          \begin{document}     We define     \[ x = 3 \]     and continue the discussion.     \end{document}      Any idea of a workaround, or a solution? (I think that I figured out that the TeX4ht file which produces those paragraph ending is `html-mml.4ht`, but I'm not sure how to fix it)


title: How do I insert a full screen picture inside an itemized environment?

text: I'm using beamer to create slides and I would like to place a full screen picture with a black background inside an itemized environment. What I tried so far is:               \documentclass[10pt]{beamer}     \usetheme{Szeged}     \usecolortheme{dolphin}          \usepackage{fontspec}     \usepackage{pgf}          \setbeamercovered{transparent=25}   %Uncover text transparently          \begin{document}         \begin{frame}             \begin{itemize}                 \item<1> first item                 \only<2>{\setbeamercolor{background canvas}{bg=black}                     \begin{figure}                     \centering                      \includegraphics[width=.7\textwidth]{image.jpg} %here I would like to have a full screen image on black background                     \end{figure}                 }                 \item<3> second item             \end{itemize}                        \end{frame}     \end{document}      I would be grateful for any clue, Mihai


title: How to layout four figures with floatrow, two of them vertically?

text: how can I get a layout like the one below in my document?               _____________  _____________  _______________     |Big Picture1| |Big Picture2| |Small Picture1|     |            | |            | |______________|     |            | |            |   c) subfigure     |            | |            | _______________     |            | |            | |Small Picture2|     |____________| |____________| |______________|      a) subfigure   b) subfigure    d) subfigure                 Fig. 1: four subfigures      I tried the floatrow package and managed to get two figures with two subfigures, respectively. But how do I combine them into one figure?               \begin{figure}     \ffigbox{     \begin{subfloatrow}[2]     \ffigbox[\FBwidth][][]{\caption{subcaption1}}         {\includegraphics[scale=0.4]{big_picture1}}     \ffigbox[\FBwidth][][]{\caption{subcaption2}}         {\includegraphics[scale=0.4]{big_picture2}}     \end{subfloatrow}     }{\caption{figure1}\label{label1}}     \end{figure}          \begin{figure}     \ffigbox{     \begin{subfloatrow}[1]         \ffigbox[\FBwidth][][]{\caption{subcaption3}}             {\includegraphics[scale=0.4]{small_picture1}}     \end{subfloatrow} \\     \begin{subfloatrow}[1]         \ffigbox[\FBwidth][][]{\caption{subcaption4}}             {\includegraphics[scale=0.4]{small_picture2}}     \end{subfloatrow}     }{\caption{figure2}\label{label2}}     \end{figure}


title: Prevent TeX4ht from inserting img in equation with \mathcal

text: When I use TeX4ht to produce MathML, it produces an image when I use `\mathcal` in the equation. The result is that MathJax complains that the code is not valid. Is there a way to fix this problem? Minimal working example, to be compiled with `latex` and `tex4ht`:               \documentclass{article}          \usepackage[xhtml,mathml]{tex4ht}          \begin{document}     $\mathcal{L}$     \end{document}      The resulting html file contains               <mi mathvariant="bold-script">       <img src="cmsy10-4c.png" alt="L" class="10x-x-4c" />     </mi>      How can I get rid of the `img` tag? And how come it is recognised as `bold- script`?


title: Reverse xaxis on polar plot

text: I'm tring to obtain a clockwise polar plot, keeping the zero in north direction. The plot is correctly displayed but I can't fix the `xtick` style.               \documentclass[10pt,border=10pt]{standalone}     \usepackage{pgfplots}     \usepgfplotslibrary{polar}     \usetikzlibrary{shapes.geometric}          \makeatletter     \def\pgftransform@angle{0}     \pgfplotsset{         xticklabel style={             inner xsep= 1pt,             circle,             anchor=-\tick+(\pgftransform@angle)         },         yticklabel style={             anchor = 90 + \pgftransform@angle         }     }     \makeatother          \begin{document}     \begin{tikzpicture}     \begin{polaraxis}[         x dir = reverse,         xticklabel=$\pgfmathprintnumber{\tick}^\circ$,         xtick={0,30,...,330},         rotate=-90]     \addplot table{         0 1          30 2         60 4         90 6         120 4         };     \end{polaraxis}     \end{tikzpicture}     \end{document}      Here's my output: in the red box you can see the strange `xticks` rotation. ![output](http://i.stack.imgur.com/A71eC.png)


title: Command behavior depending on current environment

text: I would like to write a LaTeX macro whose code depends on the parent environment such as:               \newcommand\test{     %if current_environment=env1     test1     %elseif current_environment=env2     test2     %else     }          \begin{env1}     \test %output test1     \end{env1}               \begin{env2}     \test %output test2     \end{env2}          \test %output nothing      Any idea?


title: Decimal comma: extract one feature from babel-spanish

text: `\usepackage[spanish]{babel}` makes `$12.34$` to print "12,34", not "12.34". It doesn't change dot to comma if one says for example `$x.y$`. Can I use only that feature from babel package, and still use finnish hyphenation, typography etc?


title: Vertical alignment of table rows with images. PDF vs. HTML generated by htlatex

text:
I have a table with 2 columns. Left column is text and the right column has an image. I wanted the row to be aligned at the top. So that the text and the image start at the same horizontal level. Based on this answer I found I can use `adjustbox` package to do this. The above solution works, but only when using pdflatex. When using htlatex on the same tex file the HTML still shows the row to be not aligned. It seems htlatex does not support `adjustbox`. If so, any one knows how to do this so that the HTML and the pdf look the same? Here is the latex file:               \documentclass[]{article}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage{adjustbox}          \begin{document}     \begin{longtable}{|p{3in}|p{3in}|}     \\\hline     text text text text     &      \adjustbox{valign=t}{\includegraphics[scale=0.6]{mma_e1}}      \\\hline     \end{longtable}     \end{document}      The commands used are               pdflatex foo.tex     htlatex foo.tex      Texlive 2012 on Linux. Here is screen shot of the generated PDF and the HTML. You can see they are not the same ![enter image description here](http://i.stack.imgur.com/JJNGP.jpg) **note:** I need to use `longtable` since the table is many pages long. Using `tabular` or `tabularx` with something as `m{}` to center the alignment will not work even though htlatex seems to work with this option. `longtable` does not support `m{}` alignment of rows, else I could have used this option instead. **appendix** The HTML source code generated by htlatex, if needed, is copied below               <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"         "http://www.w3.org/TR/html4/loose.dtd">             <title></title>      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">      <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">      <meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">            <meta name="src" content="index.tex">      <meta name="date" content="2013-05-17 01:15:00">      <link rel="stylesheet" type="text/css" href="index.css">

<colgroup id="TBL-1-1g"><col      id="TBL-1-1"></colgroup><colgroup id="TBL-1-2g"><col      id="TBL-1-2"></colgroup>

text text text text


title: How do I change the encoding of my files?

text: Back in the old days, before I left the hallowed shores of my native country, I didn't much care what encoding my files were in. ASCII was enough for my great-great grandfather so it was enough for me. Now I live in the land of my great-great-...-great grandfathers who have a slightly mangled alphabet and ASCII no longer suffices. That would be fine if it were just me: I've learned to love UTF-8 and have even embraced `xelatex`. But sometimes I get sent documents in weird encodings, and sometimes I want to resurrect some old document, maybe to include a section in a new document, so from time to time I find myself wanting to change the encoding of a document. So: how do I do that? (Included subquestion: how do I determine the encoding of a file?) **Notes:**   1. I realise that this is only tangentially related to TeX and friends, so am fully prepared to be told to look elsewhere, but I think that this is quite common and especially (due to the fact that it seems one has to be super-aware of encodings with TeX) important for TeXers.   2. I don't have a _specific_ example file in mind here, this is a "generic" question hoping to build a useful resource. So please answer in as full generality _as you can_ and where you need to place restrictions, please make them clear. In particular, this will almost certainly have different answers depending on the OS.   3. On the other hand, if you _do_ know a super-snazzy-wizzy method that works just brilliantly when using Emacs at midnight with a full moon, then please do post it - just be sure to include whether you are assuming the _strong_ lycanthropic principle or only the weak one.   4. In light of those last two, I'd be happy for this to be CW with one answer gathering together all the techniques in a sensible grouping.   5. If this question _doesn't_ get closed and does work as I intend, these notes should probably be removed so as not to distract from the usefulness of the answers (and because we probably _don't_ want TeX-SX to be the number one hit for the "strong lycanthropic principle").


title: How to change the text encoding of a TeXnicCenter project?

text: I was trying to collaborate with another person on a LaTeX project. Unfortunately we have a text encoding problem. He cant use my ANSI coded files. Now I need to change all my files to UTF8. Is there a option in TeXnicCenter for changing all files to utf8 or need I do it manually by saving and renaming files?


title: Package Footnote and Biblatex: only fullcites in table

text: I have a question about citation in tables/tabulars. I use biblatex with style `verbose-ibid` and the package `footnote` to get the cites working in tables/tabulars: Here I use `\savenotes` and `\spewnotes` to retrieve the cites from my table. The problem is, I obviously don't get the wanted `\autocite` but some other citation-style, always something that would be the `\fullcite` from biblatex. Look at my MWE: After a shorthand is introduced, it should also be used by `\autocite`! But in my tables I always get a fullcite. Also my text-cite 7 should know the shorthand, which is introduced in the table, but it doesn't. Any ideas to get the `footnote`-package working with biblatex?               \RequirePackage{filecontents}     \begin{filecontents*}{bibl.bib}     @BOOK{something,     title={{Fulltitle with many many characters}},     shorthand={SHORTHAND},     address = {City},     publisher = {Publ},     year = {1961},     language = {{Latin}},     }     @BOOK{another,     title={{Another Fulltitle with many many characters}},     shorthand={ANOTHERSHORTHAND},     address = {City},     publisher = {Publ},     year = {1963},     language = {{Latin}},     }     \end{filecontents*}               \documentclass{article}               \usepackage{caption}     \usepackage{placeins}     \usepackage{footnote}          \usepackage[     style=verbose-ibid,     backend=biber,     bibwarn=true,     ]{biblatex}          \addbibresource{bibl.bib}          \begin{document}               bla\autocite[1]{something}     bla\autocite[2]{something}          %table     \newcommand{\tabcolA}{p{\dimexpr 0.33\linewidth-2\tabcolsep}}          \savenotes     \begin{table}[ht]     \begin{tabular}{|\tabcolA | \tabcolA | \tabcolA |}     \hline       header & header & header \\       \hline       some text with footnote\autocite[3]{something} & sometext & some text with footnote\autocite[4]{something} \\       some text with footnote\autocite[5]{another} & sometext & some text with footnote\autocite[6]{another} \\     \hline     \end{tabular}     \caption{Differences in some texts}       \label{tab:mytextdiff}     \end{table}     \FloatBarrier     \spewnotes          bla\autocite[7]{another}. bla\autocite[8]{something}          \end{document}            Output: ![](http://i.stack.imgur.com/cjvFc.jpg)


title: Multicols leaving blank pages

text: I am trying to create a formula sheet which I am going to use for my exams. I was able to set up the layout as I like it, bit I am having a problem on pages 4, 6 and others (as you can see from the document). For some reason, the columns in the multicols are not filled up, creating either an entire blank page, or only a column that is not completely filled. I won't post the original code here as it is way too long, but you can find it here:   * Main: https://www.dropbox.com/s/4big03gn5nn75tx/main.tex   * Layout file: https://www.dropbox.com/s/3xqhfqzzkxpws8b/layout_setup.tex Please feel free to modify anything you think might make it better. Thanks!


title: dot2tex and math mode

text: I have successfully installed `dot2texi` but I'm facing an issue with the math mode. The sign `(_)` in math mode works fine however other symbols do not work. For example it ignores the bar over `b` in the following example.               \documentclass{article}          \usepackage{dot2texi}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \makeatletter     \@ifundefined{verbatim@out}{\newwrite\verbatim@out}{}     \makeatother     \begin{document}     \begin{dot2tex}[tikz,options=-t math]     digraph G {     a\bar{b} -> c;     }     \end{dot2tex}          \end{document}      is there anyway to fix this? Also, is it possible to write regular LaTeX and `$$` in the `dot2texi` without worring about define it as math/verbatim/raw mode.


title: How do I access \fontdimen parameters of math fonts in the preamble?

text: I want to do some computation with the `\fontdimen` parameters of the standard math fonts to compute the appropriate length of a `\scriptstrut` (see this answer of mine). I'd prefer to do the computation once in the preamble and not at every occurence of the `\scriptstrut`. However, the problem is that the standard math fonts are only loaded when the first bit of math occurs, so something like               \edef\mylength{\the\fontdimen17\textfont2}      doesn't work in the preamble. One could use `\AtBeginDocument`, but then still the fonts are not loaded. Is there some "official" way around this problem?


title: Using tikzpicture in beamer to make a directed acrylic graph

text: I am trying to add a directed acrylic graph to a beamer presentation. Using this code (reproduced below) I created a slide, but the image produced has every node and arrow stacked roughly on top of one another. I've tried playing with the positions of the nodes, but no matter what positions I enter they seem to stack on top of one another in the image. How do I get it to display correctly (like the image below from the site) in beamer? ![DAG of IV](http://i.stack.imgur.com/gxJxd.jpg)               \begin{frame}     \begin{tikzpicture}     % nodes %     \node[text centered] (z) {$Z$};     \node[right = 1.5 of z, text centered] (t) {$T$};     \node[right=1.5 of t, text centered] (y) {$Y$};     \node[draw, rectangle, dashed, above = 1 of t, text centered] (u) {$U$};          % edges %     \draw[->, line width= 1] (z) --  (t);     \draw [->, line width= 1] (t) -- (y);     \draw[->,red, line width= 1,dashed] (u) --node {X} (z);     \draw[->,line width= 1] (u) --(t);     \draw[->,line width= 1] (u) -- (y);     \draw[->, red, line width=1,dashed] (z) to  [out=270,in=270, looseness=0.5] node{X} (y);     \end{tikzpicture}          \end{frame}


title: Table caption not appearing in PNAS document class

text: I am unable to get table captions to show up when using the PNAStwo document class from 2008 (the latest version includes printer marks that I do not want). The documentation says " _Figure and table captions should be entered at the end of the document..._ " but as captions _are_ shown for figures, I'd like them to be shown for tables too. I was hoping their recommendation wasn't implemented as a limit for authors but it seems it is, or am I missing something? If not, is there a workaround I can employ?               \documentclass{pnastwo}          \usepackage{graphicx}     \usepackage{pnastwoF}     \usepackage{amssymb,amsfonts,amsmath}          \begin{document}          \begin{article}          \begin{table}[h]         \begin{tabular}{cc}             1 & 2 \\             3 & 4         \end{tabular}         \caption{A caption that does not appear.}     \end{table}          \begin{figure}         \caption{A caption that does appear.}     \end{figure}          \end{article}          \end{document}


title: columns have not the same size although centered

text: I made a table like this one               \documentclass{article}     \usepackage{array}     \usepackage{booktabs}       \begin{document}         \begin{table}[htb]             \centering             \caption{Reproduzierbarkeit der Elektroden}             \begin{tabular}{ccccc|c|c|c|c|}                 \toprule                     \textbf{Elektrode} &\multicolumn{4}{c}{\textbf{Mittelwert [mV]}} &\multicolumn{4}{c}{\textbf{maximale Abweichung [\%]}} \\                   \midrule                     &pH 6 &pH 7 & pH 8 &pH 9 &pH 6 &pH 7 &pH 8&pH 9\\                 \cmidrule[0.5pt]{2-9}                      6 & 111 & 111 & 111 & 111 & 10 & 12 & 13 & 11\\                      7 & 111 & 111 & 111 & 111 & 10 & 12 & 13 & 11\\                      8 & 111 & 111 & 111 & 111 & 10 & 12 & 13 & 11\\                      9 & 111 & 111 & 111 & 111 & 10 & 12 & 13 & 11\\                 \bottomrule                 \label{tab:reproduzierbarkeit}             \end{tabular}          \end{table}       \end{document}      and what I get is: ![enter image description here](http://i.stack.imgur.com/KFF6g.png) So why is the width of the ninth column bigger than the others, although all rows are centered? How can I change this, so that each column has the same width? Thanks!


title: longtable list of tables caption problem

text: I am writing a MS dissertation, and using a long table in my thesis. I have a problem related with the caption of the long table in list of tables(LoT). Table 4.1 which is seen below, is a long table and not convenient for the thesis format for LoT. I want long table to be in the same format like other tables in LoT. I solved the same problem for normal tables and figures by setting `\usepackage[caption=false]{subfig}`. However, it did not work for long table. > Table 3.5. Caption....... > > 4.1 Caption........ > > Table 4.2. Caption...... > > Table 4.3. Caption...... The long table is the following. Thanks in advance for any help.               \begin{center}     \begin{longtable}{ | c | p{3cm} | c | c | c |}     \caption{Basic properties of sensors during deployment.}  \label{table:basic-property-deployment}     \\  \hline         \textbf{Sensors} & \textbf{Location} & \textbf{Threshold} & \textbf{Base Station} & \textbf{Resistance}\\ [6pt]         \hline         \endfirsthead         \multicolumn{5}{c}%        % \bigskip          {\tablename\ \thetable\ . Basic properties of sensors during deployment} \\         \hline          \textbf{Sensors} & \textbf{Location} & \textbf{Threshold} & \textbf{Base Station} & \textbf{Resistance}\\ [6pt]          \hline          \endhead          \hline \multicolumn{5}{r}{\textit{Continued on next page}} \\          \endfoot          \hline          \endlastfoot               ROWS               \end{longtable}     \end{center}


title: section header with markboth

text: I have used `\markboth` to specify specific text in certain sections of my document. Now in the middle part of the documents (the real chapters), I want to chapter name left and the section name right. I used `\chaptermark`, but intro keeps showing. I want to keep this as simple as possible and just use markboth if possible, it would seem I am doing something simple wrong...               \documentclass[parskip=half,10pt,twoside]{scrbook}          \usepackage[dottedtoc, floatperchapter, parts]{classicthesis}          \begin{document}     \chapter*{Introduction}     \addcontentsline{toc}{chapter}{\tocEntry{Introduction}}     \markboth{\spacedlowsmallcaps{Introduction}}{\spacedlowsmallcaps{Introduction}}          \chapter[Short title]{Full title}      \renewcommand{\chaptermark}[1]{%     \markboth{\thechapter.\ #1}{}}          \end{document}      I managed to print the chapter number + title on the left with the following command. Now I just need the section number + title on the right.                \renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{\chaptername}\ \spacedlowsmallcaps{\thechapter}.\ #1}{}}      I have tried \markrigth but that does not work. Any ideas? I am sure this is pretty simple.


title: How is it that an lrbox environment is correctly placing content in TOC

text: I was reviewing some old code that I wrote and thought I found a typo. But nevertheless everything is working as I want it to. The basic idea of the MWE here is that I'm storing content in a `lrbox` which I may or may not choose to use. If I use it, I want there to be an entry in the table of contents. If I don't use the `lrbox`, then I don't want any such entry. Here's a MWE:               \documentclass{article}     \usepackage{lipsum}          \usepackage{hyperref}     \newif\ifusemybox     \usemyboxtrue     \newsavebox{\mytocitembox}     \newenvironment{mytocitem}[1]{%         \begin{lrbox}{\mytocitembox}           \phantomsection           \addcontentsline{toc}{subsection}{#1}           \begin{minipage}[t]{3in}       }       {%%           \end{minipage}%%         \end{lrbox}%%         \ifusemybox           \usebox{\mytocitembox}         \fi       }          \begin{document}          \tableofcontents          \section{A}            \lipsum[1-5]            \begin{mytocitem}{test for section A}       \lipsum[5]       \end{mytocitem}            \lipsum[6-14]          \section{B}            \usemyboxfalse            \begin{mytocitem}{test for section B}       \lipsum[10]       \end{mytocitem}          \lipsum[5-10]          \end{document}      What I'm confused about is how `\phantomsection` is working here.   It seems to me that the proper way to write this should have been to use                     \ifusemybox             \phantomsection             \addcontentsline{toc}{subsection}{#1}           \fi      in the definition of the environment (instead of what I actually did which was not to embed the `\phantomsection` etc. in a conditional). Based upon my understanding of how `lrbox`es behave, I would have expected that at the time of the creation of the `lrbox`, the `\phantomsection` would also have been produced **including** the `\addcontentsline`. In fact, the more I think about this, the more complexed I become. Could someone explain why my code works?


title: table numbering not in order

text: I am somewhat irritated about the numbering of tables. Unfortunately i dont have a MWE, i doubt the "error" will be seen in a short example (this is a thesis...). Also when moving things around the error will probably disappear on its own... still i'd rather know how to avoid it. On to the issue, in the List Of Tables I have:               1. ... p.10     5. ... p. 52     2. ... p. 53     3. ... p. 54     4. ... p. 55      The List is actually correct in sorting according to page numbers. What irritates me is that the Table numbering is NOT distributed accordingly. actually the Table numbering is in the order in which they appear in the tex document. Of course floats float, so why is the table numbering not adjusted? I've read about `\usepackage{fixltx2e}` which fixes some similar errors - no luck. Also the `flafter` package doesnt seem to change anything. Admittedly i'm using a wild mix of longtable, sidewaystable, etc Here is a MWE, well its rather long actually.               \documentclass[12pt,a4paper]{article}     \usepackage{amssymb,amsmath}     \usepackage[utf8]{inputenc}     \usepackage[T2A,T1]{fontenc} %for cyrillic support     \usepackage[russian,english]{babel}     \usepackage{tocloft}     \usepackage{longtable}     \usepackage{url}     \usepackage{scrextend}     \usepackage{float}     \usepackage{psfrag}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{graphicx}     \usepackage{rotating}     \usepackage{epstopdf}     \DeclareGraphicsExtensions{.pdf,.eps,.png,.jpg,.mps}     \usepackage{everyshi}     \usepackage[absolute]{textpos}     \usepackage{enumitem}     \usepackage{setspace}     \usepackage{subfig}     \usepackage{blindtext}          \mathsurround 1.5pt          \makeatletter     \renewcommand\@makefntext[1]{%       \noindent\makebox[0.2em][r]{\@makefnmark}#1}     \makeatother          \makeatletter     \renewcommand*{\@seccntformat}[1]{%      \csname the#1\endcsname.     }     \makeatother          \renewcommand{\cftsubsecindent}{1.5em}     \begin{document}     \tableofcontents     \newpage     \listoffigures     \addcontentsline{toc}{section}{List of Figures}     \listoftables     \addcontentsline{toc}{section}{List of Tables}     \newpage     \onehalfspacing          \section{Sec}     \blindtext     \section{Sec}     \blindtext          {     \def\legend{\multicolumn{6}{l}{\footnotesize Source:}\normalsize}          \begin{table}[ht!]\centering \caption{Means \label{meancompare}}     \begin{tabular}{l c c c c c }\hline\hline     \textbf{} & \textbf{All} & \textbf{asd} & \textbf{def} & \textbf{fgg} & \textbf{ccc}\\     \textbf{} &\text{Obs: 8038} & \text{Obs: 6590} & \text{Obs: 1014} & \text{Obs: 328} & \text{Obs: 106}\\\hline     Age & 40.515 & 40.299 & 41.560 & 40.650 & 44.028\\     HHsize & 5.308 & 5.2434 & 5.669 & 5.45 & 5.472\\     \legend     \end{tabular}     \end{table}     }          \blindtext          \section{Appendix}               \begin{sidewaystable}[htbp]\centering\small      \caption{Estimation Results Model 1     \label{tabresult regress1}}     \begin{tabular}{l r @{} l c r @{} l c r @{} l c}     \hline\hline     test  &  0.096&***  & (0.020) &  0.103&l  & (0.020) &  0.102&*  & (0.020)\\     \end{tabular}     \end{sidewaystable}               \begin{table}[htbp]     \centering      \caption{Estimation results}     \label{tabresult regress}     \begin{tabular}{l r @{} l c r @{} l c}     \hline\hline     test  &  0.096&*  & (0.020)\\     \hline     \end{tabular}     \end{table}                    \begin{sidewaystable}[htbp]     \centering\small      \caption{considered}      \begin{tabular}{l|r r|r r|r r| r}     Total  & 5.729 & 71.27\% & 1.353 & 16.83\% & 956 & 11.89\% & 8.038\\     \end{tabular}     \end{sidewaystable}               {\footnotesize     \begin{longtable}{ p{3cm} p{5cm} r r r r}     \caption{Description and Summary of Variables}\\     \hline\hline     \textbf{Dependent Variable} & \textbf{Definition} & \textbf{Mean} & \textbf{SD} & \textbf{Min} & \textbf{Max}\\\hline\endfirsthead     \caption[]{(continued)}\\\hline\hline\textbf{Independent Variable} & \textbf{Definition} & \textbf{Mean} & \textbf{SD} & \textbf{Min} & \textbf{Max}\\\hline\endhead     \hline \multicolumn{5}{l}{continued on next page}\endfoot     \hline \multicolumn{5}{l}{Source:}\endlastfoot          i100 & avbascadf & 6.748 & 2.209 & 0 & 10\\     \quad\\     \textbf{Independent Variables} \\     \cline{2-6}\\          test & 1 if test, 0 if otherwise      &0.532 & 0.499 & 0 & 1\\     \end{longtable}     }          \end{document}