title: Understanding token expansion

text: First of all, note that this question is to be regarded as a learning question as I am not looking for a package (I know very well the `xparse` package). I am attempting to write a macro which has the following usage:               \dsee*{text}[optarg]      My code is thus the following:               \def\md@err{*}     \def\@hmno[#1]{%       \textsubscript{#1}}     \newcommand{\dsee}{\@ifstar\@@dsee\@dsee}     \def\@@dsee#1{%       \md@err#1\@ifnextchar[\@hmno\relax}     \def\@dsee#1{%       #1\@ifnextchar[\@hmno\relax}      So far it works as intended: `\dsee{test1}, \dsee{test2}[opt]` becomes ![First test](http://i.stack.imgur.com/fJZC7.png) I then add some formatting to the macros.               \def\md@styl@foreign{%        \color[HTML]{0000AA}%        \rmfamily\mdseries\itshape}     % The new defs for \@@dsee and \@dsee     \def\@@dsee#1{%        \begingroup%          \md@styl@foreign\md@err#1\@ifnextchar[\@hmno\relax%]        \endgroup}     \def\@dsee#1{%        \begingroup%          \md@styl@foreign#1\@ifnextchar[\@hmno\relax%]        \endgroup}      Then my output ends as: ![Second test](http://i.stack.imgur.com/WM0M0.png). As I understand it, `\@ifnextchar` macro checks whether the following token is equivalent to its first argument, in my case `[`. However, since changing the definition of the macros, `\@ifnextchar` does not match with `[` as, apparently, it is no longer the next token. I suspect that I need some `\expandafter` before my `\endgroup`. My question is thus: Is there a way to determine which token is next in the stream, or is there a way to determine where expansion has to be delayed? Maybe using the `\tracing...` options? Any pointers would be greatly appreciated.


title: Regularized Product Symbol

text: How so I make a regularized product symbol like in Deninger's papers. It looks like a II, only large like `$\prod$` only with a bottom on it too, as in the following paper abstract: ![enter image description here](http://i.stack.imgur.com/1eJLb.png)


title: How to arrange/aligned the choices in MCQ type question?

text: This is my second time that I am asking your help. Last time I post one of my query regarding the nesting of files and sub files when I was preparing my book on a MCQ type for mathematics. And I got very much excellent helpful information from the experts around here. The problem was completely solved and the work is going smoothly. Now I have come across a new situation. I need your valuable suggestion/advice. Please help me. Let me first give a short description about my situation. As stated before, I am writing a book (MCQ type ) on mathematics where in the exercises, I am providing the problems and their solutions are being provided in some other files, and finally I am using `\input` command to join them in master file. The problem is not that. It is some thing else. When I am writing some problems, say for example               \begin{questions}     \question     Find out the value of $\sum\limits_{d|12} \phi(d)$.     \correctchoice 12     \choice 100 \\     \choice 8     \choice Cannot be determined     \end{questions}      then in the output, I come to see that the options are not properly arranged. I am unable to show it here because I really don't have much experience how to show or write commands in tex.stackexchange but I can tell you what I am willing for: The out put of the choices is coming like this:               A. 12      B. 100     C. 8    D. Cannot be determined      whereas what I require to see is the following:               A.12   B. 100     C.8    D. Cannot be determined      As you can see, in the second one, the options are well maintained and arranged in appropriate column format. I need such command so that the first situation is converted to the second one as I have shown. I tried in website like latexwiki, other manual books etc but in vain. No where I have found any simple and elegant approach. Please help me. All the problems in my book are having this type of disarranged manner whereas I want them in the above manner( in the second manner as I stated above). Please provide me some simple approach because I am neither a beginner nor an expert so that I will be understand your suggestion/ commands. In case if my query is duplicate and has been discussed earlier, please provide me the link where it has been already discussed before. Even that would be enough for me A lot of thanks to all of you in advance. P.s. I could not find a specific tag for my query. I apologize. Edit:1               \documentclass[10pt]{book}       \usepackage{amsmath,amsfonts,amssymb}                 %--------------------------------------------------------------------       \newcounter{question}       \newif\ifinchoices       \inchoicesfalse       \newenvironment{questions}{%         \list{\thequestion.}%         {%           \usecounter{question}%           \def\question{\inchoicesfalse\item}%           \settowidth{\leftmargin}{10.\hskip\labelsep}%           \labelwidth\leftmargin\advance\labelwidth-\labelsep         }%       }       {%         \endlist       }%            \newcounter{choice}       \renewcommand\thechoice{\Alph{choice}}       \newcommand\choicelabel{\thechoice.}       \def\choice{%         \ifinchoices           % Do nothing         \else           \startchoices         \fi         \refstepcounter{choice}%         \ifnum\value{choice}>1\relax         \penalty -50\hskip 1em plus 1em\relax         \fi         \choicelabel         \nobreak\enskip       }% choice       \def\CorrectChoice{%         \choice         \addanswer{\thequestion}{\thechoice}%       }       \let\correctchoice\CorrectChoice            \newcommand{\startchoices}{%         \inchoicestrue         \setcounter{choice}{0}%        \par % Uncomment this to have choices always start a new line         % If we're continuing the paragraph containing the question,         % then leave a bit of space before the first choice:         \ifvmode\else\enskip\fi       }%            \newbox\allanswers       \setbox\allanswers=\hbox{}       \newcommand{\addanswer}[2]{%         \global\setbox\allanswers=\hbox{\unhbox\allanswers #1.~#2\quad}%       }       \newcommand{\showanswers}{%         \vfill         \begin{center}           Answers         \end{center}         \noindent\unhbox\allanswers       }            \makeindex            %--------------------------------------------------------------------       \begin{document}       \begin{questions}       \question       Evaluate $\sum\limits_{i=1}^{10} \frac{i(i+1)}{2}$       \choice It is 55       \choice It is 45       \choice It is 35       \choice It is 25       % I want to put all these choices in proper alignment if it is        % necessary to put them in two lines            Evaluate $\sum\limits_{i=1}^{10} \frac{i(i+1)}{2}$         \choice It is 55         \choice It is 45         \choice It is 35         \choice It is 25         % But in case they are in single line or in 4 lines, no alignment is required as that part       % is trivial for me. The only concern is to maintain the alignment in two lines situation                 \end{questions}       \end{document}         I have provided my actual command latex file (unable to indent the codes). Any help on this regard please?


title: Abbreviating text within a reference

text: IEEE conferences want references which abbreviate certain words, like:   * International -> Int.   * Conference -> Conf.   * etc... I realize that `IEEEabrv.bib` provides similar functionality, but that requires changing the booktitle/journal entry in the bibtex file, something Mendeley (my reference manager) cannot do. Is there a way to do string replacement in a bibliography through bibtex? I could write a script which has the same effect, but I would rather specify things internally (so they can be changed for different publications).


title: Problem with beamer xcolor and cellcolor

text: I'm having trouble changing the cellcolor in beamer. I've loaded `xcolor` alongside `beamer`, and specified the `svgnames` and `table` options;               \documentclass[xcolor=svgnames,smaller,12pt,table]{beamer}      Here's how I try to change the cellcolor in beamer;               \begin{table}[H]     \centering     \caption{Summary of the differences between open and cloed word classes}          \rowcolors{2}{white}{pink!30}     \begin{tabular}{>{\centering\arraybackslash}p{5cm}>{\centering\arraybackslash}p{5cm}}     Open-class & Closed-class\\      \hline     \cellcolor[yellow]{0.5}Admit new members & Do not admit new members \\      Are numerous & Are few \\      Express "content" & Do not express "content" \\      Carry stress & Rarely carry stress \\      Can be long, e.g. \textit{antidisestablishmentarianism} & Tend to be short, e.g. \textit{the, on} \\     \hline     \end{tabular}      \end{table}      I get the error message `undefined color model`. I checked whether `yellow` is an SVG color and it is. I also defined a color model called `yellow`, and this didn't work either.


title: Multiple documents from a single dtx

text: The DTX format allows to generate both the package code (`.sty` file) and documentation (`.pdf` file) from a single dtx file. Is it possible to generate several PDFs (for example for different languages) from a single dtx file?


title: Is the package ucharclasses  not included in TeX Live?

text: I have completed the net install of TeX Live 2011 on Linux. I am trying to install the `ucharclasses` package through tlmgr but it seems that the package is missing. I am using this mirror. According to this report it is synced. Just to be sure, I tried with other mirrors too, but to no avail. I checked the files at the server at path `ctan/systems/texlive/tlnet/` and the file is indeed missing. Am I doing something wrong, or the package is just not included in the distribution? ps. I can always install it manually (eg get it from `ctan/macros/xetex/latex/`) but i'd really prefer to be able to do it through the manager (auto updates etc).


title: Frequently loaded packages: Differences between pdfLaTeX and LuaLaTeX

text: I'm in the process of switching my LaTeX document from `pdflatex` to `lualatex`. Similar to Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX I would like to know, what are typical packages loaded with LuaLaTeX and which typical pdfLaTeX packages should be removed or replaced? The following are the main difference I found so far:   * Don't use `inputenc`, but instead save your plain files in utf-8 and add the following as the first line: `% !Mode:: "TeX:UTF-8"`.   * Don't use font-packages but instead load `fontspec` with `\setmainfont{FONT_NAME}`, `\setsansfont{FONT_NAME}`, `\setmonofont{FONT_NAME}`.   * In order to make `microtype` work with `fontspec`, use the beta version of `microtype` (At least with TeX Live 2011). See more details.   * `hyperref` should be loaded with the option `unicode`. What other packages do you use? What about `babel` and `textcomp`? And are there some "killer-packages" that are only working with `lualatex` besides `fontspec`?


List mentioned below is having three items. There are four variables : 1] varone 2] vartwo 3] varthree and 4] sub ; which are coming from external CSV file. Item 2 with "Value B" will be displayed if value of variable sub is more than 4. But somehow this code does not work : can you please suggest me how to add conditions inside itemize list?               \begin{itemize}     \ifboolexpr{       test {\ifdimgreater{\varone pt}{69.99pt}} or       test {\ifdimequal{\varone pt}{69.99pt}}}     {\item \textbf{Value A: } Text for A.}{}     \ifnum\sub > 4     \ifboolexpr{       test {\ifdimgreater{\vartwo pt}{69.99pt}} or       test {\ifdimequal{\vartwo pt}{69.99pt}}}     {\item \textbf{Value B: } Text for B.}{}     \fi     \ifboolexpr{       test {\ifdimgreater{\varthree pt}{69.99pt}} or       test {\ifdimequal{\varthree pt}{69.99pt}}}     {\item \textbf{Value C: } Text for C.}{}     \end{itemize}      Note: I'm using article document class with xelatex.


title: Using a \phantom{} in \ul from the soul package

