title: Reading Arbitrary Text into a table format

text: Another file question from Latex; this time I'm trying to read in data from a single text file and put it directly into a table. The file reads something like: > something | data | stuff | bacon > > something else | data | different stuff | more bacon > > 3rd | 3rd data | you get the idea | bacon To do this I could just use a simple _\input_ but then I'd have to have all the table setup inside the text file. Since I'm not the one going to make the .txt files I'd prefer it stay nice and simple. My solution was to use expl3 and xparse. However I'm having a rough time figuring out how to make Latex spit out the file into a table. The closest I've come uses the following code and makes something like the picture. This code I did not make myself. I found it from Arbitrary text parsing from a separate file via egreg: http://tex.stackexchange.com/users/4427/egreg . His response there was very helpful and I looked into expl3 and am beginning to get a better understanding. Unfortunately I don't understand this code too much; merely the syntax (still a bit shaky there too). My general understanding is that it makes a function within a function, etc. And then reads in a file. This code will read all the lines of a file, and I'm not sure how that loops or if it's recursive. I also have no idea what _\taylor_ means. (Google was helpful in figuring most of it out, but no luck finding \taylor). Any explanations of the code would also be much appreciated.               \NewDocumentCommand{\readdata}{O{|} m}     {          \readdata:nn { #1 } { #2 }%     }               \cs_new_protected:Npn \readdata:nn #1 #2%     {         \ior_open:Nn \g__read_ior { #2 }%         \ior_map_inline:Nn \g__read_ior%         {%             \__process:nn { #1 } { ##1 }%         }%         \ior_close:N \g__read_ior%          }               \cs_new_protected:Npn \__process:nn #1 #2%     {            \seq_set_split:Nnn \l__line_seq { #1 } { #2 }%         \use:x%         {%             \exp_not:N \DataEntry%             \seq_map_function:NN \l__line_seq \__brace:n%         }%     }               \cs_new:Npn \__brace:n #1 { { #1 } }%     \ExplSyntaxOff               \newcommand{\DataEntry}[4]  % Predetermined number of columns for data     {         #1 & #2 & #3 & #4 \\%         \hline     }               ...later...               \begin{table}[ht]          \head{\caption{Results}}% title of Table          \centering          \begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{3.5cm}|}                     I'd prefer to use |c| to have them centered, but that doesn't seem to work yet...              \hline\hline         Sample \# & Something & Results & Description \\ [0.5ex] % inserts table headings         \hline                \readdata[|]{data6.txt}         \label{table:nonlin} % is used to refer this table in the text              \end{tabular}         \end{table}      ![Image of horrible table](http://i.stack.imgur.com/D393o.png)


title: Figure move to next page when I combine to two floats to appear simultaneously

text: % Hemolysis measurements with WT vs Mutant     %General parameters     \documentclass[12pt]{article}     \usepackage{doublespace,fullpage}     \usepackage{epsfig}     \usepackage{wrapfig}     \usepackage{graphics}     \usepackage{graphicx}     %Document starts      \begin{document}     \title{\textbf{\raggedright{Hemolysis measurements}}}     \date{ }     \maketitle          \section*{Hemolysis zone measurement on Blood agar}     \textsf{\emph{Staphylococcus aureus} strains USA300 WT and NE1304 were spotted on Columbia agar supplemented with 5\% Sheep blood. The bacterial spots were made by diluting an overnight culture 1:100 and dropping 10 microliters on the plate at defined intervals.}          \begin{figure}[ht]     \includegraphics[scale=0.6]{/Users/sudipdas/Desktop/Latex/3.pdf}     \caption{The zone of hemolysis caused by NE1304 is significantly less that the wild type USA300 LAC strain}     \label{fig1}     \includegraphics[scale=0.6]{/Users/sudipdas/Desktop/Latex/4.pdf}     \caption{Measurement of individual zone of hemolysis caused by USA300 LAC wild type and NE1304, n=10}     \label{fig2}     \end{figure}     \end{document}


title: Attempting to use moderncv, get wrong version of expl3 and l3kernel too old errors

text: I'm relatively new with LaTeX. I've been trying to use moderncv, but when I do I get the following errors:               LaTeX Warning: You have requested, on input line 53, version                    `2013/07/28' of package exp13,                    but only version                    `2013/03/14 v4469 L3 Experimental code bundle wrapper'                    is available.     ! Package xparse Error: Support package l3kernel too old.     See the xparse package documentation for explanation.     Type H <return> for immediate help.      ...          1.65   }      While there are many other errors, they seem to descent for the most part from this one. I'm using TeXnicCenter to run MiKTeX 2.9 on a Windows machine. Below is a fairly minimal example code that encounters the problem:               \documentclass[11pt,a4paper,sans]{moderncv}               \moderncvstyle{casual}     \moderncvcolor{blue}      \usepackage[scale=0.75]{geometry}     \name{John}{Doe}          \begin{document}          \end{document}      Is this likely to be due to a real bug with the packages involved, or is there likely something I forgot to load/didn't implement properly?


title: Custom font not loaded

text: I have an .otf font in same dir with .tex files. I'm using XeLaTex to work with this font, consider following code                \documentclass[a4paper,12pt]{article}      \usepackage[xetex]{graphicx}      \usepackage{fontspec}      \usepackage{xunicode}      \usepackage{xltxtra}      \usepackage[utf8]{inputenc}      \usepackage[usenames,dvipsnames]{xcolor}      \usepackage[T1]{fontenc}      \usepackage{fullpage}      \usepackage{csvtools}      \usepackage{graphicx}        ...       \begin{document}        ...          \begin{minipage}{84mm}            \fontspec {Collator.otf}            \sffamily             \centering            \fontsize{32}{32} \textbf{\strut \insertName}          \end{minipage}        ...        \end{document}      yields error > Font EU1/Collator.otf(0)/m/n/12=[Collator.otf]/ICU: at 12.0pt not loadable: > Metric (TFM) file or installed font not found. On `\fontspec {Collator.otf}` line, but it should find this font in project directory. Is there any other options or I'm doing something wrong?


title: How to align p-values description in the notes of a table?

text: I am trying to format the p-values description in the notes of a table. The whole table layout is done with Stata (using command esttab) but changing the p-values format seems to be impossible. Therefore, I would like to do that after having imported the table into Lyx. That's how it should look:               Observations     1333    1111       _______________________________________          Notes: Bla bla bla bla..         ***Significant at the          **Significant at the           *Significant at the       The B and the S should be aligned. (It is required by the American Economic Review) Does anyone know which package(s) I could use to achieve that? I do not need the code for it, I am eager to try first by myself! I tried with dcolumn package (close previous tabular space, opened a new one with `\begin{tabular} {l r}` but it does not look as I should.


title: Verbatim going beyond borders

text: I use `\begin{verbatim}` and `\end{verbatim}` and have enclosed a Fortran code within it. (I am not using listing for a reason). However, Verbatim is crossing the boundaries. ![enter image description here](http://i.stack.imgur.com/F0VYV.png) How do I fix this? My packages list is:               \documentclass[12pt,a4paper]{article}     \usepackage[latin3]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{listings}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}


title: Stylish Class to write a Book in LaTeX?

text: I want to write a book in LaTeX, but not in the conventional way. I want some good fonts and better page layout. The following link is an example of what I want:   http://www.intechopen.com/books/advances-in-biomaterials-science-and- biomedical-applications If anyone can suggest me a similar kind of template, I'll be grateful to that one. Kindly suggest alternatives.


title: What is an elegant way to insert a skip between two paragraphs?

text: From time to time I want to insert a skip between two specific paragraphs (at the end of a thought). My first shot was to simply insert a `\vspace` but the indentation still bothered me. So what I came up with in the end was a new command:               \newcommand{\parspace}{\vspace*{\baselineskip}\noindent}      With this I can add it wherever I want and have a break in the text. However, it doesn't feel very elegant. Is there a better way to perform the same action?


title: Double-spaced paragraphs, single-spaced headers

text: I am using the "setspace" package to format my document with double spacing (requirement for an assignment). One of my section headers takes up two lines, though, and these section headers look better with single spacing. I went ahead and fixed it with the following.               Nunc venenatis nulla eu arcu pellentesque eu molestie nunc condimentum.     Donec sodales lacinia dictum.     Sed aliquam turpis quis enim bibendum pharetra.     This is the last paragraph in section i.          \singlespace     \section{The Next Section Which Has a Fairly Long Name that Stretches Over Two Lines}     \doublespace     This is the first paragraph in section i+1.     Cras ut tortor vel dui ultricies dapibus vitae sit amet nisi.     Aliquam rhoncus leo id eros volutpat faucibus.     Integer lectus elit, varius et semper eget, tristique vel odio.      This is the only case (so far) in my paper where the heading requires two lines, so it's not a big deal to fix it with this hack. However, I can imagine as the paper gets longer and has more sections, it could become more tedious to add this hack multiple times. Is there any way I can indicate _once_ that section headings should be single- spaced and paragraphs should be double-spaced, rather than adding this hack multiple times throughout my document?


title: Aligning items in table cells

text: I have a table where I want more than one row in some cells. I am using parbox to achieve this but this makes some items in cells left aligned and some not. How can you fix this to make them all aligned the same way?               \documentclass{beamer}     \usepackage{multirow}     \begin{document}        \begin{frame}     \frametitle{Test page}        \resizebox{\textwidth}{!}{%     \begin{tabular}{|l||c|c|}             \hline                    \multirow{3}{*}  & Column one & Column two  \\        \hline        \hline             Row one&  \textcolor{gray}{$f(n) = n^2$}  & \parbox{5cm}{$f(n) = n^2$ \\ $f(n) = n^2$}\\             Row two &  \parbox{7cm}{\textcolor{gray}{$g(n,S) = n\sqrt{\log (n/S)/\log\log(n/S)})$} \\$g(n) = n^3$ } & $g(n) = n^3$\\             Row three & \textcolor{gray}{$f(n) = n^2$} & \parbox{5cm}{$f(n) = n^2$\\ $f(n) = n^2$}\\        \hline        \end{tabular}%     }        \end{frame}         \end{document}      **Update.** Following the advice in the comments I have changed the table a little to show another problem.               \resizebox{\textwidth}{!}{%     \begin{tabular}{|l||c|c|}           \hline                    \multirow{3}{*}  & Column one & Column two  \\        \hline        \hline             Row one&  \textcolor{gray}{$g(n,S) = n\sqrt{\log (n/S)/\log\log(n/S)})$}  & \parbox{5cm}{\centering $f(n) = n^2$ \\ $f(n) = n^2$}\\             Row two &  \parbox{7cm}{\textcolor{gray}{\centering $g(n,S) = n\sqrt{\log (n/S)/\log\log(n/S)})$} \\ \centering $g(n) = n^3$ } & $g(n) = n^3$\\             Row three & \textcolor{gray}{$f(n) = n^2$} & \parbox{5cm}{\centering $f(n) = n^2$\\ $f(n) = n^2$}\\        \hline        \end{tabular}%     }      g(n,S) is still not quite aligned the same in the first and second rows of "Column one".


