title: pdftooltip from pdfcomment package: Using LaTeX code in tooltip

text: I work as a Physics teacher and I am writing a "Problem-Solution-Book" with hyperlinks from problems to solutions and backreferencing -- all of it works pretty good. Now I wanted to introduce something like a "Hint" - text at the problem header which is used as a tooltip, indicating some hints for possible ways to the solution (apart from directly clicking the "solution" link ;-)) I wonder whether it is possible to use LaTeX code in the second argument of the pdftooltip command from pdfcomment package by Josef Kleber. I am using pdflatex and pdfcomment version 2.3a. What I want to do is: Using the pdftooltip command and as the mouse moves over the relevant portion a tooltip box with, say, blue background colour, appears. Here is a minimal working example:               \documentclass{scrbook}          \usepackage{xcolor}          \usepackage{pdfcomment}          \begin{document}          \pdftooltip{foo}{%     \colorbox{blue}{%     Hint: What is the definition of foo?}% End of Colorbox     }% End of pdftooltip command          \end{document}      (Well it compiles without complaining, but it does not give the expected result :-( ) However, there is no blue background colour but an almost verbatim text of colorbox ... blue etc., bracketed by (presumably) pdf code. I know, that there is the possibility of mathematical markup in pdftooltips, but what about "eye candy"? ;-) Thanks in advance Christian _Edited: I know of the packages **fancytooltips** or **cooltooltips** but they do not match my intents_


title: Extra alignment tab has been changed to \cr?

text: I get the error mentioned in the title of the question. Can you help me please ?               \begin{table}[htb!]           \centering             \caption{\textit{others criterias : first scenario}} \label{Table2}             \resizebox{0.5\columnwidth}{!}{%              \begin{tabular}{c|ccc|cccc|c}         &\multicolumn{3}{c}{\underline{Instances}}         &\multicolumn{4}{c}{\underline{DPA}}         &&         &Staff &Activities &periods  &EA     &EB    &TG-AV   &RV-TD   \\ \hline            &3     &72        &10     &477    &47     &178    &1421    \\             \hline              &3     &72        &10     &1087   &34     &207    &1170    \\             \hline              &3     &72        &10     &1415   &22     &215    &932     \\             \hline              &5     &120       &10     &1925   &1977   &485    &1897    \\             \hline              &5     &120       &10     &457    &552    &216    &1123    \\             \hline              &6     &140       &10     &1605   &1981   &347    &3039    \\         \hline         \end{tabular}%         }         \end{table}


title: Nomenclature, acronym or glossary?

text: This isn't a technical or LaTeX code question, but more of a "what should I be using for X?" question. I am writing up my PhD. It is an Engineering PhD and I have mostly abbreviations (i.e. Particulate Matter = PM, On-board Diagnostics = OBD, that sort of thing) And there are also a few symbols (e for the charge on an electron and the usual array of greek letters found in formulae). I haven't really been advised otherwise but these are all in one big Nomenclature list placed before my first chapter, built using:               \usepackage[intoc]{nomencl}      I wondering if that is actually the correct way to do things? Should I be having a separate list for abbreviations/acronyms? if so do I just add the acronym package? can I use just one package to do both?


title: Gauss package: gmatrix not equivalent to corresponding amsmath environment