text: In responding to how to typeset a Long underscore in LaTeX, I attempted to use a `\phantom` with `\ul`, but end up `Argument of \makeph@nt has an extra }.` So, what is the proper way to use a `\phantom` command in such a situation.               \documentclass{article}     \usepackage{xcolor}%     \usepackage{soul}%          \newcommand{\UnderlineText}[2][red]{\setulcolor{#1}\ul{#2}}%          \begin{document}         Signature: \UnderlineText[blue]{Sign here}              %Signature: \UnderlineText[blue]{\phantom{Sign here}}% Error if un-commented.     \end{document}


title: How to avoid automatic .tex extension in filenames?

text: I am in an mildly unfortunate situation in which, because of the way I prepared the files automatically, I ended up with a file to be attached but also another file with the same name but ending in the `.tex` extension. It seems that when referring to a file inside TeX the file with the extension `.tex` is always preferred. For example: If I have the files `example.cpp.tex` and `example.cpp` (no `.tex` extension), then with               \documentclass{article}     \usepackage{attachfile}     \begin{document}     \textattachfile{example.cpp}{link}     \end{document}      `attachfile` will attach `example.cpp.tex` instead of `example.cpp`. This seems to be also true for many LaTeX commands, such as `\input`, `\include`, `embedfile` etc. How can I enforce to use the file specified and not the `.tex` terminated one in general or in particular for `\attachfile`? (Note: the problem is not the double extension; the unexpected result will also happen with the files `example` and `example.tex`.)


title: How to get two tableofcontents (general and detailled)?

text: I often see two table of contents in books - one for the big overview, one very detailled. I would like to have that too for a book based on Springers svmono template. I have numbered chapters and unnumbered sections in the book. The tableofcontent produced only shows the parts and the numbered chapters. That ok for an overview. I would like to have another tableofcontent behind the first one showing all the unnumbered sections too - is that possible, and how can I achieve this?


title: Why can't I give a coordinate an alias using "late options"?

text: Here is a small document:               \documentclass{standalone}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}         %\coordinate (A) at (0, 0);                     % Line A         %\node [coordinate] (A) at (0, 0) {};           % Line B         %\node (A) at (0, 0) {};                        % Line C         %\coordinate [alias=AA] (A) at (0, 0);          % Line D         %\node [coordinate, alias=AA] (A) at (0, 0) {}; % Line E         %\path (A) [late options = {alias=AA}];         % Line ABC         \coordinate (B) at (1, 0);         \draw (AA) -- (B);     \end{tikzpicture}          \end{document}        1. Uncomment lines A and ABC and you get "Package pgf Error: No shape named AA is known."   2. Re-comment line A and uncomment line B and you get the same result.   3. Re-comment line B and uncomment line C and the document compiles successfully.   4. Re-comment lines C and ABC and uncomment line D and the document compiles successfully.   5. Re-comment line D and uncomment line E and the document compiles successfully. It seems that if a node is of shape coordinate, you can give it an alias, but not using the late options mechanism. If you try to do it with late options, TikZ doesn't report an error, but it doesn't do anything. I am using PGF/TikZ version 2.10.


title: Hebrew numerals

text: There appears to be three different numbering commands in the `polyglossia` package. Which one is the most correct to use? I can understand the argument for the `\Hebrewnumeralfinal` one since it seems correct to have the final letters show appropriately. But there is also a difference in the way that the other two commands generate a numeral, which is a bit confusing to me. If there are any Hebrew native speaking TeX.SX members, I would appreciate your input. This is a MWE.               % !TEX TS-program = XeLaTeX          \documentclass{scrreprt}          \usepackage{fontspec}     \setmainfont{Times New Roman}          \usepackage{polyglossia}     \setdefaultlanguage{greek}     \setotherlanguage[numerals=hebrew]{hebrew}          \begin{document}     ελληνικά \greeknumeral{1863}          Hebrew: עִבְרִית\\     \hebrewnumeral{1750}     \Hebrewnumeral{1750}     \Hebrewnumeralfinal{1750}\\     \hebrewnumeral{1}     \Hebrewnumeral{1}     \Hebrewnumeralfinal{1}     \end{document}


title: Make/Create AGU's style bibliographystyle

text: I'd like to make/create a bibliography style similar to AGU journals' style, which looks like this: In the main text:               Recent studies have shown similar results [Smith et al. 2001; Christensen et al. 2010].       and at the end, in the reference list I want them sorted by first author               Christensen D., William J.H. and Smidt J.G.. New Results, New Sci. Journal, E4, 25-49, 2010          Smith J., Robert C. and Harrison F. Old Results, Journal Sci. Tech., 12, 995-999, 2001      I have a bib file containing the list of articles e.g.               @Article{Smith2001,      author = {Smith J. and Robert C. and Harrison F},      title = {Old Results},      journal = {Journal Sci. Tech.},      volume = {12},      pages = "995-999",      year = "2001"     }      Therefore the LaTeX line should be something similar to :               Recent studies have shown similar results \citep{Smith2001,Christensen2010}.       I tried apalike, plain, unsrt, chicago, harvard and others built-in styles, none of them give me what I want. Either I got something weird in the main text for instance:               Recent studies have shown similar results [J ~ et al. 2001; D ~ et al. 2010].       or even worth, in the reference list, some styles give me this:                 [Christensen2010]  Christensen D., William J.H. and Smidt J.G.. New Results, New Sci. Journal, E4, 25-49, 2010            [Smith2001] Smith J., Robert C. and Harrison F. Old Results, Journal Sci. Tech., 12, 995-999, 2001      I tried to play quite a bit with `makebst` but my experience is too weak for reaching my goals. I also tried to play with the `cite` package options but none of them gives me satisfaction. For those who are interesting in this style, AGU provides a LaTeX template but its usage needs to use `bibitem` which is out of topic here. Furthermore, calling their template implies to get a specific layout which is not what I want here. Any help would be gracefully appreciated.


title: fontspec \setmainfont over-rides href color

text: I'm happy with the way fontspec is working for me, but have one problem. I have the command: `\setmainfont[Color=393939]{URW Palladio L}` which colors all the text in my document. I have darker greys for headings. The problem is that I want all hyperlinks to be automatically colored with the color of my choice. I use `\usepackage{hyperref} \hypersetup{...urlcolor=orange}` Coloring hyperlinks like this works fine if I do _not_ have the `\setmainfont[Color=393939]{URW Palladio L}` command, but it does not work when it is included. Is there a way I can color all body text and also automatically color hyperlinks? Kit


title: Option [(a)] to get alphabet numbering when applied to enumerate doesn't work

text: According to this popular guide http://texblog.wordpress.com/2008/10/16/lists- enumerate-itemize-description-and-how-to-change-them/, I should be able to apply an option `[(a)]` to get small case alphabet numbering. As it is below, I cannot:               \documentclass[12pt]{article}     \usepackage[version=3]{mhchem}          \date{}     \begin{document}          \begin{enumerate}[(a)]     \item {\bf \ce{CH3Br + KOH -> CH3OH + KBr}}     \end{enumerate}     \end{document}      Error message:               ! LaTeX Error: Something's     wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX     Companion for explanation. Type  H     <return>  for immediate help.  ...                                                                 l.22 \item {                 \bf \ce{CH3Br + KOH -> CH3OH + KBr}} ?


title: How to use very large data sets with pgfplots w/o making pdf take a very long time to load?

text: I'm working with a very large data set - almost 120,000 observations - and I'm using pgfplots to make some plots. The process goes ok, especially with the use of the external library, but the pdf documents take a very long time to load. It seems as though adobe is individually drawing each data point. Is there a better way to use pgfplots to make the plots easier to render? My set up is:               \documentclass[12pt]{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzexternalize          \begin{document}          \begin{figure}[h]     \footnotesize     \centering     \caption{Publicly Available Num Tested, MEAP\_stacked Number Valid}     \begin{tikzpicture}     \begin{axis}[     only marks,     width=6.2in,     ylabel={Number Tested, Public Data},     xlabel={Number Valid, Our Data},     area legend,     legend style = {at={(axis cs:700,0)},anchor=south east},     xmin=-50,     ymin=-50]     \input{statistics/Num_Valid_Writing.tex}     \addlegendentry{Writing}     \input{statistics/Num_Valid_Math.tex}     \addlegendentry{Math}     \input{statistics/Num_Valid_ELA.tex}     \addlegendentry{ELA}     \input{statistics/Num_Valid_Science.tex}     \addlegendentry{Science}     \input{statistics/Num_Valid_SS.tex}     \addlegendentry{Social Studies}     \input{statistics/Num_Valid_Reading.tex}     \addlegendentry{Reading}     \end{axis}     \end{tikzpicture}     \end{figure}          \end{document}      I'm using pdfLaTeX and Ubuntu with TeXLive. Thanks!


title: Creating figures of polytopes (in 3D): Is it worth switching from PSTricks to TikZ?

text: I used PSTricks a lot to create figures of polytopes. More recently, I have become aware of discussions going on about whether PSTricks or TikZ is the better choice for creating figures of all kinds. From the _general_ discussion on this issue, I have come to the conclusion that I want to use TikZ rather than PSTricks in the future. However, before I switch to TikZ, I want to find out whether TikZ is good for the _particular_ purpose I want to use it for. I mainly used the `pst- solides3d` package of PSTricks, and I wonder whether TikZ provides substitutes for the features of PSTricks I used. To make my question more conrete, let me just give a very simple example of a polytope that I created with PSTricks and give you a list of features that I like in this example, and you tell me whether the particular features are easily implemented in TikZ.               \documentclass{minimal}     \usepackage{pst-solides3d}     \begin{document}          \begin{pspicture}(-2.5,-1)(6,4)     \psset{viewpoint=40 16 12,Decran=130,solidmemory}     \psSolid[object=new,linewidth=0.7\pslinewidth,      action=draw*,      name=A,      fcol=1 (0.8 setgray),      sommets=        %n=4       0 0 0 %0       0.420448  0.420448 0.5 %e1      -0.420448  0.420448 0.5 %e2      -0.420448 -0.420448 0.5 %e3       0.420448 -0.420448 0.5 %e4       0 0 1.2, %u      faces={       [1 2 3 4]       [1 2 5]       [2 3 5]       [3 4 5]       [4 1 5]}]%     \psSolid[object=plan,definition=solidface,action=none,args=A 0,name=S0]     \psset{fontsize=8}     \psProjection[object=texte,text={G},plan=S0]%     \psSolid[object=plan,definition=solidface,action=none,args=A 1,name=S1]     \psProjection[object=texte,text={H},phi=90,plan=S1]%     \psPoint(0, 0, 1.2){a}     \uput[u](a){$a_G$}     \psdot[dotsize=0.1](a)     \end{pspicture}          \end{document}      ![polytope example](http://i46.tinypic.com/564wx.png) What I like about it:   1. I can create the polytope from a given set of three-dimensional coordinates.   2. If I want to change the viewpoint, I don't have to type in the code of a whole new polytope but I simply change `\psset{viewpoint=40 16 12,Decran=130}`.   3. The hidden lines are dashed. Important: I don't have to specify which lines are hidden; determining the hidden lines should be automatic.   4. I can write text on the faces of the polytope (like G, H in this example).   5. I can easily color a face (like giving the H-face a gray color).   6. The corners are easily marked (with a dot) and labeled (`a_G` in the example). Is this easily done using TikZ? An example creating this polytope with the mentioned features using TikZ would be nice (this would also help me to start using TikZ if I should decide to switch). I think if these basic things work with TikZ, then I can cope with other details that may or may not be possible with TikZ. EDIT: Answering the question of what would be "the most complicated" polytope I might want to draw: I don't know. Although I don't know TikZ, I would gess that increasing complexity in terms of an increasing number of coordinates / corners should not be problematic (is it?). Of course it's more labor- intensive to type the code (needless to say that this is also true for pstricks), but I think the general feasibility should not be affected by that (right?). That's why I focused on features instead of on the complexity of the polytope. One thing I can say is that I will probably only draw _convex_ polytopes. I might want to draw more complicated polytopes in the future, but the most complicated one I have drawn so far is probably this one (yes, the additional septagon on top is intended):                   \documentclass{minimal}          \usepackage{pst-solides3d}          \begin{document}          \begin{pspicture}[showgrid=false](-2,-0.5)(2,2.7)     \psset{viewpoint=26 7 5,Decran=50}     \psSolid[object=new, linewidth=0.7\pslinewidth,     action=draw*,     name=A,     sommets=     %n=7     0 0 0 %0 0     0.656862 0.82368 1 %w1 1     -0.234432 1.02711 1 %w2 2     -0.949194 0.457108 1 %w3 3     -0.949194 -0.457108 1 %w4 4     -0.234432 -1.02711 1 %w5 5     0.656862 -0.82368 1 %w6 6     1.05353 0 1 %w7 7     0.311322 0.390385 0.473952 %e1 8     -0.111109 0.486802 0.473952 %e2 9     -0.449873 0.216647 0.473952 %e3 10     -0.449873 -0.216647 0.473952 %e4 11     -0.111109 -0.486802 0.473952 %e5 12     0.311322 -0.390385 0.473952 %e6 13     0.499321 0 0.473952 %e7 14     -0.311322 -0.390385 0.526048 %u-e1 15     0.111109 -0.486802 0.526048 %u-e2 16     0.449873 -0.216647 0.526048 %u-e3 17     0.449873 0.216647 0.526048 %u-e4 18     0.111109 0.486802 0.526048 %u-e5 19     -0.311322 0.390385 0.526048 %u-e6 20     -0.499321 0 0.526048 %u-e7 21     0 0 1, %u 22     faces={     [0 13 16 12]     [0 12 15 11]     [0 11 21 10]     [0 10 20 9]     [0 9 19 8]     [0 8 18 14]     [0 14 17 13]     [16 13 17 22]     [17 14 18 22]     [18 8 19 22]     [19 9 20 22]     [20 10 21 22]     [21 11 15 22]     [15 12 16 22]     [1 2 3 4 5 6 7]     }]     \end{pspicture}          \end{document}      ![second polytope example](http://i46.tinypic.com/295ai46.png) At this example, one can see why it is useful that hidden lines are dashed: If they were solid, the picture would not be as readable as this one.


title: How to remove vertical-line gap on right side of tables when adding space between header and content?

text: I use the supertabular environment to create a table containing images. I defined that the header should be separated from the content by a single line. Because the first image in table is on the line separating header from content, I have added a space with `\\\\[0.5em]` (see MWE). The problem I have is, that the right vertical line of my table now is broken. All other vertical lines are ok. If I remove the space everything is fine, but the image aligns directly to the header line. How to get the gap on the right vertical line under the table header closed? Image illustrating problem: ![gap on the right vertical line](http://i.stack.imgur.com/gMxh7.png) MWE with gap:               \documentclass[a4paper,12pt,ngerman]{scrreprt}          \usepackage{supertabular}     \usepackage{graphicx}     \usepackage{array}          \begin{document}     \tablefirsthead{\hline\textsc{grafische Notation }& \textsc{Bedeutung} \\\hline \\[0.5em]}     \tablehead{\hline\textsc{grafische Notation }& \textsc{Bedeutung} \\\hline \\[0.5em]}     \tabletail{     \hline     \multicolumn{2}{|r|}{\small Fortsetzung auf nächster Seite}     \\     }     \tablelasttail{\hline}          \begin{supertabular}{|m{0.3\textwidth}|m{0.65\textwidth}|}          \centering  \includegraphics[width=0.25\textwidth]{tex}  &     { bla}     \\          \centering  \includegraphics[width=0.25\textwidth]{tex}  &     blub\\     \end{supertabular}     \end{document}      MWE without gap:               \documentclass[a4paper,12pt,ngerman]{scrreprt}          \usepackage{supertabular}     \usepackage{graphicx}     \usepackage{array}          \begin{document}     \tablefirsthead{\hline\textsc{grafische Notation }& \textsc{Bedeutung} \\\hline}     \tablehead{\hline\textsc{grafische Notation }& \textsc{Bedeutung} \\\hline}     \tabletail{     \hline     \multicolumn{2}{|r|}{\small Fortsetzung auf nächster Seite}     \\     }     \tablelasttail{\hline}          \begin{supertabular}{|m{0.3\textwidth}|m{0.65\textwidth}|}          \centering  \includegraphics[width=0.25\textwidth]{tex}  &     { bla}     \\          \centering  \includegraphics[width=0.25\textwidth]{tex}  &     blub\\     \end{supertabular}     \end{document}


title: How can I get Lewis-like structures + illustrate electron transfer

text: I know about the existence of packages that allow Lewis structures but that is not the question. The question is how to illustrate radical reactions as depicted below. The solution would ideally be typeset as inline text, not a picture. The solution should not involve TikZ. Edit: A solution which uses a pre-defined macro is preferred. "Picture-based" solutions like TikZ are just too involved because everything has to be defined from scratch. ![enter image description here](http://i.stack.imgur.com/GEVkT.png)


title: Explanations about \begingroup\edef\x{\endgroup

text: I see the code               \begingroup\edef\x{\endgroup      in the answer to this question. I want to understand the purpose of this method. In which cases should it be used?


title: Left/Center/Right references to subfigures

text: I have a figure with three subfigures shown in the code sample below. How can I change the reference to a subfigure so that I have Figure 1 (left), Figure 1 (center), and Figure 1 (right) instead of figure 1.1, 1.2, and 1.3? Also, in the caption I would like to it to have a general caption, then in the same paragraph have (left) left's caption (center) center's caption (right) right's caption.               \documentclass{article}     \usepackage{graphicx}     \begin{document}     \begin{figure*}     \begin{minipage}[b]{0.33\linewidth}     \label{fig:left}     \includegraphics[width=2.5in,height=2.5in]{img1}     \end{minipage}     \begin{minipage}[b]{0.33\linewidth}     \includegraphics[width=2.5in,height=2.5in]{img2}     \label{fig:center}     \end{minipage}     \begin{minipage}[b]{0.33\linewidth}     \includegraphics[width=2.5in,height=2.5in]{img3}     \label{fig:right}     \end{minipage}     \caption{         Blah blah blah.           \ref{fig:left} blah blah.            \ref{fig:center} blah blah.            \ref{fig:right} blah blah.     }     \label{fig:all}     \end{figure*}     \end{document}


title: pdfcrop does not work

text: I have just updated to MiKTeX 2.9 I am using Emacs and I run `pdflatex --shell-escape -interaction=nonstopmode "\input" Instructions.tex` `pdfcrop` gives me the following error               PDFCROP 1.33, 2012/02/01 - Copyright (c) 2002-2012 by Heiko Oberdiek.     !!! Error: Cannot call ghostscript ("C:\Program Files   (x86)\gs\gs8.71\bin\gswin32c.exe")!      so I tried to call `pdfcrop` manually:               C:\>pdfcrop  --margins 10 --debug Instructions-autopp.pdf s.pdf     PDFCROP 1.33, 2012/02/01 - Copyright (c) 2002-2012 by Heiko Oberdiek.     * Restricted mode: disabled     * Option `pdfversion': auto     * OS name: MSWin32     * Arch name: MSWin32-x86-multi-thread     * System: win     * Not found (gswin32c): gswin32c.exe     * Not found (gswin32c): C:\Perl\site\bin\gswin32c.exe     * Not found (gswin32c): C:\Perl\bin\gswin32c.exe     * Not found (gswin32c): C:\GTK\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\OpenVPN\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\ispell\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\ispell\gswin32c.exe     * Not found (gs): gs.exe     * Not found (gs): C:\Perl\site\bin\gs.exe     * Not found (gs): C:\Perl\bin\gs.exe     * Not found (gs): C:\GTK\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\OpenVPN\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\ispell\gs.exe     * Not found (gs): C:\Program Files (x86)\ispell\gs.exe     * Search registry at `HKEY_LOCAL_MACHINE/SOFTWARE/'.     * Registry entry found: HKEY_LOCAL_MACHINE/SOFTWARE/GPL Ghostscript/     * Registry entry found: HKEY_LOCAL_MACHINE/SOFTWARE/GPL Ghostscript/8.71/       GS_DLL = C:\Program Files (x86)\gs\gs8.71\bin\gsdll32.dll       EXE found: C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe     * Found (via registry): C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe     * Autodetected ghostscript command: C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe     * Input file: Instructions-autopp.pdf     * Output file: s.pdf     * Margins: 10 10 10 10     * PDF header: %PDF-1.4     * Using PDF minor version: 4     * Running ghostscript for BoundingBox calculation ...     * Ghostscript call: "C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe" -sDEVICE=bbox -    dBATCH -dNOPA     USE -c save pop -f Instructions-autopp.pdf     * Cleanup     * Temporary files: tmp-pdfcrop-1412.tex     !!! Error: Cannot call ghostscript ("C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe")!     * Cleanup     * Temporary files: tmp-pdfcrop-1412.tex      so it seems to find `ghostscript` but still there is an error. Ghostscript seems to be installed correctly. I can e.g. do the following:               C:\>"C:\Program Files (x86)\gs\gs8.71\bin\gswin32c.exe" -sDEVICE=bbox -dBATCH -d     NOPAUSE -c save pop -f Instructions-autopp.pdf     GPL Ghostscript 8.71 (2010-02-10)     Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.     This software comes with NO WARRANTY: see the file PUBLIC for details.     Processing pages 1 through 1.     Page 1     %%BoundingBox: 640 577 978 706     %%HiResBoundingBox: 640.053965 577.439982 977.374658 705.834189      What could I try? UPDATE Debug output:               C:\>perl pdfcrop.pl   --margins 10 --debug Instructions-autopp.pdf s.pdf     PDFCROP 1.37, 2012/10/16 - Copyright (c) 2002-2012 by Heiko Oberdiek.     * Restricted mode: disabled     * Option `pdfversion': auto     * Perl executable: C:\Perl64\bin\perl.exe     * Perl version: v5.10.1     * Perl product: ActivePerl, build 1007     * Pointer size: 8     * Pipe support: yes     * Fork support: no     * OS name: MSWin32     * Arch name: MSWin32-x64-multi-thread     * System: win     * Not found (gswin64c): gswin64c.exe     * Not found (gswin64c): C:\Perl64\site\bin\gswin64c.exe     * Not found (gswin64c): C:\Perl64\bin\gswin64c.exe     * Not found (gswin64c): C:\GTK\bin\gswin64c.exe     * Not found (gswin64c): C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\gswin64c.exe     * Not found (gswin64c): C:\Program Files (x86)\OpenVPN\bin\gswin64c.exe     * Not found (gswin64c): C:\Program Files (x86)\ispell\gswin64c.exe     * Not found (gswin64c): C:\Program Files (x86)\ispell\gswin64c.exe     * Not found (gswin32c): gswin32c.exe     * Not found (gswin32c): C:\Perl64\site\bin\gswin32c.exe     * Not found (gswin32c): C:\Perl64\bin\gswin32c.exe     * Not found (gswin32c): C:\GTK\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\OpenVPN\bin\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\ispell\gswin32c.exe     * Not found (gswin32c): C:\Program Files (x86)\ispell\gswin32c.exe     * Not found (gs): gs.exe     * Not found (gs): C:\Perl64\site\bin\gs.exe     * Not found (gs): C:\Perl64\bin\gs.exe     * Not found (gs): C:\GTK\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\OpenVPN\bin\gs.exe     * Not found (gs): C:\Program Files (x86)\ispell\gs.exe     * Not found (gs): C:\Program Files (x86)\ispell\gs.exe     * Search registry at `HKEY_LOCAL_MACHINE/SOFTWARE/'.     * Registry entry found: HKEY_LOCAL_MACHINE/SOFTWARE/GPL Ghostscript/     * Registry entry found: HKEY_LOCAL_MACHINE/SOFTWARE/GPL Ghostscript/9.06/       GS_DLL = C:\Program Files\gs\gs9.06\bin\gsdll64.dll       EXE found: C:\Program Files\gs\gs9.06\bin\gswin64c.exe     * Found (via registry): C:\Program Files\gs\gs9.06\bin\gswin64c.exe     * Autodetected ghostscript command: C:\Program Files\gs\gs9.06\bin\gswin64c.exe     * Input file: Instructions-autopp.pdf     * Output file: s.pdf     * Margins: 10 10 10 10     * PDF header: %PDF-1.4     * Using PDF minor version: 4     * Running ghostscript for BoundingBox calculation ...     * Ghostscript call: "C:\Program Files\gs\gs9.06\bin\gswin64c.exe" -sDEVICE=bbox -dBATCH     -dNOPAUSE -c      save pop -f Instructions-autopp.pdf     * Cleanup     * Temporary files: tmp-pdfcrop-3284.tex     !!! Error: Cannot call ghostscript `"C:\Program Files\gs\gs9.06\bin\gswin64c.exe"' (Bad     file descriptor/Le chemin dÆaccÞs spÚcifiÚ est introuvable)!     * Cleanup     * Temporary files: tmp-pdfcrop-3284.tex       Le chemin dÆaccÞs spÚcifiÚ est introuvable)! = The specified path can not be found. UPDATE The result of your script:               *** system() ***     GPL Ghostscript 9.06 (2012-08-08)     Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.     This software comes with NO WARRANTY: see the file PUBLIC for details.     Processing pages 1 through 1.     Page 1     %%BoundingBox: 640 577 978 706     %%HiResBoundingBox: 640.053402 577.439982 977.375220 705.851978     * No error.          *** backticks ***     %%BoundingBox: 640 577 978 706     %%HiResBoundingBox: 640.053402 577.439982 977.375220 705.851978     * No error.     ==========     GPL Ghostscript 9.06 (2012-08-08)     Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.     This software comes with NO WARRANTY: see the file PUBLIC for details.     Processing pages 1 through 1.     Page 1     ==========          *** pipe ***     [[GPL Ghostscript 9.06 (2012-08-08)]]     [[Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.]]     [[This software comes with NO WARRANTY: see the file PUBLIC for details.]]     [[Processing pages 1 through 1.]]     [[Page 1]]     %%BoundingBox: 640 577 978 706     %%HiResBoundingBox: 640.053402 577.439982 977.375220 705.851978     * No error.          *** with stderror redirection ***          *** system() ***     Can't spawn "cmd.exe": No such file or directory at test.pl line 26.     ! Exit code: 255          *** backticks ***     ! Execution error: Bad file descriptor/Le chemin dÆaccÞs spÚcifiÚ est introuvable     ==========     Use of uninitialized value $result in print at test.pl line 33.     ==========          *** pipe ***     ! Error: Execution error: Bad file descriptor/Le chemin dÆaccÞs spÚcifiÚ est introuvable          *** with stderror and stdout redirection ***          *** system() ***     Can't spawn "cmd.exe": No such file or directory at test.pl line 26.     ! Exit code: 255          *** backticks ***     ! Execution error: Bad file descriptor/Le chemin dÆaccÞs spÚcifiÚ est introuvable     ==========     Use of uninitialized value $result in print at test.pl line 33.     ==========          *** pipe ***     ! Error: Execution error: Bad file descriptor/Le chemin dÆaccÞs spÚcifiÚ est introuvable      The problem seems to be that cmd.exe can not be found. I put c:\windows\system32 in system variable PATH and now everything works! (I do not know why c:\windows\system32 was not present any more) Many thanks for your help!


How can I type the Mathematica symbols “Distributed” and “Conditioned”? ![enter image description here](http://i.stack.imgur.com/CdQGL.png) ![enter image description here](http://i.stack.imgur.com/1XP96.png)


title: Why does LaTeX replace some spaces with brackets or underscores in the listings environment?

text: I'm using LaTeX on Windows with MikTeX and I'm seeing some odd behaviour. In the output, _some_ of the spaces are replaced with bracket-like underscores. This is the code:               \documentclass[10pt]{article}     \usepackage{listings}     \begin{document}     \begin{lstlisting}[language=SAS, title=SAS code to format data on government patients]     code code;                                              code code;          code;     code;     code;     c           identity = "Subject's identity"           variable = "Subject's name in government archive of files";     FORMAT gender genderft.            code            response responseft.;     RUN;     \end{lstlisting}     \end{document}      This generates the following output: ![output with broken spaces](http://i.stack.imgur.com/4muX2.png) I've replaced all tabs with spaces, copied the code into a plain text editor and retyped all the spaces, and still the problem persists. Even copying the code into the editor from my browser after the question is posted doesn't work. The bracket/underscores are still there. No other code snippets in my document present this problem, yet they also use identical listings syntax to this example and also use SAS code.


title: Why are notes in latex-beamer not working?

text: I want to use the note-functionality of latex-beamer which should, according to the user guide, work as follow: I add a `\note{Sometext}` somewhere on a slide and if I now switch on the notes-printing using the `show notes` option, another slide should be inserted after the current one, containing the node "Sometext". This doesn't work for me: The notes are always shown like this: ![Wrong display](http://i.stack.imgur.com/eZhJc.png) This is not what I expected and not what the documentation states. In fact, the notes printing can not be disabled if replacing the `show notes` with `hide notes`. They are always printed, but not on their own page. See this minimal working example which generates the presentation above.               \documentclass[18pt]{beamer}          % Many imports     \usepackage{mdwlist}     % More imports          \usetheme{Warsaw}         \setbeameroption{show notes}          \begin{document}     \begin{frame}       \begin{itemize}         \item Eggs         \item Plants         \item Animals \note{Animals are quite huge}       \end{itemize}     \end{frame}          \end{document}


title: How do you get block dimensions in Beamer?

text: I'm using a block for emphasizing different pieces of information. I'd like those pieces to be constrained to the block dimensions and to use the columns environment, but I don't know how to get the block dimensions in order to constraint the column's width.               \begin{block}        \begin{columns}[t]           \column{.3XXX}               Blah blah           \column{.3XXX}               Blah blah           \column{.3XXX}               Blah blah        \end{columns}     \end{block}      How can I specify the column width based on the block width?


title: Wrapfig isn't working in my fcolorbox minipage

text: I'm trying to get text to wrap around my figure. This works fine in the main body of my text, but when I put it inside an `\fcolorbox` the text simply overwrites the image. I've reduced my code to the example below. Being new here I apologize if I'm doing this wrong, but I don't see a link to upload a file, so I'm hoping people can reproduce this using any image file they have lying around.               \documentclass{book}     \usepackage{graphicx} % Allows graphics to be imported     \usepackage{wrapfig} % Allows figures to go on the side of the page with text wrapping around them     \usepackage[usenames,dvipsnames]{color} % An easy way to get shaded boxes     \definecolor{light-gray}{gray}{0.8} % Defines the color we're using for shaded boxes          \begin{document}          \fcolorbox{black}{light-gray}{\begin{minipage}{\columnwidth}\parskip=6pt     Some text          \begin{wrapfigure}{r}{.2\textwidth}     \vspace{-15pt}     \begin{center}\includegraphics[width=.18\textwidth]{latexchapters/vectorsfigures/simplepath.png}\end{center}     \vspace{-15pt}     \end{wrapfigure}          {\it Answer:} To find the potential at $(x,y)$ we evaluate a line integral from the origin to $(x,y)$. For simplicity we use the path shown on the right, first going from $(0,0)$ to $(x,0)$ and then from there to $(x,y)$. Along the first segment only $f_x$ contributes, and since $y=0$, $f_x=1$ and the line integral equals $x$. Along the second segment only $f_y$ contributes, and $x$ is constant but $y$ is not, so we get $x\int_0^ye^{\tilde{y}}d\tilde{y} = xe^y-x$. Combining the two segments we find $\int_C\vec{f}=xe^y$. Remember that the gradient theorem just relates line integrals to gradients, but the definition of potential we use includes an additional minus sign, so $V(x,y)=-xe^y$.          \end{minipage}}          \end{document}


title: Forcing text to the right-hand-sideof the page

text: I'm wondering how (if possible) to force text to the right hand side in LaTeX. So, you know when you have a set of simultaneous equations and the equation reads from the left, but then over on the right there is a number indicating which equation it is for later use...? Something like:               2x + 6y + z = x ... [and then like way over here ----> ]...     -(1          3x + 4y + z = y ... [and then like way over here ----> ]...     -(2          3x + 5y + z = z ... [and then like way over here ----> ]...     -(3          x + y + z = 1 ..... [and then like way over here ----> ]...     -(4      How would I get the (1, (2 etc.. to the RHS? Sorry if this is unclear, I have no idea how else to explain it...


title: Can't make a list of symbols align correctly

text: I created a quick manual list of figures using some code from a previous answer but I can't get it to align properly. The second part will jump a few characters backwards and forwards making it look funny.               \nonumchap{List of Symbols}     \newcommand{\tab}[1]{\hspace{.2\textwidth}\rlap{#1}}          E \tab{Young's Modulus [MPa]}          F \tab{Force [N]}          $f_n$ \tab{Natural Frequency [Hz]}          I \tab{Moment of Inertia [m$^4$]}          k \tab{Spring Constant [N/m]}          L \tab{Length [m]}          m \tab{mass [kg]}          t \tab{thickness [m]}          V \tab{Volume [m$^3$]}


title: Add custom caption to LOT file

text: In my publishing company we have our own template with custom `\tcaption` command which make caption above the table with company's standards (and I don't use table environment). However this command doesn't write information in LOT file, so I can't produce the list of tables. What should I change in CLS file to fix this problem? I can't simply write `\addcontentsline{lot}` because I have 170 tables.


title: TikZ chain adjust positions of on-the-arrow node

text: \documentclass{article}      \usepackage{tikz}     \usetikzlibrary{chains}     \begin{document}     \begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)},regular/.style={draw,circle,inner sep=0,minimum size=4mm}]     \foreach \i in {0,...,11}       \node [on chain, regular] (\i) {\i};     \foreach \i [evaluate=\i as \ni using {int(mod(\i+1,12))}] \i in {0,3,6,9}       {\draw [->] (\i) to [bend right] node[auto] {$p_b$} (\ni); }     \foreach \i [evaluate=\i as \ni using {int(Mod(\i-1,12))}] \i in {0,3,6,9}       {\draw [->] (\i) to [bend right] node[auto] {$q_b$} (\ni); }     \foreach \i [evaluate=\i as \ni using {int(mod(\i+1,12))}] \i in {1,2,4,5,7,8,10,11}       {\draw [->] (\i) to [bend right] node[auto] {$p_g$} (\ni); }     \foreach \i [evaluate=\i as \ni using {int(Mod(\i-1,12))}] \i in {1,2,4,5,7,8,10,11}       {\draw [->] (\i) to [bend right] node[auto] {$q_g$} (\ni); }     \end{tikzpicture}     \end{document}      gave me ![enter image description here](http://i.stack.imgur.com/WFa2z.png) Although I have used `node[auto]` and there is certainly enough room to layout all the on-the-arrow node labels, they still crowd into a mess. I am aware that I have the option of using `node[auto,above]` or `node[auto,below]` to fine-tune the position, but that would make the code lengthy. Is there a simple way to lay out those labels beautifully?


title: How to print and assign category codes?

text: Consider the code below, which after giving me some trouble (especially with catcode 9 and 15), prints all the category codes up to catcode 15.               \documentclass{minimal}     \parindent0pt     \begin{document}     \the\catcode`\\  \ control character  \\     \the\catcode`{  \ open curly\\     \the\catcode`}  \ closing curly \\     \the\catcode`$  \ dollar\\     \the\catcode`&  \ alignment\\     \the\catcode`\      \ space \\\the\catcode`#  \ sharp\\     \the\catcode`^ \ hat \\     \the\catcode`_ \ underscore \\     \number\catcode`\  \ space \\     \catcode `\y=9     \the\catcode`\y    \ ignored character \\     \the\catcode`a \ letters\\     \number\catcode`@  \ restricted  \\     \number\catcode`~ \ tilde \\     \the\catcode`\%   \ comment\\      \catcode`\z = 15      \the\catcode`\z  \ invalid character \\     \def\test{}     %\catcode `\t=16     \ifcat\test 16  16  control sequence\fi     \end{document}      Now, getting TeX to print the catcode 16, has me puzzled. For starters if you uncomment the line, `%\catcode \t=16` you get, > >     ! Invalid code (16), should be in the range 0..15. >       l.23 \catcode\t=16 >   but, if you test with `\ifcat` a control sequence is definitely equal to category code 16. So my question is, how can I coerce TeX to say sixteen for a control sequence and how come the error message says 16 is an invalid code, but the TeXbook says it is? Mildy related question How do I get the category code of a character that is the value of a control sequence?


title: How to make pdfLaTeX multithreaded when `--shell-escape` is enabled?

text: I am using `\write18` enabled (or `\--shell-escape`) with externalization to compile a bunch of `PGFplots`. The first run takes much time, and I noticed that `pdflatex` only runs on one CPU core. Is there any way to have `pdflatex` use multiple cores? (at least when `\write18` is enabled)


title: problem - multiple index in latex

text: I find here an example and use it for my multiple index. This code in Latex works, but I want to use the newcommand `\smindexxspecial[\ITerm]{beccari}` instead `\index[\ITerm]{beccari}` or `\smsindexspecial{IServ{www.wikipedia.org}` instead `\index[\IServ]{www.wikipedia.org}`. For this I do this one `\newcommand{\smindexxspecial}[2]{{\MyLarge#2} \index[1]{#2}}`. But it doesn't work. Does anybody have an Idea?               \documentclass{article}     \usepackage{imakeidx}          \newcommand{\ITerm}{IndexTerms}     \newcommand{\IServ}{IndexServs}          \newcommand{\MyLarge}{\Large}          \newcommand{\smindexxspecial}[2]{{\MyLarge#2} \index{#2}}     \newcommand{\smindexspecial}[2]{{\MyLarge#2}\index{#2}}     \newcommand{\smindexvspecial}[2]{{\MyLarge#2}\index{#2}}     \newcommand{\smsindexspecial}[2]{{\MyLarge\url{#2}}\index{#2}}          \makeindex[name= \ITerm, Concept Index,columns=3]     \makeindex[name= \IServ,title= Websites,columns=3]          \begin{document}          Here is a list of things and people     \begin{itemize}      \item \LaTeX \index[\IServ]{www.wikipedia.org}  %\smsindexspecial{IServ{www.wikipedia.org}      \item Beccari \index[\ITerm]{beccari}           %\smindexxspecial[\ITerm]{beccari}      \item Gregorio \index[\ITerm]{gregorio}     \end{itemize}          And this is the end of the story.          \printindex[\IServ]          \indexprologue{\small In this index you’ll find only     famous people’s names}     \printindex[\ITerm]          \end{document}


title: Cannot load font packages: cmbright.sty not found

text: I have Ubuntu 10.04 and I have installed Tex Live 2011 (as super user) as per quick install guide. I also have run the command sudo texhash. I use Texworks to make PDFs. But I get error when trying to load most basic font packages, like helvet or times. I use this command in the pre-amble of the tex document:               \usepackage[T1]{fontenc}     \usepackage{times}      or any other name for font, like helvet or cmbright. I get the error that the sty package cannot be loaded:               This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)     entering extended mode     (./letterToPresident.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, loaded.     (/usr/share/texmf-texlive/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf-texlive/tex/latex/base/size11.clo))     (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty     (/usr/share/texmf-texlive/tex/latex/base/t1enc.def))          ! LaTeX Error: File `cmbright.sty' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: sty)      Is there any way to get a list of font packages THAT CAN BE LOADED using `\usepackage` command?


title: Installation of pythontex

text: I am trying to install `pythontex` on Ubuntu 13.04. but cant find the way how. Downloaded ZIP from http://www.ctan.org/pkg/pythontex. Tried to follow instructions but unfortunately something went wrong. Is there any simpler way to do it? If not, can you please help me by writing instructions step by step? RE-EDITED: After installing pythontex when I try to compile e.g.               \documentclass[10pt,a4paper]{article}       \usepackage[utf8]{inputenc}       \usepackage{amsmath}       \usepackage{amsfonts}       \usepackage{amssymb}       \usepackage{pythontex}       \listfiles            \begin{document}          \begin{pycode}       def fib(n):              a, b = 0, 1       for i in range(n):       a, b = b, a + b       return a       \end{pycode}            \end{document}        I get error:               ! LaTeX Error: Environment pycode undefined.       ! You can't use `macro parameter character #' in horizontal mode.       ! LaTeX Error: \begin{document} ended by \end{pycode}.        _File List_   article.cls 2007/10/19 v1.4h Standard LaTeX document class   size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)   inputenc.sty 2008/03/30 v1.1d Input encoding file   utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc   t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc   ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc   omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc   amsmath.sty 2000/07/18 v2.13 AMS math features   amstext.sty 2000/06/29 v2.01   amsgen.sty 1999/11/30 v2.0   amsbsy.sty 1999/11/29 v1.2d   amsopn.sty 1999/12/14 v2.01 operator names   amsfonts.sty 2009/06/22 v3.00 Basic AMSFonts support   amssymb.sty 2009/06/22 v3.00   pythontex.sty * * *


title: TeXworks bug - hidden parts of tex code

text: I use TeXworks 0.4.5 on Windows 8 and I've noticed quite an unpleasant bug. When having a rather long document (~2000 lines), some parts of the source code are not visible. Yet, they are typeset in the generated pdf. Googling for a while took me here and here. I tried everything recommended on both of these links, such as disabling babel package, turning syntax coloring off, etc. Nothing didn't help. Full document's ctrl+a -> ctrl+c -> ctrl+v didn't help either. When I create a copy of .tex file and open the copy, problem's gone (for that particular passage I'm looking at). However, I can not be sure about the rest of the document. Have you ever heard of something similar? **EDIT** : Getting line numbers on (Format -> Line numbers) seems to make invisible parts visible once again. Still, it shouldn't be necessary... (I actually find line numbers distracting, so it's not a much of solution for me.)


title: Russian in TeXShop

text: Can someone please help me type with my russian keyboard in TeXShop. I use the following code but get ???? as an output for the Cyrillic text every time.               \documentclass{article}          \usepackage[T2A]{fontenc}     \usepackage[utf-8]{inputenc}     \usepackage[russian,english]{babel}          \begin{document}     \selectlanguage{russian}     сдщвв     \end{document}      I have no idea what im doing wrong. Like I said, i keep getting question marks as the output. I use the mac russian keyboard.


title: Chemmacros: Font of coupling constant J

text: This is a follow-up question on a question I asked a few days ago (Chemmacros: Adjusting the properties of the coupling constant J) I am using the fonts `libertine` and `beramono` together with the `chammacros` package to typeset experimental data. When I do so, there are two things I have noticed: The coupling constant _J_ is displayed in the math font of latin modern roman. This also applies to the frequency - both value and unit. I believe this is because the coupling constant is typeset in a math environment? Is there a way to change this? Obviously, one suggestion would be to change the math font, e.g. to `euler vm` font. However, this font uses upright letters, and I would like to follow the convention and have an italic coupling constant _J_. Any suggestions how to overcome this issue? I suppose the easiest way would be to redefine J in eulervm fonts to be italic, because everything else would be fine automatically, however, I don't know how to do that. Of course a more general solution would be appreciated. Am I right in assuming this will be not possible with the standard options of the package? Here is a MWE, illustrating my problem:                    \documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}          \usepackage{chemmacros}          \usepackage{siunitx}          \chemsetup[nmr]{delta=(ppm),pos-number=side,use-equal,format = \bfseries,list=true}                 \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}          \usepackage[T1]{fontenc}          \usepackage[utf8]{inputenc}          \usepackage{libertine}          \usepackage[scaled=.83]{beramono}          \ExplSyntaxOn  %Defining Coupling Constant J with Subscript          \cs_set_protected:Npn \__chemmacros_nmr_coupling:w (#1;#2)           {           \tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl { #1 \! }           \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl           {           \c_math_subscript_token            { \chemmacros_chemformula:n { #2 } }           }           \__chemmacros_nmr_coupling_aux_i:w           }           \ExplSyntaxOff                \begin{document}                \begin{experimental}                \NMR(400)[C6D6] \val{2.01} (d, \J(2;CH)[Hz]{25.0}, \#{24},  \pos{5})                \end{experimental}                     \end{document}


title: Creating a table within a longtable

text: I have created a longtable by using information from the question asked here. Now I want to create a table with two columns with 3 rows each within the right part of this long table. A pictorial representation is here. I tried to do use itemize but it fails to compile. Is there a way to do it?


title: align nested in cases

text: ### Code               \documentclass[a4paper,twoside,12pt]{book}     \usepackage{amstext}     \usepackage[utf8]{inputenc}     \usepackage{cases}     \usepackage{amsmath}          \begin{document}     \begin{subnumcases}{}\label{eq:regola_scelta_reject}         \begin{aligned}         objective   &: \qquad \min \quad \sum_{j=1}^{H}x_jw_j\\         subject to  &: \qquad \displaystyle\sum_{j=1}^{H}x_jw_j \geq W_L\\         \end{aligned} \label{eq:regola_scelta_reject_1}\\         \begin{aligned}         objective   &: \qquad \min \quad \sum_{j=1}^{H}x_jw_j \vee H_{e} \geq 2 \\           subject to  &: \qquad \displaystyle\sum_{j=1}^{H}x_jw_j < W_L\\         \end{aligned} \label{eq:regola_scelta_reject_2}\\     \end{subnumcases}     \end{document}      What I'm doing wrong? This is what I'm trying to acheive: ![Example](http://i.stack.imgur.com/ltect.png)


title: How to add decorations to tikz-qtree branches (for example, create AND-branches and OR-branches)?

text: Suppose I want to show the expression               a IF b OR c     b IF d AND e     c IF f OR g      as a tree, using `tikz-qtree`. I'd want to do something like this:               \documentclass{article}          \usepackage{tikz-qtree}          \begin{document}          \begin{tikzpicture}[grow'=right]     \tikzset{level distance=2cm}     \tikzset{sibling distance=1cm}     \tikzset{every tree node/.style={anchor=base west}}     \Tree[.a              [.b                  [.d ]                  [.e ] ]              [.c                  [.f ]                  [.g ] ] ]     \end{tikzpicture}          \end{document}      The above code generates the following tree: ![The resulting tree](http://i.stack.imgur.com/kAyWb.png) However, I'd like to include some decoration in the branches, showing that the first one (from a to b and c) is an "OR" branch, and that the others are one AND branch (from b) and one OR branch (from c). Something like a arc with a label, for example. I didn't find a way to do this in the tikz-qtree documentation.


title: \bibliographystyle{plain} and \citet

text: I want to use `\citet` since it is convenient (I do not type the author's name myself). But I found the conference ask to use `\bibliographystyle{plain}` and this conference likes to number the references. So I have to make a citation, say `\cite`               \cite{a}      = someone et al. [1]. Actually, I use `\bibliographystyle{achemso}`. And it produce what I want. But the reference do not have the name of the paper. E.g. > [2]Esser, E.; Zhang, X.; Chan, T. F. SIAM J. Img. Sci. 2010, 3, 1015–1046. With the comment of Mico, I solve this problem. But still several titles are missing. E.g.                @INPROCEEDINGS{conf/nips/SmolaVL07,       author = {Smola, Alex J. and Vishwanathan, S. V. N. and Le, Quoc V.},       title = {Bundle Methods for Machine Learning.},       booktitle = {NIPS},       year = {2007},       editor = {Platt, John C. and Koller, Daphne and Singer, Yoram and Roweis, Sam         T.},       publisher = {MIT Press},       added-at = {2011-11-24T00:51:13.000+0100},       biburl = {http://www.bibsonomy.org/bibtex/2d05d5e55475c03831974396e2c0d88bf/wkotl},       crossref = {conf/nips/2007},       description = {dblp},       ee = {http://books.nips.cc/papers/files/nips20/NIPS2007_0470.pdf},       interhash = {bc8df8615544df575dc9d183ba73b809},       intrahash = {d05d5e55475c03831974396e2c0d88bf},       keywords = {TO-READ optimization},       timestamp = {2011-11-24T00:51:13.000+0100},       url = {http://dblp.uni-trier.de/db/conf/nips/nips2007.html#SmolaVL07}     }      This shows like > [16] Smola, A. J., Vishwanathan, S. V. N., & Le, Q. V. 2007, in NIPS, ed. J. > C. Platt, D. Koller, 221 222 Y. Singer, & S. T. Roweis (MIT Press) I use answer to write a little sample. But it does solve the problem of citation.               \documentclass[review]{OAGM}     %% For the accepted, final version, set this to the correct value:     %%\OAGMarXiv{0000.0000}          \usepackage{setspace}      \usepackage{ulem}      \usepackage{float} % fix the table     \usepackage{bold-extra}     \usepackage{amsmath,bm}     \usepackage[margin=1in]{geometry}      \usepackage{color}     \usepackage{amsmath,amsopn}     \usepackage{bbm}     \usepackage{import}     \usepackage{hyperref}      \usepackage[Sonny]{fncychap}     \usepackage{mathrsfs}     \usepackage{tikz,pgfplots}     \usepackage{listings}     \usepackage{fancyhdr}     \usepackage{color}     %\usepackage{breqn}      \usepackage{caption}     \usepackage{subcaption}     \usepackage{epstopdf}     \usepackage[titletoc,toc,title]{appendix}     \usepackage{mathtools}      \usepackage{tabularx}     \usepackage{booktabs}          \usepackage{graphics}     \usepackage{amsfonts}     \usepackage[bottom]{footmisc}     \usepackage{achemso}      \setkeys{acs}{articletitle}     \begin{filecontents*}{\klkl.bib}     % This file was created with JabRef 2.9.2.     % Encoding: UTF8          @INPROCEEDINGS{conf/icml/AvronKKS12,       author = {Avron, Haim and Kale, Satyen and Kasiviswanathan, Shiva Prasad and         Sindhwani, Vikas},       title = {Efficient and Practical Stochastic Subgradient Descent for Nuclear         Norm Regularization.},       booktitle = {ICML},       year = {2012},       publisher = {icml.cc / Omnipress},       added-at = {2013-01-25T00:00:00.000+0100},       biburl = {http://www.bibsonomy.org/bibtex/2b9ed7719ec246e3629d4b41b5515c7f9/dblp},       crossref = {conf/icml/2012},       ee = {http://icml.cc/discuss/2012/617.html},       interhash = {afa43f2081a8e76fd4ceeca426a7dc66},       intrahash = {b9ed7719ec246e3629d4b41b5515c7f9},       keywords = {dblp},       timestamp = {2013-01-25T00:00:00.000+0100},       url = {http://dblp.uni-trier.de/db/conf/icml/icml2012.html#AvronKKS12}     }               \end{filecontents*}                                   %\newcommand{\eq}[1]{\hyperref[#1]{Equation \eqref{#1}}}     \let\originaleqref=\eqref     \renewcommand{\eqref}{Equation~\originaleqref}          \newcommand{\dataset}{{\cal D}}     \newcommand{\fracpartial}[2]{\frac{\partial #1}{\partial  #2}}     \DeclareMathOperator*{\newarg}{arg}      \newcommand{\abs}[1]{\left\lvert #1 \right\rvert}                  % for absolute value     \newcommand{\avg}[1]{\left\langle #1 \right\rangle}           % for average     \newcommand{\norm}[1]{\left\lVert #1 \right\rVert}            % for norm     \newcommand{\bra}[1]{\left\{ #1 \right\}}            % for {}     \newcommand{\sbra}[1]{\left[ #1 \right]}            % for []     \newcommand{\lbra}[1]{\left( #1 \right)}            % for ()     \newcommand{\reffig}[1]{Figure \ref{#1}}     \renewcommand{\d}[2]{\dfrac{\mathrm{d} #1}{\mathrm{d} #2}}       % for derivatives     \newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}            % for partial derivatives     \let\underdot=\d                             % rename builtin command \d{} to \underdot{}     \title{Margin?}                    \begin{document}     \maketitle          \begin{abstract}     Today is 3/14/2014.      \end{abstract}     \newpage     Here is a new page\cite{conf/icml/AvronKKS12}.     \bibliography{\klkl}          \end{document}


title: unknown error in table

text: In the code for a table below, there is an error indicated by the red marker in the line starting with "Not protest" after compilation, although the output seems pretty much okay. Can you pinpoint the mistake please?               \documentclass{article}     %\usepackage{showframe}% http://ctan.org/pkg/showframe     \usepackage{booktabs}% http://ctan.org/pkg/booktabs     \usepackage{array}% http://ctan.org/pkg/array     \usepackage{tabularx}% http://ctan.org/pkg/tabularx     \usepackage{booktabs}% http://ctan.org/pkg/booktabs     \usepackage{array}% http://ctan.org/pkg/array     \usepackage{tabularx}% http://ctan.org/pkg/tabularx     \usepackage{calc}     \usepackage{tabu}     \begin{document}          \begin{table}[h]          \centering          \begin{tabular}{|c|c|c|}          \hline      & $N^{e}$ \textless $K_i$ & $N^{e} \geq T_i$\\     \hline      Not protest & $ -\Delta U $ & $(1-\gamma) \cdot \Delta U}$ \\     \hline     Protest & $-(k/N^{e})-\Delta$ U& $\Delta U - (k/N^{e})$\\     \hline          \end{tabular}          \caption{Payoff matrix}          \end{table}          \end{document}


title: Change font size relative to current font size

text: For some small macros I'm writing I would need to change the font size relative to the font size of the text that surrounds to macro later on. I only know how to change the font size for the whole document (documentclass/fontspec), or for some text, but only relative to the default font size for the document (`\Large`, `\small)`. What I was thinking of was something like:               \newcommand*\mycommand{\smaller ipsum}     \Large lorem \mycommand     \small lorem \mycommand      If I use `\Large`, `\small` etc in the command itself, it will not care about the font size of the surrounding text but set the font size relative to the default font size. I would want it to be e.g. 1.2 times smaller than `\Large` or `\small`, depending on where it is used.


title: How to avoid unbreakable \pmb boxes when typesetting math?

text: I have a big problem called as a river problem. I'm using the `report` class defined as:               \documentclass[11pt,notitlepage,a4paper,oneside]{report}     \usepackage[english]{babel}     \usepackage[cp1250]{inputenc}     \usepackage{graphicx,amsmath,amsthm,amssymb,a4wide,eucal,exscale,china2e,varioref,acronym}     \usepackage[left=3.5cm,top=2cm,right=2cm,bottom=2cm]{geometry}     \usepackage{fancyhdr}     \newtheorem{definition}{Definition}[chapter]     \hyphenpenalty=10000     \sloppy     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\chaptermark}[1]{\markright{\thechapter\ #1}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhf{} \fancyhead[LO]{\bfseries\nouppercase\rightmark}     \fancyhead[RE]{\bfseries\nouppercase\leftmark}     \fancyhead[RO]{\bfseries\nouppercase\thepage}     \renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \setlength{\headsep}{0.2in}     \addtolength{\headheight}{0.5pt}     \fancypagestyle{plain}     { \fancyhead{}     \renewcommand{\headrulewidth}{0pt}     }          \begin{document}          \begin{definition}     Let $(\Omega,\mathcal{F},\mathsf{F},\mathsf{P})$ be a stochastic     basis. A vector process $\mathbf{W}=(\mathbf{W}_{t},\;t\ge     0)=(W^{1}_{t},W^{2}_{t},\ldots,W^{n}_{t})_{t\ge 0}$ is called an     \pmb{n-dimensional $(\mathcal{F}_{t})$-Wiener process with     covariance matrix $Q$} if it has the following properties:     \begin{itemize}     \item[$\widetilde{(W1)}$] $\mathbf{W}_{t}-\mathbf{W}_{s}$ is     independent of $\mathcal{F}_{s}$ for all $0\le s<t$.     \item[$\widetilde{(W2)}$]     $\mathcal{L}(\mathbf{W}_{t}-\mathbf{W}_{s})=     N(\mathbf{0},(t-s)\mathbf{Q})$ \item[$\widetilde{(W3)}$]     $\mathbf{W}$ has $\mathsf{P}$-a.s. continuous trajectories.     \item[$\widetilde{(W4)}$] $\mathbf{W}_{t}$ is an     $(\mathcal{F}_{t})$-adapted process for every $t\ge 0$.     \end{itemize}     \end{definition}               \end{document}      In some cases the output is really ugly. Is it possible to get rid of "rivers" without deleting the command sloppy, which I need to keep in the document?


title: Is there a way to determine if there is a float on a page?

text: I am busy developing some code to draw layouts. Part of the code overlays the layout as shown in the images below: ![enter image description here](http://i.stack.imgur.com/6nog8.jpg)![enter image description here](http://i.stack.imgur.com/nF0DK.jpg) The black arrows to the side of the images, denote the `\topfraction` and `\bottomfraction`, parameters. It will be nice to only show them, if a float exists in that position. Is it possible to detect a float and its position? (Aim of the package, is to show in one glance all the geometry parameters and also draw a grid, see the thin light teal lines).


title: Best way to make family photo album in LaTeX

text: I use LaTeX for my research publishing and would like to make a Christmas photo album that I could send to a print shop. It occurred to me to try it with LaTeX this time (yes I know, the print version won't get delivered by Christmas). Among other reasons, it will look like I'm working on code! But I would benefit from some templates etc. and haven't had luck finding any. Can anyone recommend resources for building a family photo album in LaTeX?


title: Highlight elements in the matrix (continued)

text: Using @Stefan Kottwitz's solution of Highlight elements in the matrix, is it possible to select one single entry in the matrix? Where does one need to place the left and the right marks?


title: Does TikZ support interactive animation?

text: I am plotting a function `y = a*x^2` with a is variable constant. I would like to control a interactively but I google and seems that TikZ doesn't support interactive operation. Also, I want to know if there is any way to draw some points within the function and moving randomly?


title: Automatically place right angle indicator on normal vector

text: I'm trying to draw a normal vector on a curve, and use the usual "dot in an arc" symbol to indicate that. Here is what I have so far, which looks alright, but needed manual adjustment of angles and distances, and I was wondering if one can automatically place these.               \documentclass{scrartcl}          \usepackage{tikz}          \usetikzlibrary{positioning,arrows}          \begin{document}     \begin{tikzpicture}         \pgfmathsetmacro\rightAngleRadius{0.2}         \coordinate (start) at (0,0);         \coordinate (end) at (2,0);              \draw (start) .. controls (0.6,0.7) and (1.3,0.2) .. (end)           node[sloped,inner sep=0cm,above,pos=.5,anchor=south west,           minimum height=12](N){};              \path (N.south west) edge[-stealth'] node[above left]              {$\vec{n}$} (N.north west);         \draw (N.south west) ++ (\rightAngleRadius,-1pt)              arc (-20:80:\rightAngleRadius);         \node[above right=-3pt] at (N.south west) {.};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/31W8E.png)


title: pgfplots - Number above one of the bars in the bar chart

text: I want to put a number above only one of the bars in the bar chart. For example, above the bar A, I want to put a number say 200. Other bars will not have any number at the top. This is my code.               \begin{tikzpicture}     \begin{axis}[     ybar,     enlargelimits=0.15,     legend style={at={(0.5,-0.2)},     anchor=north,legend columns=-1},     title={Data=30\%},     ylabel={Values},     grid=major,     symbolic x coords={A,B,C,D},     xtick=data,     ytick={6600,6650,6700,6750,6800,6850,6900,6950},     ylabel style={font=\Large},     % nodes near coords,     % nodes near coords align={vertical},     x tick label style={rotate=45,anchor=east},     ]     \addplot [MyLineStyle,draw=black,error bars/.cd,y dir=both,y explicit,error bar style={line width=1pt}] coordinates     {     (A,6898.965904)+-(20,20)     (B,6801.9847)+-(20,20)     (C,6734.0923)+-(10,10)     (D,6698.2353)+-(10,10)     };     \end{axis}     \end{tikzpicture}      I want to place a number 200 just above the bar A and leave B, C, D as they are.


title: nomenclature page formatting

text: I have a list of symbols generated throught the `nomencl` package. It works fine. The only problem I have is:   1. How can I redefine the margins for the page? by default it is using the margins for chapter. I want to set smaller margin on top for this page.   2. Is it possible to generate nomenclature without a page break, like it starts where the previous text ends?


title: \newcommand with adjustable size

text: I'm soon going to take Live-notes of a course where Tensors are commonly used. Tensors consist of a Letter, say T, with numerous sub-and superscripts. Generally, a tensor could look like               T^{i_{1},i{2},i{3}}_ {j_{1},j_{2},j_{3}}       I would like to know if it is possible to create a `\newcommand` with 4 parameters,               \Tensor{T}{i}{j}{3}      Which sets the Tensor letter, the name of the super and subscript, and specifically the number of sub-and superscripts. I don't know whether this is possible.


title: \nearrow and \swarrow together

text: I'm trying to get an arrow that has an arrow head pointing north east and south west, so like `\updownarrow` but rotated. I can't seem to find this in LaTeX at all. It has to go inside an `equation` environment. Any ideas?


title: LyX new macros and instant preview

text: When we define new macros in LyX, can we still have instant preview for them? For example, I defined a new command `\abc`, but when I put `\abc` in the math inset, it does not have instant preview. Though if I compile to a DVI, it's there in DVI. Thank you.


title: How to expand a plot in a matrix over 2 or more matrix elements?

text: I use a matrix to arrange and align plots in a groupplot (as discussed here) and I want to create a groupplot with one subplot which have the size of for example two subplots as shown below. ![enter image description here](http://i.stack.imgur.com/UJp5o.png) I wrote the following LaTeX code and I am looking for an option that allows me to expand a figure over two matrix elements.               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \matrix[row sep=0.01\textwidth, column sep=0.01\textwidth] {          \begin{axis}[xtick=\empty,height=2cm,width=0.245\textwidth, scale only axis]     \addplot {rnd};     \end{axis}     \pgfresetboundingbox     \path     (current axis.south west)     rectangle (current axis.north east);     &          \\     \begin{axis}[height=2cm,width=0.245\textwidth,scale only axis]     \addplot {rnd};     \end{axis}     \pgfresetboundingbox     \path     (current axis.south west)     rectangle (current axis.north east);     &     \begin{axis}[yticklabel pos=right,height=4cm+0.01\textwidth,width=0.245\textwidth, scale only axis]     \addplot {rnd};     \end{axis}     \pgfresetboundingbox     \path     (current axis.south west)     rectangle (current axis.north east);          \\     };     \end{tikzpicture}          \end{document}      ![](http://i.stack.imgur.com/CDnip.png)


title: Correct use of \paragraph titles?

text: How should I use `\paragraph`? I mean, If I want to put "Characteristics", should I put `\paragraph{Characteristics}` or `\paragraph{Characteristics:}`. Or is it up to me which one to use?


title: Align the word input of algorithm2e with a tabularx table

text: I'm referring to this post. I like the idea from 'a different ben' of the tabularx table inside the `\Input` command. But I would like to have the word `Input:` at the top, on the same line as the first row of the table. The suggested `\newline` in the linked post doesn't work for me. MWE:               \documentclass{scrbook}     \usepackage{tabularx}     \usepackage[ruled,longend,german,algochapter]{algorithm2e}     \usepackage{lipsum}               \begin{document}       \begin{algorithm}[tbp]         \SetKwInOut{Input}{Input}         \SetKwInOut{Output}{Output}         \LinesNumbered         \caption[Description]{Description}     \Input{\begin{tabularx}{\textwidth}{p{.03\textwidth}p{.03\textwidth}X}                         $a$ &   -- &    Desc1   \\                         $b$ &   -- &    Desc2   \\                         $c$ &   -- &    Desc3                \end{tabularx}           }       \end{algorithm}     \end{document}


title: Determine height of the line you are in

text: Is there a way in PDFLaTeX to determine the height of the line you are in? Maybe something similar to PDFsavepos. In a normal line (i.e. no heading etc.), you might approximate the height by a fixed multiple of ex. But is there a better way?


title: TikZ + scalebox: Vertical text spacing in node

text: As this issue: TikZ: Text becomes invisible in large PDF could not yet be solved, my constantly growing PDF needs to become even smaller to stay out of _invisibility range_. As a consequence, `\tiny` is now far too large. After managing to remove various problems with line breaks in scale boxes, the result looks like this: ![Various font sizes and spacings](http://i.stack.imgur.com/SLo9Z.png)               \documentclass[border=0pt]{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node[draw, fill=yellow!20, rectangle, align=left, inner sep=0.5ex, font=\sffamily] at (0,0)     { Abc \\ Def \\ Ghi };          \node[draw, fill=yellow!20, rectangle, align=left, inner sep=0.5ex, font=\sffamily] at (1,0)     { \tiny{Abc} \\ \tiny{Def} \\ \tiny{Ghi} };          \node[draw, fill=yellow!20, rectangle, align=left, inner sep=0.5ex, font=\sffamily] at (2,0)     { \scalebox{0.2}{Abc} \\ \scalebox{0.2}{Def} \\ \scalebox{0.2}{Ghi} };          \node[draw, fill=yellow!20, rectangle, align=left, inner sep=0.5ex, font=\sffamily] at (3,0)     { \scalebox{0.2}{Abc} \\ \vspace{-0.2cm}\scalebox{0.2}{Def} \\ \scalebox{0.2}{Ghi} };          \node[draw, fill=yellow!20, rectangle, align=left, inner sep=0.5ex, font=\sffamily] at (4,0)     { \scalebox{0.2}{Abc} \\ \vspace{-0.2cm}\scalebox{0.2}{Def} \\ \vspace{-0.2cm}\scalebox{0.2}{Ghi} };          \end{tikzpicture}     \end{document}      The goal of the project would be to display nodes containing an image and some text lines below. Right now, the spacing between the image and the text and between each of the text lines is the issue. The first node has nothing to complain about. In the second node, the line spacing is already fairly large, even worse in the third node. In the fourth one, I tried to reduce the spacing by adding a negative vspace between Abc and Def: The result is not what I aimed at, even more so in the last node, where the text even leaves the node. In other experiments, the lower lines sometimes manage to go **above** the first line. I assume the error comes from the scalebox that leaves the original y-spacing of the text unmodified, but attempts to change that failed. Is there any way to resolve this weird spacing issue, and why does the vspace behave so unexpectedly here? PS: Is there an easier way for displaying TeX output than snapshotting Adobe Reader?


title: Is it possible to get the current item number and perform arithmetic on it in enumerate environment?

text: That is, suppose that I am at item `n` and I want to make a reference to item `n - 3` without explicitly specifying it.


title: toc- sections and subsections printing out of order

text: I have a large presentation for a series of lectures - I have split it up into separate lecture files which I have then included in the main document e.g.               \section{ Algebra  }          \include{Lect1_Binomial_Expansion}          \include{Lect2_Quadratic_Factorisation}          \include{Lect3_Polynomial_Division}          \include{Lect4_Indices}          \include{Lect5_Logarithms}          \section{Functions}          \include{Lect6_Function_Notation}      I am not looking to include any numbering etc but what I find is that the subsections in Lect1 appear in the toc before the actual subheading (there are three subsections in the first lecture). This happens later on too. Any ideas why they are out of order? Sorry I am very new to Beamer - this is only my first week using it.


title: ctable and siunitx: Last column does not center correctly (possible incompatibility?)

text: I would like to use `ctable` in my thesis for tables and graphics and I also would like to use `siunitx` for formatting numbers and aligning numbers on the decimal marker in tables. Everything seemed to work well until I discovered some strange behaviour in the last column. The heading does not get centered there (I tried the different settings for `siunitx`: table-alignment, table-text-alignment, in the preamble and for the specific column). It did not help. ctable version is rev 26694, v 1.23; siunitx is rev 29017, v 2.5p This is my minimal example:               \documentclass[english]{book}     \usepackage[utf8]{inputenc}     \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{ctable}     \usepackage{siunitx}     \begin{document}          % Does not center the heading in the last column.     \ctable[]{       |l       |S       |S       |S|     }{}{       \FL       &         {Tom} &     {Suzy} &    {Rob} \ML       Eating &      122.5 &     1.025 &     1.5 \NN       Sleeping &    9.1 &       1346.5 &    213.7 \NN       Working &     7.5 &       9.5 &       2.0125 \NN       Watching TV & 5.25 &      117.5 &     7.5 \LL}          % Works fine with simple tabular     \begin{tabular}{       |l       |S       |S       |S|       }       \hline       &         {Tom} &     {Suzy} &    {Rob} \\ \hline       Eating &      122.5 &     1.025 &     1.5 \\       Sleeping &    9.1 &       1346.5 &    213.7 \\       Working &     7.5 &       9.5 &       2.0125 \\       Watching TV & 5.25 &      117.5 &     7.5 \\ \hline     \end{tabular}          \end{document}      This is how it looks to me: ![ctable and tabular](http://i.stack.imgur.com/l5qoJ.jpg)


title: SublimeText2 -- plugin / keymap for cleanup ('latexmk -c')

text: The original question (which has since been edited numerous times) was the beginning of my ongoing quest to deal with the LaTeX auxiliary files using TexLive (MacTeX) on OSX (Snow Leopard and Mountain Lion) with Sublime Text 2. Jan Hlavacek was kind enough to provide a Bash script-based solution: Possible to have a shell script containing the whole LaTeX document? I have since written my own plugin with the assistance John Collins, Ph.D. (author of latexmk.pl), who gave me a Bash command line example `latexmk file.tex && latexmk -c file.tex`; and, with the assistance of Xymostech, who helped me convert the `&&` into Python format. Because this is an ongoing journey, there are bits and pieces of the solution in various threads throughout the internet. The best way to keep track of everything appears to be with a `github` account, which allows me to update the code as my knowledge grows: Here is my own plugin: https://github.com/lawlist/ST2-plugin-latexmk-save-build-clean Here is my unofficial modification of the LaTexTools plugin: https://github.com/lawlist/LaTexTools-Unofficial-Modification


title: Examples enumerated in the margins

text: I am writing a paper about phonetics that contains lots of examples, usually organised in tables. What I would like is to have these examples enumerated in the margins. Specifically, I need an environment called `example`, so that whatever I write               \begin{example}         some examples     \end{example}      LaTeX prints this text along with a margin note saying, e.g., "Example 2.7". It is supposed to work a bit like in this book. I did try with the following code:               \newenvironment{example}     {         \marginpar{\begin{center}Examples\\ \refstepcounter{examples}\theexamples\end{center}}         \medskip\begin{center}     }     {         \end{center}\medskip     }      but the numbers are not always aligned correctly with the examples in the margins. Any good ideas about how to make this? :-) UPDATE: On request from cmhughes, I now add my entire preamble so that he may see the problem. :-)               \documentclass[a4paper]{memoir}          %Memoir settings     \setlrmarginsandblock{*}{3.5cm}{0.75}     \setulmarginsandblock{3cm}{*}{1.2}     \checkandfixthelayout[nearest]          \usepackage{amsmath,amssymb,geometry,graphicx,amstext,enumerate,multirow,color,multicol,comment,xcolor}     \usepackage[hidelinks]{hyperref}     \usepackage{cleveref}     \usepackage[ansinew]{inputenc}     \usepackage{wasysym}     \usepackage{tipa,vowel,textcomp}               \chapterstyle{veelo}     \pagestyle{headings}          \usepackage[amsmath]{ntheorem}      % for theorem-like environments          % margin theorem     \makeatletter     \newtheoremstyle{mymargin}%     {\item[\theorem@headerfont \llap{##1 ##2}]}%     {\item[\theorem@headerfont \llap{##1 ##2}| ##3\theorem@separator\hskip\labelsep]}%     \makeatother          % my example     \theoremstyle{mymargin}     \theorembodyfont{}      % customize these to suit your tastes     \theoremsymbol{}     \theoremprework{}     \theorempostwork{}     \theoremseparator{}     \newtheorem{example}{example}     \numberwithin{example}{section}     %\usepackage{subcaption}          \begin{document}      However, using this preamble resulted in the example enumeration looking like this: ![enter image description here](http://i.stack.imgur.com/vpXV2.png) See, the number appears to the _right_ of the margin. Do you have an idea what the problem may be? :-)


title: two styles in biblatex with textcite, author (year) and (author, year)

text: I am using `biblatex` with the following commands, which produce Author (year) type citation using `\textcite{}` command. However, I have some places where I need (Author, year) type citation. How can I do this? Thanks.               \documentclass{article}     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=authoryear,maxcitenames=2]{biblatex}          %This part is for citation style textcite     \DeclareCiteCommand{\textcite}       {\boolfalse{cbx:parens}}       {\usebibmacro{citeindex}%        \ifboolexpr{ ( not test {\iffieldundef{prenote}} and                       test {\ifnumequal{\value{citecount}}{1}} ) or                     ( not test {\iffieldundef{postnote}} and                       test {\ifnumequal{\value{citecount}}{\value{citetotal}}} ) }          {\usebibmacro{textcite}}          {\printtext[bibhyperref]{% Apply citation link to bibmacro output             \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks             \usebibmacro{textcite}%             \ifbool{cbx:parens}{\bibcloseparen\global\boolfalse{cbx:parens}}{}}}}       {\ifbool{cbx:parens}{\bibcloseparen\global\boolfalse{cbx:parens}}{}%        \multicitedelim}       {\usebibmacro{textcite:postnote}}


title: No %.aux file in a particular directory

text: I have the following line in my `report.tex`               \include{intro/introduction}     \include{prlm/preliminary}     \include{svy/survey}      and the corresponding directory structure. The directory structure is relative to the directory in which `report.tex` lies is:               /intro/introduction.tex     /prlm/preliminary.tex     /svy/survey.tex      The first two (introduction and preliminary) were already there and I just added `survey.tex` file to my report. Now Latex would repeatedly complain that `No file svy/survey.aux.`. I know it is not there as latex has not parsed the corresponding tex file. I do not know how to eliminate this.


title: How do I define tikz styles with a xkeyval command?

text: I would like to write a command which allows the user to change tikz styles. My code goes like this:               \documentclass{article}     \usepackage{tikz,xkeyval}          \makeatletter     \def\DEFstyle{}     \define@key{styles}{styleA}{\def\DEFstyle{#1}}     \newcommand{\setstyles}[1]{%       \setkeys{styles}{styleA={}}        \setkeys{styles}{#1}       \tikzstyle{TIKZSTYLE}=[\DEFstyle]     }     \makeatother          \begin{document}     \setstyles{styleA={top color=green,bottom color=red}}     \end{document}      However, I always get an error message: > ! Package pgfkeys Error: I do not know the key '/tikz/top color=green,bottom > color=red' and I am going to ignore it. Perhaps you misspelled it. But the content of `\DEFstyle` is definitely `top color=green,bottom color=red` and when I directly write `\tikzstyle{TIKZSTYLE}=[top color=green,bottom color=red]` then everything works fine. Where does the bug hide?


title: how to get the size of a \pgfdeclareimage

text: Basically I want to use a TikZ node to frame a pgfimage, so later on, I will add more and connect them as I see fit. I have this:               \pgfdeclareimage[width=10em]{image1}{images/image1}     \begin{tikzpicture}       \node (MM) [rectangle,draw,thick,minimum width=10.15em,label=below:Description]{\pgfbox[center,center]{\pgfuseimage{image1}}};     \end{tikzpicture}      So now I need to get the height of image1 to add minimum height property in the node declaration. This way I can get a dynamic framing independent of the aspect ratio of the image. Maybe it's an easy task but I'm newbie to this and can't seem to find the information I need in the documentation.


title: Error using \ref in captions with Tufte and Babel

text: I am using the tufte-book class. When referencing with \ref within a caption using the babel package I get two errors: "Argument of \@iiminipage has an extra }." and "Paragraph ended before \@iiminipage was complete." The error does not occur when using \autoref instead of \ref or when deactivating babel. Code example:               \documentclass[a4paper,twoside,justified,symmetric,notoc]{tufte-book}      \usepackage[utf8]{inputenc}     \usepackage[ngerman,english]{babel}     \usepackage{graphicx}          \begin{document}          \begin{marginfigure}     \includegraphics{fig1}     \caption{xxx}     \label{fig:one}     \end{marginfigure}          \begin{figure*}[t]     \includegraphics{fig2}     \caption{Figure \ref{fig:one}...}     \label{fig:two}     \end{figure*}          \end{document}      How can I resolve this issue?


title: Error in previewing documents in latex

text: I am using Texstudio, however when I press preview, I am getting an error saying `Failed to find file C:\Users\Divy\AppDat` Any idea what is the reason for this error?


title: How to make a table with variable rows

text: This is my code extracted from a custom class file.               \makeatletter     \let\@tmemi\@empty\let\@tmemii\@empty     \def\tmemi#1{\gdef\@tmemi{#1}}                        \def\tmemii#1{\gdef\@tmemii{#1}}          \newcommand{\tablex}{%     \begin{tabular}{r@{ : }ll}     Paticipant         & John Doe  &   Mr.      \\[1ex]     Consultant         & A. Prof   &   PhD      \\[1ex]     \ifx\@tmemi\empty  &           &     \else Team         & \@tmemi   & Manager\fi \\[1ex]      \ifx\@tmemii\empty &           &     \else              & \@tmemii  & Oganizer\fi     \end{tabular}     }     \makeatother          % Case 1     \tmemi{B. Member}     \tmemii{C. Member}     \tablex          % Case 2     \tmemi{}     \tmemii{}     \tablex      and my result and question are shown in the image below (to simplify, I only show member parameters.) ![enter image description here](http://i.stack.imgur.com/R7GVm.jpg)


title: subfig and subfloat stopping doc compiling

text: I have a nice little tiled image sequence that relies on `\usepackage{subfig}` and `\usepackage[countmax]{subfloat}` being declared. Is it that `[countmax]` is trying to run against the whole doc and this is too much?               \documentclass[11pt,a4paper]{article}\usepackage{graphicx}\usepackage[english]{babel}\usepackage{caption}     \usepackage{subfig}\usepackage[countmax]{subfloat}     \begin{document}          \def \seq1width{0.325}          \begin{figure}[htbp]     \begin{center}$     \begin{array}{ccc}     \subfloat[]{\label{fig:image_1}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-0.jpeg}} &     \subfloat[]{\label{fig:image_2}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-1.jpeg}} &     \subfloat[]{\label{fig:image_3}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-3.jpeg}} \\     \subfloat[]{\label{fig:image_4}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-6.jpeg}} &     \subfloat[]{\label{fig:image_5}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-9.jpeg}} &     \subfloat[]{\label{fig:image_6}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-10.jpeg}} \\     \subfloat[]{\label{fig:image_7}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-12.jpeg}} &     \subfloat[]{\label{fig:image_8}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-13.jpeg}} &     \subfloat[]{\label{fig:image_9}\includegraphics[width=\seq1width\textwidth]{./pupbot_1-15.jpeg}}          \end{array}$     \rule{35em}{0.5pt}     \caption{\label{fig:chinese_dragon_pupbot_sequence_1} Chinese dragon puppet-robot cyclical motion sequence.}     \end{center}     \end{figure}          \end{document}      When I compile in a standalone doc (as you see the code above) it works fine but when I try to declare these packages (as you see in the code below) at the start of my `main.tex` and `\input{}` everything in the code between `\begin{figure}` and `\end{figure}` into the document I get this error: > ! Paragraph ended before \sf@setref was complete. \par l.46 I suspect you've > forgotten a `}', causing me to apply this control sequence to too much text.               \documentclass[11pt, a4paper, oneside]{Thesis}          \graphicspath{{./Pictures/}}          \usepackage[square, numbers, comma, sort&compress]{natbib}      \usepackage{graphicx}     \usepackage[english]{babel}     \usepackage{array}     \usepackage{mathtools}     \usepackage{float}     \usepackage{placeins}     \renewcommand{\lstlistingname}{Code}     \usepackage{subfig}     \usepackage[countmax]{subfloat}     \hypersetup{urlcolor=blue, colorlinks=true}      \title{\ttitle}          \begin{document}          \frontmatter     \setstretch{1.3}           %...etc


title: How to align short footnotes (centred) and longer footnotes (left) in one document

text: I am wondering whether there is some package/code that addresses the following three criteria:   * Shorter footnotes, e.g. Quine (1960, 22), would be sitting centred on the bottom of the page, if (and only if) there is only one footnote on the particular page.    * Once a longer footnote appears on a given page, i.e. one that has more than one line and thus runs by the 'usual' footnote margins, a shorter one, appearing on the same page, would 'adapt' and sit aligned to the 'usual' left margin as well.   * Additionally, in the case of two or even three short footnotes appearing on one page at the same time (either in absence or presence of a longer one), they would 'become' one paragraph. That is, the shorter footnotes would all be in one line but still be centred. I do not have any MWE here since my question is rather about whether this is possible at all. The handbook and all sources I am aware of do not discuss this issue (or I did not find it, in which case I apologise). I am reading a couple of recent Oxford University Press books right now, which do have exactly this footnote design, and I am curious if it can be achieved using TeX/LaTeX/XeTeX. I am aware of footmisc, manyfoot, and bigfoot but neither have an obvious statement in the documentation that would resolve the issue. I suppose that manyfoot, for instance, would help with the paragraph style issue, by introducing different levels, but then you have different counters, different ways to call footnotes, which is is complicated or at least non-ideal. I am looking for a more basic solution. Thank you so much for helping.