title: Suppress text formatting in Beamer handout mode

text: During a presentation, I want to highlight certain texts by changing their color and underlining them. However, I don't want such effects on the handouts. In the following MWE, I define a macro `\bluebr` to underline texts and to change their color to blue. To suppress such effects in `handout` mode, I added the `handout:0` option to the command. But this is inefficient, as I use this command a lot throughout the document.               \documentclass[handout]{beamer}          \usepackage[normalem]{ulem} % underlines       \setlength{\ULdepth}{1pt}          \newcommand<>\bluebr[1]{\alt#2{\textcolor{blue}{\uline{#1}}}{#1}}          \begin{document}          \begin{frame}     Text \bluebr<2| handout:0>{highlighted in frame 2}     \end{frame}          \end{document}      I wonder if there is a way to defining `\bluebr` so that it takes a pre-set overlay specification option `handout:0`.


title: TeXStudio : Disable auto-completion of parentheses

text: I cannot stand the auto-completion of TeXStudio (formerly TexMakerX) regarding parentheses, braces, etc. I agree auto-completion is useful sometimes, but here it does just not work as I would like. How can I remove it completely? Under `configuration -> completion` nothing is checked. From where do I remove the auto-completion of these?


title: Why isn't the resume key working for enumitem package

text: How can I make the `resume` key work when my `enumerate`d lists are contained within separate `multicol` environments? Here's the code that's not working:               \documentclass{article}     \usepackage{multicol}     \usepackage{enumitem}     \newlist{problem}{enumerate}{1}     \setlist[problem,1]{label={\bfseries\arabic{problemi}.},leftmargin=*,resume}     \def\remembered[#1]{\typeout{Call #1:\arabic{problemi}}}     \pagestyle{empty}     \begin{document}          Random content     \begin{multicols}{2}     \begin{problem}     \item something     \end{problem}     \end{multicols}     \remembered[First]          more content     \begin{multicols}{3}     \remembered[Inside 2nd]     \begin{problem}     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \end{problem}     \end{multicols}     \remembered[Outside second]          more content     \begin{multicols}{3}     \remembered[Inside 3rd]     \begin{problem}     \item something     \item something     \item something     \item something     \item something     \end{problem}     \end{multicols}     \remembered[Outside 4th]          \end{document}      The `\remember` command seems to indicate that the value of the counters isn't being localized by the `multicols` environment. So, why can't `resume` find the correct value to resume from? Without the `multicols` environment everything works as desired:               \documentclass{article}     \usepackage{multicol}     \usepackage{enumitem}     \newlist{problem}{enumerate}{1}     \setlist[problem,1]{label={\bfseries\arabic{problemi}.},leftmargin=*,resume}     \def\remembered{\typeout{\arabic{problemi}}\par I remember: \arabic{problemi}}     \pagestyle{empty}     \begin{document}          Random content     \begin{problem}     \item something     \end{problem}     \remembered[First]          more content     \remembered[Inside 2nd]     \begin{problem}     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \item something     \end{problem}     \remembered[Outside second]          more content     \remembered[Inside 3rd]     \begin{problem}     \item something     \item something     \item something     \item something     \item something     \end{problem}     \remembered[Outside 4th]          \end{document}


title: \leftskip, \linewidth and minipage

text: I have an environment with a `minipage`of the length `\linewidth-\parindent` (using the `calc` package). When I stick this in a place where `\leftskip=\parindent` it protrudes in the margin. Shouldn't `\linewidth` adapt to these new dimensions and keep the minipage inside the margin?               \documentclass{article}     \usepackage{blindtext}     \usepackage{calc}          \newenvironment{env}         {\hfill\begin{minipage}{\linewidth-\parindent}\bf}         {\end{minipage}}          \begin{document}          \tiny          \blindtext          \begin{env}     \blindtext     \end{env}          \blindtext          \setlength{\leftskip}{\parindent}          \blindtext          \begin{env}     \blindtext     \end{env}          \end{document}      ![enter image description here](http://i.stack.imgur.com/EzHC2.png) EDIT: With the hints from David I found what I needed from this question (is this a duplicate?):               \newenvironment{env}         {\list{}{}\item\relax         \nointerlineskip\leavevmode}         {\endlist}      This indents the margin via `list` (like LaTeXs `quote`) and `\nointerlineskip\leavevmode` fixes problems with missing items.


title: Page cited for bibliography

text: For each of my bibliographic entries, which I currently handle using bibtex, I would like to include the numbers of the pages of my document in which the entry is cited. For example:               James Terry. Programming for beginners. http://www.jterry.com. Cited on pages 5, 10, 11.      This means that this entry is cited on pages 5, 10, and 11 of my document. Is there a command/package that would allow me to do this automatically?


title: Using tabularx in a custom environment - "misplaced \noalign"

text: # Question Currently, I'm trying to shorten the creation of small `tabularx`-tables with pre-defined headers, but somehow, trying to use the `tabularx`-environment, even though I used the `\tabularx` and `\endtabularx` commands, inside my own yields to errors I fail to understand. My current approach:               \newenvironment{predtable}[1]%       {%         \par\nolinenumbers%         \captionof{table}{#1}%         \tabularx{\textwidth}{|l| c c c |}%             \hline%              & Heading & Heading & Heading \\%             \hline%       }%       {%             \hline%         \endtabularx%         \linenumbers%       }      This was supposed to ease table creation such that writing               \begin{predtable}         item1 & item2 & item3 & item4\\     \end{predtable}      would be enough. However, while I don't get errors when defining the environment, using it gets me the error `Misplaced \noalign \end{predtable}`. # Working example               \documentclass[12pt,a4paper]{article}     \usepackage[top=2.5cm, left=2.5cm, bottom=2cm, right=2cm]{geometry}     \usepackage{array}     \usepackage{tabularx}     \usepackage[font=footnotesize,labelfont=sc]{caption}     \usepackage{subcaption}     \usepackage[pagewise, modulo]{lineno}     \newcolumntype{C}{>{\centering\arraybackslash}X}     \newenvironment{predtable}[1]%     {%      \par\nolinenumbers%      \captionof{table}{#1}%      \tabularx{\textwidth}{|l| C C C |}%          \hline%            & Heading 1 & Heading 1 & Heading 1 \tabularnewline%          \hline%     }%     {%          \hline%      \endtabularx%      \linenumbers%     }     \begin{document}         \begin{predtable}{Caption goes here!}             Label & Contents & go & here!\tabularnewline         \end{predtable}     \end{document}      `line 26: Misplaced \noalign \end{predtable}`


title: Asymmetric uncertainties with siunitx package

text: Is it possible to typeset asymmetric uncertainties, e.g. `$0.84_{-0.01}^{+0.02}$` with the `siunitx` package?


title: How to align and resize uniformly objects in latex table

text: I am trying to make a table which includes graphics as well. I am doing               \documentclass[a4paper,12pt]{book}     \usepackage{array}     \begin{document}              \begin{table}[h!]              \begin{center}             \begin{tabular}{ | c | p{4cm} | p{3cm}|  }                   \hline               Process & Diagrams  &     \sum  $\left| \mathcal{M} \right|^2 / \left ( 4 \pi \alpha_s\right)^2$      \\ \hline\hline               $qq^\prime \rightarrow qq^\prime$                    &               \centering               \vspace{1mm}                 \includegraphics[\width=0.5\textwidth, height=20mm]{./chapter3/figures_susy/qq'_qq'.png}                      &              \vspace{1mm}           $\frac{4}{9} \frac{s^2+u^2}{t^2}$                   \\ \hline              \end{tabular}         \label{tab:scattering_diagrams}               \end{center}               \end{table}     \end{document}      but all I get looks like this ![screenshot](http://i.stack.imgur.com/8UUak.png) What I want is something like this ![screenshot2](http://i.stack.imgur.com/5Ilfs.png)


title: Is there a generic dummy command?

text: I would like to add in the title field of some bib entries a dummy command which I can redefine to force e.g. a linebreak in certain cases. I need a command which normally doesn't do anything, doesn't rely on some specific package (so that the bib-file doesn't break when used without the package), which isn't used elsewhere and which I can safely redefine without breaking something. I looked up latex.ltx but couldn't find anything suitable. Has someone an idea what I could use if I don't want to clutter the bib with `\csname adummycommand\endcsname`?


title: How to reduce vertical space in matrix?

text: I want to reduce the size of the vertical space in matrix environment and have a result something like this ![a more compact matrix](http://i.stack.imgur.com/KvCMh.png) But at present I manage something like below ![Not so compact matrix](http://i.stack.imgur.com/giinZ.png) with the following code                 $\begin{bmatrix}         00 & 08 & 10 & 18 & 20 & 28 & 30 & 38 \\         01 & 09 & 11 & 19 & 21 & 29 & 31 & 39 \\         02 & 0a & 12 & 1a & 22 & 2a & 32 & 3a \\         03 & 0b & 13 & 1b & 23 & 2b & 33 & 3b \\         04 & 0c & 14 & 1c & 24 & 2c & 34 & 3c \\         05 & 0d & 15 & 1d & 25 & 2d & 35 & 3d \\         06 & 0e & 16 & 1e & 26 & 2e & 36 & 3e \\         07 & 0f & 17 & 1f & 27 & 2f & 37 & 3f       \end{bmatrix}$      I can change the font using \mathsf{}, but other than that, how I reduce the vertical space between the rows? I did find things like array stretch to increase vertical space between rows in matrix, but not something that can decrease the space.


title: How to get chapterthumb work in KOMA-Script?

text: I came from here as I was looking for a way to get chapterthumb work according to the directions. I manually installed the `chapterthumb.sty` package into the texlive2013 distribution. However, the MWE didn't work -- error: `File chapterthumb.sty' not found. \pagestyle` The textedior (TexStudio) shows that the package is present when I hover the mouse over the `\usepackage{chapterthumb}`. I don't know whether this is enough to tell that a package is recognized by texlive. What am I missing? Note:   Xetex compilation. **Update**   I have Windows 7 platform, based Chirstian Hupfer's adivse I put the `.sty` file in the _working_ directory, this worked on the v0.1 chapterthumb package but not on v0.2. **Request**   To show in a MWE code:   1. How one can stop chapterthumb from appearing in table of contents, appendix chapters?   2. How to change the text of the chapterthumb from `Chapter 1` to `Introduction`, `Chapter 2` to `Materials & Methods`, and so forth, as promised in the linked website above. **MWE**               \documentclass{scrbook}     \usepackage{chapterthumb}     \pagestyle{scrheadings}     \lohead[\putchapterthumb]{\putchapterthumb}     \addtokomafont{chapterthumb}{\bfseries}     \begin{document}     \chapter{Am Anfang beginnt es}\dots     \chapter{Weiter}\dots     \chapter{Und weiter}\dots     \chapter{Und noch weiter}\dots     \chapter{Und immer weiter}\dots     \chapter{Geht die Reise}\dots     \chapter{Hinaus}\dots     \chapter{Und weiter hinaus}\dots     \chapter{Immer weiter hinaus}\dots     \end{document}       **Update**   there is no guarantee that the code in the MWE nor in solution to work because of the KOMA-script update. The new version of chapterthumb package is no more based on the scrpage2 package, but rather on its successor scrlayer package. Please refer to http://www.komascript.de/chapterthumbs-example for more info.


title: Change color of an item in beamer when moving to next time

text: I have three items in a beamer slide. They appear one after the other when I press next. My problem is I want the first two items to change color when the third item appears. Please explain how to do this.


title: How to use angle brackets for a keyword in \listings?

text: I've got a code of a HTML website that I want to show in my LaTeX document. The problem is, that the HTML code has a tag called `<canvas>` and the JavaScript code inside the HTML document has a variable called `canvas` too. If I set `canvas` as a keyword for the language that is used to style the code, then both words (the canvas tag and the canvas variable name) get highlighted. But I only want the tag to be blue. So I thought, I can specify a keyword called `<canvas` to prevent that the word without angle brackets is highlighted. But `morekeywords={<canvas}` does not work. **MWE:**               \documentclass{scrreprt}     \usepackage{color}     \usepackage{upquote}     \usepackage{listings}     \lstdefinelanguage{JavaScript}{       morekeywords={var, function},       morecomment=[s]{/*}{*/},%       morecomment=[l]//,%       morestring=[b]",%       morestring=[b]'%     }          \lstdefinelanguage{HTML5}{         language=html,         sensitive=false,                 morekeywords={<canvas},         otherkeywords={<, >, !},         tag=[s]     }          \lstset{%         % Basic design         basicstyle={\small\ttfamily},         % Code design            keywordstyle=\color{blue}\bfseries,         stringstyle=\color{red},         % Code         language=HTML5,         alsolanguage=JavaScript,         tabsize=2,         showtabs=false,         showspaces=false,         showstringspaces=false,         extendedchars=true,         breaklines=true,         alsodigit={.:;}         % alsoletter={},     }     \begin{document}         \begin{lstlisting}     <!DOCTYPE html>     <html>       <head>         <title>Canvas</title>         <meta charset="UTF-8" />       </head>       <body>         <canvas id="square" width="200" height="200"></canvas>         <script>                 var canvas = document.createElement('canvas');                 canvas.width = 200;                 canvas.height = 200;                      var image = new Image();                 image.src = 'images/card.png';                 image.width = 114;                 image.height = 158;                 image.onload = window.setInterval(function() {                     rotation();                 }, 1000/60);        </script>       </body>     </html>         \end{lstlisting}     \end{document}      **Screenshot:** ![enter image description here](http://i.stack.imgur.com/p7wqh.png) Can someone help me?


title: The \prescript command from the mathtools package gives incorrect alignment

text: The spacing I'm getting with the `\prescript` command from the `mathtools` package seems wrong. Here is a MWE:               \documentclass{article}     \usepackage{amsmath,mathtools}     \begin{document}     $\prescript{14}{2}{\mathbf{C}}^{5+}_{2}$     \end{document}      which produces this (red line added to make difference clearer): ![enter image description here](http://i.stack.imgur.com/4PLBW.png) I suspect it's just a problem with the command itself - if so, is there a known fix? If not, what should I be doing differently? (Of course, regardless of whose fault it is, one solution is just to use a different package for this purpose.)


title: Problem with pstricks captioning, packages etc

text: I'm new by `pstricks` and trying to make my plots with it, but I am facing some problems.   1. I cannot place my plots wherever I want to in the page as I did for `pict2e`. How can I fix the plots where I want them to be?   2. I don't know which packages are used for each plot. For example, which package should I use when I'm plotting axes and using `\psaxes` and such examples? Where can I find a good reference for that?    3. How can I make a caption for my plots? The way I used to make captions in `pict2e` is not that much useful here. For instance the code which is below :               \documentclass{book}     \usepackage{pstricks}          \begin{document}          \begin{figure}     \begin{center}     \psline[linewidth=1pt , linecolor=red]{<-}(-1,1)     \psset{linecolor=green}     \psline[linewidth=3pt]{>->}(2,-3)     \psline[linewidth=1pt , linecolor=yellow]{->}(0,1)     \psline[linecolor=orange , linewidth=1pt]{->}(1,0)     \psline[linewidth=2pt , linecolor=magenta ]{->}(1,4)     \psline[linecolor=magenta,linestyle=dotted](2,3)     {\psset{linecolor=green,linestyle=dotted}\psline(2,4)}     \caption{first arrows}      \end{center}     \end{figure}          \end{document}      ![the pdf file of the above code](http://i.stack.imgur.com/QGCoH.png)


title: Referring to tikz matrix coordinates using pgf mathematics operations

text: I would like to use pgf's math operations to refer to matrix coodinates in tikz. This works for the second coordinate, but apparently miraculously:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,arrows}     \begin{document}     \begin{equation}        \begin{tikzpicture}           [description/.style={fill=white,inner sep=2pt},baseline=(current bounding box.center)]           \matrix (m) [matrix of math nodes, row sep=1em, column sep=1.5em, text height=1.5ex, text depth=0.25ex]           {           0 & \Omega^k_X                & Z k k & Z k {k-1} & \cdots & Z k 1 & Z k 0 & 0\phantom .\\           0 & \Lambda^k \mathcal E^\vee & Z k k & Z k {k-1} & \cdots & Z k 1 & Z k 0 & 0.\\           };           \foreach \a in {2,3,...,8} {           \pgfmathsetmacro{\myresult}{\a-1}           \draw[->] (m-1-\myresult) -- (m-1-\a);           \draw[->] (m-2-\myresult) -- (m-2-\a);           };        \end{tikzpicture}     \end{equation}     \end{document}       The following, however, fails spectacularly.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,arrows}     \begin{document}     \begin{equation}        \begin{tikzpicture}           [description/.style={fill=white,inner sep=2pt},baseline=(current bounding box.center)]           \matrix (m) [matrix of math nodes, row sep=1em, column sep=1.5em, text height=1.5ex, text depth=0.25ex]           {            0 \\           \Omega^k_X  \\           Z k k \\           Z k {k-1} \\           cdots \\           Z k 1 \\           Z k 0 \\           };           \foreach \a in {2,3,...,7} {           \pgfmathsetmacro{\myresult}{\a-1}           \draw[->] (m-\myresult-1) -- (m-\a-1);           };        \end{tikzpicture}     \end{equation}     \end{document}       Apparently, this is because \myresult is 1.0, 2.0, etc, and tikz does not like. An otherwise fruitless google search turned up \pgfmathfloatint, but tikz barfs on \usetikzlibrary{fpu}. Is there any way to turn 1.0 into 1?


title: HTML reference in bib file

text: I am sure you have encountered with the following question, so in advance I would be thankful to your help. I have created a bib file, and one of the my reference is an article on the web which I would like it to make a hyperlink reference, i.e I want to be shown in the way that if I click on it, it goes to the web page.


title: Using prefix notation

text: I want to show Prefix notation in my document, somewhat like this:               + (x 5 3) (- 6 4) However, I want to enter it in maths mode, but maths mode removes all the spaces, so I get:               +(x53)(-64) Which has rather a different meaning. Obviously I could add spaces explicitly, but               $+\;(\times\;5\;3)\;(-\;6\;4) $ is not exactly readable in the source. Any better ways of doing this?


title: Longtable with multicolumn and multirow not working

text: I'm using a table generated from Excel2Latex in my document. Despite using longtable, the table gets truncated at the end of page after overflowing the bottom margin. Min. working example provided below. It includes some minor modifications made by me to use the \sfrac command and adding a spacing of 1em after some rows.               \documentclass[a4paper]{scrartcl}          \usepackage{multirow}     \usepackage{longtable}     \usepackage{ctable}     \usepackage{hyphenat}     \usepackage{xfrac}          \begin{document}          % Table generated by Excel2LaTeX from sheet 'Sheet1'     \begin{table}[htb]       \centering       \caption{A long table}         \begin{longtable}{cccccccc}         \toprule            Trial   &       & A     & B     & C     & D     & E     & Outcome \\         \midrule         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 1}} & \multicolumn{1}{c}{A} & 1     & 1     & 9     & 9     & 9     & 0.01 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 9     & 9     & 9     & 0.01 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.05 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.05 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.05 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 2}} & \multicolumn{1}{c}{A} & 1     & 1     & 1     & 1     & 1     & 0.18 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 1     & 1     & 9     & 0.32 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     & 1     & 1     & 1     & 9     & 0.32 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     & 1     & 1     & 1     & 9     & 0.32 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 1     &  \sfrac{1}{9}  &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 0.06 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 3}} & \multicolumn{1}{c}{A} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 9     & 9     & 9     & 9     & 1     & 0.69 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 4}} & \multicolumn{1}{c}{A} & 1     & 7     & 9     & 9     & 9     & 0.65 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} &  \sfrac{1}{7}  & 1     & 5     & 5     & 5     & 0.20 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 5}} & \multicolumn{1}{c}{A} & 1     &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 9     & 1     & 9     & 9     & 9     & 0.69 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 1     &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.08 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 6}} & \multicolumn{1}{c}{A} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     & 1     & 1     & 1     &  \sfrac{1}{9}  & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 9     & 9     & 9     & 9     & 1     & 0.69 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 7}} & \multicolumn{1}{c}{A} & 1     &  \sfrac{1}{3}  &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 0.04 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 3     & 1     &  \sfrac{1}{5}  &  \sfrac{1}{5}  & 3     & 0.10 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 9     & 5     & 1     & 1     & 9     & 0.41 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 9     & 5     & 1     & 1     & 9     & 0.41 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 1     &  \sfrac{1}{3}  &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 0.04 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 8}} & \multicolumn{1}{c}{A} & 1     &  \sfrac{1}{3}  & 5     &  \sfrac{1}{7}  & 5     & 0.13 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 3     & 1     & 9     & 1     & 9     & 0.35 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{5}  &  \sfrac{1}{9}  & 1     &  \sfrac{1}{9}  & 1     & 0.04 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 7     & 1     & 9     & 1     & 9     & 0.45 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{5}  &  \sfrac{1}{9}  & 1     &  \sfrac{1}{9}  & 1     & 0.04 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 9}} & \multicolumn{1}{c}{A} & 1     & 1     & 9     & 9     & 9     & 0.01 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 9     & 9     & 9     & 0.01 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.56 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 10}} & \multicolumn{1}{c}{A} & 1     & 1     & 9     & 9     & 9     & 0.03 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 9     & 9     & 9     & 0.08 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.30 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.30 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 1     & 1     & 1     & 0.30 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 11}} & \multicolumn{1}{c}{A} & 1     &  \sfrac{1}{9}  &  \sfrac{1}{9}  &  \sfrac{1}{9}  &  \sfrac{1}{9}  & 0.02 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 9     & 1     &  \sfrac{1}{5}  & 3     &  \sfrac{1}{3}  & 0.14 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 9     & 5     & 1     & 7     & 7     & 0.57 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 9     &  \sfrac{1}{3}  &  \sfrac{1}{7}  & 1     & 1     & 0.10 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 9     & 3     &  \sfrac{1}{7}  & 1     & 1     & 0.17 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 12}} & \multicolumn{1}{c}{A} & 1     & 5     & 9     & 9     & 9     & 0.62 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} &  \sfrac{1}{5}  & 1     & 5     & 5     & 5     & 0.22 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} &  \sfrac{1}{9}  &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.56 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 13}} & \multicolumn{1}{c}{A} & 1     &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.11 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 5     & 1     & 5     & 5     & 5     & 0.56 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.11 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.11 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 1     &  \sfrac{1}{5}  & 1     & 1     & 1     & 0.11 \\[1em]         \multicolumn{1}{c}{\multirow{5}[0]{*}{Trial 14}} & \multicolumn{1}{c}{A} & 1     & 1     & 1     & 1     & 1     & 0.20 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & 1     & 1     & 1     & 1     & 1     & 0.20 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{C} & 1     & 1     & 1     & 1     & 1     & 0.20 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{D} & 1     & 1     & 1     & 1     & 1     & 0.20 \\         \multicolumn{1}{c}{} & \multicolumn{1}{c}{E} & 1     & 1     & 1     & 1     & 1     & 0.20 \\[1em]         \bottomrule         \end{longtable}%       \label{tab:addlabel}%     \end{table}%          \end{document}      Below is the output. Trials after 9 are missing. ![output](http://i.stack.imgur.com/xuzKN.png)


title: Is it possible to convert PDF to TXT file using GhostScript?

text: Someone wants to convert PDF to TXT as explained in C# GhostScript - Not able to successfully convert from PDF to TXT file. I am not sure whether GhostScript can do that. Is it possible?


title: Why is the wrong version of a package being loaded?

text: I was trying out Will Robertson's answer to this question and couldn't get it to compile correctly. Chasing through the log output, it seems that an _old_ version of a package is getting loaded instead of a _new_ one. In slightly more detail, the package I was trying to test (unicode-math) said that it needed the most up-to-date versions of a couple of packages (the crucial one here seems to be fontspec). So I downloaded them and put them in to my _user_ texmf tree. However, when I compile the test file, the system one is loaded. This is despite the fact that the requesting file specifies a version later than that provided for by the system version, **and** the fact that when I do `kpsewhich fontspec.sty` then _my_ version is returned. MWE: TeXLive2009 (TeXLive 2010 has the right versions of the packages, but 2009 is what comes with my distribution) with unicode-math, fontspec, expl3, and xpackages from CTAN (as per the page on unicode-math). test.tex:               \documentclass{article}     \usepackage{unicode-math}     \begin{document}     \end{document}      both               xelatex test.tex     lualatex test.tex      complain. The complaint appears later when loading some fonts, but given that the wrong fontspec package is loaded, I'm guessing that the error lies there rather than when TeX actually complains. To confirm locations:               tmp% kpsewhich fontspec.sty        /home/astacey/texmf/tex/latex/bzr/unmodified/fontspec/fontspec.sty      But the output from TeX (slightly condensed):               tmp% xelatex test.tex     This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)      restricted \write18 enabled.     entering extended mode     (./test.tex     ...     (/home/astacey/texmf/tex/latex/bzr/unmodified/unicode-math/unicode-math.sty     ...     (/home/astacey/texmf/tex/latex/bzr/unmodified/xpackages/xparse.sty)     (/home/astacey/texmf/tex/latex/bzr/unmodified/xpackages/l3keys2e.sty)     (/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.sty     ...      Note that _some_ packages are getting pulled from my local texmf tree, it's just this one that isn't.


title: A few problems using longtable

text: I am quite new to LaTeX but I love its typographic clearness and I'm using it to create pdf for some geometric drawings, nothing involved with scientific writing. Now I'm working with some Lissajous figures and I want some pages with a lot of Lissajous figures exploring different parameters. For drawing I'm using the TikZ package. I generate all `.tex` code with a Python script. If you have better solutions than `longtable` please advice about them, I'm only a new user. First of all I want automatic spacing: if I try to put 20 figures on one row the table exceeds the page and I have to manually change the `[scale=0.2]` parameter in `\begin{tikzpicture}`. This is quite annoying. Then I want the table not to be centered but to fill all the page and I don't know how to do it. This screenshot explain better, i hope: ![enter image description here](http://i.stack.imgur.com/emOu4.jpg) This is my TeX code (only what I think is the important part):               \documentclass{article}     \usepackage{tikz}     \usepackage{longtable}          \begin{document}     \begin{center}         \bf{\Huge{ Lissajous figures \\ }}     \end{center}          \begin{longtable}{llllllllllllllllllll}     \begin{tikzpicture}[scale=0.2]     \draw (0.0,0.0) -- (0.32,0.32);     \draw (0.32,0.32) -- (0.61,0.61);     ...     \draw (-0.61,-0.61) -- (-0.32,-0.32);     \draw (-0.32,-0.32) -- (0.0,0.0);     \end{tikzpicture}          &     \begin{tikzpicture}[scale=0.2]     \draw (0.0,0.16) -- (0.32,0.47);     \draw (0.32,0.47) -- (0.61,0.73);     ...     \draw (-0.61,-0.47) -- (-0.32,-0.16);     \draw (-0.32,-0.16) -- (0.0,0.16);     \end{tikzpicture}                    \\     \hfill     \end{longtable}          \end{document}


title: My margin notes are not on the same line as my text

text: In the following MWE, we can see that the notes in the margin are shifted downwards. If a few letters are removed, the margin is properly aligned with the text. I prefer to use \myrightmargin instead of modifying the \marginpar command. I use \reversemarginpar (is it optimal ?) for I use the twoside option of the class article and for I want the notes to be always on the right ! How to glue the margin notes to the same line of the text ?                  \documentclass[twoside, a4paper, 11pt]{article}     %\usepackage{marginnote}          \usepackage{lipsum}          \setlength{\parindent}{0ex}          \newcommand{\myrightmargin}[1]{     \reversemarginpar     \marginpar{     {#1}     }     }                              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}               \section{first section}         $     j=kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk     $     \marginpar{     %\hspace*{-1.1\marginparsep}     the margin     }          \lipsum[1-8]     random text to get closer to the right margin;random text to get closer too.     \marginpar{     %\hspace*{-1.1\marginparsep}     the margin     }               random text to get closer to the right margin;random text to get closer too.     \myrightmargin{my second margin}                    \end{document}      Well my first margin note with $..$ is on the left; I do not see why.


title: How to avoid duplication of longtable setup code

text: I have many longtable's in my document. Everything is the same across all the tables, except for the caption and the content (of course). How can I avoid duplicating the stuff required to set up longtable? Is this possible? The code needed to produce one table is below. You can see there is a lot of stuff required to set up the table. I would like to avoid duplicating this stuff multiple times.               \begin{longtable}[h]{M{2.00in}M{0.85in}m{0.55in}m{0.55in}m{0.55in}m{0.55in}}     \caption{First Ministry in Jerusalem} \\     \toprule     Event & Location & Matt. & Mark & Luke & John  \\     \midrule     \endfirsthead     \caption{First Ministry in Jerusalem (continued)} \\         \toprule         Event & Location & Matt. & Mark & Luke & John \\         \midrule     \endhead         \bottomrule         \multicolumn{6}{r}{\emph{Continued on next page}}     \endfoot         \bottomrule     \endlastfoot     Content & Goes & Here     \end{longtable}


title: Can't include pifont

text: I'd like to insert "BALLOT X" symbol ✗ `U+2717` I found `\ding{55}` command from `pifont` package, but when I try this:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage{pifont}          \begin{document}          %\XSolidBrush     \ding{55}     \end{document}      I get the following error:               ! Font U/pzd/m/n/10=pzdr at 10.0pt not loadable: Metric (TFM) file not found.     ! Font U/psy/m/n/10=psyr at 10.0pt not loadable: Metric (TFM) file not found.      This is my `pifont.sty`:               \ProvidesPackage{pifont}%     [2005/04/12 PSNFSS-v9.2a     Pi font support (SPQR)     ]     \newcommand{\Pifont}[1]{\fontfamily{#1}\fontencoding{U}%     \fontseries{m}\fontshape{n}\selectfont}     \newcommand{\Pisymbol}[2]{{\Pifont{#1}\char#2}}     \newcommand{\Pifill}[2]{\leavevmode       \leaders\hbox{\makebox[0.2in]{\Pisymbol{#1}{#2}}}\hfill       \kern\z@}     \newcommand{\Piline}[2]{\par\noindent\hspace{0.5in}\Pifill{#1}{#2}%        \hspace{0.5in}\kern\z@\par}     \newenvironment{Pilist}[2]%     {\begin{list}{\Pisymbol{#1}{#2}}{}}%     {\end{list}}%     \def\Pinumber#1#2{\protect\Pisymbol{#1}{\arabic{#2}}}     \newenvironment{Piautolist}[2]{%     \ifnum \@enumdepth >3 \@toodeep\else       \advance\@enumdepth \@ne           \edef\@enumctr{enum\romannumeral\the\@enumdepth}%       \expandafter\def\csname p@enum\romannumeral\the\@enumdepth\endcsname{}%       \expandafter\def\csname labelenum\romannumeral\the\@enumdepth\endcsname{%          \csname theenum\romannumeral\the\@enumdepth\endcsname}%       \expandafter\def\csname theenum\romannumeral\the\@enumdepth\endcsname{%          \Pinumber{#1}{enum\romannumeral\the\@enumdepth}}%       \list{\csname label\@enumctr\endcsname}{%             \@nmbrlisttrue             \def\@listctr{\@enumctr}%             \setcounter{\@enumctr}{#2}%             \addtocounter{\@enumctr}{-1}%             \def\makelabel##1{\hss\llap{##1}}}     \fi     }{\endlist}     \newcommand{\ding}{\Pisymbol{pzd}}     \def\dingfill#1{\Pifill{pzd}{#1}}     \def\dingline#1{\Piline{pzd}{#1}}     \newenvironment{dinglist}[1]{\begin{Pilist}{pzd}{#1}}%       {\end{Pilist}}     \newenvironment{dingautolist}[1]{\begin{Piautolist}{pzd}{#1}}%       {\end{Piautolist}}     {\Pifont{pzd}} %ERROR     {\Pifont{psy}} %ERROR     \endinput      The problem is with the last 2 lines. Can you fix it? Or suggest an other way to display this character?


title: How to embed a song in a pdf?

text: How can I create a document that has a song playing in the back with `(La)TeX`? Is it even possible? My hunch is that if you can embed video, there should be a way to embed music... but what is the best way to do it? I guess having a black box playing a song is possible, but something tells me there should be a `beTeX` way to do this.


title: Flipping Transistors with Circuiktikz

text: I was wondering if there was any way to flip a transistor or similar node component around in the `circuitikz` package? For the bipoles it's fairly simple as you just reverse the start and end, but for more advanced circuits I'm having trouble (things such as current mirrors or what have you). I've seen various solutions on scaling up and down, but none on flipping.


title: Vacuum tube electric symbols

text: Is there a package with the electric symbols for vacuum tubes, like triodes, pentodes etc?


title: Is there a counter or variable that can be used to store numbers with decimals?

text: I'm working on an invoice document which has a "Grand Total" at the end of the document after some rows of invoice items. As such, I need to keep a running count of the total for each row. Using the traditional `\newcounter` and `\addtocounter` counter doesn't work as this doesn't accept decimals, which currency often has. What would be the recommended way to create and maintain a variable that can have numbers added to it that contain decimals?


title: how to create a two column table for differentiating?

text: I want to compare two types of networks. I have 4 comparison points. How should I create a 2 column table where every of those 4 points for both networks is aligned?


title: Using merged variablenames

text: I have variables in the form: dim1a, dim1b, dim1c...; dim2a, dim2b, dim2c... I want to create a `\newcommand` with the dimension as argument, but constant a/b/c.               \documentclass[12pt,a4paper]{article}          \begin{document}          \newcount\lengtha \lengtha = 500     \newcount\lengthb \lengthb = 800     \newcount\speeda \speeda = 100     \newcount\speedb \speedb = 600          \newcommand{\dim}[1]{\#1a}          \divide\dim{length} by 10      \divide\dim{speed} by 10           \end{document}      I cant figure out how to transport e.g the string "\speed" to form `\speeda` without latex looking for the (non-existing) variable `\speed`.


title: fractional: differences between \frac{}{} and { \over }

text: > **Possible Duplicate:**   >  What is the difference between \over and \frac? I just learned that `{3 \over 4}` and `\frac{3}{4}` can produce the same fractional 3/4. So I wonder what differences are between them?


title: help in finding errors

text: I have written this code, but it does not come out as pdf. I need help in find errors or maybe the problem is in my acrobat reader. This is the code               \documentclass{article}     \usepackage[small,nohug,heads=littlevee]{diagrams}     \usepackage{amssymb,latexsym,amsmath}     \usepackage{array}     \usepackage{tikz}     \usetikzlibrary{matrix}     \usepackage{caption}     \begin{document}     \section{Van Kampen theorem}     \begin{theorem}     If \\      \vspace \begin{array}[c]{cccc}     A&  \stackrel{i}{\rightarrow} & B\\          \scriptstyle{j}{\downarrow }  \\          C    \\     \end{array}\\ is a data of groups $A$, $B$, and $C$ and homomorphisms $i$ and $j$. Then there exists a pushout $(P,j',i')$ where \begin{equation}P=\frac{B*C}{N} \end{equaition} and $j'(b)=bN,  i'(c)=cN$ where $N$ is the normal subgroup of $B*C$ generated by $\{i(a)j(a^{-1}): a\in A\}$. This pushout called {\bf amalgamated fee product}.     \end{theorem}     \begin{proof}if $a\in A$ then     \begin{eqnarray*}       j'\circ i(a) &=& i(a)N \\       &=& j(a) ({{i(a)}^{-1}j(a)})^{-1}\\       &=& j(a)N \\      &=&j'\circ j(a)\\       \end{eqnarray*}       hence $(P,j',i')$ is a solution.       Now suppose that $(G,f,g)$ is another solution of the data. By the definition of the free product there exists unique homomorphism $\psi: B*C \rightarrow G$ with $\psi\mathop{\mid_{B}}=f$ and $\psi\mathop{\mid_{C}}=g$, if $b\in B$ and $c\in C$ then $\psi (bc)= f(b)g(c)$ and for all $a\in A$ we have $\psi (i(a)j(a^{-1}))= f\circ i(a). g\circ j(a^{-1}) =1$ because $f\circ i=g\circ j $. Hence $N\leq ker\psi $ \\        Now define      \begin{equation} \varphi: \frac {B*C}{N}\rightarrow G \end{equation} to be the homomorphism induced by $\psi $ with      \begin{eqnarray*}       \varphi \circ j'(b)&=&\varphi (bN)\\       &=& \psi (b)= f(b)\\      \end{eqnarray*}      and $\varphi \circ i'(c)= \varphi (cN)= \psi (c)=g(c)$ then the following diagram commutes\\            \begin{figure}      \begin{center}     \begin{tikzpicture}[x=1.00mm, y=1.00mm, inner xsep=0pt, inner ysep=0pt, outer xsep=0pt, outer ysep=0pt]     \path[line width=0mm] (24.26,37.44) rectangle +(79.52,59.18);     \draw(26.26,90.70) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $A$};     \draw(80.23,90.70) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $B$};     \draw(26.26,56.23) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $C$};     \draw(79.87,56.05) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $G$};     \definecolor{L}{rgb}{0,0,0}     \path[line width=0.30mm, draw=L] (30.78,91.79) -- (78.97,91.79);     \definecolor{F}{rgb}{0,0,0}     \path[line width=0.30mm, draw=L, fill=F] (78.97,91.79) -- (76.17,92.49) -- (78.27,91.79) -- (76.17,91.09) -- (78.97,91.79) -- cycle;     \path[line width=0.30mm, draw=L] (27.89,89.80) -- (27.89,61.82);     \path[line width=0.30mm, draw=L, fill=F] (27.89,61.82) -- (28.59,64.62) -- (27.89,62.52) -- (27.19,64.62) -- (27.89,61.82) -- cycle;     \path[line width=0.30mm, draw=L] (30.42,57.49) -- (78.07,57.49);     \path[line width=0.30mm, draw=L, fill=F] (78.07,57.49) -- (75.27,58.19) -- (77.37,57.49) -- (75.27,56.79) -- (78.07,57.49) -- cycle;     \path[line width=0.30mm, draw=L] (81.68,89.44) -- (81.86,61.10);     \path[line width=0.30mm, draw=L, fill=F] (81.86,61.10) -- (82.54,63.91) -- (81.85,61.80) -- (81.14,63.90) -- (81.86,61.10) -- cycle;     \draw(99.01,40.52) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $P$};     \path[line width=0.30mm, draw=L] (98.65,43.95) -- (84.03,56.77);     \path[line width=0.30mm, draw=L, fill=F] (84.03,56.77) -- (85.67,54.40) -- (84.55,56.31) -- (86.59,55.45) -- (84.03,56.77) -- cycle;     \path[line width=0.30mm, draw=L] (83.66,90.52) -- (99.73,45.76);     \path[line width=0.30mm, draw=L, fill=F] (99.73,45.76) -- (99.44,48.63) -- (99.49,46.42) -- (98.12,48.16) -- (99.73,45.76) -- cycle;     \path[line width=0.30mm, draw=L] (29.69,55.69) -- (98.10,41.97);     \path[line width=0.30mm, draw=L, fill=F] (98.10,41.97) -- (95.50,43.20) -- (97.42,42.11) -- (95.22,41.83) -- (98.10,41.97) -- cycle;     \draw(52.98,87.82) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $i$};     \draw(28.79,76.08) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $j$};     \draw(51.90,59.66) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $g$};     \draw(78.43,75.54) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $f$};     \draw(92.15,70.85) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $j'$};     \draw(59.66,44.68) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $i'$};     \draw(89.44,53.70) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont \varphi };     \end{tikzpicture}%     \caption{VAN_1}      \end{center}     \end{figure} \\     It remains to show the uniqueness of \varphi. assume that {\varphi\mathop ^{~}}. Since the digram       \begin{figure}     \centering     \begin{tikzpicture}[x=1.00mm, y=1.00mm, inner xsep=0pt, inner ysep=0pt, outer xsep=0pt, outer ysep=0pt]     \path[line width=0mm] (38.16,42.32) rectangle +(51.62,49.43);     \draw(58.75,85.83) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $B$};     \draw(40.16,70.85) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $A$};     \draw(58.75,70.49) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $G$};     \draw(69.58,58.94) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $P$};     \draw(78.61,45.40) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont $B*C$};     \definecolor{L}{rgb}{0,0,0}     \path[line width=0.30mm, draw=L] (59.84,84.75) -- (59.84,75.18);     \definecolor{F}{rgb}{0,0,0}     \path[line width=0.30mm, draw=L, fill=F] (59.84,75.18) -- (60.54,77.98) -- (59.84,75.18) -- (59.14,77.98) -- (59.84,75.18) -- cycle;     \path[line width=0.30mm, draw=L] (44.13,72.11) -- (58.03,72.11);     \path[line width=0.30mm, draw=L, fill=F] (58.03,72.11) -- (55.23,72.81) -- (58.03,72.11) -- (55.23,71.41) -- (58.03,72.11) -- cycle;     \path[line width=0.30mm, draw=L] (80.96,50.45) -- (71.75,59.66);     \path[line width=0.30mm, draw=L, fill=F] (71.75,59.66) -- (73.24,57.18) -- (71.75,59.66) -- (74.23,58.17) -- (71.75,59.66) -- cycle;     \path[line width=0.30mm, draw=L] (69.22,62.91) -- (62.00,70.31);     \path[line width=0.30mm, draw=L, fill=F] (62.00,70.31) -- (63.46,67.81) -- (62.00,70.31) -- (64.46,68.79) -- (62.00,70.31) -- cycle;     \path[line width=0.30mm, draw=L] (61.46,84.93) -- (70.13,63.81);     \path[line width=0.30mm, draw=L, fill=F] (70.13,63.81) -- (69.71,66.66) -- (70.13,63.81) -- (68.42,66.13) -- (70.13,63.81) -- cycle;     \path[line width=0.30mm, draw=L] (42.33,70.31) -- (68.86,60.56);     \path[line width=0.30mm, draw=L, fill=F] (68.86,60.56) -- (66.48,62.18) -- (68.86,60.56) -- (65.99,60.87) -- (68.86,60.56) -- cycle;     \path[line width=0.30mm, draw=L] (62.55,88.18) .. controls (75.82,84.47) and (84.98,72.35) .. (84.93,58.57) .. controls (84.92,55.76) and (84.49,52.96) .. (83.66,50.27);     \path[line width=0.30mm, draw=L, fill=F] (83.66,50.27) -- (85.16,52.74) -- (83.66,50.27) -- (83.82,53.15) -- (83.66,50.27) -- cycle;     \path[line width=0.30mm, draw=L] (41.79,69.58) .. controls (47.38,57.70) and (58.57,49.43) .. (71.57,47.56) .. controls (73.72,47.25) and (75.90,47.13) .. (78.07,47.20);     \path[line width=0.30mm, draw=L, fill=F] (78.07,47.20) -- (75.25,47.81) -- (78.07,47.20) -- (75.29,46.41) -- (78.07,47.20) -- cycle;     \draw(62.18,65.07) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont \varphi\mathop ^{~}};     \draw(77.17,55.14) node[anchor=base west]{\fontsize{14.23}{17.07}\selectfont \nu };     \end{tikzpicture}%     \caption{VAN_2}     \end{figure} \\     \~{\varphi} \circ \nu =\psi      \v          arphi \circ \nu =\varphi      \nu  is subjective      Given $p\inP$ choose $\omega \in B*C$, then $\nu (\omega ) = p$,so \~{\varphi}(p)=\~{\varphi}(\nu (\omega)) =\psi (\omega )= (\varphi \circ \nu )(\omega ) =\varphi (p) \Rightarrow \~{\varphi} =\varphi          \en          d{proof} \\                    \end{document}


title: Changing only text font to Times New Roman but keep maths symbols in default font

text: In my document, I have math symbols/equations, as well as plain text, the text has to be in Times New Roman font, so I use `\usepackage{pslatex}`. However, this also changes the font of the maths symbols as well as anything encapsulated by `$$`. Is there a way to have just my text in Times New Roman font but the math symbols all in default LaTeX font? For example:               \documentclass[twoside, a4paper, 12pt]{article}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{amsmath, amssymb}     \usepackage{pslatex}     \linespread{1}     \usepackage[top=0.5cm, bottom=0.5cm, left=0.5cm, right=0.5cm, includefoot]{geometry}          \begin{document}          Following \cite{yu}, we employ maximum constant relative risk aversion utility and minimum value at risk for optimisation. The resulting two optimization models are:     \begin{gather*}     \max\left[\left(w_1\exp\left(r\Delta t\right)\right)^{1-\gamma_1}/(1-\gamma_1) + \sum_{i=2}^6 \exp\left(w_i\left(\alpha_i - 0.5 \sigma_i^2 \right)\Delta t \right)^{1-\gamma_i}/(1-\gamma_i) \right] \\     \min\left[\sum_{i=2}^6 w_i \exp\left(\left(\alpha_i - 0.5\sigma_i^2 \right)\Delta t / \sigma_i \sqrt{\Delta t} + \Phi^{-1}\left(\beta_i \right) \right) \right]     \end{gather*}     where $\gamma_i$ is the relative risk aversion coefficient for asset $i$, $w_i$ is the weighting of asset $i$, $\Delta t$ is the length of the investment period, $\beta_i$ is the confidence level of the value at risk of asset $i$, and $\Phi^{-1}$ is the standard normal inverse cumulative distribution function.          \end{document}      produces this: ![enter image description here](http://i.stack.imgur.com/UZarm.jpg) However, I would like the maths equations/symbols to appear with the following font: (Note: ignore the text font here) ![enter image description here](http://i.stack.imgur.com/ntqkX.jpg) This is only one excerpt from my document, I have many maths symbols in `align`, `gather`, `$$` environments, how can I universally change all maths symbols to default LaTeX font?


title: Python scripting for TeXworks

text: I searched on Google for almost a day and now I give up. I can't find any reference or manual for writing `TeXworks` scripts in `python`... Does anyone know how I can find these? If no, what are the basis for writing `TeXworks` scripts? Maybe it is sufficient to get a collections of scripts written by other people and then learn from there..


title: Inserting document compiled from LaTex code inside a .tex file

text: Is there a way to insert a document within a document? The inserted code is fully .tex compliant and could be compiled as a document on its own. I envision an article document, where inside the document, I show multiple beamer documents. The purpose of this is to demonstrate various beamer features and how they affect the final beamer presentation. I would guess the code would look something like this,               \documentclass[article]     \usepackage{latexinsert} % hypothetical package          \begin{document}          \begin[frame = single]{insert_environment} % hypothetical environment name     %frame around the inserted document compiled from LaTeX code     \documentclass[article]     \usepackage{amsmath}          \begin{document}     Hello, world!     \begin{align*}     a^2 + b^2 = c^2     \end{align*}     \end{document}          \end{insert_environment}          \end{document}      Thanks for your assistance.


title: \usepackage{tikz} not working

text: I'm using MikTex and am trying to import the TikZ package to draw some graphics in LaTeX. When the pdf builds however it doesn't recognise the package TikZ and fails. Every other package I am using works fine. Any ideas what I might be doing wrong? This could just be a dumb question like I haven't downloaded ... which you need to run it but in the online manual there doesn't seem to be any system requirements etc.


title: Detect if a character is Chinese character

text: (XeLaTeX + XeCJK) I am trying to translate an English document. I need to convert all '.' to '。' if the antecedent character is a Chinese character. I am using xstring to accomplish this object but I have no idea of detecting whether a character is Chinese one or not. How to solve it?


title: Margin note left of mdframed images in a two column page

text: Is it possible to have a margin note to the left of the left column on the second page with this code and approximately halfway down the page? I cannot get it to show up using `\marginpar` or the `marginnote` package. I want the rest of the document to look approximately the same. I am using the `multicol` package because I don't want the entire document to be two columns just the second page.               \documentclass{article}     \usepackage{graphicx}     \usepackage{fancyhdr}     \usepackage{geometry}     \usepackage{multicol}     \usepackage{xcolor}     \usepackage{mdframed}     \usepackage{xspace}     \usepackage{marginnote}     \usepackage{lipsum}          \renewcommand{\footrulewidth}{0.4pt}          \geometry{headheight = 0.7in}     \pagestyle{fancy}{\fancyhf{}\fancyhead[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}\fancyfoot[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}}          \fancyhead[C]{\Huge{Lorem Ipsum} \\ \Large{Dolor sit amet}}     \fancyfoot[C]{loremipsum.com \\     \vspace{.1in}     loremipsum@gmail.com \\     \vspace{.1in}     555-555-5555}          \begin{document}          \lipsum[1]          \newpage          \begin{multicols}{2}     \begin{mdframed}[linecolor=black!30,backgroundcolor=black!5]     \begin{center}          \includegraphics[height=1.75in, keepaspectratio=true]{placeholder}          \vspace{.1in}          \includegraphics[height=1.75in, keepaspectratio=true]{placeholder}          \vspace{.1in}          \includegraphics[height=1.75in, keepaspectratio=true]{placeholder}          \vspace{.1in}          \includegraphics[height=1.75in, keepaspectratio=true]{placeholder}          \end{center}     \end{mdframed}          \columnbreak          \lipsum[1]          \end{multicols}     \end{document}


title: Command \nobreakspace unavailable in encoding EU1 if i use xelatex

text: This is my preamble:               \documentclass[11pt, a4paper]{scrartcl}     \usepackage{iftex}     \ifXeTeX       \usepackage{xunicode} %Если не ошибаюсь, то этот пакет уже загружает fontspec       \usepackage{xltxtra}  %особой роли не должен вроде как играть и в будущем скорее всего не будет нужен       \usepackage{polyglossia}            \setdefaultlanguage{polish}       \setmainfont{Liberation Serif}     \else       \usepackage[utf8]{inputenc}       \usepackage[MeX,T1, plmath]{polski}       \usepackage{datetime}     \fi     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{graphicx}     \usepackage[super]{cite}     \usepackage[hyperfootnotes=false]{hyperref}     \usepackage{siunitx}    %Для использоваия едениц измерений СИ, пример смотреть в тексте     \sisetup{     output-decimal-marker = {,},    %sisetup нужен, что бы вместо точки можно было использовать запятую.     per-mode = symbol   %Это что бы \per давала косую черту     }   %Для перечисления настроек обязательно нужна запятая между ними          % \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }      With this preamble i get > Command \nobreakspace unavailable in encoding EU1 If i uncomment \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ } i get > Undefined control sequence


title: Compiling latex directly from R

text: I want to find a programmatic way of converting a `.tex` latex document to pdf. What I usually do, and this works in most cases, is to use:               tools::texi2dvi(latexfile, pdf = TRUE, clean = TRUE)      However, I now need to work with documents that contain Asian fonts (Chinese, Japanese and Korean). Searching on tex.stackexchange.com leads to advice to incude the following lines in the tex file:               \usepackage{xeCJK}     \setCJKmainfont{MS Mincho} % for \rmfamily      This means I need to use `xelatex` to build the pdf. I have tried variations on the following theme, none of which work.               shell(cmd="xelatex latexfile", mustWork=TRUE, translate=TRUE)      **Question:** How can I call `xelatex` programmatically? **Additional information:**   * I am on Windows 7, R2.13-1   * `xelatex` is installed on my machine and works fine if I call it any other way (including via the command line)   * I am using StatET in Eclipse


title: PGFPlots how to add a label "0" to the origin

text: I am using pgfplots to plot the a function. I have been looking around on the forums, but I could not find a solution. I would like to origin to be indicated as a 0 on the x axis. I would also like to get the axis labels to appear respectively left and below the axis. Any ideas? I have the following plot:               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}       \begin{axis}[width=7cm, height=2cm,xmin=-6,xmax=6,ymin=0,ymax=1,     no markers,     samples=50,     axis lines=left,      axis lines=middle,      scale only axis,     % extra y ticks={0.5},     /pgfplots/ytick={0, 0.5,1}, % make steps of length 0.5     /pgfplots/xtick={-5,0,5}, % make steps of length 5         xlabel=$Li$,         ylabel={$f_{comp}(Li))$}       ]          \addplot {1/(1+exp(-x)};        \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7Xsrz.png)


title: I'd like to include Markdown in a LaTeX file

text: I have a LaTeX file, `foo.tex` and a bunch of markdown files `{1..N}.markdown` in the same directory. Basically, I'd like to be able to `\include{1.markdown}` and have _the markdown rendered to LaTeX_ and included in `foo.tex`. How can I do this? The closest I can come up with is pandoc which lets me define a template and variables at the command line. This can obviously work, but is cumbersome and annoying. Is there any better solution?


title: Placing two figures (each having subfigures) next two each other

text: I would like to place two figures, where each `figure` has subfigures next to each other. I tried with `minipage`, but tex does not like the `\subfigure` as `Not in outer par mode`. Is there any way to place figures with subfigures next to each other?               \begin{figure*}[htbp]               \begin{minipage}[hbt]{0,49\textwidth}          \begin{figure}     \subfigure[Subfigure 1.1]{     \label{fig:subfig1_1}     \includegraphics[scale=0.42]{graphs/sub_1_1.pdf}     }          \subfigure[Sub 1.2] {     \label{fig:subfig1_2}     \includegraphics[scale=0.42]{graphs/sub_1_2.pdf}     }     }     \label{fig:subfigure1}      \caption{Subfigure 1}     \end{figure}     \end{minipage}                         \begin{minipage}[hbt]{0,49\textwidth}     %... as above     \end{minipage}     \end{figure*}


title: Is there a pure LaTeX or TeX package for chart drawing?

text: We are creating an easy-to-use LaTeX template for our institution. I'd like to have a pure LaTeX way to create simple bar graphs and pie charts. Does anything exist? I can certainly throw the students at matplotlib or gnuplot, but it would be nice to have something simpler.


title: Problem With Spacing and Quotation

text: > **Possible Duplicate:**   >  How to modify spacing around quotation environment? I am using `\begin{quote} text \end{quote}` to provide quotation in a `.tex` document. However, once the document is compiled the space between the quoted text and the regular text is way too wide. Is there a way to control for this, or make the spacing less wide?


title: convention for marking LaTeX in programming comments?

text: Is there a convention for marking the beginning of LaTeX-based material placed inside the comments of (say) a C++ or Python program? Or does one simply jump into LaTeX syntax?


title: bodegraph on Ubuntu 10.04

text: I have been trying to get the tex package bodegraph working on my Ubuntu 10.04 machine. First off since Ubuntu ships with Texlive 2009 I had to uninstall the default version and manually install Texlive 2011. I was then able to get `bodegraph` to output semilog grid lines, labels, and the like. The problem is when I try to actually plot a transfer function, and `bodegraph` has to use `gnuplot`. I get an error saying:               ! I can't write on file `gnuplot/test/1.gnuplot'.      `test.tex` is the name of my input file and I am using `pdflatex`. I have a suspicion that this has something to do with `pdflatex` not having the permissions to run `gnuplot` or to write temp files where it wants to, but I have no clue where to start digging in. Does anyone have any experience with `bodegraph` on Ubuntu, or have seen this problem before **EDIT** \- Include MWE               \documentclass[10pt]{article}          \usepackage{tikz}     \usepackage{bodegraph}          \usetikzlibrary{intersections}     \usetikzlibrary{calc}     \usetikzlibrary{positioning}          \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}          \begin{document}          \begin{tikzpicture}[>=latex',         ref lines/.style={thin,blue!60},         ref points/.style={circle, black, opacity=0.7, fill, minimum size= 3pt, inner sep=0},         every node/.style={font=small},         bode lines/.style={very thick, blue},         Gclabel/.style={text=blue},         xscale=12/3]          \begin{scope}[yscale=4/110]     \UnitedB     \semilog{-1}{2}{-50}{60}          % Breaks When The Following Line Is Added     \BodeAmp[ref lines, red!60]{-1:1.35}{POAmpAsymp{4}{2.0}+IntAmp{1}}          \end{scope}          \end{tikzpicture}     \end{document}


title: how to align the following in a table?

text: I am trying to have the cell on the left be aligned with the three cells on the right, so that they all start at the same height:               \begin{tabular}{lp{2.5in}}     \multirow{3}{*}{\raisebox{-.1\height}{\includegraphics[width=3.5in]{plot.pdf}}} &           child:      lots of text here     &     parent:           lots of text here          $\,$     &      grandparent     lots of text here          \end{tabular}      right now, the cell on the right is much higher than the cell on the left. I tried raisebox, as can be seen in the code, but it doesn't raise the image. I tried both -.1 and .1, I tried various numbers - the raisebox does not have any effect. I think it is related to the fact I am using multirow. Is there a way to vertically align the image and the cells on the right? I will also mention that the cells on the right do not overflow at the bottom, there is definitely space where you could fit it and "lower" them.


title: Chapterbib is working but keeps giving me errors. Any way to silence it?

text: I'm using Chapterbib to write my bibliography separately after each chapter. It does work but bibtex is still giving me plenty of errors and warnings:               Illegal, another \bibstyle command     I'm skipping whatever remains of this command.          Illegal, another \bibdata command     I'm skipping whatever remains of this command.          Warning--I didn't find a database entry for "druhy".      etc. Basically I'm getting 2 error messages per file and 1 warning message per citation. Since the final publication will be quite large, I'd rather not have tens of errors and hundreds of warnings when I compile it all together. Is there any way around it? I'd be happy with just silencing these particular error and warning messages. I did follow the instructions for the build order (latex, bibtex on individual files, latex, latex). Minimal working example: **Test.tex**               \documentclass{article}     \usepackage{chapterbib}     \begin{document}     \include{chapter1}     \include{chapter2}     \end{document}      **Chapter1.tex**               blabla \cite{prvni}     \bibliographystyle{plain}     \bibliography{jedna}      **Chapter2.tex**               bleble \cite{druhy}     \bibliographystyle{plain}     \bibliography{dva}      **jedna.bib**               @article{prvni,     author = "A. Aa",     title = "blahblah",     year = "2000",     journal = "tojefuk"     }      **dva.bib**               @article{druhy,     author = "B. Bb",     title = "blehbleh",     year = "2001",     journal = "tojejedno"     }


title: How can I get the ordinary polynomial long division by using polydiv like this?

text: I want to get the following polynomial long division like this: ![Polynomial Long Division](http://i.stack.imgur.com/Fto0L.png) But as you know, when I use command `\polylongdiv` (package `polynom`), I always get the following: ![polydiv result](http://i.stack.imgur.com/YgNyH.png) How can I get the result as in the first picture? At present, I have no idea to do so. Here is my tex file:               \documentclass{article}          \usepackage{polynom}          \begin{document}          $$\polylongdiv{x^3-12x^2-42}{x-3}$$          \end{document}


title: small integral delimiter

text: while reading a book on maths lately, I have seen a small integral delimiter such that, in what follows:               \begin{equation}     \sum_i^j A_{ij}\int\limits_{-\infty}^{+\infty} \cos x dx      \end{equation}      the sum and integral would be of the same height. Are you aware of something like that? Thank you


title: Is there a way to make a "non-selectable" space in LaTeX?

text: Is there a way to create a horizontal space in LaTeX that is visible to the reader but invisible to the computer when selecting and copying text (using PDFLaTeX)? An example of the problem: When I read a PDF that has a bank account number in it and I want to manually type/write it into a banking form, it helps a lot to have regular spacing in the number, e.g. "Bank Account no. 123 456 789". However, when I use online banking, the form field does not expect spaces in the number and additionally has a limited length. So when I copy&paste the number from the PDF, all I get in the form field is "123 456 7", because it's limited to 9 characters and it copied the spaces. So the question is: Can I get LaTeX to show spaces that help readability but that are not selected/copied when copying the text? I still want to read "123 456 789", but when I select and copy that text, I want "123456789" in my clipboard. I searched for spacing-related topics and tutorials, but only found the usual commands (such as \hspace or \hskip). Using tables or arrays does not help either, there's always a selectable space or even a newline. Thanks a lot in advance for any help!


title: How can I create a full-size circumflex in typewriter font?

text: I have some C source code and would like to show the circumflex or caret (`^`) in the way it is typically shown in source code -- as a full-size character. The source code will be appearing in typewriter font, and I'd like for the character to have the same (i.e. fixed) width as all the other characters. Things that I tried (all inside `\texttt{}`) that don't work satisfactorily:   * `\textasciicircum` produces a small, high circumflex   * \char`\^ same   * `\verb|^|` same   * `\wedge` in math mode produces a symbol that is too big and too wide, upsetting alignment of subsequent columns I'm also interested in showing a full-size tilde (`~`), though I see that has already been beaten to death here. I really hope the same hijinks won't be needed for the circumflex, but it would be good to know for sure either way!


title: whitespace/brace/indentation conventions for LaTeX programming

text: This question is not about formatting the text/markup of a document. I'm really focused on the programming aspect of LaTeX. I'm working on a fairly large set of document classes and packages, and I'm wondering what's conventional for bracing and indentation. Looking at the `latex.ltx` file, I see some groups which have their closing braces as the end of the last line, e.g.,:               \def\vgl@{\par \dimen@\prevdepth \hrule \@height\z@       \nobreak\vskip\skip@ \prevdepth\dimen@}      Other times the closing brace is in the next line, as in               \def\ltx@sh@ft #1{%       \dimen@ #1%       \kern \strip@pt         \fontdimen1\font \dimen@       } % kern by #1 times the current slant      I suppose the latter style could be called K&R. I don't know if the former has enough adherents in the C world to have a name. As of this morning I'm considering K&R style braces with indents of four spaces. `latex.ltx` and other sources I've read use two, but four seems a bit more readable. Extra newlines means one has to be careful about extra spaces and `\par`s being added, but for purposes of readability I like the space. I'm interested to hear what other conventions LaTeX programmers have used and come to like.


title: Making tables more prominent

text: I am working on a long LaTeX document with several tables, which contain mainly text, or text and numbers. The tables are a `\begin{table} ... \begin{tabular}` environment. It is often difficult to see where the tables start and end on a page -- they are "mixing" in with the text too much and are disappearing, so it is difficult to easily locate "Table 1.1" and to navigate the document. I found this solution to colour the entire table, but this only coloured the table itself, not the caption or footnotes under the table. I moved the `\colorbox` before the `\begin{table}` but this gave an error. I tried inserting a `\hline` before the `\end{table}` but this also did not work. How can I make the tables more prominent, without, obviously, making them garish? I thought a light shading under the entire table (caption, footnotes, etc.), or a bold line above and/or below the table?


title: Automatically placing citations in the correct places

text: Is there any package which intelligently handles the placement of citation information relative to the citation style guide chosen? Here is a sample paragraph: > The report says the stream will overflow if there are too many fish (White > 2). It outlines plans to build a canal to control the water (White 15). > These plans describe for flood gates near the lake (White 16) and a > computer-controlled system (White 20).   * If multiple page numbers to 1 particular text appear within different sentences in 1 paragraph, the page number information is collected together and displayed at the end of the paragraph: > The report says the river will overflow if there are too many fish. It > outlines plans to build a canal to control the water. These plans describe > for flood gates near the lake and a computer-controlled system. (White 2, > 15-6, 20)   * If the next paragraph begins with a sentence containing a citation from the same author, ibid. is used: > The report also outlines plans to collect the fish for the zoo (ibid. 30). > Brown however, offers other suggestions (3).   * If the author's name is used within the text (as above), then it is removed from the page number at the end of the sentence or paragraph (or as appropriate to the citation formation selected).


title: If fractions are Inner atoms, why don't they have thin spaces on either side?

text: The _TeXbook_ says that fractions are Inner atoms. But if so, they don't seem to have thin spaces on either side when Inner atoms have them. For instance, in               \documentclass{article}          \usepackage{amsmath}          \begin{document}     \[     a\frac{b}{c}d     \qquad      a{\frac{b}{c}}d     \qquad      a\mathinner{\frac{b}{c}}d     \]     \end{document}      I see more space around the third fraction (which I've explictly made an Inner atom) than around the first fraction, and I see the same amount of space around the second fraction (which I've explicitly made an Ord atom) and around the first fraction. What's going on? If I used ordinary LaTeX 2e without `amsmath` or any other packages, or if I did this in plain TeX with `{b\over c}`, would I get a different result?


title: changebars for a long document

text: What are the additional ways to add changebars, not using the package changebar? _second attempt below_ : How do I add change bars? The package `changebar` appears broken, and it is difficult to construct an MWE to illustrate. Are there any other good ways to add changebars? _original question below_ : I have been struggling with `\usepackage{changebar}` for about four hours now, and it appears to be woefully broken. For example: if I add one more `\section{foo}` to my document, the change bar (in my first paragraph in the introduction) disappears.


title: Using "= in preamble with babel

text: I have noticed a strange behaviour when switching between the packages `german` and `babel` with the `german` option. There is obviously a difference in how `"=` is handled in the preamble:               \documentclass{article}     \usepackage{german}     \title{Some"=Thing}     \begin{document}     \maketitle      Some"=Text.     \end{document}      yields the following result: ![](http://i.stack.imgur.com/8DIY5.png) while the following code               \documentclass{article}     \usepackage[german]{babel}     \title{Some"=Thing}     \begin{document}     \maketitle      Some"=Text.     \end{document}      does not handle the `"=` in the `\title{}` command correctly: ![](http://i.stack.imgur.com/AK8Qc.png) What is the reason for this behaviour? How can I make the `babel` package behave like the `german` package? (I have to switch from `german` to `babel` because some packages like `fancyref` use the wrong translations if only `german` is used.)


title: Using "German" quotation marks inside \newcommand

text: > **Possible Duplicate:**   >  babel shorthand "| doesn’t work in macros I know there is a deeper non-understanding of LaTeX mechanics at work here, but I have no idea how to phrase my question to cover the general case, sorry.               \documentclass{scrbook}     \usepackage[ngerman]{babel}          % Trivial case, the "real" macro is a *bit* more involved     \newcommand{\mymacro}[1]{"`#1"'}          \begin{document}          "`Foo"'     \mymacro{Bar}          \end{document}      "Foo" gets typeset as expected, with the correct "German" quotation marks. But "Bar" gets typeset verbatim:               "`Bar"'      Apparently, the quotation marks "transformation" doesn't work inside `\newcommand`. Since I never really understood what the more "magic" LaTeX commands (like `\relax`, `\detokenize` or `\makeatletter`) really were about, or how the underlying TeX really works, I'm stuck and cannot figure out **what I need to make the quotation marks inside the macro work properly**...


title: How to define a new command for guillemets marks

text: > **Possible Duplicate:**   >  babel shorthand "| doesn’t work in macros I would like to define a new command for guillemets marks. I know how to obtain them in LaTeX and those I would like to use are produced by this code:               "<lorem ipsum dolor sit amet">      with `italian` option for the `babel` package (my complete code will follow below). I tried to define my new command as               \newcommand{\guille}[1]{"<#1">}      but it doesn't work and it simply produces the same as               \textquotedbl\textless ... \textquotedbl\textgreater      Now, if I define               \newcommand{\newtextemdash}{---}      LaTeX correctly replaces `---` with an em-dash. Why this replacement does not occur with `"<` and `">`? Finally, where can I find the rule such that `---` must be replaced by `\textemdash`? And the one for `"<` and for `">`?               \documentclass{minimal}     \usepackage[italian]{babel} % this activates "<...">     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \newcommand{\guille}[1]{"<#1">} % this does not work     \newcommand{\newtextemdash}{---} % this works     \begin{document}     Lorem ipsum dolor \newtextemdash{} sit amet \newtextemdash{} consectetuer adipiscing elit.     \guille{Lorem ipsum dolor si amet}     I would like to have this: "<Lorem ipsum dolor sit amet">     \end{document}      ![output](http://i.imgur.com/yt9ope4.png)


title: Creating Table of Contents / Section Headings

text: I found this article and would like to know how can one create a template (generic) to accomplish this. It would be great to implement a (generic) template to be able to make it for a table of contents, list of figures, list of tables, list of listings (code), etc... I would like the table of contents, table of figures, etc.. to all start on a fresh page instead of running on from the previous section. I will post a external like because you will able to get a better idea of what I am asking. I could post a picture, but the functionality would be taken away, i.e., being able to click the link and it takes you to the appropriate part of the document. I would like to know how is this done for contents,figures, sections, references, footnotes, etc. Also, if one can include how to play around with the color of the wording for the contents would be great. Can I also add, (I know its already a lot, but I think this is the last thing) I would like to be able to move the contents, list of figures, list of tables to the center of the page and I would like if I could have control of what to name them, i.e., Table of Contents instead of Contents produced from `\tableofcontents,\listofigures,\listoftables`. Okay I will stop here, its already a lot to digest I think.   * microtype   * TOC and Headings (This is the document that has the centered and underlined section titles that I would like to accomplish).


title: tikz: plot stepped gauss

text: I need to plot a stepped gauss curve as shown below. Yet I want to do this dynamically (in text) so I can alter it later. ![http://media.texample.net/tikz/examples/PDF/gnuplot-tikz- terminal.pdf](http://i.stack.imgur.com/QT0MG.png) I know how to plot a smooth gauss but I really need the stepped one. Also a bar (option `ybar`) won't do because I only need the contour of the bar plot (no bars, just one curve). I've tried:               \draw[black,thick] plot[id=gg,raw gnuplot] function{         set xrange [0:7.5];         set samples 30;         normal(x,mu,sigma)=sigma<=0?1/0:invsqrt2pi/sigma*exp(-0.5*((x-mu)/sigma)**2);         invsqrt2pi = 0.398942280401433;         plot 3.5*normal(x,1.5,0.5) with histeps;     };      yet the `histeps` option from gnu plot doesn't kick in... (this script does work when in gnuplot).


title: Line numbering the whole mainmatter in memoir

text: Ok, now I am panicking, since `lineo` cannot be used with `memoir` (using `\RequirePackage{lineno}`).   The specifications for the paper I am writing are _numbering the`mainmatter`, footnotes included_ for reviewing purpose.   Well, I am struggling to find out how this can be possibly done.


title: Set up a system to alternate between genders per paragraph

text: In RPG writing it has become traditional to swap _he_ and _she_ on a per paragraph basis. Something like "He can use the smite evil ability one a day at first level. (Blah blah blah, paragraph break) when the paladin gets to 4th level she can use the ability three times a day." Now, this isn't that hard to write, but often paragraphs get moved around and such. Is there a way I could type `\hir` and `\sie` into my text, then have LaTeX figure out what order the paragraphs are in, and swap them into _he_ , _she_ , _him_ , _her_ , alternating male and female each paragraph?


title: Problem with sizing side-by-side minipages

text: I've been writing up my resume in LaTeX (for the flashiness and also to get better with LaTeX), and I've been having some trouble with one of the macros I wrote, called `\nrccolstring`. `\nrccolstring` is supposed to take two text fields and make them into side- by-side miniboxes that span all of the space allocated for them. The first minibox is left-justified, and the second minibox is right-justified. My macro works great when it's on the whole page, but it craps out on me when I nest it inside another minibox (such as the one I'm currently using to control columns). When I run the attached code, I get the following output: ![enter image description here](http://i.stack.imgur.com/crJpr.png) So what's up? Why does it fail on the second macro? I get a couple of warnings (shown below), but the document compiles fine.                 Overfull \hbox (2.22221pt too wide) in paragraph at lines 33--34<br>       Underfull \hbox (badness 10000) in paragraph at lines 33--34      What's going on here? There's clearly something I don't understand about how the sizing of a minipage works. Should I be using something other than miniboxes to achieve the effect? I thought about using columns or a table originally, but I wanted something that would automatically size the cells to take the entire `\textwidth` and also make sure that the cells are wide enough (assuming the overall `\textwidth` is big enough to fit everything). Thoughts?               \documentclass{article}     \usepackage[top=0.5in, bottom=0.5in, left=0.5in, right=0.5in]{geometry}          \usepackage{calc}     \usepackage{blindtext}          %----------------------- Registers-----------------------------%     \newlength{\registera}     \newlength{\registerb}     %-------------------- Text Field Macros-------------------------%     \newcommand{\CompanyName}{This is a Fictional Company Name}     \newcommand{\Description}{\blindtext}          %-------------------- Formatting Macros------------------------%          \newcommand{\nrccolstring}[2]{         \begingroup         \setlength{\registera}{\widthof{\noindent \raggedright #1}}%         \setlength{\registerb}{\dimexpr \textwidth - \registera \relax}%         \noindent \begin{minipage}[t]{\registera}             \noindent \raggedright #1\\          \end{minipage}         \noindent \begin{minipage}[t]{\registerb}             \noindent \raggedleft #2\\         \end{minipage}     \endgroup}          %------------------------ Body Text ---------------------------%          \begin{document}         \blindtext         \par \bigskip         \par\nrccolstring{\textbf{\CompanyName}}{2011-Present} % Macro works here!         \par         \Description         \par \bigskip              \noindent \begin{minipage}[t]{0.5\textwidth}             \par\nrccolstring{\textbf{\CompanyName}}{2011-Present}  % Macro doesn't work here!             \par             \Description         \end{minipage}         \noindent \begin{minipage}[t]{0.5\textwidth}             \Description         \end{minipage}     \end{document}


title: Breaking lines in equations

text: I had an equation that was too long. It got cut off, so I modified it with the `split` environment inside an `equation` environment:               \begin{equation}     \begin{split}     & I_{ribbon} = \frac{1}{2} M(a^2 +b^2) \\ &= \frac{1 }{2}\times3.8\times0.001kg\times\Big(\frac{12.49\times0.001m}{2} + \frac{20.79\times0.001m}{2}\Big)^2 = 2.794\times10^{-7} kg\cdot m^2     \end{split}     \end{equation}      The only issue now is that the equation number is on the line between the two lines of the equation, i.e. vertically centered across the two lines, rather that on the last line where I think it should be. How can I fix this?


title: Place label in middle of line with TikZ

text: What is the best way to place a label in the middle of a line with TikZ? I mean smack dab in the middle of the line, not above or below it. The following is close               \begin{tikzpicture}     \draw[|->, color=red] (-4cm, 0.5cm) -- (2.5cm, 0.5cm) node[midway, color=black] {$\tau_{r}$};     \end{tikzpicture}      But the line crosses right through the node and its text, which is bad. I don't know if there is an option to choose the background color of a node, which I think would solve the problem (e.g. `background=white`). `fill` doesn't seem to work.


title: What is the difference between the hyphen-like characters #45 and #127 from the T1 encoding?

text: What is the difference between the symbols with decimal indices #45 and #127 from the T1 encoding? Character #45 seems to be the ordinary hyphen, but what about #127? The en-dash and em-dash are at positions #21 and #22, respectively. This excellent answer to my question about which ligatures are contained in a font drew my attention to this matter. According to it, TeX will build a "ligature" that looks like a hyphen (presumably either #45 or #127) out of the character sequence #45-#127. (Why does it do that?)


title: How to specify height and width of \fbox{}

text: I am trying to have my text read like this inside a box:                       If A and B are two events that are not mutually exclusive then:                              $P(A \cup B) = P(A) + P(B) - P(A \cap B)$      Al I have is this, can someone help guide me of hidden commands that I don't know about?               \fbox{If A and B are two events that are not mutually exclusive then $P(A \cup B) = P(A) + P(B) - P(A \cap B)$}