text: The following quote is taken from the `gauss` package documentation: > The package defines a new matrix environment `gmatrix` which behaves just > like Latex's and AMS-Latex's matrix. But when using the `gmatrix` environment within `align`, the output is **not** equivalent to the corresponding `amsmath` environment:               \documentclass{scrartcl}     \usepackage{lmodern}     \usepackage{amsmath}     \usepackage{gauss}          \begin{document}          \begin{align*}       \begin{pmatrix}       0 & 1 & 0 & 1 & 1\\       1 & 0 & 1 & 1 & 1\\       1 & 1 & 0 & 1 & 0       \end{pmatrix}     \end{align*}          \begin{align*}       \begin{gmatrix}[p]       0 & 1 & 0 & 1 & 1\\       1 & 0 & 1 & 1 & 1\\       1 & 1 & 0 & 1 & 0       \end{gmatrix}     \end{align*}          \end{document}      The parentheses are of equal height, but the line spacing is different, and in my opinion the upper version looks better: ![pmatrix vs. gmatrix](http://i.stack.imgur.com/yti7X.png) Furthermore, the horizontal alignment of the whole matrix is a little bit different, but this might be due to some extra space needed when typesetting the matrix operations (which is the whole point of the `gauss` package). Interestingly, when using `equation` instead of `align`, the first problem vanishes. Is there any way to get the same behaviour for the `align` environment?


title: Insert code snippet via keyboard shortcut in TeXworks

text: I know there already are questions (1, 2) on creating keyboard shortcuts in TeXworks. The discussion (also in the Google thread referred to), however, seems a little outdated. By now, there is the possibility to create keyboard shortcuts via the `shortcuts.ini` file (link) as well as keywords via adding a `.txt` file to the `completion` folder (link, p.23). What I am trying to achieve is: create a keyboard shortcut (say, `ctrl`+`shift`+`v`) which inserts a code snippet such as `\vec{#INS#}•` (which would insert the snippet `\vec{}`, move the cursor to `#INS#` and add a placeholder at `•`). While the first part (create a keyboard shortcut for some command) as well as the second one (create a keyword which expands to the full snippet) can be carried out separately, I can't get the combination to work - I only figured how to add shortcuts for commands listed at the bottom of this explanation. Any help on how to perform the desired task would be appreciated. If my question is not clear, please let me know.


title: Define kerning in lualatex

text: I am trying to define a kerning between V and /. (see question) My approach is the following, but I don't see any differences between using the feature file and not using it.               \documentclass{standalone}     \usepackage{filecontents}          \begin{filecontents*}{mykern.fea}     languagesystem DFLT dflt;     languagesystem latn dflt;     feature kern {     pos \V  \SLASH -800;     } kern;          \end{filecontents*}          \usepackage{fontspec}     \setmainfont[FeatureFile=mykern.fea]{TeX Gyre Pagella}     %\setmainfont[]{TeX Gyre Pagella}     \usepackage{unicode-math}     \setmathfont[math-style=upright]{euler.otf}          \usepackage{microtype}     \usepackage{siunitx}          \begin{document}     \begin{tabular}{ll}     Text  & MV/m \\     equation & $MV/m$\\     two mathrm & $\mathrm{MV}/\mathrm{m}$\\     one mathrm & $\mathrm{MV/m}$\\     siunitx & \si[per-mode = symbol]{\mega\volt\per\metre}\\     %one mathrm & $\mathrm{MV/m}$\\     \end{tabular}     \end{document}


title: Document layout, combining text and figure panels

text: This is a question so general, I couldn't easily find an archived post which directly addressed it. I am interested in using LaTeX to design a one sided sheet containing figures and small amounts of text. I have a specific layout in mind drawn below. I want to be able to draw these regions, crop graphics (in graph/logo) to fit them, and place text which never flies beyond the boundary regions drawn. ![mock up of output](http://i.stack.imgur.com/eQfQx.png) How can one do that? I'm reaching for latex because I am generating PDFs and hope to loop over information and generate hundreds of such documents.


title: mirror node shape

text: I have to draw a diagram and would like to fit it on a page, thus i have not much space. Therefore I have to "stack" some gates, however it would be beneficial if I could put the outputs of the logic gate on the left and the inputs on the right side. Is there a way to flip a nodes shape (the label `&` still needs to be readable the right way round)? Sketch of the issue (left what I would like, right alternative for the time beeing): ![sketch of the issue, left optimal, right current solution](http://i.stack.imgur.com/sJnW6.png) (I did not put much time into the simplified doodle, but I think it illustrates the issue, how to get the upper and gate) **edit** : in my case a `3 input and` will do, however I am curious about solutions and not "workarrounds". MWE: Simply an `and` gate. Question, how do i turn the input and output sides arround (the order of `input n` anchors can be upside down)               \documentclass[12pt]{article}     \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}          \usetikzlibrary{circuits}     \usetikzlibrary{circuits.logic}     \usetikzlibrary{circuits.logic.IEC}     \begin{document}          \begin{tikzpicture} [circuit logic IEC,     every circuit symbol/.style={     logic gate IEC symbol color=black,     fill=blue!20,draw=blue,very thick}]              \node (and)[and gate]{};         \draw (and.output) -- ++ (1,0);         \draw (and.input 1) -- ++ (-1,0);         \draw (and.input 2) -- ++ (-1,0);          \end{tikzpicture}          \end{document}


title: Subfigures side by side with captions

text: I am using the following code to put my two figures side by side with different captions,               \begin{figure*}[t!]         \centering         \begin{subfigure}[b]{0.5\textwidth}             \centering             \includegraphics[height=1.2in]{a}             \caption{Lorem ipsum}         \end{subfigure}%         ~          \begin{subfigure}[b]{0.5\textwidth}             \centering             \includegraphics[height=1.2in]{b}             \caption{Lorem ipsum, lorem ipsum,Lorem ipsum, lorem ipsum,Lorem ipsum}         \end{subfigure}         \caption{Caption place holder}     \end{figure*}      I get the following output: ![output](http://i.stack.imgur.com/T9fCK.png) However, I want to position both my images vertically same line, like the following: Desired output: ![desired](http://i.stack.imgur.com/tXoxu.jpg)


title: How to remove the indent after enumerate

text: I have made a list using enumerate. Here's the code.               \documentclass[journal]{IEEEtran}               % *** GRAPHICS RELATED PACKAGES ***     %Custom Styles Defined Here % %     \ifCLASSINFOpdf     \else     \fi     \hyphenation{op-tical net-works semi-conduc-tor}     \setlength{\parindent}{0.5cm}               % %Document Starts Here % %     \begin{document}     %     % paper title     % can use linebreaks \\ within to get better formatting as desired     \title{AAAAAAA AAAAAAA  AAAAAA}     %     %     % author names and IEEE memberships     % note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break     % a structure at a ~ so this keeps an author's name from being broken across     % two lines.     % use \thanks{} to gain access to the first footnote area     % a separate \thanks must be used for each paragraph as LaTeX2e's \thanks     % was not built to handle multiple paragraphs     %          \author{XXX~XXX, %~\IEEEmembership{Member,~IEEE,}             YYY~YYY, %~\IEEEmembership{Fellow,~OSA,}             ZZZ~ZZZ and~AAA~AAA %~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space     \thanks{M. Shell is with the Department     of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta,     GA, 30332 USA e-mail: (see http://www.michaelshell.org/contact.html).}% <-this % stops a space     \thanks{J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space     \thanks{Manuscript received April 19, 2005; revised January 11, 2007.}}          % note the % following the last \IEEEmembership and also \thanks -      % these prevent an unwanted space from occurring between the last author name     % and the end of the author line. i.e., if you had this:     %      % \author{....lastname \thanks{...} \thanks{...} }     %                     ^------------^------------^----Do not want these spaces!     %     % a space would be appended to the last name and could cause every name on that     % line to be shifted left slightly. This is one of those "LaTeX things". For     % instance, "\textbf{A} \textbf{B}" will typeset as "A B" not "AB". To get     % "AB" then you have to do: "\textbf{A}\textbf{B}"     % \thanks is no different in this regard, so shield the last } of each \thanks     % that ends a line with a % and do not let a space in before the next \thanks.     % Spaces after \IEEEmembership other than the last one are OK (and needed) as     % you are supposed to have spaces between the names. For what it is worth,     % this is a minor point as most people would not even notice if the said evil     % space somehow managed to creep in.                    % The paper headers     \markboth{Journal of \LaTeX\ Class Files,~Vol.~6, No.~1, January~2007}%     {Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}     % The only time the second header will appear is for the odd numbered pages     % after the title page when using the twoside option.                              % make the title area     \maketitle               \begin{abstract}     %\boldmath     Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.     \end{abstract}     % IEEEtran.cls defaults to using nonbold math in the Abstract.     % This preserves the distinction between vectors and scalars. However,     % if the journal you are submitting to favors bold math in the abstract,     % then you can use LaTeX's standard command \boldmath at the very start     % of the abstract to achieve this. Many IEEE journals frown on math     % in the abstract anyway.          % Note that keywords are not normally used for peerreview papers.     \begin{IEEEkeywords}     Charge Pump, Energy Harvesting, CNFET, DC/DC Converter.     \end{IEEEkeywords}                                   % For peer review papers, you can put extra information on the cover     % page as needed:     % \ifCLASSOPTIONpeerreview     % \begin{center} \bfseries EDICS Category: 3-BBND \end{center}     % \fi     %     % For peerreview papers, this IEEEtran command inserts a page break and     % creates the second title. It will be ignored for other modes.     \IEEEpeerreviewmaketitle                    \section{Introduction}     % The very first letter is a 2 line initial drop letter followed     % by the rest of the first word in caps.     %      % form to use if the first word consists of a single letter:     % \IEEEPARstart{A}{demo} file is ....     %      % form to use if you need the single drop letter followed by     % normal text (unknown if ever used by IEEE):     % \IEEEPARstart{A}{}demo file is ....     %      % Some journals put the first two words in caps:     % \IEEEPARstart{T}{his demo} file is ....     %      % Here we have the typical use of a "T" for an initial drop letter     % and "HIS" in caps to complete the first word.     \IEEEPARstart{T}{he} Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum:     \begin{enumerate}       \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla fa.       \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl.     \end{enumerate}%     %     The rest of the paper is organized as follows. Section II provides an introduction to Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.          \section{Carbon Nanotube Field Effect Transistors}     \indent     Lorem ipsum dolor sit amet,.          % needed in second column of first page if using \IEEEpubid     %\IEEEpubidadjcol          \subsubsection{Subsubsection Heading Here}     Subsubsection text here.               % An example of a floating figure using the graphicx package.     % Note that \label must occur AFTER (or within) \caption.     % For figures, \caption should occur after the \includegraphics.     % Note that IEEEtran v1.7 and later has special internal code that     % is designed to preserve the operation of \label within \caption     % even when the captionsoff option is in effect. However, because     % of issues like this, it may be the safest practice to put all your     % \label just after \caption rather than within \caption{}.     %     % Reminder: the "draftcls" or "draftclsnofoot", not "draft", class     % option should be used if it is desired that the figures are to be     % displayed while in draft mode.     %     %\begin{figure}[!t]     %\centering     %\includegraphics[width=2.5in]{myfigure}     % where an .eps filename suffix will be assumed under latex,      % and a .pdf suffix will be assumed for pdflatex; or what has been declared     % via \DeclareGraphicsExtensions.     %\caption{Simulation Results}     %\label{fig_sim}     %\end{figure}          % Note that IEEE typically puts floats only at the top, even when this     % results in a large percentage of a column being occupied by floats.               % An example of a double column floating figure using two subfigures.     % (The subfig.sty package must be loaded for this to work.)     % The subfigure \label commands are set within each subfloat command, the     % \label for the overall figure must come after \caption.     % \hfil must be used as a separator to get equal spacing.     % The subfigure.sty package works much the same way, except \subfigure is     % used instead of \subfloat.     %     %\begin{figure*}[!t]     %\centerline{\subfloat[Case I]\includegraphics[width=2.5in]{subfigcase1}%     %\label{fig_first_case}}     %\hfil     %\subfloat[Case II]{\includegraphics[width=2.5in]{subfigcase2}%     %\label{fig_second_case}}}     %\caption{Simulation results}     %\label{fig_sim}     %\end{figure*}     %     % Note that often IEEE papers with subfigures do not employ subfigure     % captions (using the optional argument to \subfloat), but instead will     % reference/describe all of them (a), (b), etc., within the main caption.               % An example of a floating table. Note that, for IEEE style tables, the      % \caption command should come BEFORE the table. Table text will default to     % \footnotesize as IEEE normally uses this smaller font for tables.     % The \label must come after \caption as always.     %     %\begin{table}[!t]     %% increase table row spacing, adjust to taste     %\renewcommand{\arraystretch}{1.3}     % if using array.sty, it might be a good idea to tweak the value of     % \extrarowheight as needed to properly center the text within the cells     %\caption{An Example of a Table}     %\label{table_example}     %\centering     %% Some packages, such as MDW tools, offer better commands for making tables     %% than the plain LaTeX2e tabular which is used here.     %\begin{tabular}{|c||c|}     %\hline     %One & Two\\     %\hline     %Three & Four\\     %\hline     %\end{tabular}     %\end{table}               % Note that IEEE does not put floats in the very first column - or typically     % anywhere on the first page for that matter. Also, in-text middle ("here")     % positioning is not used. Most IEEE journals use top floats exclusively.     % Note that, LaTeX2e, unlike IEEE journals, places footnotes above bottom     % floats. This can be corrected via the \fnbelowfloat command of the     % stfloats package.                    \section{Conclusion}     The conclusion goes here.                              % if have a single appendix:     %\appendix[Proof of the Zonklar Equations]     % or     %\appendix  % for no appendix heading     % do not use \section anymore after \appendix, only \section*     % is possibly needed          % use appendices with more than one appendix     % then use \section to start each appendix     % you must declare a \section before using any     % \subsection or using \label (\appendices by itself     % starts a section numbered zero.)     %               \appendices     \section{Proof of the First Zonklar Equation}     Appendix one text goes here.          % you can choose not to have a title for an appendix     % if you want by leaving the argument blank     \section{}     Appendix two text goes here.               % use section* for acknowledgement     \section*{Acknowledgment}               The authors would like to thank...               % Can use something like this to put references on a page     % by themselves when using endfloat and the captionsoff option.     \ifCLASSOPTIONcaptionsoff       \newpage     \fi                    % trigger a \newpage just before the given reference     % number - used to balance the columns on the last page     % adjust value as needed - may need to be readjusted if     % the document is modified later     %\IEEEtriggeratref{8}     % The "triggered" command can be changed if desired:     %\IEEEtriggercmd{\enlargethispage{-5in}}          % references section          % can use a bibliography generated by BibTeX as a .bbl file     % BibTeX documentation can be easily obtained at:     % http://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/     % The IEEEtran BibTeX style support page is at:     % http://www.michaelshell.org/tex/ieeetran/bibtex/     %\bibliographystyle{IEEEtran}     % argument is your BibTeX string definitions and bibliography database(s)     %\bibliography{IEEEabrv,../bib/paper}     %     % <OR> manually copy in the resultant .bbl file     % set second argument of \begin to the number of references     % (used to reserve space for the reference number labels box)     \begin{thebibliography}{1}          \bibitem{IEEEhowto:kopka}     H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus       0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.          \end{thebibliography}          % biography section     %      % If you have an EPS/PDF photo (graphicx package needed) extra braces are     % needed around the contents of the optional argument to biography to prevent     % the LaTeX parser from getting confused when it sees the complicated     % \includegraphics command within an optional argument. (You could create     % your own custom macro containing the \includegraphics command to make things     % simpler here.)     %\begin{biography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}     % or if you just want to reserve a space for a photo:          \begin{IEEEbiography}{Michael Shell}     Biography text here.     \end{IEEEbiography}          % if you will not have a photo at all:     \begin{IEEEbiographynophoto}{John Doe}     Biography text here.     \end{IEEEbiographynophoto}          % insert where needed to balance the two columns on the last page with     % biographies     %\newpage          \begin{IEEEbiographynophoto}{Jane Doe}     Biography text here.     \end{IEEEbiographynophoto}          % You can push biographies down or up by placing     % a \vfill before or after them. The appropriate     % use of \vfill depends on what kind of text is     % on the last page and whether or not the columns     % are being equalized.          %\vfill          % Can be used to pull up biographies so that the bottom of the last one     % is flush with the other column.     %\enlargethispage{-5in}                    % that's all folks     \end{document}      The problem is that when I make a preview of this, I get indentation(for two lines) in the paragraph just after the list. I don't want that. How can I remove that? I am new to LaTeX. Please help. Here's the screenshot of generated pdf. ![Generated PDF](http://i.stack.imgur.com/38EcM.jpg)


title: Multiple corresponding authors in BioMed Central LaTex template

text: I am using the BioMed Central LaTex template in order to submit a scientific paper that has the formatting required for such journal. The only problem I am finding is that I do not seem to be able to indicate more than one author as a corresponding author. There is a .cls file included along with the .tex template where I think the problem would be, but authors are discouraged to modify that .cls file. The BioMed Central template can be found at http://www.biomedcentral.com/authors/tex [bmc_article (ZIP format) link] If you give it a try, you can go to the following lines in the .tex file:               \author[        addressref={aff1},                   % id's of addresses, e.g. {aff1,aff2}        corref={aff1},                       % id of corresponding address, if any        noteref={n1},                        % id's of article notes, if any        email={jane.e.doe@cambridge.co.uk}   % email address     ]{\inits{JE}\fnm{Jane E} \snm{Doe}}     \author[        addressref={aff1,aff2},        email={john.RS.Smith@cambridge.co.uk}     ]{\inits{JRS}\fnm{John RS} \snm{Smith}}      it works for just one corresponding author, but if I want to make both authors corresponding authors and add:                  corref={aff1,aff2},      for John RS Smith too, it will no longer interpret Jane E Doe as a corresponding author ('??' instead of '*' and no contact information under '*Correspondence'). Check the following images, the first one is the template as is, with only Jane E Doe as corresponding author. ![enter image description here](http://i.stack.imgur.com/LdLv5.png) This second picture correspond to the template when I try to make both authors corresponding authors... It only understands John RS Smith and adds a '??' for Jane E Doe, omitting her contact information under '*Correspondence'. ![enter image description here](http://i.stack.imgur.com/5tYlk.png) Any clue anyone?? Any help would be really appreciated. It's crucial that I get this done asap, preferably without modifying the accompanying .cls file. Many many many thanks!


title: Circular arrow in 3D to indicate a unit axis rotation

text: I would like to indicate the directions of rotation and symbols used for the respective Euler angles. This would look nice using small circular arrows around the axes, as shown below: ![Euler Axis Rotations](http://i.stack.imgur.com/4Thyk.png) In this drawing, I added the arrows with Gimp afterwards. How can I do this using TikZ, and label the arrows? MWE:               \documentclass{article}     \usepackage{tikz}     \usepackage{tikz-3dplot}          % Redefine rotation sequence for tikz3d-plot to z-y-x     \newcommand{\tdseteulerxyz}{     \renewcommand{\tdplotcalctransformrotmain}{%     %perform some trig for the Euler transformation     \tdplotsinandcos{\sinalpha}{\cosalpha}{\tdplotalpha}      \tdplotsinandcos{\sinbeta}{\cosbeta}{\tdplotbeta}     \tdplotsinandcos{\singamma}{\cosgamma}{\tdplotgamma}     %     \tdplotmult{\sasb}{\sinalpha}{\sinbeta}     \tdplotmult{\sasg}{\sinalpha}{\singamma}     \tdplotmult{\sasbsg}{\sasb}{\singamma}     %     \tdplotmult{\sacb}{\sinalpha}{\cosbeta}     \tdplotmult{\sacg}{\sinalpha}{\cosgamma}     \tdplotmult{\sasbcg}{\sasb}{\cosgamma}     %     \tdplotmult{\casb}{\cosalpha}{\sinbeta}     \tdplotmult{\cacb}{\cosalpha}{\cosbeta}     \tdplotmult{\cacg}{\cosalpha}{\cosgamma}     \tdplotmult{\casg}{\cosalpha}{\singamma}     %     \tdplotmult{\cbsg}{\cosbeta}{\singamma}     \tdplotmult{\cbcg}{\cosbeta}{\cosgamma}     %     \tdplotmult{\casbsg}{\casb}{\singamma}     \tdplotmult{\casbcg}{\casb}{\cosgamma}     %     %determine rotation matrix elements for Euler transformation     \pgfmathsetmacro{\raaeul}{\cacb}     \pgfmathsetmacro{\rabeul}{\casbsg - \sacg}     \pgfmathsetmacro{\raceul}{\sasg + \casbcg}     \pgfmathsetmacro{\rbaeul}{\sacb}     \pgfmathsetmacro{\rbbeul}{\sasbsg + \cacg}     \pgfmathsetmacro{\rbceul}{\sasbcg - \casg}     \pgfmathsetmacro{\rcaeul}{-\sinbeta}     \pgfmathsetmacro{\rcbeul}{\cbsg}     \pgfmathsetmacro{\rcceul}{\cbcg}     }     }          \tdseteulerxyz          \usepackage{siunitx}          \begin{document}     % Set the plot display orientation     % Syntax: \tdplotsetdisplay{\theta_d}{\phi_d}     \tdplotsetmaincoords{60}{110}          % Start tikz-picture, and use the tdplot_main_coords style to implement the display      % coordinate transformation provided by 3dplot.     \begin{tikzpicture}[scale=3,tdplot_main_coords]          % Set origin of main (body) coordinate system     \coordinate (O) at (0,0,0);          % Draw main coordinate system     \draw[red, thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};     \draw[red, thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};     \draw[red, thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};           \end{tikzpicture}          \end{document}


title: pgfplots: using macro for tick label

text: I would like to use a macro to define the label of an extra tick in a pgfplots picture. When the macro uses a greek character it generates an error:               ! Missing \endcsname inserted.      Here is my MWE:               \documentclass{article}     \usepackage{pgfplots}     \newcommand{\extraticksmwe}{%         extra y ticks={.5}, extra y tick labels={$\alpha$}%     }     \begin{document}     \begin{tikzpicture}     \begin{axis}[         ytick={0},         \extraticksmwe         ]          \addplot[]{ .5 };     \end{axis}     \end{tikzpicture}     \end{document}      Note that if I do not use a greek character, e.g. using $a$ instead of $\alpha$, the same code above does not generate an error. Similarly, if I do not use a macro at all, it does not generate an error, so the following code works fine:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[         ytick={0},         extra y ticks={.5}, extra y tick labels={$\alpha$}%         ]          \addplot[]{ .5 };     \end{axis}     \end{tikzpicture}     \end{document}


title: Please help me tikz picture in beamer class

text: I have a tikz picture. It work smoothly in my thesis file. But when I put it to frame, it make error please help me. Here is my code:               \documentclass{beamer}     \usepackage{graphicx}     \usepackage[labelsep=quad,indention=10pt]{subfig}     \usepackage{tikz}     \begin{document}          \frame{     \begin{figure}[ht]     \centering       \begin{tikzpicture}[     init/.style={       draw,       circle,       inner sep=2pt,       font=\Huge,       join = by -latex     },     squa/.style={       draw,       inner sep=2pt,       font=\Large,       join = by -latex     },     start chain=2,node distance=13mm     ]     \node[on chain=2]        (x2) {$x_2$};     \node[on chain=2,join=by o-latex]        {$w_2$};     \node[on chain=2,init] (sigma)        {$\displaystyle\Sigma$};     \node[on chain=2,squa,label=above:{\parbox{2cm}{\centering Activate \\ function}}]          {$f$};     \node[on chain=2,label=above:Output,join=by -latex]        {$y$};     \begin{scope}[start chain=1]     \node[on chain=1] at (0,1.5cm)        (x1) {$x_1$};     \node[on chain=1,join=by o-latex]        (w1) {$w_1$};     \end{scope}     \begin{scope}[start chain=3]     \node[on chain=3] at (0,-1.5cm)        (x3) {$x_3$};     \node[on chain=3,label=below:Weights,join=by o-latex]        (w3) {$w_3$};     \end{scope}     \node[label=above:\parbox{2cm}{\centering Bias \\ $b$}] at (sigma|-w1) (b) {};          \draw[-latex] (w1) -- (sigma);     \draw[-latex] (w3) -- (sigma);     \draw[o-latex] (b) -- (sigma);          \draw[decorate,decoration={brace,mirror}] (x1.north west) -- node[left=10pt] {Inputs} (x3.south west);     \end{tikzpicture}     \end{figure}     }     \end{document}


title: Position with pdfpages

text: I have a landscape A5 pdf, which I would like to include on top of the page. However, with this MWE the file is centered:               \documentclass[a4paper]{scrartcl}     \usepackage{pdfpages}     \begin{document}     \includepdf{a5.pdf}     \end{document}


title: esint package changes integral to cap symbol

text: The following code produces wrong output:               \documentclass{article}     \usepackage{amsmath, esint, kpfonts}          \begin{document}     \[\int_a^b f(x) dx \]     \end{document}      ![](http://i.stack.imgur.com/T8MWh.png) If I change the loading order of the packages everything works:               \usepackage{kpfonts,esint}      ![](http://i.stack.imgur.com/M5tq3.png) Why is this happening? It seems such a simple case.


title: Converting animations to individual Beamer slides

text: I am writing a Beamer presentation which includes an animation, created via the `animateinline` environment within the `animate` package. When I create a handout of my slides (by setting the `handout` option), I would like to have each frame of the animation displayed as a separate slide, preferably with no animation controls shown. Is there an easy way to do this that does not involve duplicating the code for the animation? A minimal example showing what I want to achieve is:               \documentclass{beamer}     \usepackage{animate}     \usepackage{boolexpr}          \begin{document}          \begin{frame}         \begin{center}             \begin{animateinline}[controls]{1}                 \multiframe{2}{iStep=1+1}                 {                 \ifthenelse{\iStep=1}{Frame 1}{Frame 2}                 }             \end{animateinline}         \end{center}     \end{frame}          \end{document}      This gives an animation with two frames. What I would like is that, when I change the source to include the `handout` option to the `beamer` document class, each frame of the animation corresponds to a new slide in the handout (so the handout would have two slides).


title: Non-compiling TeXstudio

text: I've used latex on Unix machines and MikTeX and TeXworks on Windows. I asked if some LaTeX software could be installed on machines in a library, and the person who tends the computers installed TeXstudio. I put a .tex file there that that compiled properly on other machines with other software. I either push the "compile" button --- a green triangle --- or choose "compile" from the "Tools" menu. Nothing happens at all. No .log file is created. The person who installed the software can't help because he never even heard of LaTeX before I mentioned it, and I haven't used TeXstudio before. Any ideas?


title: Replace \path in Tikz with a 3D tube

text: Is it possible to define a new command in Tikz, which will use the same arguments as the `\path [line] (node1) -- (node2);` command, but which draws instead a 3D tube?


title: SI Unit Volt Ampere (VA) printed wrongly with space

text: The symbol Voltampere VA should be printed without space between V and A, is there a way to correct that with siunitx?                \documentclass{article}      \usepackage{siunitx}         \begin{document}         \SI{10}{\volt\ampere}              10 VA       \end{document}      ![enter image description here](http://i.stack.imgur.com/yMNEc.png)


title: Taking advantage of auto-pst-pdf when XeLaTeXing

text: I use a lot of `PSTricks`-based graphics. Since graphics generation takes an awful long compilation time over `XeLaTeX`, I resort to `pdfLaTeX` first using the `auto-pst-pdf` package. On a later run, meaning, once the graphics have been generated, I can use the `off` option so as to use the already-existing pdf file issued by `auto-pst-pdf`, but this works only over `pdfLaTeX`. I've tried with the `\savepicture` and `\usepicture` commands over `XeLaTeX`, but I don't get the graphics. My question goes thus: What would be a "good" approach to using the `auto-pst- pdf`-generated file with the graphics in an automated way when compiling over `XeLaTeX` in order to have this automated? I know I could split the `auto-pst- pdf`-generated file and save the graphics on a separate basis, but I'm asking about a more efficient approach in terms of "manual tweaking."


title: How to create the name space for a kid's math worksheet? and other issues?

text: I want my worksheet the name and date to the left above the worksheet's title. I also want to learn what code to use to adjust the spacing. The spacing is a little off and I want the two columns of problems to be symmetrical. This is my code and I was hoping that someone experienced in this type-setting language can assist:               \documentclass{article}     \usepackage{gensymb}     \usepackage{amsfonts}     \usepackage{amsmath}     \begin{document}     \title{7th Grade Algebra: Exponents}     \author{Ms. Lampianerani}      \maketitle     \begin{tabular}{rl}     Name:  & \rule{0.25\linewidth}{\linethickness} \\      Date:  & \rule{0.25\linewidth}{\linethickness} \\      \end{tabular}          \section{Notes}       Simplify the following negative exponent problems. You want to get an answer with   all positive exponents.           \begin{minipage}{.45\linewidth}     \begin{flushleft}       \begin{enumerate}          \item $\displaystyle \frac{1}{k^{-5}}$     \item $k^{-5}$      \item $a^3 b^{-2}$     \item $c^{-4}d^{4}$      \item $(a^2 b^{-7})^{0}$          \end{enumerate}     \end{flushleft}      \end{minipage}     \hfill      \begin{minipage}{.45\linewidth}     \begin{flushright}       \begin{enumerate}     \setcounter{enumi}{5}          \item $\displaystyle \frac{-45}{5x^{-6}}$     \item $\displaystyle \frac{x^{-8}}{4y^{15}}$      \item $\displaystyle \frac{2a^3}{b^{-5}}$      \item $\displaystyle \frac{y^{-9}}{x^{-15}}$      \item $ - 10y^{-3}$      \end{enumerate}      \end{flushright}      \end{minipage}      \end{document}


title: `documentclass` and required `packages` for compiling R help in tex

text: I got the help on `R` functions in `.tex` format using help_console function. I wonder what is the `documentclass` and required `packages` to compile this document correctly. Thanks in advance for your help. My MWE is: * * * **Code** * * *               \documentclass{article}          \begin{document}          HeaderA{lm}{Fitting Linear Models}{lm}     aliasA{print.lm}{lm}{print.lm}     keyword{regression}{lm}     %     begin{Description}relax     code{lm} is used to fit linear models.     It can be used to carry out regression,     single stratum analysis of variance and     analysis of covariance (although code{LinkA{aov}{aov}} may provide a more     convenient interface for these).     end{Description}     %     begin{Usage}     begin{verbatim}     lm(formula, data, subset, weights, na.action,        method = qr, model = TRUE, x = FALSE, y = FALSE, qr = TRUE,        singular.ok = TRUE, contrasts = NULL, offset, ...)     end{verbatim}     end{Usage}     %               \end{document}      * * * **Output** * * * ![enter image description here](http://i.stack.imgur.com/6fXpe.png)


title: Linewrap in legend in pgfplots [Solved]

text: I try make plot with long text in legend.               \documentclass{report}     \usepackage{pgfplots}     \pgfplotsset{     every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left},     tick label style={font=\tiny\scriptsize},     legend style={font=\scriptsize},     axis lines=left,     legend style={draw=none},     }     \begin{document}     \begin{figure} [H]     \centering     \begin{tikzpicture}     \begin{axis} [     xlabel={x},     ylabel={y},     height=10cm,     width=17cm,     legend columns=2,     ]     \addplot[color=red, mark=*] coordinates {      (-3.79489, -0.794084)       (-3.54497, -0.919739)       (-3.51697, -0.93037)       (-3.3082, -0.986154)       (-0.165787, 0.986289)       (0.92704, 0.600204)      };     \addlegendentry{Long long  long  long  long  long  long  long  long  long  long long  long  long  long  long  long  long  long  long  long  long  long  long  long  long  long  long  long  long  long text};          \addplot[color=blue, mark=*] coordinates {      (-3.79489, 0.607808)       (-3.54497, 0.39253)       (-3.51697, 0.366622)       (-3.3082, 0.165834)       (-0.165787, -0.165029)       (0.92704, 0.799847)      };     \addlegendentry{Plot 1};          \addplot[color=green, mark=*] coordinates {      (-2.79489, 1.607808)       (-2.54497, 1.39253)       (-2.51697, 1.366622)       (-2.3082, 1.165834)       (-2.165787, -1.165029)       (1.92704, 1.799847)      };          \addlegendentry{Plot 3};     \end{axis}     \end{tikzpicture}     \caption{Chart}     \end{figure}          \end{document}      But I see that: ![enter image description here](http://i.stack.imgur.com/02DAa.png) If I use `legend style={text width=5.5cm},` I see that: ![enter image description here](http://i.stack.imgur.com/nbLvN.png) Is it possible to wrap the text in the legend?


title: Post-commit service hook for GitHub repository containing LaTeX?

text: This question is related to Compiling documents online. I store my LaTeX documents in a git repository on GitHub. Is there a web service which offers a post-commit hook for GitHub which automatically fetches my document and compiles it? For example, ReadTheDocs provides compilation for documentation of Python projects stored in GitHub repositories; the documentation is fetched and compiled after each commit to the repository.


title: How can I draw a cake using TikZ?

text: It is always someone's birthday. I would like to use TikZ to draw a birthday cake. There are all sorts of cakes. What I would like is a cake that looks nice and tasty. Preferably a cake with lots of chocolate and vanilla custard. How can I draw this with TikZ? Here is something to start with:               \documentclass{article}          \usepackage{tikz}          \usetikzlibrary{shapes}          \newsavebox{\mycandle}% From http://tex.stackexchange.com/a/39211/5701     \savebox{\mycandle}{      \begin{tikzpicture}[scale=.1]       \shade[top color=yellow,bottom color=red] (0,0) .. controls (1,.15)       and (1,.3) .. (0,2.5) .. controls (-1,.3) and (-1,.15) .. (0,0);       \fill[red!70!blue] (.4,0) rectangle (-.4,-5);     \end{tikzpicture} }          \begin{document}          \begin{tikzpicture}[>=stealth, shape aspect=.5]       \draw[fill=yellow!16] (0,-0.2) circle [x radius=1.59cm, y radius=0.29cm];       \node [cylinder,cylinder uses custom fill, cylinder end fill=yellow!6,     cylinder body fill=yellow!12, shape border rotate=90, minimum width=3cm, minimum       height=1.2cm, aspect=2.5, overlay, draw] {};       \foreach \candle in {(-0.32,1.05), (0.32,1.05), (1.2,0.9), (-1.2,0.9), (0.65,0.7), (-0.65,0.7)} \node at \candle {\usebox{\mycandle}};     \end{tikzpicture}          \end{document}      ![A cake to decorate](http://i.stack.imgur.com/p9ecK.png) Oh, and apparently someone already made a pink cake but without providing a recipe.


title: Why does PDFLaTeX and XeLaTeX generates 11.955 font size for 12pt documentclass option?

text: I am currently working on post-processing PDFs that are generated from either `pdflatex` or `xelatex` with the **12pt** documentclass option. Since I am looking at the uncompressed PDF sources, I noticed that the PDF command **Tf** to select the font specifies a font size of 11.955 instead of 12. I am curious: does anyone here know why? Minimal example for XeLaTex:               % !TEX TS-program = xelatex     \documentclass[12pt]{article}          \begin{document}     Why is this font size 11.955 in PDF?     \end{document}      but typeset with `xelatex --output-driver="xdvipdfmx -V4 -z0" <FILE>` to obtain uncompressed PDF output. Then, looking at the .pdf file, the first object is the stream:               stream      q 1 0 0 1 72 720 cm BT /F1 11.955 Tf 56.41 -65.75 Td[(Wh)26(y)-325(is)-326(this)-327(fon)26(t)-325(size)-326(11.955)-327(in)-326(PDF?)]TJ 173.79 -564.39 Td[(1)]TJ ET Q          endstream      and you can see `/F1 11.955 Tf` to select the indirect font object called `/F1` with size 11.955. The same effect if you use `pdflatex`, for example with this input:               \documentclass[12pt]{article}          \pdfcompresslevel=0     \pdfobjcompresslevel=0          \begin{document}     Why is this font size 11.955 in PDF?     \end{document}      My `pdflatex` (from Mac TexLive 2014) then generates:               stream     BT     /F15 11.9552 Tf 128.413 654.247 Td [(Wh)27(y)-326(is)-327(this)-326(fon)27(t)-326(size)-326(11.955)-327(in)-326(PDF?)]TJ 173.786 -564.384 Td [(1)]TJ     ET          endstream      with a font size of 11.9552.


title: Multiple inclusion of the same image gives huge PS file

text: I am using `beamer` and having included the same image many times with `pgf`, declare once and insert. It looks like the PS file from `dvips` grow linear as I create slides (the image is on the background). Reading online this should not be a problem on Unix systems, but the on windows it might be an issue. Anyone have a solution as compiling takes around 1min now and the PS file is 200mb, not that handy? How its used currently:               \pgfdeclareimage{redtree}{images/red_tree}%     \setbeamertemplate{background}{%     \pgftext[at=\pgfpoint{30mm}{\framesep-0.22\framesep},base,base]{\pgfuseimage{redtree}}     }


title: Newline in \def

text: I can not solve my problem. I have definition:               \def\mfTitle{askdj asldj asdlk jhasd kjhaslkjd asdas}      and I would like add a newline into it:               \def\mfTitle{askdj asldj asdlk \newline jhasd kjhaslkjd asdas}      but I get an error:               ! Undefined control sequence.     \@normalcr ->\let \reserved@e                                    \relax \let \reserved@f \relax \@ifstar {\let ...     l.20 ...fined\relax\else\pdfinfo{ /Title (\mfTitle                                                       ) /Author (\mfAuthor) /Cre...      Is it possible to do it in some easy way? Thanks **EDIT** usage of `\mfTitle`:               \documentclass[12pt]{book}     \usepackage{slovak}     \usepackage{epsfig}     \usepackage{color}     \usepackage{url}     \usepackage[utf8]{inputenc}          \renewcommand\baselinestretch{1.3} % riadkovanie jeden a pol          % pekne pokope definujeme potrebne udaje     \def\mftitle{Názov Práce}     \def\mfthesistype{Diplomová alebo neviem aká práca}     \def\mfauthor{Študent Autor}     \def\mfadvisor{Dr. Evorubač, ZLe.Sa.}     \def\mfplacedate{Bratislava, 2008}          \ifx\pdfoutput\undefined\relax\else\pdfinfo{ /Title (\mftitle) /Author (\mfauthor) /Creator (PDFLaTeX) } \fi          \begin{document}          \frontmatter          \thispagestyle{empty}          \noindent     \begin{minipage}{0.20\textwidth}     \includegraphics[width=0.9\textwidth]{komlogo-new}     \end{minipage}     \begin{minipage}{0.79\textwidth}     \begin{center}     \sc asd asdasd \\     asd asd, asd a asd \\     asd asd, asd     \end{center}     \end{minipage}          \vfill     \begin{center}     \begin{minipage}{0.8\textwidth}     \hrule     \bigskip\bigskip     \centerline{\LARGE\sc\mftitle}     \smallskip     \centerline{(\mfthesistype)}     \bigskip     \bigskip     \centerline{\large\sc\mfauthor}     \bigskip\bigskip     \hrule     \end{minipage}     \end{center}     \vfill     {\bf Vedúci:} \mfadvisor     \hfill\mfplacedate     \eject % EOP i          \thispagestyle{empty}~\vfill\eject % EOP ii          {~}\vspace{12cm}          \noindent     \begin{minipage}{0.25\textwidth}~\end{minipage}     \begin{minipage}{0.68\textwidth}     Čestne prehlasujem, že som túto diplomovú prácu vypracoval(a) samostatne s použitím citovaných zdrojov.          \bigskip\bigskip          \hfill\hbox to 6cm{\dotfill}     \end{minipage}     \vfill\eject % EOP iii     ~\vfill\eject % EOP iv          \tableofcontents          \mainmatter          \input 01intro.tex     \input 02dalej.tex          \backmatter          \nocite{*}     \bibliographystyle{alpha}     \bibliography{literatura}          \end{document}


title: Switching from memoir to report

text: I've been using `memoir` for a while now, and have started facing problems with modified output routine, this has forced me to seriously consider switching (back) to `report` class. What I'm going to ask might seem like a case of "Do the research for me", so I hope I'm not asking for too much. I would like to know how to produce 'exactly' the same output with `report` given the following: The preamble (up until now of course) `Preamble.tex`:               \documentclass[a4paper,twoside,12pt,openright,final,oldfontcommands]{memoir}      \usepackage[T1]{fontenc}     \usepackage{import}     \usepackage{color}     \usepackage{algorithm}     \usepackage{caption}     \captionsetup{font=small,labelfont=bf}     \usepackage{arabtex}     \usepackage{utf8}     \usepackage{graphicx}     \usepackage{float}     \setcounter{secnumdepth}{3}      \usepackage{fixltx2e}     \usepackage{paralist}      \usepackage{hyperref}     \hypersetup{pdftex,                 linktocpage=true,                 bookmarks=true,                 colorlinks=true,                 citecolor=blue,                 filecolor=black,                 linkcolor=blue,                 urlcolor=black}     \usepackage[all]{hypcap}     \usepackage{calc}     \copypagestyle{ruledsmallhd}{ruled}     \makeevenhead{ruledsmallhd}{\footnotesize\scshape\leftmark}{}{}     \makeoddhead{ruledsmallhd}{}{}{\footnotesize\scshape\rightmark}     \makeheadrule{ruledsmallhd}{0px}{0px}      The main file:               \input{Preamble.tex}     \begin{document}     \pagestyle{ruledsmallhd}     \pagenumbering{roman}     \maketitle     \newpage     \maxtocdepth{subsection}     \tableofcontents     \newpage     \listoffigures     \listoftables     \subimport{./Chapter1/}{Chapter1.tex}     \subimport{./Chapter2/}{Chapter2.tex}     \bibliographystyle{unsrt}     \bibliography{./Bibliography}     \end{document}      I think the obvious issue is producing exactly the same headers/footers with `fancyhdr` instead of `pagestyle`, but of course I wouldn't really know what else would change, hence I've posted this question.


title: how to force TeX to keep line breaks?

text: I would like to write a programme code to a file, so that it can be later on executed. The language requires to keep line breaks.               \begin{myCode}     one     two     three     \end{myCode}      In my macro I have following               \obeylines      which produces this output:               one^^Mtwo^^Mthree      Is there a simple way how to replace `^^M` by a line ending character that would by recognized by a Unix system? I understood that `verbatim` environment processes text line by line, but in this case it's probably not necessary. **Update:** Here's the minimal working code:               \documentclass{minimal}     \usepackage{environ}          \newwrite\myOutput     \makeatletter          \def\my@writeToFile#1{       \immediate\openout\myOutput=output.txt%       \immediate\write\myOutput{#1}       \immediate\closeout\myOutput     }          \newenvironment{myCode} {         \obeylines         \Collect@Body\my@writeToFile %macro from the environ package     }{%     }     \makeatother          \begin{document}       \begin{myCode}       one       two       three       \end{myCode}     \end{document}


title: Why doesn't \newline work inside lstlisting?

text: I am new to LaTeX and am using a template provided by a friend:                \subsection{P2P library}     The library is implemented in C-Sharp and provides two basic facilities - maintaining a member list at every instance and the support for receving and multicasting UDP data.           The public methods it has are      \begin{lstlisting}           void setPorts(int recvHere \newline, int sendFrom      Why doesn't `,int sendFrom` move to a new line in the PDF output? In fact it just shows up in the PDF output.


title: How to replace parentheses with symbol of other font so that they are expandable?

text: I use Bitstream Charter for my document, but I'm not satisfied with the appearance of round parentheses. I'd like to replace them with the parentheses from Palatino, both in text and math mode. In math mode I managed to change the symbol font to CM with the instructions from here and here, but now the parentheses do not automatically scale with `\left(` and `\right)`. A manual adjustment with `\big`, `\Big`, etc also does not work. The parentheses always stay the normal (text) size as shown below. The example code               \documentclass{memoir}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage[charter]{mathdesign}          \DeclareFontFamily{T1}{alt}{\hyphenchar\font=-1}     \DeclareFontShape{T1}{alt}{m}{n}{       <5> <6> <7> <8> <9> <10> gen * alt       <10.95> alt10 <12> <14.4> <17.28> <20.74> <24.88> alt12       }{}     \DeclareSymbolFont{alt}{U}{alt}{m}{n}          \DeclareMathDelimiter{(}{\mathopen}{alt}{`(}{alt}{`(}     \DeclareMathDelimiter{)}{\mathclose}{alt}{`)}{alt}{`)}          \begin{document}     Inserting eq.~(2b) into eq.~(1) yields     \begin{equation}     A = B \left( \frac{A-\phi}{c \left(1+E^{1/m} \right)} + \frac{1}{2} \right)     \end{equation}     \end{document}      produces ![an example output formula](http://i.imgur.com/hukdi0m.png) My principal question is how to make the parentheses expandable. Less importantly, I'd also like to know how to change them to a font other than CM (since the CM symbols are a bit too light in comparison to Charter) and how to substitute them also in text mode (in the above example you can see that they are still in Charter).


title: "Activate" active characters in argument passed as macro

text: Let's say I have some macro (`\iPrint` in the MWE) that internally uses active characters to interpret its argument:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \begingroup       \lccode`\~=`\|       \lowercase{\endgroup         \def~#1~{\textbf{#1}}%       }     \def\iPrint{%       \begingroup       \catcode`\|=\active       \iPrintX     }     \def\iPrintX#1{%       #1       \endgroup     }          \begin{document}     \def\temp{This |doesn't work|, though :-(}     \begin{itemize}       \item \iPrint{This |works pretty| well!}       \item \iPrint{\temp}     \end{itemize}     \end{document}      This yields: ![Output](http://i.stack.imgur.com/7Byqf.gif) AFAIU the issue, catcodes are assigned at definition time of a macro: When `\temp` is defined, `|` is not active. However, is there something I can do within `\iPrint` to make it active anyway? Some sort of recoding the argument with the current catcodes?


title: hyperref error when using XeLaTeX and fontspec with LaTeXmk

text: I have defined a compilation tool for TeXWorks as follows:               Program: latexmk     Arguments: -e                $xelatex=q/xelatex $synctexoption %0 %S/                -pdf                $fullname      It works fine in most cases, but I'm having problems with one file that imports the `hyperref` package. Here's a minimal example:               \documentclass{article}     \usepackage{fontspec}     \usepackage[xetex,bookmarks=true,colorlinks=true,linkcolor=headernfooter,urlcolor=headernfooter,linktoc=section,]{hyperref}     \begin{document}     hello, paper!     \end{document}      If I use the (predefined) XeLaTeX compilation tool instead, it works. If I comment the line importing `hyperref`, it works. But if I try to combine them, I get the following error message: > ! Package hyperref Error: Wrong driver option `xetex',   >  (hyperref) because XeTeX is not detected. If I remove the `xetex` option and the import of `fontspec`, both work, but then I can't choose the fonts I want in my real document. How do I combine these requirements?


title: TeX family tree with timeline?

text: When I first started using TeX, I felt overwhelmed by the myriad of names — BibTeX, XeTeX, LaTeX, XeLaTeX, ConTeXt, LuaTeX, MacTeX, TeXLive — and more. I didn't know the packages from the programs from the distributions, or what begat what. Since then I've learned, but once in a while I still come across names I don't recognize. I often wonder where I might find a “TeX Family Tree” showing how everything relates along a timeline. I've looked and looked, but have never found anything. So, I decided to bite the bullet and roll my own. I'm looking for feedback:   * Are the relationships correct?   * Is anything major missing?   * What can be improved? Clicking on the image leads to a PDF. I made two versions: Portrait and Landscape. * * * ![](http://i.stack.imgur.com/pUHFq.jpg) * * * ![](http://i.stack.imgur.com/t5N2t.jpg) * * * The chart spans 52 years — all the way back to 1962, when D.E.K. began writing TAOCP — and includes 17 versions of TeX, 12 versions of METAFONT, 17 derivatives of TeX (CommonTeX, Web2C, MLTeX, eTeX, TeX-XeT, TeX--XeT, eTeX, eLaTeX, encTeX, Omega, Aleph, XeTeX, XeLaTeX, ArabXeTeX, ConTeXt, LuaTeX, LuaLaTeX), 3 formats (Plain TeX, AMS-TeX, LaTeX), 7 tools (WEB, CWEB, dvips, pdftex, pdfetex, pdflatex, BibTeX), 8 distributions (PCTeX, DirectTeX, MiKTeX, proTeXit, teTeX, 4AllTeX, TeXLive, MacTeX), and 36 D.E.K. publications (TAOCP, Computers & Typesetting, Literate Programming, and so on). I learned a lot making this. I included Knuth's writings because (a) I think they're integral to TeX's history and because (b) I find it fascinating how they fit into the overall timeline, epecially the gaps. If anyone would like to experiment with modifications, please be my guest. The `graphviz` source is here.


title: Set page size in mm's

text: A contact has asked for a documents pages to be set to 130 x 198mm - and so my `\documentclass[12pt,a5paper]{book}` isn't going to cut it - how do I specify page size in mm?


title: How to suppress "underfull \vbox" warning for one specific \marginpar

text: I have just started using LaTeX, so forgive me if this is a basic question. I have a `\marginpar` in a two column article. It is very narrow (despite me increasing `\marginparwidth`). When the document is rendered I get the error message               Underfull \vbox (badness 1102) has occurred while \output is active      I understand why I am getting it and I am happy to live with it, as the output looks ok to me. I would like to suppress this warning message in relation to the specific `\marginpar` that I know is causing it, but without disabling the appearance of other potential error or warning messages. Is this possible?


title: Is there any solution to include Java Applets in presentations/beamers?

text: I am preparing a presentation on the compiler Texmaker "documentclass" in "beamer". I was fascinated with the package "multimedia" which is a solution to include movies in the presentation. Question: Is there any solution to include Java Applets in presentations/beamers or a link to webpage? Thank's.


title: Problems shrinking margins with fncychap and memoir class

text: Hullo all. I am typing/editing a doc using the `memoir` class and Bjornstrup fancy chapter headings. Whenever I try to adjust [shrink] the margins using the `geometry` package, 'odd' things happen: the bottom right corner of the greyed-in header which is 'behind' [for lack of a better word] the chapter number starts to disappear: bit-by-bit. Here is my attempt to reproduce a MWE: The first is my `ruleofprayer.tex f`ile:               \documentclass[a4paper,12pt,twoside]{book}     \input{preamble}     \begin{document}     \include{chapter1}     \end{document}      Then, here is my `preamble.tex` file:               \usepackage{lmodern}     \usepackage{geometry}     \usepackage[dvipsnames]{xcolor}     \usepackage{amssymb}     \usepackage{framed}     \usepackage{indentfirst}     \usepackage{changes}     \usepackage[Bjornstrup]{fncychap}     \usepackage[pagestyles]{titlesec}     % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %     \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont}     \ChTitleVar{\raggedleft\Huge\sffamily\bfseries}          \titleformat{\section}[display]     {\normalfont\Huge\scshape\mdseries\centering}{}{16pt}{\Large}     \titlespacing*{\section}     {0pt}{20pt}{16pt}          \titleformat{\subsection}     {\normalfont\Large\bfseries\centering}{}{1em}{}     \titlespacing*{\subsection}     {0pt}{3.25ex plus 1.0ex minus 0.2ex}{1.5ex plus 0.2ex}          \titleformat{\subsubsection}     {\normalfont\large\scshape\mdseries\centering}{}{1em}{}     \titlespacing*{\subsubsection}     {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}          \titlespacing{\section}{0pt}{*2}{*2}     \titlespacing{\subsection}{0pt}{*2}{*2}     % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %      \geometry{       left=2.85cm,       right=2.85cm,       top=1.95cm,       bottom=2.25cm     }     % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %      \newpagestyle{main}{     \headrule     \sethead[\scshape\chaptertitle][][]{}{}{\slshape\chaptertitle}     \setfoot[][\thepage][]{}{\thepage}{}     }     \pagestyle{main}      And finally a brief portion of `chapter1.tex`:               \chapter{Saturday Evening Prayers}     Towards evening, we stand before the holy icons (having lit a candle and   maybe some incense), with reverence and fear of God; we gather our thoughts, make the Sign of the Cross, and say:          In the Name of the Father, and of the Son, and of the Holy Spirit. Amen.          \begin{framed}     From St. Thomas Sunday until Ascension, instead of \textbf{O God, cleanse me, a sinner \ldots we say:}     Christ is risen from the dead, trampling down death by death, and upon those in the tombs bestowing life.     \end{framed}          Afterwards, we collect our thoughts, and make seven prostrations (or metanoias), saying:          \section*{The Seven--Bow Beginning}      If I leave the `geometry` package alone (i.e. without any values assigned to it) the greyed-in background turns out as a nice rectangle as it should; only when I attempt to 'meddle' with the geometry and mess with the margins do I encounter the problem. Thanks! I apologize for not properly splitting the files up before. I hope this clarifies the MWE.


title: Drawing node in tikz with both background fill and grid pattern?

text: Is it possible to use the grid pattern on a node but also setting a background color to it, say blue? I want to use something like               \node (b) [fill=red, pattern=grid] {b};      I am aware of the solution here: How to combine fill and pattern in a pgfplot bar plot?, but it does not seem to apply directly to a node. Thanks in advance!


title: Wrong small cap title in toc

text: In what follows, I do not know why the "a" of the appendix in the toc is not a small cap?               \documentclass[12pt]{book}     \usepackage{kpfonts}           \DeclareRobustCommand{\capsspacing}{\scshape\MakeLowercase}     \usepackage[linktocpage=true]{hyperref}                     \usepackage[titles]{tocloft}     \renewcommand{\cftchappresnum}{\normalfont}%     \renewcommand{\cftchapfont}{\capsspacing}%     \renewcommand{\cftchappagefont}{\normalfont}%           \begin{document}     \tableofcontents     \appendix     \chapter{title}     \end{document}


title: How do I make the figure float [H] here when I use SCfigure?

text: When I was using `\begin{figure}....\end{figure}`, I was able to fix the figure in the location using the `[H]`, `[h]`, or `[h!]` options, but that doesn't work when I use `SCfigure`. How do I fix a `SCfigure` in place?               \documentclass[12 pt , twoside, a4paper] {article}     \usepackage[pdftex]{graphicx}     \usepackage{sidecap}     \begin{document}     \begin{SCfigure}     \includegraphics[scale=0.5]{EffectiveArea}     \caption{height of cylinder=v$\Delta$t  \newline     volume of cylinder=$\pi (2r)^2(v\Delta t)$  \newline     number of collision per second=$\frac{N}{V_{molecule}}V_{cylinder}     \newline \quad \quad \quad \quad =\frac{N}{V_{molecule}}\pi (2r)^2(v\Delta t)$}     \end{SCfigure}     \end{document}      And the error is: `! LaTeX Error: \caption outside float`.


title: LaTeX template for the journal "Blood"

text: Does anybody know where I can find a LaTeX template for publishing articles in "Blood", the journal of the American society of Hematology?


title: Torus with semi-dashed line in TikZ

text: Is there a simple way to produce in TikZ a two-torus rounded by two circles, each with the non-visible half dashed, as in the sketch?![enter image description here](http://i.stack.imgur.com/nWQdS.png)


title: Infinite canvas

text: It seems that all LaTeX formatting assumes we will ultimately print the document but if the goal is to publish online - under some circumstances, we might desire to have all the document in one "infinite" page so the reader can scroll it. That is the idea behind the infinite canvas. How should go about to try to implement this idea in a TikZ picture? How to avoid the picture being cropped by the page length set by document class?


title: Wrong toc small cap heading

text: In what follows, the toc heading is wrong except for the last page and I cannot find a solution. I've been trying to modify the `\tableofcontents` as well as the `\toc@heading` commands without success.               \documentclass[12pt]{book}     \usepackage[left=3.8cm,right=3.8cm,top=10cm,bottom=10cm,letterpaper]{geometry}     \usepackage{kpfonts}             \DeclareRobustCommand{\capsspacing}[1]{\textsc{\MakeLowercase{#1}}}     \usepackage[linktocpage=true]{hyperref}                   \begin{document}     \tableofcontents     \markboth{\capsspacing{\contentsname}}{\capsspacing{\contentsname}}     \chapter{title}\section{title}\section{title}\section{title}\section{title}\section{title}\section{title}     \chapter{title}\section{title}\section{title}\section{title}\section{title}\section{title}\section{title}     \chapter{title}\section{title}\section{title}\section{title}\section{title}\section{title}\section{title}     \end{document}      The toc heading is supposed to be in small caps for all toc pages.


title: Using a math operator inside a 'cases' environment

text: When I do this:               \begin{equation}      b_i =     \begin{cases}     arg \min_{\forall p \in B} d(a_i, p) & \text{if } d(a_i, b_i) < D_{max}     \\     \text{undefined} & \text{otherwise}     \end{cases}     \end{equation}      the `_` doesn't cause the following text to go below `\min`, but rather appear as a subscript. Is it possible to make a `\min` expression with the following text below it inside a `cases` environment?


title: Use citeauthor with a bibliography style other than plainnat

text: I am trying to use `\citeauthor` from the `natbib` package with a bibliography style that is provided by a journal. Is this possible? I looked at `plainnat.bst`, but I didn't see any instances of `\citeauthor` that I was hoping to just copy into `mystyle.bst`. I saw this thread: Using \citeauthor in custom bibliography style but don't understand the solution. Here are some demo tex/bib files: http://daviddoria.com/Uploads/Bibtex/ When I use `\bibliographystyle{ieee}`, I get "author undefined" errors on the `\citeauthor` lines. It works fine if I use `\bibliographystyle{plainnat}`. Is it possible to use `\citeauthor` with this IEEE style?


title: enumitem newlist with etaremune

text: I am entering my publications into the CV. Currently, I am using `enumitem` to define a new enumerate list as follows:               \makeatletter     \newlength{\bibhang}     \setlength{\bibhang}{1em}     \newlength{\bibsep}      {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}     \newlist{bibenum}{enumerate}{3}     \setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%         itemindent=-\bibhang,         itemsep=\bibsep,parsep=\z@,partopsep=0pt,         topsep=0pt}     \let\oldendbibenum\endbibenum     \def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}     \makeatother      And add the publications as follows:               \begin{bibenum}     \item \bibentry{pub1}     \item \bibentry{pub2}     \end{bibenum}      It works fine (an example shown below) ![example](http://i.stack.imgur.com/E57vl.png) but gives the numbers in increasing order. Instead I want them in decreasing order. So, I tried using the `etaremune` package as follows               \makeatletter     \newlength{\bibhang}     \setlength{\bibhang}{1em}     \newlength{\bibsep}      {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}     \newlist{bibenumr}{etaremune}{3}     \setlist[bibenumr]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%         itemindent=-\bibhang,         itemsep=\bibsep,parsep=\z@,partopsep=0pt,         topsep=0pt}     \let\oldendbibenumr\endbibenumr     \def\endbibenumr{\oldendbibenumr\vspace{-.6\baselineskip}}     \makeatother      But it gives an error of `undefined control sequence...Package enumitem Error: Unknown list type 'etaremune')`. Any ideas what is wrong? Is it possible to use `etaremune` with `enumitem` package? EDIT: As pointed out by egreg, I cannot use etaremune with enumitem. Does anyone know any other way to do it? Basically a reverse numbered list with flexibility of defining the way it looks (like square brackets, indentations, separations etc. Following is a minimum working example. I started from a template I found online and tried to remove all the unnecessary commands. Any help?               \documentclass[11pt]{article}          % This is a helpful package that puts math inside length specifications     \usepackage{calc}          % Layout: Puts the section titles on left side of page     \reversemarginpar          %% Use these lines for letter-sized paper     \usepackage[paper=letterpaper,                 marginparwidth=1.2in,     % Length of section titles                 marginparsep=.05in,       % Space between titles and text                 margin=1in,               % 1 inch margins                 includemp]{geometry}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% DEFINE THE "bibenum" list using enumitem package     %%% Need to modify this such that "bibenum" gives reverse numbering instead     \usepackage[shortlabels]{enumitem}          \makeatletter     \newlength{\bibhang}     \setlength{\bibhang}{1em}     \newlength{\bibsep}      {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}     \newlist{bibenum}{enumerate}{3}     \setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%             itemindent=-\bibhang,             itemsep=\bibsep,parsep=\z@,partopsep=0pt,             topsep=0pt}     \let\oldendbibenum\endbibenum     \def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}     \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \usepackage{hyperref}          %%% SECTION HEADINGS     \renewcommand{\section}[1]{\pagebreak[3]%         \vspace{1.3\baselineskip}%         \phantomsection\addcontentsline{toc}{section}{#1}%         \noindent\llap{\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%         \vspace{-\baselineskip}\par}          \begin{document}          \section{\textbf{Journal Publications}}          \begin{bibenum}         \item pub1         \item pub2         \item pres1         \item pres2     \end{bibenum}          \end{document}


title: Comma after first author name in authoryear biblatex style with two authors

text: I am using the following:               \documentclass{article}     \usepackage[american]{babel}     \usepackage{filecontents}          \usepackage[style=authoryear,%     natbib=true,      % enable natbib macros     %firstinits=true, % use initials as first names     dashed=false,     % do not use a dash instead of author name in case of several publications     useprefix=true,     maxnames=100,     % in the bibliography show all names     maxcitenames=2,   % in the text use et al. for more than 2     backref=true,     % have backrefs in the bibliography     ]{biblatex}     \setlength\bibitemsep{1mm}     \setlength\bibhang{1cm}          %print authors in smallcaps everywhere     \renewcommand*{\mkbibnamelast}[1]{%       \ifmknamesc{\textsc{#1}}{#1}}          \renewcommand*{\mkbibnameprefix}[1]{%       \ifboolexpr{ test {\ifmknamesc} and test {\ifuseprefix} }         {\textsc{#1}}         {#1}}          \def\ifmknamesc{%       \ifboolexpr{ test {\ifcurrentname{labelname}}                    or test {\ifcurrentname{author}}                    or ( test {\ifnameundef{author}} and test {\ifcurrentname{editor}} ) }}          \begin{filecontents}{\jobname.bib}     @Article{gillies,       author = {Gillies, Alexander and Mister Miller},       title = {Herder and the Preparation of Goethe's Idea of World Literature},       journaltitle = {Publications of the English Goethe Society},       volume = {9},       date = {1933},       pages = {46--67}}     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \citep{gillies}     \printbibliography     \end{document}      However this gives: `GILLIES, Alexander and Mister MILLER (1933). “Herder and the Preparation of Goethe’s Idea of World Literature.” In: Publications of the English Goethe Society 9, pp. 46–67 (cit. on p. 1).` But I want: ` GILLIES, Alexander, and Mister MILLER (1933). “Herder and the Preparation of Goethe’s Idea of World Literature.” In: Publications of the English Goethe Society 9, pp. 46–67 (cit. on p. 1).` How can i add the comma?


title: What's the elegant way to spread subfigures on the multiple pages?

text: Having 3 figures that thematically should stay together in one `figure` environment as subfigures (I'm using `subfig` currently), I know that there's no way to **allow those pictures to separate** over few pages automatically with `subfig` (according to 13.pg of documentation). Is there a way to do this with some other package? **\- OR -** What's the most elegant way to do this?


title: "Escaping" Linux kernel version in latex

text: I'm trying to include a kernel version info (i.e. `\texttt{2.6.40.4-5.fc15.x86_64}`) in my LaTeX document. However, LaTeX keeps trying to put it into "math-text" ("Missing $ inserted" and so on). How do I escape this text, so that I can place it as text, not an equation?


title: Is there a bibstyle for the Nature journal?

text: I'm writing a manuscript to submit to this journal, and I'm using bibtex. Problem is: I can't find any bibliography style files that comply to the demands of the journal. Does anyone know if there's a format for that? The format requires (for articles being cited):   * Last-name-first authors, with abbreviated first names: `Dylan, B. & Doe, J.`   * Full title, only first word capitalized, no italic, ending with a full stop: `This is a title.`   * Name of the journal in italics: _`Nature`_   * Volume number (and comma) in bold: **`323,`**   * Followed by page and (in curved brakets) year. So it would end up like this   Dylan, B. & Doe, J. This is a title. _Nature_ **323,** 89-92 (1999) Does anyone know of a bibstyle that complies to these rules?


title: Setting result from pgfmathifthenelse as variable

text: So I'm trying to set a variable using the value of another variable. Basically something like below:               \pgfmathsetmacro{\newVar}{\pgfmathifthenelse{\oldVar==0}{(\x/2)}{\x}}      But no matter what I do I can't seem to get the syntax right. I'm assuming it has something to do with expanding stuff, but can't figure out what is and isn't needing to be expanded. I can't find anything on this that makes sense. All the ones I've seen use the if/then to actually output things rather than set them as variables. Any thoughts?


title: Normal probability plot with percentile grid and axis

text: How can I make a normal probability plot with a percentile grid and y-axis as shown in figure? I've read the pgfplots documentation but i can't find anything useful. ![Normplot](http://i.stack.imgur.com/20ziO.png)


title: A wheel of fortune

text: To motivate my students to participate I have divided my class into teams. I want to randomly draw the name of a team to come to board. And of course I want to do it the hard way. I want a PDF file with a list of names so that every time I click somewhere on it, it randomly pops some name up. With some pizzazz! Is this possible? Can a PDF file have a random number generator embedded? Edit: What I need is a sample LaTeX file where a random number generator controls the appearance of the resulting PDF file every time a button on the PDF file is clicked. In my application the fixed portion of output page may have a rectangular array or circular list of names. The animation could consist of highlighting different names/blocks in a random fashion until it stabilizes to a particular block.


title: How to import data from a CSV file in a figure caption using csvsimple?

text: I have made a pretty report that gets all the data from CSV files `data.csv` like this :               Images,Infos,Bayer,BilineaireA,BilineaireB,TeinteA,TeinteB,ContourA,ContourB,Forme          img1(illusion),Temps (en ms),0,4,5,7,6,6,7,442     img1(illusion),Erreur MSE,152.44,34.44,34.44,24.04,24.04,24.06,25.99,32.90     img1(illusion),Erreur DeltaE,17.70,4.92,4.92,4.58,4.58,4.39,4.30,5.24     img1(illusion),Erreur PSNR (en dB),26.30,32.76,32.76,34.32,34.32,34.32,33.98,32.96          img2(points1),Temps (en ms),0,1,4,3,3,2,3,123     img2(points1),Erreur MSE,6.28,3.83,3.83,3.24,3.28,2.69,2.36,2.56     img2(points1),Erreur DeltaE,0.79,1.09,1.09,0.72,0.72,0.63,0.34,0.60     img2(points1),Erreur PSNR (en dB),40.15,42.30,42.30,43.02,42.97,43.83,44.41,44.05     ...      I've written many macros like the one below which reads the MSE error for an image `#1` generated using a given algorithm `#2` (be gentle, it's the first time I write my own macro !) :               \newcommand{\MSE}[2]{%     \csvreader[ head to column names,%                 before filter=\ifthenelse{ \equal{\Images}{#1} }{%                               \ifthenelse{ \equal{\Infos}{Erreur MSE} }{\csvfilteraccept}{\csvfilterreject}%                                }{\csvfilterreject}]%                {data.csv}{}{#2}%     }      Nevertheless, it seems that I can't use my macros inside captions of figures (and subfigures too). Here is a minimal example that fails :               \begin{filecontents*}{data.csv}     Images,Infos,Bayer,BilineaireA,BilineaireB,TeinteA,TeinteB,ContourA,ContourB,Forme          img1(illusion),Temps (en ms),0,4,5,7,6,6,7,442     img1(illusion),Erreur MSE,152.44,34.44,34.44,24.04,24.04,24.06,25.99,32.90     img1(illusion),Erreur DeltaE,17.70,4.92,4.92,4.58,4.58,4.39,4.30,5.24     img1(illusion),Erreur PSNR (en dB),26.30,32.76,32.76,34.32,34.32,34.32,33.98,32.96     \end{filecontents*}     \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{csvsimple}          \newcommand{\MSE}[2]{%     \csvreader[ head to column names,%                 before filter=\ifthenelse{ \equal{\Images}{#1} }{%                               \ifthenelse{ \equal{\Infos}{Erreur MSE} }{\csvfilteraccept}{\csvfilterreject}%                                }{\csvfilterreject}]%                {data.csv}{}{#2}%     }          \begin{document}     \listoffigures     \begin{figure}         \centering         My Image         \caption{A caption \MSE{img1(illusion)}{\BilineaireA} }     \end{figure}     \end{document}      I can read `! TeX capacity exceeded`. If I put my command inside a `minipage` environment, I get the following error :               Argument of \@caption has an extra }      Thank you for your help !


title: How can I restrict `pgfplots` plot to an interval manually?

text: OK, I've plotted these graphs but am unable to stretch the second one, so that **they both have the same values on the vertical lines** drawn from one to another. I've tried to set `domain=0:2200` for both but it doesn't work.![alt text](http://i.stack.imgur.com/kRaYy.png)


title: Reducing Vertical Margin List of Equations

text: I am trying to add a List of Equations to my dissertation that matches the style of the list of tables and list of figures. I am very close but am hung up on the last step. How can I reduce the vertical space between the "EQUATION .. PAGE" line and the line that shows the first equation? ![enter image description here](http://i.stack.imgur.com/IlfhV.png) I am using the tocloft package and the code to generate this table is shown below               \newcommand{\listequationsname}{LIST OF EQUATIONS \vskip 0.0in \noindent     \textnormal{EQUATION} \hfill \textnormal{PAGE}}     \newlistof{myequations}{equ}{\listequationsname}     \newcommand{\myequations}[1]{%     \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}     \setlength{\cftmyequationsnumwidth}{2.5em}% Width of equation number in List of Equations     \setlength{\cftmyequationsindent}{2em}      I think I am looking for another `\setlength` command but have scoured the `tocloft` documentation and cant seem to find what parameter to set.


title: Help me compile this code

text: \documentclass{article}     \usepackage{amsmath}     \usepackage{algorithm2e}          \begin{document}     \begin{algorithm}     \caption{CAS}\label{CAS}      {$\sum^{N_{C}}_{i=1}$$L_C$} $\gets$ position of \textit{$canditate_i$}\\     {$\sum^{N_{C}}_{i=1}$$D_{C_i}$} $\gets$ distance of \textit{(eNB,$canditate_i$)}\\     \textit{$i$}=$N_C$\\     sort $D_{C_i}$ by descending order\\     $i=N_C$     \While{\textit{$i$}> 0}{     \textit{$i$}= \textit{$i$} - 1          \textit{select $canditiate_i$ as agent}          \textit{random($$D_{C_i}$}select $canditate_i$ as agent}     }               \end{algorithm}     \end{document}      I encounter a compile problem. I think I'm not Not familiar with its algorithm2e's grammar. please help me fix this code!!


title: URW-Garamond with mathdesign is typesetting vertical double-quote as vertical double-quote

text: I just started using URW-Garamond with mathdesign, and it's typesetting straight double-quote character as a straight double-quote rather than a right double-quote. How can I fix this? That is, when I put this in my header:               \usepackage[T1]{fontenc}     \usepackage[urw-garamond]{mathdesign}      I get a nice Garamond in my output, but `"` in my input file produces a Garamond version of the same character in the output. If I use two single- quotes instead, it comes out properly as a double right-quote. I could switch to typing `''` or set up a macro, but this is undesirable for more than one reason. Is there any way to use urw-garamond without this non-traditional behavior for `"`?


title: Creating Hotkeys in LyX

text: How I can I create hotkeys for some of the features in LyX? Are there keyboard shortcuts for the "Horizontal Space" feature?


title: Using a string defined with \newcommand as a function argument

text: I'm currently using LaTeX to make a poster, which is all going very nicely. However for each of the seven boxes on the poster, I've got to pass eight arguments which may change in the future. I thought a sensible thing to do would be:               \newcommand{\details}{textborder=roundedsmall,borderColor=black,headerborder=open,linewidth=1,boxshade=plain,boxColorOne=box,headerColorOne=head1,headerColorTwo=head2}      and then:               \headerbox{Aims}{name=aims,column=0,below=background,\details}{         Aims     }      However this throws out an error               Package xkeyval Error: blabla (the contents of \details) undefined in families posterbox.      I have checked that replacing the `\details` with the contents of the custom command works fine! Any ideas on how to solve this?


title: Is it possible to compile hidden files?

text: (This question may make sense only in Linux.) I have the following simple file called `.main.tex`. Note that it is a "hidden" file because of its name.               \documentclass[]{article}     \begin{document}     sample     \end{document}      I cannot compile it the usual way `pdflatex .main.tex` because I get this error:               $ pdflatex .interpolation.tex     This is pdfTeX, Version 3.1415926-2.6-1.40.14 (TeX Live 2014/dev)      restricted \write18 enabled.     entering extended mode     (./.main.tex     ...     No file .main.aux.     pdflatex: Not writing to .main.aux (openout_any = p).     ! I can't write on file `.main.aux'.     \document ...ate \openout \@mainaux \jobname .aux                                                        \immediate \write \@mainau...     l.4 \begin{document}     (Press Enter to retry, or Control-D to exit; default file extension is `.tex')     Please type another output file name:       Of course if the filename were `main.tex` it would work. **Is there a workaround to compile dot files directly?** Or is this another limitation of how TeX detects file extensions (confused by the dots)? * * * Note that other related but different questions where asked before, this is however different: (windows) TeX engine can't write on hidden aux files in Windows (cleanup related) Is there a way to configure pdflatex to make all but the .tex and .pdf files hidden files? (limitations of extension handling) How to avoid automatic .tex extension in filenames?


title: How to add “cont.” section title to the top of pages?

text: I have a document that contains few small sections. What I would like is if the section name was repeated at the top of page body (not in the header), if new section doesn't start on that page. And the repeated name should include something like “(cont.)”. So, for example:               Page 1:     ----     Section 1          Some text …     ----          Page 2:     ----     Section 1 (cont.)          More text …          Section 2          Even more text …     ----          Page 3:     ----     Section 3          The end.     ----      How can I do this in LaTeX?


title: How to define an environment that takes a number of arguments and produces a table

text: What is the best way to create an environment that takes a number of arguments, like this:               \finding{%     Text argument #1,     Text argument #2,     Text argument #3,     Text argument #4}      and produces something like this:               \documentclass[11pt,letterpaper]{article}          \begin{document}     \begin{table}     \begin{tabular}{|l|l|}      \multicolumn{1}{l}{\textbf{Finding \foo}} \\     \hline     \textbf{Synopsis:}  & \textbf{Text argument \#1} \\     \hline     Recommendation:     & Text argument \#2 \\     \hline     Comments:           & Text argument \#3 \\     \hline     Risk value          & Text argument \#4 \\     \hline     \end{tabular}     \end{table}     \end{document}      Where `\foo` is a custom stepcounter defined by               \newcounter{bar}     \newcommand{\foo}{%         \stepcounter{bar}%         \thebar}


title: Changing the section and subsection font color in contents page in beamer

text: ![my contents page](http://i.stack.imgur.com/cmHoC.jpg) I want to change the section and subsection names in my contents page on beamer. Plz help me. Thanx in advance


title: How can I use \footnotemark with a \ref argument?

text: I want to refer to an existing footnote and I'm not happy with the workaround given here: http://anthony.liekens.net/index.php/LaTeX/MultipleFootnoteReferences I found that I can put a `\label` inside a footnote and then get the footnote- number by a `\ref` to this label. I'm not sure what would be the best way to reference to a footnote, but I would have formatted it like a normal footnote number (superscript). I tried to write `\footnotemark[\ref{LabelName}]`, but that produces an error. Can anybody help? Is there any reason why I should not do it like that? (any risk of failure?)               \documentclass[11pt]{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}          \usepackage[T1]{fontenc}           \begin{document}          First footnote\footnote{\label{Firstfootnote}My first footnote}          Second footnote\footnote{Second Footnote}          Third footnote where I want to refer to first footnote\footnote{I now want to refer to the first footnote by \ref{Firstfootnote}, but I'd like to format it like \footnotemark[1], but footnotemark[ref{Firstfootnote}] produces an error}          \end{document}      \-- **(my) solution:** add `\usepackage{refcount}` and use `\footnotemark[\getrefnumber{Firstfootnote}]`


title: How can I use `catchfile` package to gobble first characters on a line

text: When using the `fancyvrb` environment `Verbatim`, you can gobble the first `n` characters of each line before printing it out. I'd like to be able to do something similar, but not via verbatim. In the following MWE, I would like to read in the file:                   \textbf{This is the first line.}     %%  \textbf{This is the second line.}      and have LaTeX process it as though it'd been passed a file:               \textbf{This is the first line.}     \textbf{This is the second line.}      Here's an example of what I've tried, but it doesn't work as hoped:               \begin{filecontents*}{aetesting}         \textbf{This is the first line.}     %%  \textbf{This is the second line.}     \end{filecontents*}     \documentclass{article}     \usepackage{catchfile}     \def\gobblefirst#1#2#3#4{}     \def\mysetup{\let\do\gobblefirst\dospecials}     \CatchFileDef{\aemyfile}{aetesting}\mysetup     \begin{document}          \aemyfile          \end{document}      **UPDATE** I can almost get this to work (without `catchfile`)               \begin{filecontents*}{aetesting}       The character of the First Caesar has perhaps never been worse       appreciated than by him who in one sense described it best; that is,            \textbf{This is the first line.}\par     %%  \textbf{This is the second line.}               %%  Great as Caesar was by the benefit of his original nature, there can be       no doubt that he, like others, owed something to circumstances; and     \end{filecontents*}     \documentclass{article}     \makeatletter          \newread\file     \newcommand\aeomit[2]{}     \newcommand\myaccumulatedfile{}     \newcommand*\aegobbleinput[1]{%       \IfFileExists{#1}{%         \openin\file #1         \begingroup         \endlinechar\newlinechar         \loop\unless\ifeof\file           \obeyspaces           \readline\file to\foo           \edef\myaccumulatedfile{\myaccumulatedfile\expandafter\@gobbletwo\foo\relax\relax}%%         \repeat         \closein\file         \expandafter\endgroup         \scantokens\expandafter{\myaccumulatedfile}       }{%         \errmessage{File `#1' doesn't exist!}%       }%     }          \makeatother     \begin{document}          Try:          \aegobbleinput{aetesting}          \end{document}      The problem is that leading spaces are ignored and I don't want them ignored. Also my line break before `\textbf{This is the first line.}` is no longer properly treated as a paragraph break. :( **Further update** Thinking I might try this in LaTeX3, I run into even more troubles.               \usepackage{xparse}     \ExplSyntaxOn          \ior_new:N \g_ae_fh_ior     \tl_new:N  \l_ae_fh_line_tl          \cs_new:Npn \__ae_gobble:n #1        {         \file_if_exist:nTF { \__ae_open:n { #1 } }                            { \typeout{no file!}  }       }          \cs_new:Npn \__ae_open:n #1       {         \ior_open:Nn           \g_ae_fh_ior { #1 }         \ior_str_map_inline:Nn \g_ae_fh_ior { \tl_gput_right:Nn \l_ae_fh_line_tl {##1 \par}}         \ior_close:N           \g_ae_fh_ior       }          \NewDocumentCommand{\aegobbleinput}{m}         {           \__ae_gobble:n {#1}         }          \ExplSyntaxOff      Here I'm not even trying to truncate anything. But I can't get LaTeX to read the file. I get one of two errors with this code. When I try to use the `inline` map, I get the error               ! Illegal parameter number in definition of \l__file_internal_name_tl.     <to be read again>                         1     l.6 \aegobbleinput{aetesting.tex}          ?       If I get rid of that line, even though getting rid of it should result in nothing getting parsed, I get the error message               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ! LaTeX error: "kernel/space-in-file-name"     !      ! Space in file name '\ior_open:Nn \g_ae_fh_ior {aetesting.tex}\ior_close:N     ! \g_ae_fh_ior '.     !      ! See the LaTeX3 documentation for further information.     !      ! For immediate help type H <return>.     !...............................................            l.6 \aegobbleinput{aetesting.tex}          ?       which makes absolutely no sense to me particularly because I'm very closely following the example as posted here.


title: Proposition command doesnt work

text: Please refer to the below code:               \documentclass[a4paper,11pt]{report}      \usepackage{a4wide}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{url}     \usepackage{fixltx2e}     \usepackage{caption}     \usepackage{subcaption}     \oddsidemargin 0.0in     \textwidth 6.27in     \topmargin -0.5in     \textheight 9.69in     \footskip 0.5in     \urlstyle{sf}     \usepackage{fancyhdr}     \makeatletter     \newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}     \makeatother     \usepackage{epstopdf}     \usepackage{multirow}     \usepackage{subfig}     \linespread{1.3}     \usepackage{float}     \usepackage{enumerate}     \usepackage{enumitem}     \usepackage{multirow}     \usepackage{amsmath, amsthm, amssymb}          \begin{document}     \begin{prop}     1. $x=Y+z$ \\     2. $\alpha=1-x$     \end{prop}     \end{document}


title: How can i pull an example out of a dtx file?

text: The central question is how can i convert a part of a dtx file to straight LaTeX. In learning more about a package, I want to play with an example from a dtx? The output shows up in the pdf. The dtx, however has the code layed out like:               % \latexcommand          % some text that prints          % \morelatexcode      I cannot determine what packages are needed and why just removing the "% " does not work. The code i want to play with is from longtable.dtx, but there are other dtx files that have interesting examples that i would like to play with.


title: TikZ: placing square brackets (or open rectangles) perpendicular to lines forming a circle?

text: I am drawing a little sketch depicting an experiment (code below): ![enter image description here](http://i.stack.imgur.com/In8ST.png) At the arrows (under % Outgoing lines in the code) to the right I would like to place little rectangles with their long side perpendicular to each arrow (what would be even better if those rectangles were more like square brackets, i.e. unfilled rectangles with thick lines and the long side closer to the arrow not drawn). The size of such a rectangle should be just big enough so that the heads of the upper two lines can "fit" into one. Since I have defined the arrows to have the same length and just point away from a certain central point under different angles, their end points essentially lie on a circle. Any ideas how I can achieve what I outlined above?               \documentclass[article]          \usepackage{tikz}     \usetikzlibrary[patterns]          \begin{document}          \pagestyle{empty}          \begin{tikzpicture}              % Beam, upper border         \fill[draw opacity=0,pattern color=gray,pattern=horizontal lines] (-2,0.8) rectangle (2,-0.8);         % Beam direction         \draw[->,thick] (-1.5,0) -- (1.5,0);         \draw[latex-] (1.0,0.5) -- ++(80:1.5cm) node[right]{Beam};              % Slit, uppper part         \fill[black] (-0.125,3) rectangle (0.125,0.8);         % Slit, lower part         \fill[black] (-0.125,-0.8) rectangle (0.125,-3);              % Target         \draw[pattern=north east lines]  (1.9,0.7) rectangle (2.1,-0.7);         \draw[latex-] (2.0,-0.7) -- ++(260:1.5cm) node[right]{Target};              % Outgoing lines         \draw[->] (2.2,0.0) -- +(45:2cm);         \draw[->] (2.2,0.0) -- +(35:2cm);         % Area element         \draw[<->] (2.2,0.0) +(35:1.5cm) arc [start angle=35,delta angle=10,radius=1.5cm];         \draw[-latex] (2.2,0.0) ++(38:1.5cm) ++(0cm,1cm) node[above]{$d$} -- ++(0cm,-0.95cm);              \draw[->] (2.2,0.0) -- +(0:2cm);         \draw[->] (2.2,0.0) -- +(-45:2cm);          \end{tikzpicture}          \end{document}               \usepackage{tikz}     \usetikzlibrary[patterns]          \begin{document}          \pagestyle{empty}          \begin{tikzpicture}              % Beam, upper border         \fill[draw opacity=0,pattern color=gray,pattern=horizontal lines] (-2,0.8) rectangle (2,-0.8);         % Beam direction         \draw[->,thick] (-1.5,0) -- (1.5,0);         \draw[latex-] (1.0,0.5) -- ++(80:1.5cm) node[right]{Beam};              % Slit, uppper part         \fill[black] (-0.125,3) rectangle (0.125,0.8);         % Slit, lower part         \fill[black] (-0.125,-0.8) rectangle (0.125,-3);              % Target         \draw[pattern=north east lines]  (1.9,0.7) rectangle (2.1,-0.7);         \draw[latex-] (2.0,-0.7) -- ++(260:1.5cm) node[right]{Target};              % Outgoing lines         \draw[->] (2.2,0.0) -- +(45:2cm);         \draw[->] (2.2,0.0) -- +(35:2cm);         % Area element         \draw[<->] (2.2,0.0) +(35:1.5cm) arc [start angle=35,delta angle=10,radius=1.5cm];         \draw[-latex] (2.2,0.0) ++(38:1.5cm) ++(0cm,1cm) node[above]{$d$} -- ++(0cm,-0.95cm);              \draw[->] (2.2,0.0) -- +(0:2cm);         \draw[->] (2.2,0.0) -- +(-45:2cm);          \end{tikzpicture}          \end{document}