title: How can I find the location (coordinates) between two ticks in pgfplots?

text: I would like to change the behavior of `pgfplots` for the placement of tick scale labels and units. My desired placement would be or between the last two ticks or in place of the second last tick. For units, this function isn't existing yet, but at least it is possible to define the units separately as part of the `\usepgfplotslibrary{units}`. Maybe in future this will be possible to define their placement. For the tick scale labels, placement is possible with `every tick scale label/.style={}` (s. page 277 in the manual). For that, I am having two questions.   * Is there a possibility to find the coordinates between the last two ticks (e.g. in style of `(xticklabel cs:...)`)?    * How can I prevent overlapping? If to narrow, the tick scale label shall be positioned in place of the second last tick label. For that, this tick label has to be disabled. * * * The placement of units is also discussed here without solution. * * * **Edit** Here is an MWE for workaround. `\cdot 10^{-2}` should be between 1.3 and 1.2. I would like it more with `\times` in stead of `\cdot`.               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[sticky-per]{siunitx}          \usepackage{tikz}     \usepackage{pgfplots}     \SendSettingsToPgf %follow localization     \usepgfplotslibrary{units}     \pgfplotsset{                 compat=1.8,                  unit marking pre={\!\!/},                  unit marking post={},                 y label style={rotate=-90},                 %scale ticks above exponent = 1, %choose between scaling to one number before comma or to multiples of 3                 %scaled ticks=engineering, http://tex.stackexchange.com/a/124268/32245                 }          \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}       \begin{axis}[         yticklabel=$\pgfmathprintnumber{\tick}$,%follow localization         xticklabel=$\pgfmathprintnumber{\tick}$,%follow localization             %Problem here: for `scaled ticks=false` and big numbers, the numbers overlap             xlabel=$\vartheta$, ylabel=$P$,             x unit= \si{\kelvin}, y unit= \si{\watt},             %scaled x ticks=false, %or {base 10:-3}, local manipulation of scaling             %scaled y ticks={base 10:-2}, %or false, local manipulation of scaling                     ]         \addplot coordinates {             (1000,.01)             (2000,.011)             (3000,.012)             (4000,.013)         };       \end{axis}     \end{tikzpicture}     \caption{Loss $P$ over temperature $\vartheta$}     \end{figure}     \end{document}      Some extras coming up when seeing my result:   * Why isn't there a `10^3` on the x axis?   * This x tick scale label would be a candidate to be positioned _on_ the 3,500 tick   * Possibility to move units to the coordinates I am searching in this post. E.g. `\si{\kelvin}` in place of the 3,500 tick   * Parsing all numbers in ticks in respect to the `siunitx` localization


title: Print macro content with condition

text: I would like something like the following:               \documentclass{article}     \newcommand{\acell}{}     \newcommand{\bcell}     \newccomand{\zcell}[1]{#1}     \ifx\acell{A}      \ifx\bcell{A}       \zcell{yes}      \else       \zcell{no}      \fi     \else     \fi     \begin{document}     \begin{tabular}{ccc}     \acell{A} & \bcell{A} & \zcell{} \\     \acell{A} & \bcell{B} & \zcell{} \\       \end{document}      But this code does not work. It does not print "yes" and "no" where the 'zcell' macro is. Is it possible to achieve this?


title: Non italic math mode symbols?

text: I would like to insert a `\mu` command to form `$\mu$` m (micro meters) i.e. as a unit, not a variable. This means I do not want `\mu` to be italic. However, LaTeX only accepts the `\mu` command in math-mode and therefore it appears in italic.... `\mathrm{\mu}` does not work. Any ideas on how can to change this into a regular upright symbol?


title: How do I put a blank page between two pages of the table of contents?

text: My table of contents have two pages, page ix and page x, but I want to just let even pages have contents, so I have to put a blank page between those two. So I need to have the TOC at pages ix and xi, but page x completely blank. Somebody knows how to do that?


title: Undefined control sequence error in pspicture

text: I found this interesting question Draw closed curve in Tikz for which an even interesting answer was provided by the user Garbage Collector. Just for the fun of it, I tried compiling his answer on my system, which I have pasted here:               \documentclass[pstricks,border=3pt]{standalone}     \usepackage{pstricks-add}     \def\N{15}     \begin{document}     \psLoop{20}{%     \begin{pspicture}[showgrid=false](-2,-2)(2,5)         \psclip{\psbezier[linestyle=none](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)}             \psLoop{\N}{                 \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$+$}                 \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$-$}}%         \endpsclip         \psbezier[linecolor=orange](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)     \end{pspicture}}     \end{document}      I received 120 error messages, all of them read: `13: Undefined control sequence \end{pspicture}}`. Can someone shed any light on this matter?


title: How to make an 'if' on roman numbered pages and another 'if' on arabic numbered pages

text: I want to make some conditions on roman pages and another condition on arabic numbered page. (I want to know how to remove the background from specific pages in both numbering categories).               \AddEverypageHook{%     \ifnum\value{page}>0     \ifodd\value{page}\relax%     \backgroundsetup{% settings for odd-numbered pages       angle=0,       contents={\begin{tikzpicture}[remember picture,overlay]         \node at ([yshift=0cm,xshift=-9.7cm]current page) {\includegraphics[scale=1.10]   {Margin2.png}};    %% yshift and xshift for example only     \end{tikzpicture}}       }%     \else     \backgroundsetup{% settings for even-numbered pages       angle=0,       contents={\begin{tikzpicture}[remember picture,overlay]         \node at ([yshift=0cm,xshift=9.7cm]current page) {\includegraphics[scale=1.10]{Margin2.png}};    %% yshift and xshift for example only     \end{tikzpicture}}     }%     \fi%     \BgMaterial     \fi}      EDIT:                \begin{document}      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      \pagestyle{empty} %No headings for the first pages.      %% front setting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      \input{pg}      \cleardoublepage      \pagenumbering{Roman}      \pagestyle{empty}      \tableofcontents %Table of contents                 \chapter*{\textbf{Introduction}}       \pagenumbering{arabic}       \addcontentsline{toc}{chapter}{Introduction}            \thispagestyle{plain}           \large BLA BLA.           \end{document}      I want to remove the bg from the homepage and i want to know how we can remove background from specific pages. \NoBgThispage doesn't work here


title: how to write ceil and floor in latex?

text: Is there a macro in latex to write `ceil(x)` and `floor(x)` in short form? The long form               \left \lceil{x}\right \rceil       is a bit lengthy to type every time it is used.


title: How can I make footnote text color match body text color?

text: How can I modify the following code to also make the footnote text blue (globally, for all footnotes), like the body text?               \documentclass{article}     \usepackage{color}     \begin{document}     \color{blue}          This is sample text.\footnote{See page 1.}          \end{document}      I'm weaving Rnw files with `knitr` and typesetting LaTeX into PDF using `pdfLaTeX`.


title: Sort bibliography entries in alphabetical order by the entries' "short" value

text: How can the bibliography list entries be sorted in alphabetical order using the `s` ("short") field of the publication entries in the example below? I don't want to use a BibTeX file, but the `start/stoppublication` commands.               \setuppublications[         alternative=apa-de,         criterium=text,         sorttype=cite,  % "cite" oder "bbl" are supported, something like "short" needed         refcommand=short,           numbering=short,           autohang=yes,         setupinteraction=start,     ]          \setuppublicationlist[         samplesize={AAAAAAA},         author=\invertedauthor,         artauthor=\invertedauthor,     ]          %=== entries ===          \startpublication[       k=bh2008,       t=book,       a={Bringhurst},       y=2008,       n=1,       s={Elements},     ]       \author[]{Robert}[]{}{Bringhurst}       \pubyear{2008}       \title{The Elements of Typographic Style}       \edition{3.2}       \city{Point Roberts WA, Vancouver}     \stoppublication               \startpublication[       k=taco1999,        t=article,       a=Hoekwater,       y=1999,       s=TH99,       n=1     ]     \artauthor[]{Taco}[T.]{}{Hoekwater}     \arttitle{\CONTEXT\ Publication Module, The user documententation} \journal{MAPS}     \pubyear{To appear}     \note{This article}     \pages{66--76}     \stoppublication               \startpublication [       k=fielding2000,       t=phdthesis,       a={Fielding},       y=2000,       n=1,       s={FIE2000},     ]       \author[]{Roy Thomas}[R. T.]{}{Fielding}       \title{Architectural Styles and     the Design of Network-based Software Architectures}       \pubname{University of California, Irvine}       \isbn{0-599-87118-0}     \stoppublication          %=== /entries ===          \starttext          Foo \cite[fielding2000]. Bar \cite[taco1999]. Baz \cite[bh2008]          \completepublications          \stoptext      This results in: ![result page 2](http://i.stack.imgur.com/RGdw2.png) But the wanted order would be:   * Elements   * FIE2000   * TH99 One solution that would work, is to write publication entries in the correct alphabetical order and set `sorttype=bbl`. But this would be too complicated. Is there an easy way to achive this?


title: Strange ampersand shape in italics

text: I'm trying to use the `&` symbol in the bib file. The following is my code:               booktitle = {Design, Automation {\&} Test in Europe Conference {\&} Exhibition},      The output is : ![enter image description here](http://i.stack.imgur.com/dVFgX.jpg) Is this common? Or do I do something wrong?


title: Error with \DeclareRobustCommand, \usepackage{hyperref,xcolor} and \usepackage{graphicx}

text: In order to tie capital letters with a capital hyphen, I created a command               \DeclareRobustCommand{\capitalhyphen}{\raisebox{0.24ex}{\resizebox{0.4em}{\height}{-}}\kern-0.07em}      which uses `graphicx` package. I'd like to use this command in `\chapter` and similar 'moving arguments'. This code:               \documentclass[11pt]{report}     \usepackage[utf8]{inputenc}     \usepackage[english,ukrainian]{babel}     \usepackage{graphicx}     \DeclareRobustCommand{\capitalhyphen}{\raisebox{0.24ex}{\resizebox{0.4em}{\height}{-}}\kern-0.07em}     \begin{document}     \chapter{ФІЗИКО\capitalhyphen МАТЕМАТИЧНИЙ}     \end{document}       works fine and does the job. However, adding               \usepackage[unicode]{hyperref,xcolor}     \hypersetup{citebordercolor=green,linkbordercolor=white}      to the preamble, results in an error. Ho to fix it? **UPDATE:** I figured out that if we add `bookmarks=false` option the problem disappears. Is there any chance to use this `\DeclareRobustCommand` and still have bookmarks??


title: Clickable Link back to the Table of Contents

text: There are many questions and answers surrounding how to make the `Table of Contents` content clickable. I am wondering how to make a reference to the `Table of Contents` and create a link elsewhere in the document to click on and go back to the table of contents. I have tried giving the `Table of Contents` its own label via `\tableofcontents\label{toc}` and then using a reference link `\ref{toc}` but this produces the error: `./project.tex:133: Package hyperref Warning: Suppressing empty link on input line 133.`


title: SCfigure won't compile, shows a runaway argument error

text: I'm trying to create an SCfigure, but the formatting doesn't seem to be working. I have used this same code and it worked fine, but I tried to compile again in a new session and this error showed.               \documentclass[12pt,onecolumn]{extarticle}     \usepackage[pdftex]{graphicx}     \graphicspath{ {C:/Users/WKUUSER/Pictures/} }     \usepackage{mathptmx}     \usepackage{extsizes}     \usepackage{setspace}     \usepackage{amsmath}     \doublespacing     \usepackage[margin=1in]{geometry}     \usepackage{sidecap}          \begin{document}     \begin{SCfigure}     \centering     \caption{A field line is traced from $\theta = 0$ to $\theta = 2\pi$ with initial conditions $\psi$ from 0.8 to 1.4 and $\phi$ from 0 to $2\pi$.}     \label{lyapunov}     \includegraphics[width=0.5\textwidth]{lastPtsMaxExc.png}     \end{SCfigure}          \end{document}          Runaway argument?     {\settowidth \labelwidth {\@biblabel {     ! Paragraph ended before \list was complete.     <to be read again>                     \par       Am I making an obvious error in formatting, or is there something deeper at play? This might be related: LaTeX warns me that my references are undefined no matter how many times I recompile. I am not using a bibtex file. I am using TeXworks.


title: How can I make an environment so that I can reserve space for text next to a figure?

text: I'm working on a layout for a custom textbook class, and I'm having issues getting this environment to work as I like. Here's a shot of my current working layout: ![enter image description here](http://i.stack.imgur.com/b4ct6.png) I'd like to be able to make an environment so that a minipage is sitting left of the image and I can populate it with text if needed. I've tried using the `environ` package to do this, but the layout is not working, despite several tweaks. Here's my page layout: ![enter image description here](http://i.stack.imgur.com/Nqy0A.png) I'd like the left `\minipage` to use the margin notes space, and the right minipage to use the body. I've tried using the following code, but it doesn't seem to want to work.               \documentclass{book}     \let\cleardoublepage\clearpage          \usepackage{tikz}     \usepackage[explicit]{titlesec}     \usepackage[strict]{changepage}     \usepackage{calc}     \usepackage{environ}     \usepackage[       left=2.25in,       right=0.75in,       top=1.25in,       bottom=1.25in,       marginparwidth=1.75in,       marginparsep=.25in,       asymmetric]{geometry}          \NewEnviron{myfig}[2]{       \begin{adjustwidth}{-2.0in}{0.25in}         \begin{table}[h]           \centering           \makebox[0pt][c]{\parbox{\textwidth}{%           \colorbox{lightgray}{           \begin{minipage}{2.0in}             #1\\#2           \end{minipage}}           \colorbox{cyan}{           \begin{minipage}{\textwidth}             \BODY           \end{minipage}}           }}         \end{table}       \end{adjustwidth}       }               \makeatletter     \titleformat{\chapter}       {\normalfont\sffamily\Huge\scshape}       {}{0pt}       {\thispagestyle{empty}    % Remove page number on new chapters       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west)           {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=cyan] (0,-1) rectangle               (25cm,3cm);             \draw[fill=cyan] (0,-24) rectangle               (25cm,-25cm);             \ifttl@label% <---------------------- Added condition on \ifttl@label               \node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]                   {\color{white}\LARGE CHAPTER \Huge\thechapter};             \fi% <------------------------------- end condition on \ifttl@label             \node[anchor=west,xshift=.21\paperwidth,yshift=-.065\paperheight,rectangle]                   {\color{cyan}\Huge\MakeUppercase{#1}};            \end{tikzpicture}           };        \end{tikzpicture}       }     \makeatother          \begin{document}       \chapter{test}       \begin{myfig}{Label}{This is a description}         foobar       \end{myfig}     \end{document}      The above mwe produces the following: ![enter image description here](http://i.stack.imgur.com/0AwR1.png) * * * **EDIT:** Thanks to help from Sašo Živanović, it's much closer to working... but there's an alignment issue I'd like to point out: I'd like the text description of the figure to show at the top left of the image. As of right now it's hovering at the bottom left. ![enter image description here](http://i.stack.imgur.com/dT9MC.png)


title: Glossary package - acronyms with numbers not accepted

text: I'm having some trouble with acronyms such as I2C, where there is a number inside. My code is like the following:               \usepackage[acronym]{glossary}     \makeglossary     \newacronym{I2C}{Inter-Integrated Circuit}{}          \begin{document}     \I2C     \end{document}


title: Relative positioning of edge labels in Tikz

text: I have a graph with multiple edges that originate at the same y-level (possibly at different angles) and end at different y-levels. I would like to position the edge labels at the same y height. Example:               \documentclass[a4paper]{article}          \usepackage{tikz}     \usetikzlibrary{arrows,automata}          \begin{document}          \tikz{      \node[draw,circle,minimum size=5mm] (a1) at (0,0) {};      \node[draw,circle,minimum size=5mm] (a2) at (1,0) {};      \node[draw,circle,minimum size=5mm] (b1) at (1,-3) {};      \node[draw,circle,minimum size=5mm] (b2) at (3,-5) {};      \draw (a1) to node [auto,near start] {1} (b1);      \draw (a2) to node [auto,very near start] {2} (b2);     }          \end{document}      output: ![The generated output](http://i.stack.imgur.com/g5neS.png) As you can see the labels "1" and "2" are not at the same height. Is there a way to position label "2" exactly at the same y-coordinate as "1"? (The x coordinate should then be determined by the edge itself) I would like to keep the connection between edge and label so that even when the endpoints of the edges (here b1 and b2) move the labels move with them.


title: How do I pass the right option to select english?

text: OK I'm not a LaTeX developer but I'm using someone else's file to produce a document. I don't know LaTeX at all, How do I pass a command option to tell the package to use `english` and not `french` when this is in the `.cls` file?               \DeclareOption{french}{\ORG@isfrenchtrue}     \DeclareOption{english}{\ORG@isfrenchfalse}


title: Customize bst for shown year after Title

text: I'm need of change master thesis are shown. I'm used the ABNT-ALF with some modifications ex: abnt-my.bst. I need that YEAR shown (date) after o TITLE and before of type. However, such change not modify another types : (Article, Book, etc) like stay: CORDEIRO, F. L. R. **Representações neural e fuzzy de controle**. Dissertação (Mestrado) — Pontifícia Universidade Católica de Minas Gerais, Programa de Pós-graduação em Informática, 2010. How it must be: CORDEIRO, F. L. R. **Representações neural e fuzzy de controle**. 2010. Dissertação (Mestrado) — Pontifícia Universidade Católica de Minas Gerais, Programa de Pós-graduação em Informática. My main document:               \documentclass[a4paper]{article}     \usepackage[brazil,brazilian]{babel}     \usepackage[ansinew]{inputenc}     \usepackage{abnt-alf}     \usepackage[alf]{abntcite}          \newcommand{\qcounts}{{\normalfont\textit{quadrat counts}}{}}     \newcommand{\q}{{\normalfont\textit{quadrat}}{}}     \newcommand{\qs}{{\normalfont\textit{quadrats}}{}}     \newcommand{\citrus}{{\normalfont\textit{Citrus}}{}}     \newcommand{\msc}{{\normalfont\textit{Morte Súbita dos Citrus}}{}}     \newcommand{\MSC}{\acronym{MSC}{}}     \newcommand{\geoR}{{\normalfont\textsf{geoR}}{}}     \newcommand{\geoRglm}{{\normalfont\textsf{geoRglm}}{}}     \newcommand{\splancs}{{\normalfont\textsf{splancs}}{}}     \title{Modelo autologístico para dados de citrus}          \author{     Fabio CORDEIRO      \footnote{Programa de Pós-graduação em Engenharia Elétrica,       Pontifícia Universidade Católica de Minas Gerais.      Caixa Postal 00000, CEP 81531-990, Belo Horizonte, Minas Gerais, Brasil.      E-mail: fabioleandro@oucminas.br}\\     }          \begin{document}     \maketitle     \section{resumo}           \section{Introducao}          Testando referencias \cite{fabio}          \section{metodologia}          \bibliographystyle{abnt-alf}           \bibliography{bibliografia} %%%%%%%%%          \end{document}      My bibliography file:               @MASTERSTHESIS{fabio,     author = {Anna Izabel J. Tostes},     title = {Representações neural e fuzzy de controle},     school = {Pontifícia Universidade Católica de Minas Gerais},     year = {2010}     }      Thanks for the help.


title: How to use xstring commands in biblatex DeclareFieldFormat?

text: I'm trying to tweak a `biblatex` bibliography. One problem is the rendering of entries with `eprint` fields. Sometimes, I have something like                 eprint         = "hep-ph/0207124",      sometimes its                 eprint         = "0207124",       primaryClass   = "hep-ph",      but sometimes the class is given in both:                 eprint         = "hep-ph/0207124",       primaryClass   = "hep-ph",      I'd like to render all consistently in a format like "arXiv:hep-ph/0207124" for example. For this, I tried to customize `\DeclareFieldFormat{eprint:arxiv}`. My problem is that I can't properly use `xstring` commands like `\IfSubStr` or `\StrDel` in `\DeclareFieldFormat`. If I try to find `primaryClass` in `eprint`, it just doesn't work. I've traced it down a bit. If `#1` is `hep-ph/0207124`, then               \StrDel{#1}{\thefield{eprintclass}}      doesnt work. It doesn't find the string. I guess I need to make `\thefield` expand somehow. Even then, directly substituting the string doesn't work either:               \StrDel{#1}{hep-ph}      But it works partially if I use `0` or `\string h` (but not `h`) as an argument. I believe it has to do with the catcodes of the arguments. I tried a bunch of `\detokenize`, `\expandafter`, `\expandarg`, but without a systematic approach I can't get it to work. **So how do I use the string manipulation commands properly from within biblatex's field formats?** (Not-quite) minimal (not-quite) working example follows:               \documentclass{article}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @article{Witten:2002ei,           author         = "Witten, Edward",           title          = "{Quest for unification}",           pages          = "604-610",           year           = "2002",           eprint         = "hep-ph/0207124",           archivePrefix  = "arXiv",           primaryClass   = "hep-ph",           SLACcitation   = "%%CITATION = HEP-PH/0207124;%%",     }     \end{filecontents}          \usepackage[style=numeric,sorting=none]{biblatex}     \addbibresource{\jobname.bib}          \usepackage{xstring}     \makeatletter          \DeclareFieldFormat{eprint:arxiv}{%       arXiv\addcolon\space%       \iffieldundef{eprintclass}%         {#1}%         {%         eprint = #1 \par         class = \thefield{eprintclass} \par         number = \StrDel{#1}{\thefield{eprintclass}} \par         removing `0' = \StrDel{#1}{0} \par%         removing `h' = \StrDel{#1}{h} \par%         removing `\textbackslash string h' = \StrDel{#1}{\string h} \par%         }%     }          \makeatother          \begin{document}          \cite{Witten:2002ei}          \printbibliography     \end{document}


title: Change Language in \usepackage[<language>]{babel}?

text: I've been trying to change the language of my LaTeX document by replacing `\usepackage[swedish]{babel}` with `\usepackage[english]{babel}` but I only get this message:               ! Package babel Error: You haven't loaded the option swedish yet.      I've read in an other question at this forum that compiling enough would solve the problem, but that doesn't work for me. Does anyone know what I should do?


title: Package babel Error: You haven't loaded the language french yet

text: I just got LaTeX up and running and started following some basic instructions. The first time I followed the beginning over here: http://ftp.ctex.org/pub/tex/tools/editors/TeXworks/manual.pdf               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{geometry}     \geometry{a4paper}     \usepackage[francais]{babel}     \title{Premier document}     \author{Un TeXnicien}     \date{}     \begin{document}     \maketitle     Voici un texte accentué en français!     \end{document}      Now, afterwards I restarted the program and made a new TeX file. However, this time I can't run this:               \documentclass{article}     \usepackage[english]{babel}          \begin{document}     test     \end{document}      Because I get the error in the title. What's up with this? I'm using TeXworks.


title: Can't Compile Because I haven't loaded Babel - But I'm not using Babel?

text: I tried compiling a document with an included Hebrew word. I copy and pasted the `\usepackag`e example loading English and French as an example. Since then, my document will not compile no matter what I do. I have completely removed babel from the preamble and it now complains that I am not loading English. I tried using `\usepackage[english]{babel}`, but then it tells me I'm not loading french. I add french, it complains about my encoding. But I don't have a single french word or accent in my text!               \documentclass{report}     \setcounter{tocdepth}{3}     \begin{document}      This will not compile, with the following logfile:               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/TeX Live for     SUSE Linux) (format=pdflatex 2013.12.10)  20 MAR 2014 19:43     entering extended mode      \write18 enabled.      file:line:error style messages enabled.      %&-line parsing enabled.     **/home/michael/Dropbox/ProjectMalynne/TEX/.Main.tex.swp     (/home/michael/Dropbox/ProjectMalynne/TEX/.Main.tex.swp     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 78 languages loaded.     (/usr/share/texmf/tex/latex/base/book.cls     Document Class: book 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/bk10.clo     File: bk10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@chapter=\count80     \c@section=\count81     \c@subsection=\count82     \c@subsubsection=\count83     \c@paragraph=\count84     \c@subparagraph=\count85     \c@figure=\count86     \c@table=\count87     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     (/usr/share/texmf/tex/latex/cjhebrew/cjhebrew.sty     Package: cjhebrew 2004/08/27 v. 0.1a cjhebrew Hebrew Typesetting System     ) (/tmp/.Main.tex.aux          /tmp/.Main.tex.aux:6: Package babel Error: You haven't loaded the language     english yet.          See the babel package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.6 \select@language{english}          Here is how much of TeX's memory you used:      244 strings out of 493315      2957 string characters out of 6145892      52158 words of memory out of 5000000      3777 multiletter control sequences out of 15000+600000      3640 words of font info for 14 fonts, out of 8000000 for 9000      957 hyphenation exceptions out of 8191      23i,0n,17p,200b,49s stack positions out of 5000i,500n,10000p,200000b,80000s          /tmp/.Main.tex.aux:6:  ==> Fatal error occurred, no output PDF file produced!      Again, I'm not loading babel, and I keep getting exceptions. I tried trashing the `aux` files, but it's no use. Any ideas?


title: Splitting a command syntax across a \newenvironment definition

text: This question is a direct follow-up to the question Can a \newcommand Definition Contain Braces as Substitution Text? I asked yesterday. The following example is once again a counter-intuitive one, to demonstrate what I wish to achieve. I'm trying to split the `parbox` syntax across the begin code and end code of a `newenvironment`. Using `begingroup` and `endgroup` does not seem to work here, and is producing an error.               \newenvironment{mybox}{\parbox{10cm}\begingroup}{\endgroup}      Is this possible in LaTeX? Just to elaborate a bit on my specific need, I need a lot of **centered** , **framed** boxes to highlight some "warnings" and "best practices". For this, I thought of the following environment:               \newenvironment{mybox}[2]%     {%       \begingroup \centering \fbox \begingroup \parbox{10cm} \begingroup #1 \hspace{5pt}       {\large \textbf{\textsf{#2}}} \hfill \\     }%     {%      \endgroup \endgroup \\ \endgroup \vspace{5pt} %     }      One of the arguments is for switching between the texts "Warning" and "Best Practices", and the other one is to provide a special symbol for each type (like a star or as shadowed box)


title: What bibliography style should I use in a presentation?

text: I am using authoryear (from biblatex) style for articles. However, for beamer presentations, this style is not useful. Indeed, the complete references are cited at the end of the presentation ; so I have severals slides with only references. I will not take 5 min at the end of my presentation to allow everyone to read my bibliography (it makes no sense). If I decide to use a verbose style which will put references in footnotes, I have other problems : Many footnotes eats the space and they are too tiny to allow a good reading... Does someone is aware of a bibliography style designed for beamer presentation?


title: Improve pfgplots precision with gnuplot

text: I have measured the execution time of two algorithms (a naive, and an optimized one), and I would like to display measured data with `pgfplots` plus a trend line for the naive algorithm. I have used Matlab's `cftool` to get a polynomial function for trend line:               Linear model Poly2:         fittedmodel(x) = p1*x^2 + p2*x + p3         Coefficients (with 95% confidence bounds):             p1 = 1.61e-06 (1.61e-06, 1.61e-06)             p2 = -0.003371 (-0.003636, -0.003107)             p3 = -0.0772 (-5.333, 5.179)          >> vpa(fittedmodel.p1)          ans =          0.0000016101333575269318185488581079978          >> vpa(fittedmodel.p2)          ans =          -0.0033714174188680659169370379402153          >> vpa(fittedmodel.p3)          ans =          -0.077204674695659905592215466185735      But plotting everything into one figure `pgfplots` produces an erroneous line for the trend line at low values. ![](http://i.stack.imgur.com/GZtbb.png) I am using `gnuplot` for the trend line, because `pgfplots` did not even make any output for low values. I do not know what I'm doing wrong, probably the precision is not big enough. If that is the problem, how can I improve it? Here is my MWE:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{xcolor}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{positioning, shapes, pgfplots.units, pgfplots.dateplot, calendar}     \pgfplotsset{width=12cm, compat=newest}          \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}          \begin{document}          \begin{tikzpicture}%[font=\large\sffamily]         \begin{loglogaxis}[/pgf/number format/.cd,use comma,%         use units=true,%         y unit=s,%         y unit prefix=m,%         ylabel={Fut\'{a}si id\H{o}},%         scaled y ticks=false,%         y tick label style={/pgf/number format/fixed,%             /pgf/number format/1000 sep=\thinspace},%         x unit=n,%         xlabel={Bemenet},%         legend pos=north west,%         legend style={draw=none}]             \addplot+[mark=*,%                 mark options={scale=0.5,fill=blue,draw=blue},%                 color=blue] table[col sep=semicolon,%                 x=n,%                 y=t_naive] {exectime.csv};             \addlegendentry{naive}                  \addplot[mark=none,%                 style=dashed,%                 color=blue!50!white,%                 domain=1:1000000000,%                 samples=1000] gnuplot {0.0000016101333575269318185488581079978 * x^2 - 0.0033714174188680659169370379402153 * x - 0.077204674695659905592215466185735};             \addlegendentry{naive trend}                  \addplot+[mark=*,%                 mark options={scale=0.5,fill=red,draw=red},%                 color=red] table[col sep=semicolon,%                 x=n,%                 y=t_optimized] {exectime.csv};             \addlegendentry{optimized}         \end{loglogaxis}     \end{tikzpicture}          \end{document}      Here is the content of the exectime.csv file:               n;t_naive;t_optimized     1;0.00549499999999999;0.00004500000000000     2;0.00557399999999999;0.00004500000000000     3;0.00567399999999998;0.00017300000000000     4;0.00568299999999998;0.00017300000000000     5;0.00579299999999997;0.00021100000000000     6;0.00607500000000001;0.00047400000000000     7;0.00633200000000002;0.00059600000000000     8;0.00651200000000000;0.00077000000000000     9;0.00679999999999998;0.00088800000000000     10;0.00690799999999997;0.00093600000000000     20;0.00881400000000000;0.00188800000000000     30;0.01110500000000000;0.00308100000000000     40;0.01380300000000000;0.00416600000000000     50;0.01744700000000000;0.00563000000000000     60;0.02035800000000000;0.00680900000000001     70;0.02407600000000000;0.00820300000000001     80;0.02794400000000000;0.00928900000000000     90;0.03238200000000000;0.01039000000000000     100;0.03820100000000000;0.01162200000000000     200;0.09925500000000000;0.02850100000000000     300;0.19628100000000000;0.04459999999999990     400;0.29108000000000000;0.06029799999999990     500;0.42527000000000000;0.07618300000000010     600;0.58424000000000000;0.09287300000000000     700;0.79010700000000000;0.11013500000000000     800;0.98573400000000000;0.12708500000000000     900;1.21879600000000000;0.14422200000000000     1000;1.48462400000000000;0.16221400000000000     2000;5.56059100000000000;0.35208600000000000     3000;12.10970900000000000;0.54000899999999900     4000;21.03929400000000000;0.72470000000000000     5000;32.41173900000000000;0.91246400000000100     6000;46.36602000000000000;1.11181800000000000     7000;62.61670900000000000;1.30629200000000000     8000;81.58859900000000000;1.51091900000000000     9000;102.89399700000000000;1.71370300000000000     10000;126.75557200000000000;1.92297700000000000     25000;844.62786300000000000;5.06326700000000000     50000;3816.58308900000000000;10.59345300000000000     75000;8806.76242100000000000;16.10985800000000000     100000;15800.83862700000000000;22.00894600000000000     1000000;1606761.62740000000000000;232.43642700000000000     10000000;;2462.02062400000000000     100000000;;25872.93018000000000000     1000000000;;274393.61750000000000000


title: Controlling the scope of \label and \ref

text: > **Possible Duplicate:**   >  Can I re-use section labels across chapters? Is there a way to control the scope of the command `\label` and `\ref`? In document `chap1.tex`, I declare the label `\label{lemma}` and access it with `\ref{lemma}`.   In document `chap2.tex`, I also declare the label `\label{lemma}` and access it with `\ref{lemma}`. Then, in `book.tex`, the error `multiply defined label` is raised. I understand the error wouldn't be raised if I use `\label{1:lemma}` and `\label{2:lemma}`. Is it possible to redefined the command `label` and `ref` so that `\label{lemma}` produces the key `chap1:lemma`, and `\ref{lemma}` invokes the key `chap1:lemma`.   That is `label` and `ref` based themselves on the current document name. Any other solution is also welcome.


title: Plots only logarithmicly spaced samples

text: I have a data file with many entries, order of 10000. I want to plot them all with lines, and a small subset of them with points and error bars (can not plot error bars on 10000 samples). Plotting each N is easy done using `each nth point=N`, but I am using a semilogarithmic axis, so I want to plot each 10^N (even better 2^N). Right now I preprocess the data file and generate another one with the interesting samples subset, is there a way to make pgfplots do that? ### EDIT This is a minimal working example:               \documentclass[10pt,a4paper]{article}          \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \begin{document}          \begin{tikzpicture}       \begin{semilogxaxis}         \addplot+ table[col sep=comma, x=x, y=y, each nth point=100]             {aaa.txt};       \end{semilogxaxis}     \end{tikzpicture}          \end{document}      File `aaa.txt` is something like this:               x,y,var     1,1,0.7257899338880273     2,2,0.5103550634511824     3,3,0.8469400089552953     4,4,0.8351651602434369     5,5,0.07359721861492374     6,6,0.3107395762944515     7,7,0.9151522020717112     8,8,0.4967609141914707     9,9,0.2218284814240239     10,10,0.7166461578126254     ...      I generated the coordinates with Ruby's script `1.step(1024) { |i| puts "#{i},#{i},#{rand}" }`. With `using nth point=100` it plots only at 100, 200, 300... I tried replacing it with the `x filter` suggested but it keeps plotting the whole data file (it does not say on command line that it is skipping points because a filter, as it does for `using nth point`).


title: Why does \mathrm{\varphi} work, but \text{\varphi} does not?

text: This:               \documentclass{article}          \usepackage{amsmath}          \begin{document}     $\mathrm{\varphi}$     \end{document}      Versus:               \documentclass{article}          \usepackage{amsmath}          \begin{document}     $\text{\varphi}$     \end{document}      The first works, the last does not. Why? Especially when defining macros with `\text` this can lead to problems. Any way around it?


title: Problem with macro using \newcount in \caption

text: I have a macro `\foo` that performs arithmetic on it's argument:               \documentclass{article}          \newcommand{\foo}[1]{         \newcount\tmpR         \tmpR=#1         \advance\tmpR by -1         R{\number\tmpR}     }          \begin{document}          \foo{10}          \begin{figure*}     \caption{\foo{99}}     \end{figure*}          \end{document}      This compiles with no errors. However, if I comment out the first call to `\foo{10}`, I get the following error from the macro call in the caption:               $ pdflatex mwe.tex     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)     restricted \write18 enabled.         entering extended mode     (./mwe.tex     LaTeX2e <2011/06/27>     Babel <3.9g> and hyphenation patterns for 78 languages loaded.     (c:/texlive/2013/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (c:/texlive/2013/texmf-dist/tex/latex/base/size10.clo)) (./mwe.aux)     ! Undefined control sequence.     <argument> \tmpR          l.15 \caption{\foo{99}}      What is the cause of this error, and how can I fix it? Is there a better way to write this macro?


title: Change page number position in the middle of a document

text: I'm creating a large document. My document contains three parts : frontmatter, main, backmatter. For frontmatter I have to place page number centering, for main I have to place page number flushright, and for backmatter I have to place page number centering. So confusing about it. Anyone could help me please ? Can I use this : How to change the position of the page number in the first page of every chapter of a book?


title: hyperref: Height of page (\paperheight) is invalid (0.0pt)

text: I am getting the following annoying warning from `hyperref`:               hyperref.sty: [hyperref] Height of page (\paperheight) is invalid (0.0pt), usi\     ng 11in. (page 1)      I am using a thesis class (`thesis.cls`) and some packages like `fancyhdr` etc. I compile using `pdflatex`. I tried to fix the warning with this:               \special{papersize=11in,8.5in}      but it didn't help. Any suggestions? Thanks!


title: MiKTeX europecv (German) language

text: I'm translating a CV into German, under both OS X and Windows 7 with MiKTeX. The problem is that German doesn't work. I tried French, Italian, Dutch and they all work. Any idea where I should look for a resolution?               \documentclass[10pt,ngerman,nologo]{europecv}      I get no errors, nothing, just the result is in English. For the record, `AppData\Roaming\MiKTeX\2.9\tex\latex\europecv` contains all the expected language templates (`ecvde.def` being the interesting one). I simply copied the German words into `ecven.def` but that's ridiculous. LE. I'm actually generating the document with LyX. If I export it the language appears as in the code snippet above - `ngerman`. It would seem that `german` is the correct setting; I'm still investigating.


title: Difficulty saving formatting to a sequence to be called later in my code

text: I had an idea about how to answer this question and started putting some things together. I wanted to put something together that was fairly powerful and could handle simplification of linear expressions. I should start by apologizing for the length of this example. It is quite long. But all my attempts at reducing it have either resulted in code that compiles, or results in code that has other issues which, when resolved seem to shed no light on what's happening here. I can say that the first portion of code I post below works _reasonably_ well (it's not perfect, but it does get close to the job I want). Regarding simplifying linear expressions, I got something that worked pretty well. Here's the code I put together to do that; I called the file containing this code *reduce_terms.tex*:               \ExplSyntaxOn     %-@-(1)------------------------------------------------------------------------------------     %% some SEVEN commands to help avoid errors in naming the "counters"     \cs_new:Npn \_stirling_var_get:n    #1   { \int_use:c  { l/stirling/var/ #1 /int } }     \cs_new:Npn \_stirling_var_create:n #1   { \int_new:c  { l/stirling/var/ #1 /int } }     \cs_new:Npn \_stirling_var_incr:nn  #1#2 { \int_add:cn { l/stirling/var/ #1 /int } {#2}}     \cs_new:Npn \_stirling_var_decr:nn  #1#2 { \int_sub:cn { l/stirling/var/ #1 /int } {#2}}     \cs_new:Npn \_stirling_var_unset:n  #1          {          \cs_undefine:c { l/stirling/var/ #1 /int }        }     \prg_new_conditional:Npnn \_stirling_var_if_exists:n #1 { T , F , TF }       {          \int_if_exist:cTF { l/stirling/var/ #1 /int }            { \prg_return_true: }            { \prg_return_false: }        }     %%--------------------------------------------------------------------------------     \cs_new:Npn \_stirling_var_advance_counter_according_to_term_sign:nn #1#2       {         \bool_if:NTF \l_term_is_positive_bool           { \_stirling_var_incr:nn { #1 }{ #2 } }           { \_stirling_var_decr:nn { #1 }{ #2 } }       }     %%--------------------------------------------------------------------------------     %% a crude attempt to determine whether a token is a digit     \prg_new_conditional:Npnn \is_digit:n #1 { p, T, F , TF }       { \int_compare:nTF { `0 > `#1 }                          { \prg_return_false: }                          { \int_compare:nTF { `#1 > `9 }                                             { \prg_return_false: }                                             { \prg_return_true:  }           }}          %-@-(2)------------------------------------------------------------------------------------     %%--------------------------------------------------------------------------------     \seq_new:N \l_stirling_ordered_list_of_all_variable_names_seq     \seq_new:N \l_stirling_list_of_plus_separated_tokens_seq     \seq_new:N \l_stirling_list_of_minus_separated_tokens_seq     %% boolean to track whether term was preceded by a "+" or "-"     \bool_new:N \l_term_is_positive_bool     %% token list to store the first term from a string of "-" separated items.     \tl_new:N  \l_stirling_lead_tl          %-@-(3)------------------------------------------------------------------------------------     \bool_new:N \l_stirling_have_not_hit_nondigit_token_yet_bool     \tl_new:N   \l_stirling_tmp_a     \tl_new:N   \l_stirling_tmp_b     \tl_new:N   \l_stirling_tmp_c          \cs_new:Npn \_stirling_var_read_coefficient:n #1        {         \bool_set_true:N \l_stirling_have_not_hit_nondigit_token_yet_bool         \tl_clear:N      \l_stirling_tmp_a         \tl_clear:N      \l_stirling_tmp_b         \tl_clear:N      \l_stirling_tmp_c         \tl_set:Nf       \l_stirling_tmp_a { \tl_trim_spaces:n { #1 }}         %% if expression starts with a negative sign, you don't want to mistake         %% there will be an empty token passed.  You want to ignore this term          %% otherwise the constant term will be augmented.         \tl_if_empty:NF \l_stirling_tmp_a         {           \tl_map_inline:Nn \l_stirling_tmp_a             {               %% collect all the digits to build the numerical coefficient.               %% As soon as we hit something that is not a digit, stop and               %% treat all remaining tokens as part of the variable name                %% regardless of whether later digits will occur.               \bool_if:NTF \l_stirling_have_not_hit_nondigit_token_yet_bool                 {                   \is_digit:nTF { ##1 }                     {  \tl_put_right:Nn  \l_stirling_tmp_b { ##1 } }                     {  \bool_set_false:N \l_stirling_have_not_hit_nondigit_token_yet_bool                        \tl_put_right:Nn  \l_stirling_tmp_c { ##1 } }                 }                  {                   \tl_put_right:Nn \l_stirling_tmp_c { ##1 }                 }              }           %% The contents of \l_stirling_tmp_b are to be used as a number.  If           %% no digits were found, then this variable is empty.  If it is empty,           %% then it should be set to the value of "1".           \tl_if_empty:NT \l_stirling_tmp_b { \tl_set:Nn \l_stirling_tmp_b { 1 } }           \_stirling_var_if_exists:nTF { \l_stirling_tmp_c }              {                \_stirling_var_advance_counter_according_to_term_sign:nn { \l_stirling_tmp_c } { \l_stirling_tmp_b}             }             {               \_stirling_var_create:n { \l_stirling_tmp_c }               \_stirling_var_advance_counter_according_to_term_sign:nn { \l_stirling_tmp_c } { \l_stirling_tmp_b}               %% "x" may be stronger than you need.  But you do need to expand so that it's               %% not the token \l_stirling_tmp_c sitting in the sequence.               \seq_put_right:Nx \l_stirling_ordered_list_of_all_variable_names_seq { \l_stirling_tmp_c }             }         }       }               %-@-(4)------------------------------------------------------------------------------------     \cs_new:Npn \_parse_expression:n #1       { %%\fbox{\ttfamily#1}          \__parse_addition:n {#1}       }          \cs_new:Npn \__parse_addition:n #1       {         \seq_set_split:Nnn \l_stirling_list_of_plus_separated_tokens_seq { + } { #1 }         \seq_map_function:NN \l_stirling_list_of_plus_separated_tokens_seq                               \__parse_subtraction:n       }          \cs_new:Npn \__parse_subtraction:n #1       {           \seq_set_split:Nnn \l_stirling_list_of_minus_separated_tokens_seq { - } { #1 }           \seq_pop_left:NN   \l_stirling_list_of_minus_separated_tokens_seq \l_stirling_lead_tl           \bool_set_true:N   \l_term_is_positive_bool           \_stirling_var_read_coefficient:n { \l_stirling_lead_tl }           \bool_set_false:N  \l_term_is_positive_bool           \seq_map_function:NN \l_stirling_list_of_minus_separated_tokens_seq                                \_stirling_var_read_coefficient:n       }          %-@-(5)------------------------------------------------------------------------------------     \cs_new:Npn \_reset_coefficient_counters:n #1       {         \seq_map_function:NN \l_stirling_ordered_list_of_all_variable_names_seq                              \_stirling_var_unset:n        }          %-@-(6)------------------------------------------------------------------------------------     %%--------------------------------------------------------------------------------     \cs_new:Npn \_write_expression:n #1       {         \seq_map_function:NN \l_stirling_ordered_list_of_all_variable_names_seq                              \_stirling_var_set_according_to_coefficient:n        }          \tl_new:N        \l_stirling_plus_sign_tl     \bool_new:N      \l_stirling_passed_first_term_bool     \bool_set_true:N \l_stirling_passed_first_term_bool          \cs_generate_variant:Nn \tl_put_right:Nn {Nf}     \cs_new:Npn \_stirling_var_set_according_to_coefficient:n #1       {         %% No "+" should precent the lead term         \bool_if:NTF   \l_stirling_passed_first_term_bool           { \tl_set:Nn \l_stirling_plus_sign_tl {   } }           { \tl_set:Nn \l_stirling_plus_sign_tl { + } }         \int_compare:nNnT { \_stirling_var_get:n { #1 } } > { 0 } { \l_stirling_plus_sign_tl }         \int_case:nnn { \_stirling_var_get:n { #1 } }           { {  0 } {     }             {  1 } { \tl_if_empty:nTF {#1}{ 1 }{#1}  \bool_set_false:N \l_stirling_passed_first_term_bool}             { -1 } { -#1                             \bool_set_false:N \l_stirling_passed_first_term_bool}           } { \_stirling_var_get:n { #1 } #1         \bool_set_false:N \l_stirling_passed_first_term_bool}         %% as soon as you've processed first coefficient, change         %% the boolean that tracks this.  Otherwise, you may not         %% have "+" signs where you believe they should be.  Also,         %% without this boolean, you might have "+" where you'd prefer         %% not to have them:  such as in front of the first term.       }          \ExplSyntaxOff      After getting this much up and running, I thought it would be a simple task to create the partial derivatives. But I got stuck with the denominators. Here's the code that I wrote trying to get the denominator formatted correctly. I've embedded several of my approaches to get this right--some are clearly wrong-- but nothing I do seems to work. I'm quite mystified. The idea here is that I format each part of the denominator and then _store_ the formatting in a _sequence_ variable which will be called later on when I actually want to print out the derivative. I've already tried posting a question early regarding this next portion of code. I was hoping I'd narrowed it down to something that would prove fruit. But alas, even if I managed to narrow it down correctly, I'm having difficulty getting the posted solutions to cooperate. This following code I saved in a file I called *find_derivatives.tex*:               \ExplSyntaxOn     \seq_new:N  \l_stirling_derivative_denominator_raw_seq     \seq_new:N \l_stirling_denominator_pow_seq          \tl_new:N \l_stirling_tmp_d     \cs_generate_variant:Nn \tl_set:Nn {Nx}     \cs_generate_variant:Nn \seq_gput_right:Nn { Nf}     \cs_new:Npn \_parse_derivative:nn #1#2        {         \_parse_expression:n {#2}         %%---------------------------------------------------------------------------         %% This next line gets it completely wrong                                            \seq_gput_right:Nn \l_stirling_denominator_pow_seq { d#1^{ \_write_expression:n {}  }}         %%---------------------------------------------------------------------------         %% Uncommenting this next set of lines will also result in an error.                  %% This next approach gives me an "inaccessible" error.                               %%<2>%% \tl_set:Nx \l_stirling_tmp_d { \_write_expression:n {}}                       %%<2>%% \seq_gput_right:Nx \l_stirling_denominator_pow_seq { d#1^{ \l_stirling_tmp_d  }}         %%---------------------------------------------------------------------------         %% Uncommenting this line, things are a bit better.  But this seems comletely         %% contrary to what I want to do.                                                     %%<3>%% \seq_gput_right:Nn \l_stirling_denominator_pow_seq { d#1^{ \_parse_expression:n {#2} \_write_expression:n {}  }}         %%---------------------------------------------------------------------------         %% This line shouldn't be here, but it shows the values that should                   %% be appearing in the exponents, but which aren't.                                   \fbox{\_write_expression:n{}}\,         \_reset_coefficient_counters:n {}         }          \cs_new:Npn \parse_derivative:nn #1 #2        {         \seq_set_split:Nnn \l_stirling_derivative_denominator_raw_seq { , } { #2 }         \seq_map_inline:Nn \l_stirling_derivative_denominator_raw_seq           {             \group_begin:             \tl_if_single:nTF { ##1 }               { \_parse_derivative:nn { ##1 } { 1 } }                { \_parse_derivative:nn ##1 }              \group_end:           }               \frac{#1}{ \seq_use:Nn \l_stirling_denominator_pow_seq {\,} }       }              \NewDocumentCommand{\derivative}{ mm }         { \parse_derivative:nn {#1}{#2} }          \ExplSyntaxOff      Here's the master document:               \documentclass[12pt]{article}     \usepackage{amsmath,amssymb}     \usepackage{xparse}     \input{lib/reduce_terms}     \input{lib/find_derivatives}     \ExplSyntaxOn     %% Not quite overkill.     \cs_new:Npn \simplify_expression:n #1       {         \group_begin:         \_parse_expression:n {#1}         \_write_expression:n {}         \_reset_coefficient_counters:n {}         \group_end:       }     \NewDocumentCommand{\simplifyExpression}{ m }         { \simplify_expression:n {#1} }     \ExplSyntaxOff     \pagestyle{empty}     \begin{document}          \begin{align*}        \simplifyExpression{12-x-3y-k-x-3-y-y-w+4w+10x-w2-7+5} \\        \simplifyExpression{3a+x-2y-4x}                        \\        \simplifyExpression{-3+7-x+2y}                         \\        \simplifyExpression{-3}                                \\        \simplifyExpression{1+x}                               \\        \simplifyExpression{1}                                 \\        \simplifyExpression{x}                                 \\        \simplifyExpression{x+y-x}                             \\     \end{align*}          \[       \derivative{x}{{v}{3},{w}{3k+2-k},y,{z}{m+k}}     \]          \end{document}      which results in ![enter image description here](http://i.stack.imgur.com/mvex0.png) My question is about how to get the variables in the denominator to have the correct exponents. The expressions in the `fbox`s are what should be appearing as the exponents.


title: \multicolumn error in texmaker

text: The code below gives me the following error: `! Paragraph ended before \multicolumn was complete.` I tried several times but I cannot find what I did wrong. The exact same table works perfectly fine in MikTeX, but I am using TeXmaker now and it does not work. Is there a special package that I should import?               \begin{tabular}{ccc}     \includegraphics[scale=.2]{J48PerClass.eps} &     \includegraphics[scale=.2]{PARTCM.eps} &     \includegraphics[scale=.2]{SVMCM.eps} \\     \small{(a) J48} & \small{(b) PART} & \small{(c) SVM} \\     \includegraphics[scale=.2]{J48PCM.eps} &     \includegraphics[scale=.2]{PARTPCM.eps} &     \includegraphics[scale=.2]{MLPCM.eps} \\     \small{(d) J48 pruned} & \small{(e) PART pruned} & \small{(f) MLP} \\     \includegraphics[scale=.2]{NBCM.eps}& \multicolumn{2}{c}{          \raisebox{2.2cm}{\footnotesize{     \begin{tabular} {|l|l|}     \hline       a = SQL injection              &l = Static \\       b = Denial of Service          &m = Other attack\\       c = Spam on Wiki               &n = Password cracking on Wiki \\         d = Spam on Blog               &o = Spam on Wiki  \\       e = Password cracking on Blog  &p = Wiki  \\       f = Other vulnerability scan   &q = Blog \& Wiki  \\       g = DFind                      &r = Blog  \\       h = Other fingerprinting       &s = Spam on Blog  \\       i = (XSS) Cross site scripting & \\       j = (RFI) Remote file inclusion  & \\       k = Static \& Blog \& & \\       \ \ \ \ \ Wiki        & \\ \hline       \end{tabular}       }}}      \\          \small{(g) NB} & & \\          \end{tabular}


title: long table's and figure's captions

text: How can I make the table and figure captions aligned in the list of tables or list of figures , my problem is that the list of figures and list of tables are going outside the page margins.               \documentclass[b5paper, 12pt]{report}     \begin{document}     \tableofcontents     \listoffigures     \listoftables     % the table caption is long when it added to the list of tables.     \begin{table}%[position specifier]      \centering        \caption{Comparison with "Indirect Ident." method with a white noise disturbance}     \begin{tabular}{| l | l | l | l |l |}\hline      method& criterion& 25dB & 15dB & 10dB \\ \hline           \end{tabular}     \end{table}     \end{document}


title: Include without pagebreak

text: I really like the `\input` command, but what I really like more is the `\includeonly` command. Is there a way to have the best of these worlds? (i.e. an `\inputonly` or an `\include` without page-breaks?)


title: Wrong page number in table of contents

text: I have a document of 72 pages and page numbers in the table of contents are completely wrong. I'm trying to review everything step by step, so the first problem I've noticed is the following: I compile only the first part of the document:               % Style     \documentclass[a4paper,12pt]{report}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \setlength{\parindent}{0pt}     \usepackage[header]{appendix}     \usepackage[hidelinks]{hyperref}     \usepackage{lipsum}          % Figures     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{float}     \usepackage{tikz}          \begin{document}          \begin{titlepage}     My title page     \vfill     \end{titlepage}          \section*{Preface}     \thispagestyle{plain}     \lipsum[1-2]          \begin{minipage}[b]{0.45\textwidth}     \begin{flushleft}     \rule{5cm}{2cm}     \end{flushleft}     \end{minipage}     \hspace{2mm}      \begin{minipage}[b]{0.45\textwidth}     \begin{flushright}     \rule{5cm}{2cm}     \end{flushright}     \end{minipage}          \begin{figure}[H]     \centering     \rule{1cm}{3cm}     \end{figure}          \chapter*{Abstract}     \thispagestyle{plain}     \lipsum[1-3]          \tableofcontents          \chapter{Introduction}          \end{document}      And what I get is > Contents: > > 1 Introduction p.5 while it should be > Contents > > 1 Introduction p.4 but when I comment the first two images, I get the right page number. Does anybody know why this happens? I've compiled 3 times but I still have the same problem. I've also tried substituting the minipages by               \begin{figure}[H]     \centering     \begin{subfigure}[b]{0.4\textwidth}         \centering         \includegraphics[width=\textwidth]{logo1.jpg}     \end{subfigure} \quad     \begin{subfigure}[b]{0.4\textwidth}         \centering         \includegraphics[width=\textwidth]{logo2.jpg}     \end{subfigure}     \end{figure}      but I have exactly the same problem.


title: Bold of authors list changes style with bibtex

text: This is related to another question I had, but when I try to make an entire entry bold in my bilbiliography, it changes the format of the author list. I would like to be able to make only some entries in my bibliography bold and retain normal formatting for the rest. Here's my MWE:               \documentclass[notitlepage,groupedaddress]{IEEEtran}     \usepackage{filecontents}     \usepackage{cite}          \begin{filecontents}{\jobname.bib}          @article{BCS,         title = {Theory of Superconductivity},         volume = {108},         number = {5},         journal = {Physical Review},         author = {Bardeen, J. and Cooper, L. N. and Schrieffer, J. R.},         month = dec,         year = {1957},         pages = {1175--1204}     }             @article{EPR,         title = {Can {Quantum-Mechanical} Description of Physical Reality Be Considered Complete?},         volume = {47},         number = {10},         journal = {Physical Review},         author = {Einstein, A. and Podolsky, B. and Rosen, N.},         month = may,         year = {1935},         pages = {777--780}     }     \end{filecontents}          \begin{document}     Hello world\cite{BCS}\cite{EPR}     \bibliographystyle{IEEEtran}     \bibliography{\jobname}     \end{document}      Without any formatting commands, this file gives me the following output for the BCS paper: `J. Bardeen, L. N. Cooper, and J. R. Schrieffer, “Theory of superconduc- tivity,” Physical Review, vol. 108, no. 5, pp. 1175–1204, Dec. 1957.` Now, if I change the authors portion of the BCS paper to **bold** :               author = {\textbf{Bardeen, J. and Cooper, L. N. and Schrieffer, J. R.}},      I get different output: `Bardeen, J. and Cooper, L. N. and Schrieffer, J. R., “Theory of superconductivity,” Physical Review, vol. 108, no. 5, pp. 1175–1204, Dec. 1957.` If I try `\bf` or `\bfseries`, the bold runs off and encompasses both the BCS and EPR citations. Is there a way I can highlight the authors list of the BCS paper without changing the style of the initials and names? The paper I'm actually working is far larger scale and I want to avoid hardcoding authors in my desired format. Please note that I'm working with `IEEEtran`, so I believe `biblatex` is not an option here as the `biblatex` IEEE style doesn't produce a format identical for use in publication.


title: Active character and delimited argument

text: Say I have a macro `\foo` that takes one argument, delimited at start and at end by a `!`. The problem is that I don't know at the time of the call of `\foo` if `!` has been made `\active` by, say, french `babel`. For now, I use the following approach. It works but I need to maintain two version of the same macros, one dealing with non active `!` and the other with active `!`.               \documentclass{standalone}          \makeatletter     \begingroup       \catcode`\!=12\relax       \gdef\foo@nonactive!#1!{Non active: #1.}       \catcode`\!=\active\relax       \gdef\foo@active!#1!{Active: #1.}     \endgroup          \def\foo{%       \ifnum\the\catcode`\!=\active\relax         \expandafter\foo@active       \else         \expandafter\foo@nonactive       \fi}     \makeatother          \begin{document}          \catcode`\!=12\relax     \foo!bar!     \catcode`\!=\active\relax     \def !{This exclamation mark is active}     \foo!bar!!          \end{document}      **Question** Is this approach robust and is there an other way to do that (with and/or without `eTeX`).


title: Index with an initial letter of the group

text: > **Possible Duplicate:**   >  package makeidx: print first letter for each group of keys I'm trying to adapt the index of my contribution such that each group of words (starting with the same letter) has the starting letter displayed as bold an on top of the group. Note that I tried to find an answer, but the related questions and answers are rather confusing. I use `\documentclass[a4paper,12pt]{book}` and `\usepackage{makeidx} \makeindex`.


title: How To Format an Index Alphabetically in LaTeX

text: > **Possible Duplicate:**   >  Index with an initial letter of the group **Code:**               \documentclass{article}          \usepackage{index}     \usepackage{lipsum}     \makeindex          \begin{document}          \section{\index*{Hello World}}          Hello World          Some text about \index*{foo}.          \lipsum[1-15]          \index*{Hello World}.          \printindex          \end{document}      **Output:** ![enter image description here](http://i.stack.imgur.com/QK1uz.jpg) **Required Output:** ![enter image description here](http://i.stack.imgur.com/ZdYyL.jpg) Please guide me how to achieve the desired Output.


title: Enumerated column in tabular

text: How can I have a column in a `tabular` environment so that the first column is automatically produced? Something like this:               \begin{table}     \begin{tabular}{lc}     Step  & Comments \\     1st & a \\     2nd & b \\     3rd & c \\     4th & d      \end{tabular}     \caption{}\label{}     \end{table}      Here I am envisaging that the first column is auto-generated and all I have to do is place an `\item` or some other iterator there. The first row is the column header. Any help getting started would be great!


title: LyX Formating of Subsection Titles

text: Pretty simple but I cannot replicate what I have seen people do in LaTeX using LyX. I am making a resume and I want my headers to line up on the left (in a pane with no line) and have the text start for the relevant header on the header line and go down from there, such as:               Education                   XYZ University                                 GPA - 3.0/4.0                                 cum laude          Relevant Work Experience    XYZ Job                                 ABC Job          Other Work Experience       QWE Job          Skills                      LaTeX, C++          Personal Interests          Hiking


title: Customizing itemize inside a node in beamer

text: I am working with the MWE below and I am trying to do something that seems to be easy, but I cannot figure out.               \documentclass{beamer}          \usepackage{tikz}     \usetikzlibrary{positioning,calc,decorations.pathreplacing}          \begin{document}                    \begin{frame}          \begin{tikzpicture}         \node (B) at (0,0) {\includegraphics[scale=.2]{example-image}};                   \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (nuc) at (B) {};         \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (cyt) at ($(B)+(.4,.4)$) {};         \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (cha) at ($(B)+(.8,-.6)$) {};         \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (mem) at ($(B)+(.4,-1)$) {};                   \node[right=1cm of B.north east, align=left, text width=3cm, font=\tiny, fill=yellow] (C1) {             \begin{itemize}              \item RNA processing              \item DNA repair              \item cell cycle regulation              \item cellular component organization              \item metabolic pathways             \end{itemize}         };         \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=red!50!black] (C1.north west) -- (C1.south west) node[midway] {};              \node[right=0.5cm of B.east, align=left, shift={(0cm,-1.5cm)}, text width=4cm, font=\tiny, fill=yellow] (C2) {             \begin{itemize}              \item bind growth factors, receptors and metal ions              \item cell signaling and communication              \item cell migration, motility, localization and adhesion             \end{itemize}         };         \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=green!25!black] (C2.north west) -- (C2.south west) node[midway] {};              \path[->, >=latex, red!50!black, opacity=.6, line width=1pt] {[out=350,in=180]             (nuc) edge ($(C1.west)-(.2,0)$)             (cyt) edge ($(C1.west)-(.2,0)$)};         \path[->, >=latex, green!25!black, opacity=.6, line width=1pt] {[out=350,in=180]             (cha) edge ($(C2.west)-(.2,0)$)             (mem) edge ($(C2.west)-(.2,0)$)};          \end{tikzpicture}     \end{frame}          \end{document}      It produces the following output: ![](http://i.stack.imgur.com/HvFr7.png) I would just want:   1. Red text in the upper yellow box and green text in the lower one   2. Red and green circle for each item   3. No vertical space between items   4. No indentation for the items   5. No horizontal space between item circle and text Any help would be appreciated.


title: Texcount.pl with Texmaker word.count file not found error

text: I'm trying to get texcount.pl http://app.uio.no/ifi/texcount/ to work inside Texmaker but I get the error about the word.count that is not found. The documentations says that I have to add `\--shell-escape` to solve the problem but I don't know where to put that. Does anyone know?


title: Modifying "Cover page" and "Title page" of thesis

text: I am using thesis template from (: https://www.sharelatex.com/templates/thesis/easy-thesis/ ) to write. Currently I am experiencing some issues/problems, where, I need to change some parts (Frontpages) in this template in order to follow my institution's thesis format. This template have three important files such as Thesis.tex, Thesis.cls and Administritive.tex. I could do some simple tweaks to get what I want but now I feel lost when tried with what I want. The format that my institution expect is as below:               Cover page     Title page          ORIGINAL LITERARY WORK DECLARATION     ABSTRACT     ABSTRAK     ACKNOWLEDGMENTS     TABLE OF CONTENTS     LIST OF FIGURES     LIST OF TABLES     LIST OF SYMBOLS AND ABBREVIATIONS     LIST OF APPENDICES               CHAPTERs...               APPENDICES     REFERENCES     LIST OF SCIENTIFIC CONTRIBUTIONS      Here I need to change the "Cover page" and also the "Title page" according to my institution's need. For example, the "Cover page" contains Title, name of author and faculty + university's name - in ARIAL look like font. The "Title page" contains the title, author name, "THESIS SUBMITTED IN FULFLLMENT OF THE REQUIREMENT FOR THE DEGREE OF DOCTOR OF PHILOSPHY" and finally department + faculty + university's name. The above two formats are not as in the thesis template I mentioned at the top. I also want to make the contents look like below where I add "ABSTRAK" and " LIST OF SYMBOLS AND ABBREVIATIONS". All are in UPPER CASE LETTERS.               ORIGINAL LITERARY WORK DECLARATION     ABSTRACT     ABSTRAK     ACKNOWLEDGMENTS          TABLE OF CONTENTS     LIST OF FIGURES     LIST OF TABLES     LIST OF SYMBOLS AND ABBREVIATIONS     LIST OF APPENDICES      I dont know where exactly I need to change in order to get what I want. Do I need to change the "Thesis.cls" or any other file? I have played around to get what I want. Although I get something like below:               LIST OF APPENDICES      But the character 'T' becomes small. I am not happy on this. Other than that this template works fine. Hope I get some help from experts out there. Many thanks in advance.


title: Wrapfigure beamer style

text: I want to add a graphic plot to my slide, but if I do it with `wrapfigure`, I get no error massages, but the plot simply does not appear? Code of the TeX file, which uses `beamerdefs.sty`, I have also added the wrapfig package:               \begin{frame}{EWMA Plot}     \begin{wrapfigure}{r}{5cm}       \begin{center}         \includegraphics[scale=0.4]{ewma2.jpg}       \end{center}       \caption{EWMA}     \end{wrapfigure}     \end{frame}      As I said, no error message, it just does not appear, if I do it without `wrapfigure` the graphic appears? Can anyone help?


title: How to convert a one digit number to a two digit number

text: I have a table that represents a timetable for bus, so each cell contains time of departure as hour followed by minute, both as two digits, but sometimes I don't have two digits,just one so I have to switch eg. from `12 4 -> 12 04.` How is it possible?


title: Debugging Lua in LuaLatex with LDT

text: LDT is an IDE for lua based on eclipse. It is quite nice and the best free lua debugger I've seen(I've just stumbled upon it the last 2 days or so). It took me a bit to get setup properly but because the way it works using remote debugging I think it can be used to debug lualatex. I have gotten it to work with lualatex except for getting breakpoints to work(just runs through the code as if they weren't set). I've started a thread on the koneki forum for it to see if the developers can help with the issue. (it's probably something simple I'd imagine) I believe the ability to debug lua IN latex will will be tremendously beneficial(at the very least, to me) so I'm posting this to "spread the word". Here is the latest               The issue I get with the following test is:          "LuaSocket 2.0.2          test.tex:8: LuaTeX error debugger.lua:68: module 'socket' not found:      no field package.preload['socket']      [kpse lua searcher] file not found: 'socket'      [kpse C searcher] file not found: 'socket'     stack traceback:"          with the following code(DebugTest.lua):          "         socket = require("socket")         print("\n"..socket._VERSION.."\n")         require("debugger")()     "          Line 68 in debugger is              local socketcore = require"socket.core"          and I've tried changing it to              local socketcore = require"socket"          but get the same error.          I then copied core.dll and socket.lua from my main lua distro so that lualatex could find it(same dir as my lua code). This got past that error. (I don't know why the first line worked and printed version though... should be the exact same stuff?)          Next I got an error in base_path:          "156: if not base_dir then error("Unable to determine the working directory.")end"          which I just hard coded the base_dir to the source code files.          When I ran for the first time I got a timeout trying to access the debugger. When I started the DGBT and ran everything worked BUT the breakpoints were not hit. Subsequently running the tex program without DGBT running did not cause it to time out but printed debugger_loop error msg that generally happens in LDT.          So the only real issue is getting the breakpoints working. Any ideas?      http://www.eclipse.org/forums/index.php/m/872983/#msg_872983 As far as I know there is no way to step through lua code... and in fact I imagine this method could be easily adapted to step through tex code(well, in some sense). Anyways, hopefully more people are interested in getting this to work than me and see the benefit.


title: How to break header titles in a table

text: Please, how to break headers titles in a table ?               \begin{table}[H]     \begin{tabular}[h]{|p{2cm}||p{2cm}}      \hline     {title one} & {title two}   \\ \hline\hline     \end{tabular}     \caption{title}     \end{table}      Thank you.


title: Convert TeX to XDoc

text: I am rather new in this forum, so that I hope you will be patient in case of naive question. I would like to know if any of you is aware of ready-made tools to convert a `TeX` document into a XDoc. So far I have not been able to find anything on the net.


title: Greatest hits? Can I find the most \ref'd part of my document?

text: I now have a 200 page document and have used `\ref` and `\label` very frequently. I was wondering if it is possible to use LaTeX to create a table at the start of the document with the "top ten" most internally referenced sections/figures/tables/pages of the document? This would be interesting for me as author but also hopefully interesting for the reader also - e.g. identifying the key parts of the document to read. No idea if LaTeX is able to do this or not?


title: How to get the chapter title in a single page - titlesec

text: Because of my thesis `report` style, I want to have the chapter title in a single page. I'm working with `titlesec` package. I used `\clearpage` and `\newpage` to solve this, but doesn't work. I also used `\titlespacing`, but without good results for different size of titles.               \documentclass[11pt]{report}     \usepackage[T1]{fontenc}     \usepackage{titlesec}     \usepackage{calc}     \usepackage{lmodern}     \usepackage{lipsum}          \titleformat{\chapter}[display]     {\filcenter}     {{%        \filcenter\fontsize{48pt}{48pt}\usefont{T1}{phv}{m}{n}\MakeUppercase{\chaptername}        \fontsize{48pt}{48pt}\selectfont\thechapter%      }%     }     {5pt}     {\Huge\usefont{T1}{phv}{b}{n}%      \parbox{\textwidth-\widthof{\LARGE\sffamily\MakeUppercase{\chaptername}}}%     }          \begin{document}       \setcounter{chapter}{21}            \chapter{Chapter Title}       \section{Section one}         \lipsum[1]         \section{Section two}       \chapter{Another chapter}       \section{Section one}         \lipsum[2]     \end{document}


title: Gnuplot output encoding

text: I have this gnuplot script and works fine:               set term png     set output 'test.png'          plot sin(x) ti "Eñe"      Note de 'ñ' in the label. This produces an image and you can read the 'ñ'. Now I try to change the term to `epslatex`:               set term epslatex color     set output 'test.tex'          plot sin(x) ti "Eñe"      Run gnuplot, and it generates `test.tex` and `test.eps`. Then I have a master file:               % master.tex     \documentclass{report}     \usepackage[spanish]{babel}     \usepackage[latin1]{inputenc}          \begin{document}     \input{test.tex}     \end{document}      When I compile `master.tex` (either with texmaker or from console with pdflatex) I get an error. If I open `test.tex` with texmaker, instead of 'eñe' I have 'EÃ±e'. But if I open it with gvim, I have 'ñ'. When I fix it from textmaker, everything works just fine. There is a workaround that I don't want to use: In the gnuplot script, instead of 'eñe' I can write 'e\\~ne'. That works, but I really don't want to do it that way. I've tried using `set encoding` to `utf8` and `iso_8859_1` in the gnuplot script with no luck. Any ideas?


title: Plenty of space on page but can't make figures bigger

text: I am trying to put two figures on one page in latex, without using minipage. But the second figure is moved to the next page at a certain size, even though there is plenty of white space left on the page. Any ideas?


title: How can I store variables and iterate over them?

text: I want to know how I can store variables so I can iterate over them. Say we have this input in the document:               \inputcommandname{first input}     \inputcommandname{second input}     \inputcommandname{third input}      Later in the document we write something like `\outputinreverseorder` and get “Input 3 is ‘third input’. Input 2 is ‘second input’. Input 1 is ‘first input’.” Writing something like `\outputinorder` gives the opposite order.


title: Drawing a venn diagram with two nodes using Tikz?

text: How do I create a Venn Diagram with entities no larger than below, but with text scaled to fit; and circles in alignment horizontally?               \documentclass[a4paper, 14pt]{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}       \tikzset{venn circle/.style={draw,circle,minimum width=3cm,fill=#1,opacity=0.4}}            \node [venn circle] (A) at (0,0) {first order logic};       \node [venn circle] (B) at (30:2cm) {logic programming};       \node[below] at (barycentric cs:A=1/2,B=1/2){definite clause logic};     \end{tikzpicture}            \end{document}      ![venn](http://i.stack.imgur.com/vtC90.png)


title: bookmark language isn't Greek {LyX}

text: I am using LyX in order to write my thesis in Greek Language. When I press the preview button on LyX, everything is ok with the greek language on my thesis except the bookmarks on the side of pdf. They aren't in Greek ... although table of contents is in Greek. I attach a screenshot in order to understand what's my issue: ![http://img823.imageshack.us/img823/6858/screenshotfrom201211131.png](http://i.stack.imgur.com/79kDt.png) How can i fix this ?


title: Modifying mini-toc content

text: I am writing my Masters Thesis and I am using minitoc package to print contents per chapter. However I want to desativate de mini TOC BORDER. How can I do it? Regards


title: How to redefine thebibliography to put the bib list to a tabular?

text: The `bibliography` environment results in a list. However, I want to produce a `tabular` with two columns. The first column is the id, like `1`, `2`..., and the second column is the content of the bib. Any one have a solution? This result should look like:               ----------------------     | 1 | this is bib one |     ----------------------     | 2 | this is bib two |     ----------------------      ## UPDATE: I try to code from scratch, and get a workable solution.               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}          \makeatletter     \renewcommand\@biblabel[1]{#1}     \newenvironment{tablebibliography}%     {\center\tabularx{\textwidth}{|c|X|}\hline%     \setcounter{enumiv}{0}%     \let\p@enumiv\@empty%     \renewcommand\theenumiv{\@arbic\c@enumiv}}%     {%\\\hline     \endtabularx\endcenter}          \def\@@preparetbibitem{%     \addtocounter{enumiv}{1}%     \ifnum\the\value{enumiv}>1\\\hline\fi}          \def\tbibitem{\@ifnextchar[\@tlbibitem\@tbibitem}     \def\@tlbibitem[#1]#2{\@@preparetbibitem\@biblabel{#1} & \if@filesw%     {\let\protect\noexpand\immediate\write\@auxout%     {\string\bibcite{#2}{#1}}}\fi\ignorespaces}          \def\@tbibitem#1{\@@preparetbibitem\@biblabel{\the\value{enumiv}} & \if@filesw%     \immediate\write\@auxout%     {\string\bibcite{#1}{\the\value{enumiv}}}\fi\ignorespaces}     \makeatother          \begin{document}     This is reference\cite{itemone}, this is another reference\cite{itemtwo}.     \begin{tablebibliography}     \tbibitem{itemone} first item     \tbibitem[label]{itemtwo} second item     \tbibitem{itemthree} 3rd item \\\hline     \end{tablebibliography}     \end{document}      However, there are two issues:   * the 1st cell of the 1st line is not center-aligned.   * I must add `\\\\\hline` at the end of the last item, because I can't put it before `\endtabularx`, or it will complain `\hline noalign`. How to solve these problems? ## UPDATE: I replace `tabularx` with `tabu`, and the problems metioned above are solved. But the `\cite` link is broken. I don't kown how the `\bibitem` defines the link destination, so, what is the `\label` counterpart for `\cite` as to `\ref`?               \usepackage{longtable}     \usepackage{tabu}     \newenvironment{tablebibliography}%     {\center\longtabu to \textwidth{|X[-1,c]|X[1,p]|}\hline%     \setcounter{enumiv}{0}%     \let\p@enumiv\@empty%     \renewcommand\theenumiv{\@arbic\c@enumiv}}%     {\\\hline     \endlongtabu\endcenter}      ## UPDATE: I solved the link problem.               \def\@tbiblink#1{%     \Hy@raisedlink{\hyper@anchorstart{cite.#1}\relax\hyper@anchorend}}      So `\cite` or `\hyper@link` links to `\@tbiblink`.


title: How do I use \StrSubstitute for a custom environment containing custom commands (Use of \@xs@StrSubstitute@@ doesn't match its definition)

text: This might be a tricky one... I have a custom command which highlights "properties"               \pdesc{Property name}{DE}{EN}.      ![enter image description here](http://i.stack.imgur.com/I7FVz.png) Depending on the language (determined using the jobname), either the DE or EN field is compiled. If the EN field is empty, a message is shown (\mist = missing translation). ![enter image description here](http://i.stack.imgur.com/AvqtT.png) I made some changes to the \mist command. Usually both boxes are equally wide. This Is how the command is build:               \newcommand{\pdesc}[3]{\vspace{5pt}     \fcolorbox{black}{gray}{     \begin{minipage}[c]{0.97\textwidth}     \vspace{5pt}     \textcolor{title}{\textbf{#1}}\\     \ifde{#2}{#3}     \ifde{}{\ifstrempty{#3}{\mist{\ifde{Fehlende Übersetzung!}{Missing Translation!}}}{}}     \vspace{1ex}     \end{minipage}}     \vspace{5pt}          }               \newcommand{\mist}[1]{\rc{\textcolor{purple}{\textbf{#1}}}{Hier fehlt eine Übersetzung}}      I am looking for a way to use \StrSubstitute in the first field, thus in the first field of my \pdesc command. Since this field contains lots of code with ".", ";", "_" etc., causing Latex´ line break mechanism to fail, It would be really nice not to deal with all line breaks manually. I already have a working command for custom line breaks that I use in urls:               \newcommand{\bpath}[1]{%     \StrSubstitute{#1}{/}{/\allowbreak{}}[\result]%     \StrSubstitute{\result}{.}{.\allowbreak{}}[\result]%     \StrSubstitute{\result}{\_}{\_\allowbreak{}}[\result]%     \StrSubstitute{\result}{=}{=\allowbreak{}}[\result]%     \StrSubstitute{\result}{,}{,\allowbreak{}}[\result]%     \StrSubstitute{\result}{;}{;\allowbreak{}}[\result]%     \StrSubstitute{\result}{&}{&\allowbreak{}}[\result]%     \result%     }      However, If I try to use this command (directly or indirectly), Texworks displays               " > [10]     Underfull \hbox (badness 10000) in paragraph at lines 205--205     []$[]$     ! Use of \@xs@StrSubstitute@@ doesn't match its definition.     \new@ifnextchar ...served@d = #1\def \reserved@a {                                                       #2}\def \reserved@b {#3}\f...      which is caused by language tags within the first field of pdesc, since this field is displayed in English and German. By using \tags{de}{XX} AND \tags{en}{xx}, I control whether, e.g., a "and " or an "und" is displayed.


This question has a possible solution, but it's for the ConTeXt writer, which I can't use. ConTeXt: How to change the background color and border of a Pandoc-generated blockquote? What would be a LaTeX solution to achieve the same? EDIT: pandoc version is 1.9.4.2 on a debian wheezy system. This is the tex generated from `pandoc -V geometry:a4paper -V geometry:margin=2cm test.md -o test.tex`               \section{Test 1}     \subsection{Test 2}     \ldots{} this is a test.     \begin{verbatim}         Block         quote         123     \end{verbatim}     \ldots{} more text.      I don't use a custom template. If I put the example (`\startsetups framedsetups` ...) from the link in a file framedtext.tex and include it via -H, I get (and yes, I know I'd have to change the environment `verbatim`instead of `blockquote`):               >$ pandoc -H framedtext.tex -V geometry:a4paper -V geometry:margin=2cm test.md -o test.pdf     pandoc: Error producing PDF from TeX source.     ! Undefined control sequence.     l.39 \startsetups


title: Time calculations

text: Based on a given starting time, I'd like to automatically calculate a time table. Based on https://groups.google.com/forum/#!topic/de.comp.text.tex/BQrRUYmDrHw I put the following MWE together:               \documentclass{beamer}          \newcount\hours     \newcount\minutes          \def\gettime#1:#2\relax#3#4{\def#3{#1}\def#4{#2}}          \newcommand{\add}[2]{%         \expandafter\gettime#1\relax{\hrs}{\mins}%         \expandafter\gettime#2\relax{\addhrs}{\addmins}%         \hours=\hrs\relax%         \advance\hours by \addhrs\relax%         \minutes=\mins\relax%         \advance\minutes by \addmins\relax%         \ifnum\minutes>59\relax%         \advance\minutes by -60\relax%         \advance\hours by 1\relax%         \else%         \ifnum\minutes<0\relax%         \advance\minutes by 60\relax%         \advance\hours by -1\relax%         \fi%         \fi%         \ifnum\hours>23\relax%         \advance\hours by -24\relax%         \else%         \ifnum\hours<0\relax%         \advance\hours by 24\relax%         \fi%         \fi%         \ifnum\minutes<10\relax%         \xdef#1{\number\hours:0\number\minutes}%         \else%         \xdef#1{\number\hours:\number\minutes}%         \fi%         }          \begin{document}             \begin{frame}                 \xdef\startTime{09:30}                   \begin{tabular}{l l l}                     top1 & \startTime{} -- \add\startTime{01:00}\startTime & \textcolor{red}{01:00}\\                      top2 & \startTime{} -- \add\startTime{00:45}\startTime & \textcolor{red}{00:45}\\                      top3 & \startTime{} -- \add\startTime{00:15}\startTime & \textcolor{red}{00:15}\\                      \hline                     Sum & \textcolor{red}{09:30} -- \startTime                 \end{tabular}              \end{frame}     \end{document}      **Now the question:** How can I insert the red denoted times automatically as well? [In values in the third column are the durations] ![enter image description here](http://i.stack.imgur.com/x92Jq.png)


title: Sublime Text with LaTeXTools sets wrong PATH for TeX in OSX Mavericks

text: I'm having a very bizarre problem with ST2 for Mac OSX. I just installed it today, along with the LaTeXTools plugin. With the standard classes it works just fine. My dissertation, however, uses a custom class (umthesis, which I renamed to umassthesis.cls [and updated the `\ProvidesClass` accordingly] to avoid conflict with the University of Michigan class on CTAN) and for some reason my ST2+LaTeXTools isn't locating the file. It's giving me the following error in the console: "./umthsmpl.tex:91: LaTeX Error: File `umassthesis.cls' not found. [^^M]" It is, I believe, in the appropriate place (/Users/Dennis/Library/texmf/tex/latex/umassthesis.cls) and the other program I use to edit TeX (LaTeXian) is finding the class file without issue. Is there something I need to modify in order to get this working with ST2? UPDATE: I also ran `latexmk` (the same process ST2 runs) from the command line, which also gave me a successful compilation. UPDATE 2: Following a comment, I placed the class file in the same directory as the `.tex` file I'm trying to compile, and it worked. So it seems that Sublime is setting the PATH incorrectly. How do I modify the path ST2 w/ LaTeXTools sets so that it scans my user texmf directory?


title: General way to split a line by a rule of thumb and displaying results

text: The following is to construct illustrations for concepts of frequency of a properly sampled outcome if any such frequency exists. Doing such illustrations is tedious and liable to error by hand ... so it's best to make a pair of macros and make a macro out of them that does the following: Suppose I have a block of text with, say, 2 or more arbitrary letters or numbers, axaaxxaaaxxaaaxxaaaaxxaxa How does one make a macro that splits a line of text according to the following rule: If the parameter to the macro is 2, take every second letter in each pair and juxtapose them. That is line 2. Delete these letters from the original line and the remainder is line 1. Display all 2 lines. If the parameter to the macro is 3, take every second letter in each triple and juxtapose them. This is line 2. Take every third letter in each triple and juxtapose them. That is line 3. Delete these letters from the original line and the remainder is line 1. Display all 3 lines. If I write               \brk{+}{1}{axaaxxaaaxxaaaxxaaaaxxaxa}      the equivalent manual code is               \begin{equation}         \textrm{axaaxxaaaxxaaaxxaaaaxxaxa}     \end{equation}      If I write               \brk{+}{2}{axaaxxaaaxxaaaxxaaaaxxaxa}      the equivalent manual code is               \begin{equation}         \textrm{aaxaaxaxaaxaa}     \end{equation}     \begin{equation}         \textrm{xaxaxaaxaaxx}     \end{equation}      If I write               \brk{+}{3}{axaaxxaaaxxaaaxxaaaaxxaxa}      the equivalent manual code is               \begin{equation}         \textrm{aaaxaxaxa}     \end{equation}     \begin{equation}         \textrm{aaaxaxaxa}     \end{equation}     \begin{equation}         \textrm{axxaxaaaa}     \end{equation}      And so on. Now the - parameter chooses the second version of the macro and reverse this behavior. If I write               \brk{-}{1}{axaaxxaaaxxaaaxxaaaaxxaxa}      the equivalent manual code is               \begin{equation}         \textrm{axaaxxaaaxxaaaxxaaaaxxaxa}     \end{equation}      If I write               \brk{-}{2}{aaxaaxaxaaxaa}{xaxaxaaxaaxx}      the equivalent manual code is               \begin{equation}         \textrm{axaaxxaaaxxaaaxxaaaaxxaxa}     \end{equation}      If I write               \brk{-}{3}{aaaxaxaxa}{aaaxaxaxa}{axxaxaaaa}      the equivalent manual code is               \begin{equation}         \textrm{axaaxxaaaxxaaaxxaaaaxxaxa}     \end{equation}      And so on. Yes, the ability to format the results into a specific environment for instance the equation environment or change the font or vertical spacing of the n lines in `\\{brk{+/-}{n}{axaaxxaaaxxaaaxxaaaaxxaxa` is important as this is for figure purposes. Hopefully there is a way to make it not a problem for the macro. BTW the result is this: if the strings are long enough and tending to a frequency of, say, x is 1/3 (iff the original string was randomly sampled as it must be for most scientific purposes) then in each of the two or three or more string made from it by any rule of thumb, the frequency of x is also tending to be 1/3 rather quickly. And if we sampled three parts of the same population each tending to a frequency of x being 1/3 and then added the strings together according to any systematic rule, the frequency of x tends again to 1/3.


title: How to conditionally define a new command in LaTeX?

text: I'm trying to compile a LaTeX code with an older version of some package. Thus, I'm having a few issues due to undefined commands. How can I add conditional code so that I can define some work-around commands of this older package version?               % I want something like this:     if command \foobar is not defined       \newcommand{\foobar}{FooBar}          % I don't need an "else" clause here, but it would be good     % to know how to add one, in case I need it in future          end if


title: Errors for \subfloat environment

text: I am getting these errors (below) for each `\subfloat` when using this code. It has worked fine in the rest of my thesis, but suddenly there is a problem. Note that I exported all previous work from LyX, and these are the first new figures and subfigures I am adding ("inserted text" code <> switched so they would show).               ! Missing $ inserted.>inserted text> $ }          ! Extra }, or forgotten $.<argument> ...s/Chapter4/Style_Groups-SG1-MAE2445}}          ! Extra }, or forgotten $.\sf@@@subfloat ...de \setbox \@tempboxa \hbox {#4}\@tempdima =\wd \@tempboxa...}          ! Missing $ inserted.>inserted text>$ }          ! Missing } inserted.>inserted text>} }          ! Missing } inserted.>inserted text>} }      Here is an example               \documentclass[english]{report}     \usepackage{subfig}     \begin{document}     \begin{figure}     \centering     \subfloat[MAE 2445]{includegraphics[scale=0.2]{Figures/Chapter4/Style_Groups-SG1-MAE2445}     }          \subfloat[MAE 2459]{includegraphics[scale=0.2]{Figures/Chapter4/Style_Groups-SG1-MAE2459}     }          \protect\caption{Style Group 1}\label{SG1-all}     \end{figure}     \end{document}      Apparently my coding skills are not up to snuff!


title: Can I draw shapes and align them as a matrix or a table using TikZ?

text: Is there any way to create this final figure along with its text which depicts the idea behind k-fold cross-validation in statistics with shapes aligned like in a table or a matrix using TikZ? From where can I start, is there any similar code that can be of help? also is there any pre-defined shapes library to allow using more different shapes than what provided in the figure below? ![enter image description here](http://i.stack.imgur.com/WNIbp.png)


title: Heatmaps using Tabular - Size and Key

text: I am using the following code to generate a heatmap.               \documentclass[12pt]{article}     \usepackage{tikz}     \usepackage{collcell}          \newcommand*{\MinNumber}{0}%     \newcommand*{\MaxNumber}{1}%          \newcommand{\ApplyGradient}[1]{%             \pgfmathsetmacro{\PercentColor}{100.0*(#1-\MinNumber)/(\MaxNumber-\MinNumber)}             \hspace{-0.33em}\colorbox{red!\PercentColor!black}{}     }          \newcolumntype{R}{>{\collectcell\ApplyGradient}c<{\endcollectcell}}     \renewcommand{\arraystretch}{0}     \setlength{\fboxsep}{3mm} % box size     \setlength{\tabcolsep}{0pt}          \begin{document}     \begin{table}[ht]     \begin{center}     \begin{tabular}{*{10}{R}}       0.03 & 0.34 & 0.41 & 0.25 & 0.89 & 0.49 & 0.79 & 0.83 & 0.82 & 0.94 \\       0.49 & 0.25 & 0.80 & 0.83 & 0.93 & 0.25 & 0.82 & 0.80 & 0.35 & 0.00 \\       0.21 & 0.13 & 0.53 & 0.07 & 1.00 & 0.66 & 0.07 & 0.18 & 0.73 & 0.05 \\       0.81 & 0.49 & 0.27 & 0.07 & 0.57 & 0.12 & 0.26 & 0.39 & 0.57 & 0.80 \\       0.23 & 0.31 & 0.90 & 0.03 & 0.18 & 0.60 & 0.49 & 0.02 & 0.44 & 0.50 \\       0.40 & 0.91 & 0.84 & 0.88 & 0.04 & 0.59 & 0.75 & 0.91 & 0.69 & 0.88 \\       0.36 & 0.12 & 0.92 & 0.73 & 0.12 & 0.58 & 0.42 & 0.89 & 0.15 & 0.50 \\       0.93 & 0.07 & 0.57 & 0.43 & 0.12 & 0.70 & 0.54 & 0.25 & 0.06 & 0.57 \\       0.09 & 0.98 & 0.46 & 0.83 & 0.69 & 0.56 & 0.08 & 0.77 & 0.40 & 0.88 \\       0.07 & 0.44 & 0.65 & 0.46 & 0.65 & 0.75 & 0.80 & 0.56 & 0.89 & 0.50 \\     \end{tabular}     \end{center}     \end{table}     \end{document}      I want to achieve the following:   1. Add a key (preferably on the right)    2. Add Row and Column Names    3. Shrink the size of the heatmap Since I am new to latex, I am struggling with plots and tables.


title: Something wrong: LaTeX with listings

text: I'm trying to get green comments and blue javadocs. But with this code I can't get blue javadocs, always I get all comments green:               \usepackage{color}     \definecolor{gray97}{gray}{.97}     \definecolor{gray75}{gray}{.75}     \definecolor{gray45}{gray}{.45}          \definecolor{red}{rgb}{0.6,0,0} % strings     \definecolor{green}{rgb}{0.25,0.5,0.35} % comments     \definecolor{purple}{rgb}{0.5,0,0.35} % keywords     \definecolor{blue}{rgb}{0.25,0.35,0.75} % doc          \usepackage{listings}     \lstset {     frame               =   Ltb,     framerule           =   0pt,     aboveskip           =   0.5cm,     framextopmargin     =   3pt,     framexbottommargin  =   3pt,     framexleftmargin    =   0.4cm,     framesep            =   0pt,     rulesep             =   .4pt,     backgroundcolor     =   \color{gray97},     rulesepcolor        =   \color{black},     %     stringstyle         =   \color{red},     showstringspaces    =   false,     basicstyle          =   \ttfamily\small,     commentstyle        =   \color{green},     morecomment         =   [s][\color{blue}]{/**}{*/},     keywordstyle        =   \color{purple}\bfseries,     %     numbers             =   left,     numbersep           =   15pt,     numberstyle         =   \tiny,     numberfirstline     =   false,     breaklines          =   true,     }      I use this code to print the code example:               \begin{lstlisting}[language=C]         /* Includes */         #include <stdio.h>              int main(int argc, char* argv[]) {             puts("Hola mundo!"); // Text console         }     \end{lstlisting}      In that can I be wrong? Thanx