title: \setuppagenumbering[location=] causes problem in Context

text: I am new to tex world. I am converting a markdown to pdf, first using the pandoc to create the text and then `ConText` to generate the pdf. I hope to release the template to wider pandoc audience if I can resolve some of the issues. When I add `\setuppagenumbering[location=]` to the template to remove the default page number in the header, I get the following error. Also attached is the tex file for your reference.               mtx-context     | run 1: luatex --fmt="C:/Programs/context/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0     dde776fb1556f32e/formats/luatex/cont-en" --interaction="nonstopmode" --jobname="taf-user-guide10" --lua="C:/Programs/con     text/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" --no-pars     e-first-line --c:currentrun=1 --c:fulljobname="./taf-user-guide10.tex" --c:input="./taf-user-guide10.tex" --c:kindofrun=     1 --c:maxnofruns=8 --c:nonstopmode "cont-yes.mkiv"     This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5041)      \write18 enabled.     open source     > 1 > 1 > C:/Programs/context/context/tex/texmf-context/tex/context/base/cont-yes.mkiv          ConTeXt  ver: 2014.09.06 20:59 MKIV beta  fmt: 2014.9.8  int: english/english          system          > 'cont-new.mkiv' loaded     open source     > 2 > 2 > C:/Programs/context/context/tex/texmf-context/tex/context/base/cont-new.mkiv     close source    > 2 > 2 > C:/Programs/context/context/tex/texmf-context/tex/context/base/cont-new.mkiv          system          > files > jobname 'taf-user-guide10', input './taf-user-guide10', result 'taf-user-guide10'     fonts           > latin modern fonts are not preloaded     languages       > language 'en' is active     open source     > 2 > 3 > C:/Project/meccano/trunk/docs/user manual/taf-user-guide10.tex     open source     > 3 > 4 > C:/Programs/context/context/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv     close source    > 3 > 4 > C:/Programs/context/context/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv     fonts           > bodyfont '20pt' is defined (can better be done global)     fonts           > bodyfont '24pt' is defined (can better be done global)     fonts           > bodyfont '16pt' is defined (can better be done global)     backend         > xmp > using file 'C:/Programs/context/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'     pages           > flushing realpage 1, userpage 1     pages           > flushing realpage 2, userpage 2     structure       > sectioning > title @ level 2 : 0.0 -> \headtext {content}     pages           > flushing realpage 3, userpage 3          lua error       > error on line 150 in file C:/Project/meccano/trunk/docs/user manual/taf-user-guide10.tex:          .../context/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt to index field 'numbers' (a nil value)     stack traceback:             .../context/tex/texmf-context/tex/context/base/strc-doc.lua:904: in function 'getsectionnumber'             [\directlua]:1: in main chunk          140       {\tfd {\switchtobodyfont [20pt] TAF User Guide}}     141       \blank[5*big]     142       {\tfa abc}     143       \blank[2*big]     144       {\tfa \currentdate}     145       \blank[3*medium]     146     \stopalignment     147     148     \completecontent     149     150 >>  \chapter{Creating device driver}     151     \section[how-to-create-the]{How to create the}     152     153     asdasdasd adasd a     154     155     \stoptext      The Tex File produced by pandoc and converted to pdf using `Context`               \startmode[*mkii]       \enableregime[utf-8]       \setupcolors[state=start]     \stopmode          % COLOR==================================================     \definecolor [darktheme]             [r=0.43, g=0.00, b=0.00]\definecolor [blockquotebackground]  [r=0.85, g=0.65, b=0.55]\definecolor [codebackground]        [r=0.95, g=0.95, b=1.00]% Enable hyperlinks======================================     \setupinteraction[state=start, color=darktheme]          % PAGE SETUP ================================================     \setuppapersize [A4][A4]     \setuplayout    [width=middle,  backspace=1in, cutspace=1in, height=middle, topspace=0.75in, bottomspace=0.75in]               % HEADER ================================================     %\setupheadertexts[][][][]     \setupfootertexts[\setups{text right}][][][\setups{text left}]     \setuppagenumbering[location=,alternative=doublesided]          \startsetups[text right]       \rlap{}       \hfill       \bf {\sl {TAF User Guide} (420) }       \hfill       \llap{\pagenumber}     \stopsetups          \startsetups[text left]       \rlap{\pagenumber}       \hfill       \bf \cap{ Chapter \namedheadnumber{chapter} }  \getmarking[chapter]       \hfill       \llap{}     \stopsetups               % BODY ======================================================     \setupbodyfont[palatino,11pt]     \setupwhitespace[medium]               % HEADINGS ==================================================     \unexpanded\def\HeadTitle#1#2%     {\hbox to \hsize \bgroup     \hfill     \setupframed[offset=.5em,frame=off]     \tbox{\framed[width=2cm,align=left]{#1}}%     \tbox{\framed[width=7cm,align=right,leftframe=on]{#2}}%     \egroup}          \setupheads[alternative=inmargin,separator=--,color=darktheme]     \setuphead[chapter]      [style=\tfd \bf, command=\HeadTitle, textstyle=bold]     \setuphead[section]      [style=\tfb \bf]     \setuphead[subsection]   [style=\tf \bolditalic]     \setuphead[subsubsection][style=\bf, number=no]                    % BLOCKQUOTE ================================================     \definebackground       [blockquote]       [         framecolor=darktheme,         background=color,         backgroundcolor=blockquotebackground,         frame=off,          leftframe=on,         rulethickness=2mm,         offset=overlay,         leftoffset=2em,         rightoffset=1em,         width=\textwidth,         setups=framedsetups,         before=\blank,         after=\blank,       ]          % CODE ================================================     \definetextbackground       [verbatim]       [         background=color,         backgroundcolor=codebackground,         backgroundoffset=0mm,         offset=0.8cm,         frame=off,         location=paragraph,         before=\blank,         after=\blank,       ]          \setuptyping       [typing]       [margin=2mm,bodyfont=10.0pt,     before={\starttextbackground[verbatim]},     after={\stoptextbackground}]               \definedescription       [description]       [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]          \setupitemize[autointro]    % prevent orphan list intro     \setupitemize[indentnext=no]          \setupfloats[figure][location=left,width=6.3in]     \setupfloats[table][default={here}]     \setupcaptions[figure][style=bold]          \setupthinrules[width=15em] % width of horizontal rules          \setupdelimitedtext       [blockquote]       [before={\blank[medium]},        after={\blank[medium]},        indentnext=no,       ]          % TOC======================================================     \setupcombinedlist[content][list={chapter,section,subsection}]          % level=4, \subsubsubsections are not listed in ToC     % alternative=c, space to the page number is filled with dots     \setupcombinedlist[content][list={chapter,section}, alternative=c,]          \setuplist[chapter][width=10mm, style=bold]     \setuplist[section][width=20mm, style=normal, pagestyle=normal]     %\setuplist[subsection][width=20mm, style=slanted, pagestyle=normal]          % pagestyle=normal for changing the appearance of pagenumber     %\setuplist[subsubsection][width=20mm, style=slanted, pagestyle=normal]                         \starttext          \startalignment[center]       \blank[4*big]       {\tfd {\switchtobodyfont [20pt] TAF User Guide}}       \blank[5*big]       {\tfa abc}       \blank[2*big]       {\tfa \currentdate}       \blank[3*medium]     \stopalignment          \completecontent          \chapter{Creating device driver}     \section[how-to-create-the]{How to create the}          asdasdasd adasd a          \stoptext      Here is a minimal example that shows that same error message.               \setupfootertexts[\namedheadnumber{chapter}]     \setuppagenumbering[location=,alternative=doublesided]          \starttext          \completecontent          \chapter{Creating device driver}          \section{How to create the}          Chapter text          \stoptext


title: fancyhdr: Footer not centered after changing page geometry

text: # MWE               \documentclass{article}     \usepackage{lipsum}     \usepackage[showframe]{geometry}     \usepackage{fancyhdr}     \fancyhf{}     \cfoot{something centered in footer}     \lhead{\rule{\textwidth}{3pt}}     \pagestyle{fancy}     \begin{document}     A normal page.          \clearpage     \newgeometry{margin=.5in,includeheadfoot,hcentering}     \lipsum[1-2]          \noindent\rule{\textwidth}{3pt}          \end{document}      # Problem As is shown in the MWE, the footer is not centered on the second page, after the geometry has been changed. Is there a way to correct this?


title: Apply command list to argument correctly

text: I have a clist filled with values I want to use as commands and apply them all successively e.g. `\cmda{\cmdb{\cmdc{arg}}}` to the argument of the \apply function. I added an example but it doesn't work. Any ideas how to solve that problem with a correct `\apply` function? I would be very thankful, because I spent a lot of time but still haven't found any working solution.               \documentclass{article}          \usepackage{xparse}     \usepackage{amsmath,amssymb}     \ExplSyntaxOn     \clist_new:N \g_pkg_cmd_clist {}     \NewDocumentCommand{\addcmd}{ m }        {           \clist_put_right:Nn \g_pkg_cmd_clist {#1}        }     \NewDocumentCommand{\apply}{ m }        {          \tl_clear:N \l_tmpa_tl          \tl_set:Nn \l_tmpa_tl {#1}          \clist_map_inline:Nn \g_pkg_cmd_clist          {               \tl_put_right:Nn \l_tmpa_tl {\csname ##1\endcsname{\l_tmpa_tl}}          }          \tl_use:N \l_tmpa_tl        }     \ExplSyntaxOff          \begin{document}     \addcmd{dot}     \addcmd{vec}     \addcmd{breve}          $\apply{x}$ should be $\breve{\vec{\dot{x}}}$     %After appling all entries should be cleared     \addcmd{breve}     \addcmd{dot}     \addcmd{vec}          $\apply{y}$ should be $\vec{\dot{\breve{y}}}$          \end{document}      Maybe to explain the goal: I want to create a package which allows kind of object-oriented symbols definition commands like this:               \var<fcn1,fcn2,...>[subscripts or if known as superscripts][superscripts]     \current[battery,max][2] %=I_{bat,max}     \state<v>[i] %state vector \vec{x}_i (with \state=x)     \state<M> %=\mathbf{\uppercase{x}} (with \state=x)


title: hyperlink an \item and \ref

text: I have a custom environment which is just an `enumerate` with the `\item` written for me. I would like the enumeration label to be a hyperlink- in the MWE below, it simply links to a page at the end of the document. When referencing the environment using `\ref` the printed version will look fine. However, you'll notice that the hyperlink created by `\ref{testref}` goes to the same link that the enumeration label goes to, and not to the environment that it references. What needs to be changed to get the hyperlinks to behave as expected?               \documentclass{article}          \usepackage{lipsum}     % sample text     \usepackage{enumitem}   % enumerations     \usepackage{hyperref}   % hyperlinks                  \newcounter{problem}     \newcounter{subproblem}     \newenvironment{problem}{\setcounter{subproblem}{0}\refstepcounter{problem}{\bfseries Problem \theproblem}}{}     \newenvironment{subproblem}{%         \stepcounter{subproblem}%         \begin{enumerate}[label=\protect\hyperlink{newpage}{\theproblem.\thesubproblem},leftmargin=*]          \item}{\end{enumerate}}          \begin{document}          \begin{problem}      \begin{subproblem}       \lipsum[1]      \end{subproblem}      \begin{subproblem}\label{testref}       \lipsum[1]      \end{subproblem}     \end{problem}          Test reference: \ref{testref}          \begin{problem}      \begin{subproblem}       \lipsum[1]      \end{subproblem}      \begin{subproblem}       \lipsum[1]      \end{subproblem}     \end{problem}          \newpage          \hypertarget{newpage}{We'll link to this}          \end{document}


title: Backref also lists and links to citations in listoffigure/listoftables

text: I sometimes use `\cite` in the `figure` or `table` environment and use backref to be able to link to citations from the bibliography. If I include a list of figures or list of tables the citation is repeated and the corresponding pagenumber is listed in the bibliography. How can I prevent the count of the second citation, so that only the first one in the main text appears in the bibliography? **MWE** : test.tex:               \documentclass{book}          \usepackage{hyperref}     \usepackage[hyperpageref]{backref}     \renewcommand*{\backrefalt}[4]{%     \ifcase #1 %     Not cited.%     \or     Cited on page #2.%     \else     Cited on pages #2.%     \fi     }          \begin{document}     \mainmatter     \begin{figure}     \caption{Lorem ipsum \cite{One}.}     \end{figure}          \backmatter     \bibliographystyle{unsrtnat}     \bibliography{bib}     \listoffigures          \end{document}      bib.bib:               @Article{One,     title={This},     author={Me},     year=2013,     journal={My journal},     volume=1     }      Compile 3-4 times and both locations will show up in the bibliography.


title: multipart node to represent a byte

text: I am trying to create a multipart node to represent a byte I wish I could write `\Byte{0 1 0 0 1 1 0 0}` or `\Byte {0, 1, 0, 0, 1, 1, 0, 0}` and obtain ![enter image description here](http://i.stack.imgur.com/2R8fY.jpg)               \documentclass[12pt]{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes.multipart}          \newcommand{\Byte}{     \node [rectangle split,rectangle split parts=8, rectangle split horizontal,draw ] at (2,2)     {\nodepart{one}0\nodepart{two}1\nodepart{three}0\nodepart{four}0\nodepart{five}1\nodepart{six}1\nodepart{seven}0\nodepart{eight}0};     }     \begin{document}          \begin{tikzpicture}     \Byte     \end{tikzpicture}     \end{document}


title: how to get the right format of a subfigure if i use a custom figure number

text: I'm a heavy LaTeX user, but have very lite idea how the Tex programming is done. I'm writing a longer document and wanted to have figure numbers like that: chaper.section.figure_number e.g. Figure 4.3.10. After some goggeling i found this solution which works just fine:               \makeatletter     \@addtoreset{equation}{section}     \@addtoreset{figure}{section}     \@addtoreset{table}{section}     \def\thefigure{\thesection.\@arabic\c@figure}     \def\thetable{\thesection.\@arabic\c@table}     \def\theequation{\thesection.\@arabic\c@equation}     \makeatother      ,although I have no Idea why. When I'm using a subfigure with a label unfortunately I get references like that: chaper.figure_nuber e.g. 4.30(a). But what i want is: chapter.section.figure_number.(a,,b,c..) e.g. 4.2.10(a). I guess I have to define an additional command like above, but from the subfig documentation I can't say which and how... I would appreciate any help


title: Noisy, analogue waveform in TikZ

text: Is there an easy way of drawing a noisy waveform in TikZ? I know you can draw a simple sinusoid by repeatedly using cos and sin for every half-period, but doing that for a noisy waveform seems like a massive undertaking and a very roundabout way of doing it. I'm looking for something like this: ![Noisy waveform](http://i.stack.imgur.com/KQ7D1.gif) It doesn't have to be that long, a fifth of the length is fine. I'm diagramming a noise reduction system and need to show a noisy waveform as the input to the diagram (whereas the rest of the diagram is simple rectangular boxes and text...). Any ideas?


title: How can I create a better cryptogram environment?

text: I put together a macro that takes two arguments. The first argument is a string of letters which defines a cipher. The second argument is a message to be encrypted using this cipher.               \documentclass{article}     \usepackage{geometry}     \setlength{\parindent}{0pt}     \setlength{\parskip}{2ex}     \makeatletter          %%---------------------------------------------------------------------     %% #1=replacement cipher                                                    %% #2=text to be enciphered                                                 %% starred version will group letters into collections                      %% of five letters (stripping out previous space and punctuation)           \newif\if@regroup@letters@by@fives@     \def\makecryptogram{%%       \@ifstar{\@regroup@letters@by@fives@true\@makecryptogram}               {\@regroup@letters@by@fives@false\@makecryptogram}}     \def\@makecryptogram#1#2{%%       \bgroup         \@build@cipher{#1}%%         \if@regroup@letters@by@fives@           \expandafter\@build@groups@of@five\expandafter{#2}%%         \else           \edef\ae@encrypted@message{#2}%%         \fi         \ttfamily         \raggedright         \uppercase\expandafter{\ae@encrypted@message}%%         \par       \egroup}          %%---------------------------------------------------------------------     %% counter to assist in tracking and encoding letters of the                %% alphabet.                                                                \newcounter{@letter@code}     %% #1=replacement cipher                                                    \def\@build@cipher#1{%%       \setcounter{@letter@code}{64}%%       \@@build@cipher#1\relax}     %% #1=current letter representing encryption of nth letter                  %% #2=placeholder to test end of content                                    %%                                                                          %% No error should be raised if the cipher has fewer than 26 letters.       %% In that case, only the initial portion of the alphabet will be           %% encrypted.  If there are more than 26 letters for the cipher, do         %% nothing with the extras.                                                 %%                                                                          %% Ignore the difference between upper and lower case letters of input      %% characters.  Regardless of input, output is all upper case.              %%                                                                          \def\@@build@cipher#1#2{%%       \stepcounter{@letter@code}%%       \ifnum\value{@letter@code}<91\relax         \ifnum`#1>\number\numexpr`a-1\relax           \uccode\value{@letter@code}=\number\numexpr`#1-32\relax           \uccode\number\numexpr\value{@letter@code}+32\relax=\number\numexpr`#1-32\relax         \else           \uccode\value{@letter@code}=\number\numexpr`#1\relax           \uccode\number\numexpr\value{@letter@code}+32\relax=\number\numexpr`#1\relax         \fi         \ifx\relax#2\relax           \let\ae@continue@building@cipher\relax         \else           \let\ae@continue@building@cipher\@@build@cipher         \fi       \else         \let\ae@continue@building@cipher\relax       \fi       \ae@continue@building@cipher#2%%     }          %%---------------------------------------------------------------     \newcounter{@ae@letter@counter}     \newif\if@spaceOrPunctuation@     \def\@build@groups@of@five#1{%%       \def\ae@encrypted@message{}%%       \setcounter{@ae@letter@counter}{0}%%       \@@build@groups@of@five#1\relax}     %% <space>s are ignored merely by the manner in which TeX     %% grabs the next token for the arguments of a macro.         %% When gathering into groups of five letters, all punctuation     %% should be suppressed and dropped.     \def\@@build@groups@of@five#1#2{%%       \@spaceOrPunctuation@false       \if-#1\relax\@spaceOrPunctuation@true\fi       \if,#1\relax\@spaceOrPunctuation@true\fi       \if;#1\relax\@spaceOrPunctuation@true\fi       \if:#1\relax\@spaceOrPunctuation@true\fi       \if.#1\relax\@spaceOrPunctuation@true\fi       \if?#1\relax\@spaceOrPunctuation@true\fi       \if!#1\relax\@spaceOrPunctuation@true\fi       \if@spaceOrPunctuation@       \else         \stepcounter{@ae@letter@counter}%%         \xdef\ae@encrypted@message{\ae@encrypted@message#1}%%         \ifnum\value{@ae@letter@counter}=5\relax           \setcounter{@ae@letter@counter}{0}%%           \xdef\ae@encrypted@message{\ae@encrypted@message\space}%%         \fi       \fi       \ifx\relax#2\relax         \let\ae@continue@building@blocks@of@five\relax       \else         \let\ae@continue@building@blocks@of@five\@@build@groups@of@five       \fi       \ae@continue@building@blocks@of@five#2%%     }          \makeatother          \usepackage{environ}     \makeatletter     \NewEnviron{cryptopgram}[1]       {\@build@cipher{#1}%%        \expandafter\@build@groups@of@five\expandafter{\BODY}%%        \ttfamily        \raggedright        \uppercase\expandafter{\ae@encrypted@message}%%        \par       }          \makeatother          \begin{document}          From Bertrand Russell's \emph{Problems of Philosophy}.          \def\mypassage{%%'       Is there any knowledge in the world which is so certain that no       reasonable man could doubt it? This question, which at first sight       might not seem difficult, is really one of the most difficult that       can be asked. When we have realized the obstacles in the way of a       straightforward and confident answer, we shall be well launched on       the study of philosophy--for philosophy is merely the attempt to       answer such ultimate questions, not carelessly and dogmatically, as       we do in ordinary life and even in the sciences, but critically,       after exploring all that makes such questions puzzling, and after       realizing all the vagueness and confusion that underlie our ordinary       ideas.}          Without changing word boundaries:\par     %%            --ABCDEFGHIJKLMNOPQRSTUVWXYZ--                \makecryptogram{BCDNXGHELOPUQASRVFWTYZIJKM}{\mypassage}          Collect letters into groups of five:\par     \makecryptogram*{BCDNXGHELOPUQASRVFWTYZIJKM}{\mypassage}          Pseudo-environment:\par     \begin{cryptopgram}{BCDNXGHELOPUQASRVFWTYZIJKM}       Is there any knowledge in the world which is so certain that no       reasonable man could doubt it? This question, which at first sight       might not seem difficult, is really one of the most difficult that       can be asked. When we have realized the obstacles in the way of a       straightforward and confident answer, we shall be well launched on       the study of philosophy--for philosophy is merely the attempt to       answer such ultimate questions, not carelessly and dogmatically, as       we do in ordinary life and even in the sciences, but critically,       after exploring all that makes such questions puzzling, and after       realizing all the vagueness and confusion that underlie our ordinary       ideas.     \end{cryptopgram}          \end{document}      ![enter image description here](http://i.stack.imgur.com/CJp1j.png) There are a couple of things I would like to know how to do (if they're even feasible) which I'll raise as separately posted questions. Here's the context for the first question: My code works by taking the cipher, remapping the `\uccode`s for each the letters of the alphabet, then calling `\uppercase` with these new `\uccode` values on the message. (The material to be encrypted should just be plain text without any mark up except for possible punctuation.) I would like to consider a different approach that will not rely on using `\uppercase`. I would like to be able to temporarily remap character codes within the confines of an environment. Of course, once the environment is over, the old character codes should be restored. So for example, instead of changing `\uccode`s, I would like to remap character code of `C` to that of `N`, `D` to `O`, etc. as in the above cryptograms. In other words, when TeX sees the token `C` with catcode=11, it behaves as though this were `N` with catcode=11, and so on for all the text tokens with catcode=11. However, I can't find any such mechanism for remapping character codes. In other words, is there a way of encrypting a cipher that can avoid changing the upper case codes?


title: How to insert logo in LyX beamer?

text: I am trying to make presentation by using LyX beamer template (already installed in program files). But I am not able in insert a university logo on title page. Hope that some one can solve this problem. Please download any lyx file from the link below and try to insert your own logo. http://www.ctan.org/tex- archive/macros/latex/contrib/beamer/solutions/conference-talks I have followed the instruction given in the file. > "If you have a file called "institution-logo-filename.xxx", where xxx is a > graphic format that can be processed by latex or pdflatex, resp., then you > can add a logo by uncommenting the following:"               %\pgfdeclareimage[height=0.5cm]{institution-logo}{institution-logo-filename}     %\logo{\pgfuseimage{institution-logo}}      I have uncommented these two lines and have the logo file with same name "institution-logo-filename" in the same folder, but it does not work.


title: pgfopts error when installing ytableau

text: I am trying to install ytableau.sty, following the directions here and here, and in the ytableau README. I am running TexShop 2.47 on OS X 10.6. Here's a walkthrough of what I've done, although I suspect I may have gone wrong early on. First of all, I don't already have it:               \documentclass{amsart}     \usepackage{ytableau}          \begin{document}          \end{document}      produces               ! LaTeX Error: File `ytableau.sty' not found.      Downloaded `ytableau.ins` from CTAN, ran `latex ytableau.ins`, created directory `~/Library/texmf/tex` and copied resulting `ytableau.sty` file to it. Test file now produces               LaTeX Warning: You have requested, on input line 173, version                    `2011/06/02' of package pgfopts,                    but only version                    `2008/06/26 v1.0  LaTeX package options with pgfkeys'                    is available.            ! Undefined control sequence.       l.174 \ProcessPgfPackageOptions                                      {/ytableau/options}      Repeated process to install the June 2, 2011 version of pgfopts. I still get the same error message. I've tried putting pgfopts in a few different places, namely `~/Library/texmf/tex`, `~/Library/texmf/tex/pgfopts`, `~/Library/texmf/latex` and `~/Library/texmf/latex/pgfopts`, but either LaTeX is still finding the old version or that wasn't the actual problem.


title: How to set output directory in context command?

text: When using `lualatex` or `pdflatex` commands, there is an option to set the destination/processing folder as               lualatex -output-directory=/destination/folder file.tex      I was unable to find a similar option for `context` command. How to force `context` to write log files and resulting pdf in a custom folder?


title: Best way to create colored text boxes

text: I am retyping some old exams into LaTeX, and I encountered the page below ![Old exam](http://i.stack.imgur.com/dGpEk.png) Now with some clever commands, and whatnot I was able to create something almost identical. Though the spacing is a tad off, and my equation is a tad small. I also had to use some hacks and ugly code to produce the result Does anyone have a better cleaner way to do this ? Here is almost the exact code I am using for typesetting these exams. Only difference is that all the "junk" in the header is placed i sty. files. So y header contains only 3-5 input files. Here I included everything that is needed to run the code. Some improvements to the code below would be great.               \documentclass[10pt,a4paper]{article}     \usepackage[hmargin=3cm,vmargin=2cm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[norsk]{babel}     \usepackage[dvipsnames*,svgnames]{xcolor}     \usepackage{mathtools}     \usepackage{xstring}     \usepackage{xparse}          \newcounter{tittel}     \setcounter{tittel}{0}     \newcounter{problem}     \setcounter{problem}{0}     \newcounter{alternative}     \setcounter{alternative}{0}          \newcounter{navn}[problem]     \renewcommand{\thenavn}{\alph{navn}}     \newcommand{\navn}{\stepcounter{navn}\paragraph*{\thenavn)}}     \setcounter{navn}{0}          \newcommand{\NR}[1]     { \vspace{5mm} \begin{minipage}[t]{0.051 \textwidth}      \navn \hspace{0pt}     \end{minipage}     \begin{minipage}[t]{0.949\textwidth}     #1      \end{minipage}     \vspace{-0.3cm}     }          \newif\iffirstalt          \NewDocumentCommand{\Oppgave}{m o}{%       \IfNoValueTF{#2}{\setcounter{alternative}{0}\stepcounter{problem}    \firstaltfalse}%                   {\stepcounter{alternative}\iffirstalt\else\stepcounter{problem}    \firstalttrue\fi}       \section*{Oppgave \arabic{problem}%                  {\normalfont\IfNoValueTF{#2}{}{~Alternative     \Roman{alternative}\ }                     \normalsize (#1 poeng)}%        \addcontentsline{toc}{section}{Oppgave \arabic{problem} }}      \vspace{3mm} }          \begin{document}          \Oppgave{5}          En gruppe på $8$ elever besår av like mange gutter som jenter. Vi trekker     tilfeldig ut 8 elever.          \NR{ Hva er sannsynligheten for å trekke ut $2$ gutter og $1$ jente? }          \NR{ Hva er sannsynligheten for å trekke ut minst $1$ jente? }          \begin{center}            \noindent\fcolorbox{black}{LightSteelBlue}{%         \parbox[t][3cm][c]{11cm}{ \hspace*{0.25cm} Hypergeometrisk     sannsynlighetsfordeling: $\displaystyle P(X=x)=\dfrac{\binom{m}{k}\binom{n-m}{r-k}}{\binom{n}{r}}$ \\          \hspace*{0.25cm} $m$ elementer i $D$. $n-m$ elementer i $\bar{D}$ \\        \hspace*{0.25cm} $r$ elementer trekkes tilfeldig. \\        \hspace*{0.25cm} $X$ er antall elementer som trekkes fra $D$  }%       }%        \end{center}              \end{document}      Below is a minimal example, barely enough to produce the page above.               \documentclass[10pt,a4paper]{article}     \usepackage[hmargin=3cm,vmargin=2cm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[norsk]{babel}     \usepackage[dvipsnames*,svgnames]{xcolor}     \usepackage{mathtools}          \begin{document}          \section*{Oppgave 2 \normalsize \normalfont (5 poeng)}          En gruppe på $8$ elever besår av like mange gutter som jenter. Vi trekker     tilfeldig ut 8 elever.          \paragraph*{a)} Hva er sannsynligheten for å trekke ut $2$ gutter og $1$ jente?           \paragraph*{b)} Hva er sannsynligheten for å trekke ut minst $1$ jente?           \begin{center}            \noindent\fcolorbox{black}{LightSteelBlue}{%         \parbox[t][3cm][c]{11cm}{ \hspace*{0.25cm} Hypergeometrisk     sannsynlighetsfordeling: $\displaystyle P(X=x)=\dfrac{\binom{m}{k}\binom{n-m}{r-k}}{\binom{n}{r}}$ \\          \hspace*{0.25cm} $m$ elementer i $D$. $n-m$ elementer i $\bar{D}$ \\        \hspace*{0.25cm} $r$ elementer trekkes tilfeldig. \\        \hspace*{0.25cm} $X$ er antall elementer som trekkes fra $D$  }%       }%       \end{center}          \end{document}      Here is how my output looks ![My output](http://i.stack.imgur.com/mwZ9b.png) Question(s)   * Is there an easier way, that also looks better for creating the blue box?   * Are there any smal improvements that could be done to my "long" code?


title: How to put image as background in slide

text: \documentclass[a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[frenchb]{babel}     \usepackage{arabtex}     %\usepackage{lucidabr}     \usepackage{amsmath}     \usepackage{pdfslide}     \usepackage{pause}     \usepackage{array}     \usepackage{graphics}      \pagestyle{title} \novocalize     \begin{document}           \pagedissolve{Dissolve /D 1 /Di /H /DM /O}      \overlay{221.jpg}     \orgname{}          \orgurl{\RL{\LARGE bsm alallh alr.hmn alr.hym \hspace{5cm}}}     \color{white}     \title{\RL{\LARGE alslAm `lykm \hspace{7cm}}}     \author{\scalebox{1}[1.3]{\RL{\LARGE m--r.hb--A b--.dy--wfn--A alk--rAm \hspace{5cm}}}}          \notes{This is for public consumption and for release to            Comprehensive \TeX{} Archive Network}                     \pagedissolve{Wipe /D 3 /Di /H /M /O} \overlay{10.eps}      $\hspace{-1.4cm}\begin{array}[c]{ccc}      {\textrm{Ministère de l'enseignement supérieur}}&            &\large\RL{wzArT alt`lym al`Aly wAlb.h_t al`lmy\hspace{0cm}}  \\      {\textrm{et de la recherche scientifique }\hspace{0cm}}     &           & \\     {\large\textrm{Ecole Normale Supérieure }}     &            &\large\RL{almdrs--T al`ly--A li--l-'s--At--_dT\hspace{2cm}}           \\     { \large\textrm{-Vieux Kouba - (Alger)} }      &            &\large\RL{- alqbb"aT alqdym--T - $)$ aljzA'ir $($ \hspace{2cm}}  \\     {\textsl{Département de Mathémathiques}} &            &{\Large\RL{qsm alryA.dyAt\hspace{2cm}}} \\     \end{array}$\\     \color{red}     \begin{center}     \RL{\Huge alm`AdlAt altfA.dlyT alnAq.syT}\\     \RL{\LARGE mdxl 'ilY dwAl dyrkly}\\     \vspace{1cm}     \RL{m_dkrT txrj lnyl ^shAdT alt`lym al_tAnwy}     \end{center}     $\begin{array}{ccc}      \RL{t.ht 'i^srAf al-'stA_d $:$}     &     &\large\RL{'i`dAd $:$\hspace{9cm}} \\      \RL{ `bd al-lh drbAl}          &     & \RL{bwAlbyt slym\hspace{7cm}}\\                                       &   &\RL{.hryz blqAsm xAld\hspace{7cm}}\\                                        &   &\RL{bn `ysY brAhym\hspace{7cm}}\\      \end{array}$\\      \newpage      \pagedissolve{Dissolve /D 3 /Di /H /DM /O} \overlay{221.jpg}     \LARGE \centerline{\textcolor[rgb]{0.42,0.00,0.42}{\RL{ mx.ta.t     al`r.d}}} \color{white} \large     \begin{arabtex}     \bf{mqdmT}          \vspace{1cm}           \bf{alf.sl al-'wl $\textbf{:}$ \normalsize     t_dkyr bAlf.dA'-At $\mathcal {L}^p$}          \vspace{1cm}           \bf{alf.sl al_tAn-E $\textbf{:}$ \normalsize drAsT alm`AdlT $Au=f$     .hsb lAks myl.grAm}          \vspace{1cm}           \bf{alf.sl al_tAl_t $\textbf{:}$ \normalsize drAsT alm`AdlT $Au=f$     b.tryqT alm'u_trAt alrtybT}          \vspace{1cm}           \bf{xAtmT}     \end{arabtex}     \newpage     \pagedissolve{Blinds /D 3 /Di /H /M /O} \overlay{5345.jpg}     \begin{arabtex}     \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{mqdmT}}$}     \large           t`tbr alm`AdlAt altfA.dlyT aljz'iyT .hAfzA qwyA fy t.twyr     al-'dwAt al-'sAsyT fy alt.hlyl al.hqyqy wAlt.hlyl altAb`y mn_d bdAyT     alqrn al`^sryn, fy h_dA al-'xyr .zhrt 'i.hdY 'qwY 'dwAt alt.hlyl     alryA.dy 'lA why f.dA'At sbwlAf wAlty wss`t alhndsT altfA.dlyT     wt.hlyl fwryiy  'ilY alt.hlyl al`dady wAlryA.dyAt alt.tbyqyT,     wtst`ml h_dh alf.dA'At `mwmA fy t`mym .hlwl alm`AdlAt altfA.dlyT     aljz'iyT, wb^skl xA.s alm`AdlAt altfA.dlyT alnAq.syT wAlty lhA .trq     `dT lil.hl fy h_dh alf.dA'At.          \end{arabtex}     \newpage     \pagedissolve{Split /D 3 /Di /H /M /O} \overlay{15.jpg}     .\vspace{5cm}          \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{\bf{alf.sl     al-'wl $\textbf{:}$ \normalsize t_dkyr bAlf.dA'-At $\mathcal {L}^p$}     }}$} \large     \newpage          \pagedissolve{Split /D 3 /Di /H /M /O} \overlay{7567.jpg}     .\vspace{5cm}          \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{\bf{alf.sl     al_tAn-E $\textbf{:}$ \normalsize drAsT alm`AdlT $Au=f$ .hsb lAks     myl.grAm}} }$}     \newpage          \large\newpage                \pagedissolve{Split /D 3 /Di /H /M /O}\overlay{221.jpg}                    .\vspace{5cm}          \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{ \bf{alf.sl     al_tAl_t $\textbf{:}$ \normalsize drAsT alm`AdlT $Au=f$ b.tryqT     alm'u_trAt alrtybT} }}$} \large     \newpage     \pagedissolve{Wipe /D 3 /Di /H /M /O} \overlay{981.jpg}     \sffamily\Large %\color{section0}     \color{white}          \begin{arabtex}               \end{arabtex}     \newpage\pagedissolve{/S /Box /D 2 /Dm /V /M /O}     \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{\bf{     alxAtmT}}}$} \large     \begin{arabtex}     lqd 'iqt.srnA fy m_dkrtnA hAth `lY drAsT .tryqtyn lilb.h_t `n wjwd     .hlwl lilm`AdlAt aaltfA.dlyT alnAq.syT, `lY alr.gm mn wjwd `dT .trq     lA ymkn"un"aA al-'ilmAm.          h_dA wn^syr 'ilY 'nanA 'inthjnA 'slwbA jdydA fy 'i`dAd h_dh     alm_dkrT, w_dlk brqnhA bibrnAmj \LR{\LaTeX}, wh_dA bAlr.gm mn     al.s`wbAt aljmT alty wAjhtnA '_tnA' 'istxdAmh, wnrjw '"an" nkwn     b_dlk qd w.d`nA lbnT, ntmnY '"an" tlyhA lbnAt 'xrY fy h_dA almjAl.          \end{arabtex}     \newpage     .\vspace{5cm}          \LARGE \centerline{$\textcolor[rgb]{0.42,0.00,0.42}{\RL{\bf{^skrA     `lY .hsn al-'i.s.gA' wAlmtAb`T}}}$} \large     \newpage     \end{document}               \end{document}


title: LaTeX {scrreprt} page numbering

text: I'm writing in LaTeX a `scrreprt` onesided document, for which I would like to number the pages on the right side of the footer (don't need anything more in the footer). I've found this: http://notfaq.wordpress.com/2006/10/04/latex-customize-page-numbering/ this is exactly what I need, but the right enumeration is only within chapters from the second side, on the first page of every chapter it doesn't work and default is used (number in the middle of the footer) Do you have some ideas how to fix it?


title: `macro parameter character #' in horizontal mode - Texmaker

text: I use Texmaker and I keep getting this error:               ! You can't use `macro parameter character #' in horizontal mode.      However I can force compile it using `cmdline` as `pdflatex foo.tex`. Any idea what the error could be?               \documentclass[a4paper,12pt]{article}      \usepackage[paper=a4paper,left=30mm,right=20mm,top=25mm,bottom=30mm]{geometry}     \usepackage[pdftex]{graphicx}     \usepackage[toc,page]{appendix}     \usepackage{framed}     \usepackage[toc]{glossaries}     \usepackage{hyperref}     \usepackage{setspace}     \usepackage{mathtools}     \usepackage{amsmath}     \usepackage{algorithm2e}     \usepackage{algorithmic}     \usepackage{underscore}     \begin{document}     {\large Thesis Advisory Committee}            random text     \end{document}      It says the error is near `{\large }`. I use this in the BiBTeX file:               @misc{ten,         author = {pable, Chandandeep Singh },         title = {Completely Fair Scheduler},         howpublished = "\url{http://www.linuxjournal.com/magazine/completely-fair-scheduler}",         year = {2009},         note = "{Online, accessed 25-01-2013}"     }


title: How to draw a graph along with probabilty tables using TikZ package

text: I need help to draw a Directed Acyclic Graph of Bayesian Network along with probability of each node using TikZ package. Here is an example: ![enter image description here](http://i.stack.imgur.com/B7RzI.gif) Table grid can be a full or partial as in above example.


title: Problem adding a new section?

text: I think my question is pretty simple, but since I've been using LaTex for 2 days by now... Anyway, the thing is I'm having a problem adding a new section. I use the command `\section`, but in the previous section there is three subsections, the last one is filled up with lots of images and when I input a new section, the section begins right after the first image of the previous subsection and I don't know how to solve it. End of the code:               %last picture of the subsection%          \begin{figure}[h]         \centering         \includegraphics[width=1\textwidth]{28_google}         \caption{$\sqrt[3]{28}$ \hspace{0.5mm} calculated by Google with 11 places of precision and 11 places after the comma.}         \label{fig:28_google}     \end{figure}          \section {Conclusions}      This section appears after the first image instead of the end of the subsection. If anyone could help, thank you! PS: I want the fourth section to start after the previous subsection (the one with images).


title: AUCTeX XeLaTeX preview fails: fontspec cannot-use-pdftex error

text: I am struggling setting up AUCTeX preview in a way that I can use it with XeLaTeX documents. When I try to generate the previews I get the following error > >     cannot-use-pdftex >   generated by the `fontspec` package. So I guess I have to force the use of XeLaTeX even when generating previews, but I didn't find anything suitable on the net. Here is a MWE:               \documentclass[b5paper,BCOR=8mm,DIV=calc,11pt]{scrbook}     \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{url}     \newcommand{\nacr}{\newacronym}          \title{Some title}     \author{}     \date{\today}     \begin{document}     \maketitle     \begin{equation}     \theta=asdf_{bsdf}     \end{equation}     \end{document}      and here is the full result:               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ! Fatal fontspec error: "cannot-use-pdftex"     !      ! The fontspec package requires either XeTeX or LuaTeX to function.     !      ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"     ! instead of plain "latex" or "pdflatex".     !      ! See the fontspec documentation for further information.     !      ! For immediate help type H <return>.     !...............................................        ...               Preview-LaTeX exited as expected with code 1 at Sun Apr 01 09:30:59     LaTeX: LaTeX found no preview images      Setting local variables didn't help. If I remove:               \usepackage{fontspec}     \usepackage{xunicode}      The error is gone. In consequence, I guess I need a way to force auctex to compile previews with xelatex. Any ideas or existing setups? Some additional information: AUCTeX 11.86 and gs 9.0 on debian wheezy as well as AUCTeX 11.86 on windows 7. preview of `circ.tex` works fine


title: Designing a new mathematical operator

text: We all know that `\binom{n}{r}` in math mode renders the binomial coefficient. For the purposes of a note, I am TeXing up, I am interested in designing a new math operator. Suppose I called that operator as `\bil{}{}`, I would like the following input `\bil{n}{r}` to give `<n,r>`. Can anyone please help me with how I would do that?


title: Changing axes' origin adds weird whitespace

text: I would like to display points in a Tikz picture, whose y components are all negative. That is per se no problem, but I want the y axis to be a bit higher than the x axis to emphasize the negative values.   See the screenshots below the code. In another file with different data I got it perfectly working using Jake's approach to move the coordinate axes. However, in the file below increasing the y intersection coordinate (`axis line origin={0,THIS}`) only adds weird whitespace before the Tikz picture.   No warnings (except the one for _filecontents_ ) are shown. **What is the reason for this behavior? How can I fix it?**   (Note: I'm also open to suggestions not involving Jake's code anymore as long as my desired result is produced.) MWE:               \documentclass[tikz,border=2pt]{standalone}          \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \usepackage{filecontents}     \usepackage[utf8]{luainputenc}          % Author:  Jake <http://tex.stackexchange.com/users/2552/jake>     % Link:    http://tex.stackexchange.com/a/62431/38074     % License: CC BY-SA 3.0     \pgfplotsset{         axis line origin/.style args={#1,#2}{             x filter/.append code={ % Check for empty or filtered out numbers                     \ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#1}\fi                 },             y filter/.append code={                     \ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#2}\fi                 },             xticklabel=\pgfmathparse{\tick+#1}\pgfmathprintnumber{\pgfmathresult},             yticklabel=\pgfmathparse{\tick+#2}\pgfmathprintnumber{\pgfmathresult}         }     }          \begin{filecontents*}{data.csv}     Data     t;x;y     0.000000000E0;6.348840913E-4;9.925120686E-4     8.333333333E-3;5.838627285E-4;4.724618695E-4     1.666666667E-2;1.094161960E-3;-2.700310368E-3     2.500000000E-2;7.550411425E-4;-5.097581518E-3     3.333333333E-2;6.794111604E-4;-9.011432646E-3     4.166666667E-2;3.461038282E-4;-1.562674575E-2     5.000000000E-2;1.282057031E-4;-1.909622209E-2     5.833333333E-2;-3.401256682E-4;-2.518409682E-2     1.408333333E0;-3.104116765E-2;-1.739549231E0     1.416666667E0;-3.322785461E-2;-1.740279419E0     1.425000000E0;-3.599135975E-2;-1.742337105E0     1.433333333E0;-3.808925614E-2;-1.744682891E0     1.541666667E0;-7.108984101E-2;-1.839024730E0     1.550000000E0;-7.297102460E-2;-1.857275769E0     1.558333333E0;-7.571494352E-2;-1.870979850E0     1.566666667E0;-7.854608723E-2;-1.892338940E0     1.575000000E0;-8.274961995E-2;-1.897014288E0     \end{filecontents*}               \begin{document}         \begin{tikzpicture}             \pgfplotsset{ticks=none}             \begin{axis}[                 axis x line=right,                 axis y line=left,                 axis lines=middle,                 axis line origin={0,0.5},                 xlabel=Time,                 ylabel=x,                 xticklabel style={inner xsep=0pt, anchor=north west},                 xtick={0},                 after end axis/.code={                     \path (axis cs:0,0)                     node [anchor=south east,xshift=-0.075cm] {0};                 }             ]                 \addplot[color=red,ultra thick] table [                     skip first n=1,                     col sep=semicolon,                     x=t,                     y=y                 ] {data.csv};             \end{axis}         \end{tikzpicture}     \end{document}      Current result: ![Actual result](http://i.stack.imgur.com/2QFzx.png) The result I'd like: ![Wanted result](http://i.stack.imgur.com/hFKSt.png)


title: Appending a keyword to the end of a bibliography item

text: This question is actually a follow-up to another question of mine, Patching \printbibliography for displaying content to both document and log. The code works marvellously, and I'm able to analyze the text formatting for every entry. The tricky part is how to separate where an entry ends and the other one starts:               ...          ...\T1/cmr/m/n/10 2     ...\T1/cmr/m/n/10 0     ...\T1/cmr/m/n/10 1     ...\T1/cmr/m/n/10 2     ...\T1/cmr/m/n/10 .     ...\penalty 10000     ...\glue(\parfillskip) 0.0 plus 1.0fil     ...\glue(\rightskip) 0.0     ..\penalty -51     ..\glue 4.0 plus 2.0 minus 1.0     ..\glue(\parskip) 0.0     ..\glue(\baselineskip) 4.50183     ..\hbox(7.49817+2.49939)x324.44702, glue set 0.4662, shifted 20.55298     ...\hbox(7.49817+2.49939)x0.0     ....\glue 0.0     ....\glue -10.55298     ....\glue -10.0     ....\hbox(7.49817+2.49939)x10.55298     .....\glue 0.0 plus 1.0fil minus 1.0fil     .....\T1/cmr/m/n/10 [     .....\T1/cmr/m/n/10 2     .....\T1/cmr/m/n/10 ]     ....\glue 10.0     ...\penalty 0     ...\T1/cmr/m/n/10 A     ...\T1/cmr/m/n/10 u     ...\T1/cmr/m/n/10 t          ...      Since I know beforehand that my bibliography style uses `[1]`, `[2]` and so forth, I can easily spot where the new item starts. But I was thinking if I could append a keyword to every item, so I can use it as a closing markup. In the chatroom, Marco Daniel brilliantly suggested me to go with:               \renewbibmacro*{finentry}{\finentry <keyword here>}      This will append `<keyword>` to every bibliography item. So far, it's an interesting approach. But there's something I'd like to avoid: the keyword will also be printed in both document and `.log` file. Sadly, `\wlog` doesn't work here because the box content is saved for a later use. The macro will be called when the entries are added to the `.aux` file and not during the box trace. My test file:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[backend=biber,                 bibstyle=numeric-comp,                 sorting=none]{biblatex}          \addbibresource{biblatex-examples.bib}           \usepackage{xpatch}          \makeatletter     \def\biblio@inlog#1{%       \begingroup       \let\biblio@inlog\@gobble       \chardef\current@mode\interactionmode       \showboxdepth=\maxdimen       \showboxbreadth=\maxdimen       \sbox\z@{\vbox{\printbibliography[#1]}}       \batchmode       \wlog{BEGIN BIBLIOGRAPHY}       \showbox\z@       \wlog{END BIBLIOGRAPHY}       \interactionmode=\current@mode       \endgroup}     \xapptocmd{\blx@printbibliography}{\biblio@inlog{#1}}{}{}     \makeatother          \begin{document}          \cite{companion} \cite{ctan}           \printbibliography          \end{document}      Does anybody have a suggestion if I can add any keyword or mark that indicates the end of a bibliography item in the `.log` output, but not in the document? I suspect this is not possible or the box saving process must be drastically altered.


title: Put subscript underneath instead of in the bottomright corner

text: I wonder if there is a way to create an equation like that where the "subscript" is placed underneath instead of in the bottom right corner. I also want the "subscript" to be center aligned with the number above. ![enter image description here](http://i.stack.imgur.com/e4p3q.jpg)


How do I use texstudio internal viewer independently? I was impressed by its fast rendering. On the subject, which do you think is the fastest (in rendering) pdf viewer? I don't care about loading time or other features. But when I view a heavy document with hi-res images, I don't want lags when I go through pages.


title: Axis label placement in 3d plot far out but why?

text: I want to plot a dataset in a 3D pgfplots graph. It looks like a good start but somehow the label placement is far out. Boiling it down to a MWE did not give me any hints how to get the labels back in place. Is there any option I overlooked? My pgf and pgfplots version's are fairly recent, so it should not be this issue: 3d axis label ovelapping. Here is my almost minimal example:               \documentclass[tikz]{standalone}     \usepackage{tikz,pgfplots,pgfplotstable}     \pgfplotsset{compat=1.7}           \begin{document}          \pgfplotstableread{     as_concentration    T        0.00        0.0     0.00        0.152        0.13        0.00         }\ascycledata          \pgfplotstableread{     as_concentration    T        0.00        0.152        0.13        0.00         }\asdata          \begin{tikzpicture}     \begin{axis}[         view={45}{45},         width=10cm,         height=10cm,         ymin=-0.1, ymax=0.25, xmax=0.19, xmin=0,    zmax=0.3,         xlabel=$x$,         ylabel=$y$,         axis lines=center,         ]         \addplot3 [forget plot,no marks,fill=blue, opacity=0.5]                           table[x=as_concentration,y expr=0,z=T] {\ascycledata};               \addplot3+ [] table[x=as_concentration,y expr=0,z=T]    {\asdata};                   \end{axis}     \end{tikzpicture}           \end{document}      And the output with the axis labels far away: ![wrong result](http://i.stack.imgur.com/H51kw.png)


title: Bakoma - how to view errors

text: When my latex doc has errors, Bakoma displays the arrows at the bottom right corner used to navigate between errors, but I cannot see what is the actual error - I do not see a console window and do not know how to view it. What am I missing?


title: xypic: curved invisible arrows

text: I want to create two invisible arrows so I can link between them, the problem is that when I try the make these arrows curved they become no longer invisible? Here is a sample document:               \documentclass{article}     \usepackage[all]{xy}     \begin{document}     \[     \xymatrix{A      \ar@{}@/^{2.4pc}/[d] \\      B     }     \]     \end{document}      It gives the following graph: ![graph](http://i.stack.imgur.com/tbgHy.png) What I want is to make the arrow going from $A$ to $B$ invisible, but it doesn't work! So what's wrong with this latex code?


title: inverted commas inside punctuation outside in biblatex-chicago

text: I write my PhD thesis using csquotes and opting for the British quotation style with inverted commas and leaving punctuations outside. For example: Kant is nowadays considered the ‘ _fondateur de discursivité_ ’ of modern Western cosmopolitanism. However, biblatex-chicago, in the footnote citations and bibliography, uses the inverted commas outside the punctuation marks. For instance: Term used by Foucault in Michel Foucault, ‘Qu’est-ce qu’un auteur ?,’ in _Dits et Ecrits, tome 1 : 1954-1975_ , ed. Daniel Defert and François Ewald (Paris: Gallimard, 2001 [1969-70]), 804. Does anyone know how to set biblatex-chicago to automatically put the inverted commas inside the punctuation marks? Thank you in advance for your answer.               \documentclass{scrbook}          \usepackage[style=british,autostyle=true,strict=true,english=british,autopunct=true,parthreshold=true]{csquotes}     \SetBlockThreshold{2}      \usepackage{polyglossia}             \setdefaultlanguage[british]{english}      \setotherlanguage{french}     \usepackage[notes,natbib,isbn=false,backend=biber,hyperref=true]{biblatex-chicago}     \usepackage{filecontents}     \begin{filecontents*}{MWE.bib}          @incollection{Foucault:2001qf,         Address = {Paris},         Author = {Michel Foucault},         Booktitle = {Dits et Ecrits, tome 1 : 1954-1975},         Editor = {Daniel Defert and Fran{\c c}ois Ewald},         Pages = {789--821},         Publisher = {Gallimard},         Title = {Qu'est-ce qu'un auteur ?},         Year = {2001 [1969-70]}}          @incollection{Flynn:2005rw,         Address = {Cambridge},         Author = {Thomas Flynn},         Booktitle = {The Cambridge Companion to Foucault},         Edition = {2nd},         Editor = {Gary Gutting},         Pages = {29--48},         Publisher = {Cambridge University Press},         Title = {Foucault's Mapping of History},         Year = {2005}     }     \end{filecontents*}          \bibliography{MWE.bib}          \begin{document}     Kant is nowadays considered the `\textit{fondateur de discursivité}' of modern Western cosmopolitanism.\footnote{Term used by Foucault in \autocite[804]{Foucault:2001qf}.} He gave a definition of what he meant with `problematisation' in an interview:          \hyphenblockquote{british}{The ensemble of discursive and nondiscursive practices that makes something enter into the play of the true and the false and constitutes it an object of thought (whether in the form of moral reflection, scientific knowledge, political analysis or the like).\autocite[38]{Flynn:2005rw}}          \printbibliography     \end{document}


title: How to draw AVL rectangle represention in TikZ?

text: I am trying to represent AVL's in an old way that I was taught and found more intuitive to display in comparison to most common books nowadays. The raw images with the features I am interested in are shown below from the Niklaus Wirth 1986 book and some hand written notes. While the visualization may be specific, representing AVLs is a general data structures concept of computer science, and the intention is actually to use such drawings for lecture notes. So I believe it can be useful to a wider audience. ![enter image description here](http://i.stack.imgur.com/yQB4R.jpg) From this one (the book) I am trying to get exactly what it is shown: `Some nodes as circles`, `some as long vertical rectangles`, with dashed lines highlighting the bottom part of the tree, and one single node with an X indicating the node of removal. Some rectangles stay above, within and below as shown in the figure. I have been trying to try representing the dashed lines as some sort of tikz node and position accordingly but no luck. * * * ![enter image description here](http://i.stack.imgur.com/cUYFg.jpg) From the hand written notes, I am trying to get `numbers around the nodes (-2, -1, h-1, etc)`, letters 'A,B,C,D' on the rectangles, and the `circle oriented arrows to indicate rotation direction`. * * * I was able to find ways to represent numbers around another question as well try to represent parts of the tree with triangle shapes but modifying their minimal examples to what I want has been particularly challenging.


title: Attaching a file into PDF with Latex

text: \documentclass[pdftex,12pt,a4paper]{article}     \usepackage{attachfile}     \usepackage[pdftex]{graphicx}          \begin{document}          \pagenumbering{gobble}          \textattachfile[mimetype=audio/wav,created=D:2012042200000000'00',modified=D:2012042200000000'00']{./kop-echo.wav}{\includegraphics[scale=0.25]{./geluidspictogram.png}}          \end{document}      Embedding a (sound) file using the `attach` package works, but the only reason for me not implementing it is that the resulting PDF file shows an ugly empty comments square (I don't need) when I hover over the embedded icon. Can this be suppressed, or is this just the way Acrobat Reader works? ![Screen dump](http://i.stack.imgur.com/A6OzZ.png)


title: pgfgantt: Labels not properly centered

text: I am trying to create a Gantt chart, and found this wonderful package pgfgantt. However, my labels do not get properly centered in the boxes. Am I doing something wrong? Is there a way to get the result I want? (I looked around for an answer, but could not find it. My apologies if I missed it.) Here is the code:               \documentclass{standalone}     \usepackage{pgfgantt}     \definecolor{grey}{gray}{0.75}     \begin{document}     \begin{ganttchart}[hgrid, inline, bar height = 1, bar top shift = 0, x unit = .7cm, y unit chart= .4cm]{17}     \ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}     \ganttbar{1}{1.00000}{2.00000}     \ganttbar[bar/.style={fill=grey}]{\ }{2.00000}{3.00000}     \ganttbar{4}{3.00000}{8.00000}     \\     \ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}     \ganttbar{2}{1.00000}{3.00000}     \ganttbar[bar/.style={fill=grey}]{\ }{3.00000}{4.00000}     \ganttbar{5}{4.00000}{15.00000}     \\     \ganttbar[bar/.style={fill=grey}]{\ }{0.00000}{1.00000}     \ganttbar{3}{1.00000}{4.00000}     \ganttbar[bar/.style={fill=grey}]{\ }{4.00000}{5.00000}     \ganttbar{6}{5.00000}{17.00000}     \end{ganttchart}     \end{document}      I cannot post the resulting pdf, because I'm a new user, but maybe you can still see it here ![](http://i.stack.imgur.com/ONM3K.png)


title: moderncv - how to put personal info under name

text: I'm new in LaTeX and `moderncv`. I'd like to put my contact info under name but I don't know how. I found this problem similar to mine, but it changes position of the picture. This is my `.tex` file after modification:               \documentclass[11pt,a4paper,sans]{moderncv}     \moderncvstyle{classic}     \moderncvcolor{blue}          \makeatletter     \renewcommand*{\makecvtitle}{%       % recompute lengths (in case we are switching from letter to resume, or vice versa)       \recomputecvlengths%       % optional detailed information box       \newbox{\makecvtitledetailsbox}%       \savebox{\makecvtitledetailsbox}{%         \addressfont\color{color2}%         \begin{tabular}[b]{@{}p{10cm}@{}}%           \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet %             \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}} % if \addresstreet is defined, \addresscity will always be defined but could be empty           \ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile} %           \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%         \end{tabular}       }%       % optional photo (pre-rendering)       \newbox{\makecvtitlepicturebox}%       \savebox{\makecvtitlepicturebox}{%         \ifthenelse{\isundefined{\@photo}}%         {}%         {%          % \hspace*{\separatorcolumnwidth}%           \color{color1}%           \setlength{\fboxrule}{\@photoframewidth}%           \ifdim\@photoframewidth=0pt%             \setlength{\fboxsep}{0pt}\fi%           \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%       % name and title       \newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%       \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%       \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)         {\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth     }}%         {}%      % \begin{minipage}[b]{\makecvtitlenamewidth}%         \raggedright\namestyle{\@firstname\ \@familyname}\par\medskip%         \ifthenelse{\equal{\@title}{}}{}{{\centering\titlestyle{\@title}\par}\medskip}%       %\hfill%       % detailed information     %  \llap{     %     \usebox{\makecvtitledetailsbox}%     %\end{minipage}\ignorespaces%     %}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced       % optional photo (rendering)       \usebox{\makecvtitlepicturebox}\\[2.5em]%       % optional quote       \ifthenelse{\isundefined{\@quote}}%         {}%         {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%       \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvtitle     \makeatother          \usepackage[scale=0.75]{geometry}     % personal data     \name{John}{Doe}     \address{street and number}{postcode city}{country}     \phone[mobile]{+1~(234)~567~890}     \email{john@doe.org}     \photo[64pt][0.4pt]{picture}     \begin{document}     \makecvtitle          \section{Education}     \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}     \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}          \end{document}      with this result ![enter image description here](http://i.stack.imgur.com/jn0XP.png) but I'd like to put the picture little above and more on the right like in file without modification:               \documentclass[11pt,a4paper,sans]{moderncv}     \moderncvstyle{classic}     \moderncvcolor{blue}          \usepackage[scale=0.75]{geometry}     % personal data     \name{John}{Doe}     \address{street and number}{postcode city}{country}     \phone[mobile]{+1~(234)~567~890}     \email{john@doe.org}     \photo[64pt][0.4pt]{picture}     \begin{document}     \makecvtitle          \section{Education}     \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}     \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}          \end{document}      ![enter image description here](http://i.stack.imgur.com/v4hJr.png) What am I supposed to do?


title: Vertical space between chapter heading and table

text: In my appendix I have only chapters followed by one or more tables each. These tables are captioned. But I'd like the tables to begin after the usual vertical space which is put if you simply write some text following a chapter. Here is a very short MWE to illustrate this. As you can see, the vertical space between the heading and the chapter is much bigger than the one between the heading and some text.               \documentclass[a4paper, 12pt, headsepline, smallheadings,]{scrreprt}     \usepackage{booktabs}     \usepackage[showframe]{geometry}     \renewcommand*{\chapterheadstartvskip}{\vspace{-1\baselineskip}}     \begin{document}     \chapter{Chapter}     \begin{table}[h]     \caption[title table 1]{description table 1}     \fbox{content}     \end{table}     \chapter{Chapter}     aaa     \end{document}      **edit** : I realized that `\captionsetup{aboveskip=0pt}` reduces the space. So the space seems to come from the caption package? What is the right value to use (some tests have shown that it's not zero but has to be a little negative)? Also how can I set this locally for the whole appendix but not for the content before? Original question: How can the vertical space between the heading and the table be set to the same value as between the heading and the text? Thanks!


title: Setting coordinate system for TiKZ picture

text: I'd like to use TiKZ to generate stand-alone PDF diagrams programatically. I have an application that generates simple geometry of lines and arcs etc and I'd like to create (using e.g. Ruby) TikZ diagram text files from that simple geometry. I have a bounding box (AABB) of each chunk of geometry and my question is what is the most idiomatic TiKZ and LaTeX/ConTeXt way of specifying what would in effect be a window-to-viewport transform between the application geometry bounds and the TiKZ drawing bounds? I can see I can use:               \begin{tikzpicture}[x=2cm,y=1.5cm]       to set distance units and:               scale=1.5       parameter, but I suspect there's a better way. Any advice is much appreciated,


title: Preventing drop caps from overlapping next paragraph

text: Using the `lettrine` package, big drop caps can sometimes overlap next paragraphs, as show here: ![overlap](http://i.stack.imgur.com/Wcilf.png) How can I do it so that following paragraphs are built around the lettrine instead of overlapping it?


title: I would like to borrow revtex's amazing footnote and bibtex macros

text: Anybody know how `revtex` accomplishes its amazing citation handling. For instance, if I have a list of references in natbib using any bibstyle it looks like this [1,2,3,4,5] or [2,4,5,3,1] depending on the order of the `\cite{key2,key4,key5,key3,key1}`. However in revtex it takes that list, no matter the order and makes it [1-5] even for the `\cite` command I quote above (assuming they're already referenced). I am trying to write a thesis which is not compatible with revtex, but I don't want to have to hunt down all my `\cite`s and put them in order manually. Additoinally there is no way to "shorten" the list on first citation by simply doing `\cite{ref1}--\cite{ref5}` as it would read [1]-[2] if 2,3,4 haven't already been cited. There must be a way to get the actually superscript reference numbers in order by just "borrowing" one of the revtex packages? Anyone know which one does it? An example from my thesis to illustrate: Typically this material has been a high-κ dielectric [50,42,51,86,65,63,64]. which I would like to read: Typically this material has been a high-κ dielectric [42,50,51,63-65,86]. Suggestions???


title: How can I use the layout and twoside options of the geometry package?

text: When I use the `geometry` package (2010/09/12 v5.6) for a `twoside` document with one paper size (e.g. A4) and another layout size (e.g. A5), I had expected that I could print a page, turn the paper, print the other side, and cut the paper according to the crop marks. For this to work the crop marks at both sides of the sheet of paper must lay at the same position, i.e. if the first side is placed at the left of the sheet of paper, the second one must be placed at the right side. But the MWE               \documentclass[twoside]{article}     \usepackage[twoside,a4paper,layout=a5paper,showframe,showcrop]{geometry}     \begin{document}     1     \newpage     2     \end{document}      and pdfLaTeX result into ![pdfLaTeX MWE.tex](http://i.stack.imgur.com/AHIOQ.png) What must I change to get "twoside-mode"?


title: With fontspec, how can one define a variation of a font family?

text: I keep running into the following situation using _fontspec_ with _XeTeX_ :   * I define a "base" font family using `\newfontfamily`.   * I then want to access a "spaced small caps" variant, using the `LetterSpace` feature within the `SmallCapsFeatures` set.   * I then want to define yet another variation on the former small caps spacing settings, for use in a different context within the paragraph. So far, the only way I've figured out how to do this is to define _wholly separate font families_ for each of these three variations (no adjustment to spacing, one adjustment to spacing, and some other adjustment to spacing), like so:               \setmainfont[BoldFont={* Semibold},                  Numbers={OldStyle,Proportional}]                 {Adobe Garamond Pro}          \newfontfamily\rmaltfamily       [BoldFont={* Semibold},        Numbers={OldStyle,Proportional},        SmallCapsFeatures={LetterSpace=2.5}]       {Adobe Garamond Pro}          \newfontfamily\rmaltloosefamily       [BoldFont={* Semibold},        Numbers={OldStyle,Proportional},        SmallCapsFeatures={LetterSpace=4.0}]       {Adobe Garamond Pro}      In the spirit of not repeating oneself, that's just awful. The only thing I _intend_ to change between those is the presence and value of the `LetterSpace` feature. I tried using the `\addfontfeature` command as shown in Example 42 in the fontspec manual to _layer_ these changes over the current font, but, despite what the manual suggests, at least with my fonts, the `LetterSpace` feature is only available for specification within the `SmallCapsFeature` set, which is in turn only available for specification within either the `\newfontfamily` or `\fontspec` commands. For reference here, the manual advertises that the following should be possible:               \fontspec{Didot}     \addfontfeature{LetterSpace=0.0}     USE TRACKING FOR DISPLAY CAPS TEXT \\     \addfontfeature{LetterSpace=2.0}     USE TRACKING FOR DISPLAY CAPS TEXT      Though my three separate `\fontfamily` definitions do work, it feels like the wrong tool for the job. Is there some better way to define a basic font family and then layer in a few changes in it, such that those changes can be used in certain contexts and be restricted in scope?


title: Center align caption on margin

text: I am trying to align figure caption on the outer margin with koma-script, but no matter what I tried the option `centeredbeside` does not work.               \documentclass[captions=centeredbeside]{scrbook}     \usepackage[demo]{graphicx}          \begin{document}     \begin{figure}     \centering     \includegraphics{figure1}     \begin{captionbeside}{Caption beside figure.}[o][0.3\textwidth]     \end{captionbeside}     \label{fig:death-miser}     \end{figure}     \end{document}      Besides, captions always appear on the right margin (not on the outer margin). I have also tried:               \usepackage[outercaption,wide]{sidecap}     \sidecaptionvpos{figure}{c}       It works better, but the caption is still on the right margin, even if the page is even. I tried using `mparhack` to fix this but it did not work either.


title: Refer to a particular line of a page

text: I am new to LaTeX, so I was probably quite naive to think that I will get a ready answer to this but to my surprise was not able to find an answer to this. I just want to refer to a particular line of a particular page. So that I can say "see line 2 on Page 56" and it will automatically change when the document changes. Any suggestions will be highly appreciated!


title: Explanation of a word in a footnote at the bottom of the page

text: I want to provide an explanation for a word as a footnote at the bottom of the page in which the word appears. For instance, in the main text, I would have > Here is my word¹ and, in a footnote at the bottom of the page, I would explain the word in question: > ¹ explain it here... How can I do that?


title: Typesetting mixed-case acronyms with numbers

text: What are the various alternatives to typeset acronyms that contain lowercase letters, lowercase letters and numbers? For example, take the acronym SOA4All. The naive way would be to typeset it just like that:               SOA4All      This is not really nice, of couse. A next step is to introduce small caps:               {\scshape soa}4{\scshape a}ll      Slightly better, but the number doesn't blend in all the well. We could add old-style numerals:               {\scshape soa}\oldstylenums4{\scshape a}ll      This is kind-of OK, but the 4 is really low now, and the small `l`s still stick out.   Here they are all together: ![enter image description here](http://i.stack.imgur.com/Y2Pxh.png) Which alternatives do you see and what would you recommend?


title: How to add axes in a magnified part of a graph using spy?

text: My problem is the following. I would like to draw the (magnified) axes on the magnified area of spy. For instance, take the following example (from pgfplots.pdf, p.121):               % Preamble: \pgfplotsset{width=7cm,compat=1.5.1}     % requires \usetikzlibrary{spy}      \begin{tikzpicture}[spy using outlines=     {circle, magnification=6, connect spies}]     \begin{axis}[no markers,grid=major,     every axis plot post/.append style={thick}]     \addplot  coordinates     {(0, 0.0) (0, 0.9) (1, 0.9) (2, 1) (3, 0.9) (80, 0)};     \addplot +[line join=round] coordinates     {(0, 0.0) (0, 0.9) (2, 0.9) (3, 1) (4, 0.9) (80, 0)};     \addplot +[line join=bevel] coordinates     {(0, 0.0) (0, 0.9) (3, 0.9) (4, 1) (5, 0.9) (80, 0)};     \addplot +[miter limit=5] coordinates     {(0, 0.0) (0, 0.9) (4, 0.9) (5, 1) (6, 0.9) (80, 0)};     \coordinate (spypoint) at (axis cs:3,1);     \coordinate (magnifyglass) at (axis cs:60,0.7);     \end{axis}     \spy [blue, size=2.5cm] on (spypoint)     in node[fill=white] at (magnifyglass);     \end{tikzpicture}      I would like to draw axes (with a new grid) in the magnifyglass to see (approximately) the peak values in (x,y). Kind of like the "Loupe" tool in the DataGraph software. Is this possible?


title: Hide \thechapter for unnumbered Chapters

text: I want to display my Chapter-Numbers on the right below the Title. I came to the following minimal working example:               \documentclass{article}     \usepackage{titlesec}     \usepackage{marginnote}     \usepackage{lipsum} % for dummy text only     \titleformat{\section}[block]{\LARGE\selectfont}{}{0em}{}[\marginnote{\Huge\thesection}]          \begin{document}         \section{First section with\\linebreak}             \lipsum[2]         \section*{Unnumbered}             \lipsum[12]         \section{Three}             \lipsum[5]     \end{document}      However the unnumbered section now gets numbered as 1. How can I suppress `\thesection` for unnumbered sections? When I move the `\marginnote` to the `<label>` field in `\titleformat` the Number 'ignores' that the Title contains linebreaks and is positioned relative to the first line. EDIT: As an example, this is my code for the chapter. Using your solution – which works without an `\if` – I get the Error “`\begin{document} missing`“.               \titleformat{\chapter}[block]{\fontsize{40}{10}}{}{0em}{#1}[         \begin{textblock}{2}(13.7,3.2)             \color[rgb]{0.39453,0.48047,0.511719}   % Error Happens Here             \thechapter         \end{textblock}     ]      As soon as I add a \if around the block, the error disappears.               \titleformat{\chapter}[block]{\fontsize{40}{10}}{}{0em}{#1}[         \iftrue{             \begin{textblock}{2}(13.7,3.2)                 \color[rgb]{0.39453,0.48047,0.511719}   % No Error Happens with if                 \thechapter             \end{textblock}         }         \fi     ]


title: Can I print a list of acronyms without a header with the acro package?

text: I want to produce a list of acronyms from the `acro` package without any header at all. Is this possible? I have tried putting things like `*`, `{}`, and `(space)` in the header argument, but nothing has worked. The best I can do is use `header=subsection*` and leave `name=` but this still leaves whitespace where the subsection title _should_ be. Example:               \documentclass[10pt,letterpaper]{article}     \usepackage[latin1]{inputenc}          \usepackage{acro}          \DeclareAcronym{SAE}{     short=SAE,     long=Stackexchange acronym example}          \begin{document}     Here's a \ac{SAE}     \printacronyms[header=subsection*, name=]          \end{document}


title: Trying to draw a line that changes color

text: I'm trying to use `tikz` to draw a line that changes color at two different points. As you can see from the code below, what I want is a line that starts solid red, changes to dotted gray, and ends as solid green. When I compile, though, I get the red section only, without the other two. What is the remedy?               \documentclass[border=2mm]{standalone}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}              %% The line itself              \draw [red, very thick, |-] (0,0) -- (22,0);         \draw [gray, very thick, dotted] (22,0 -- 26,0);         \draw [green, very thick, ->] (26,0 -- 40,0);          \end{tikzpicture}     \end{document}


title: How to evaluate an expression before printing it?

text: **Start of Edit   ** In response to the comments I have added the following `mwe`:               \documentclass{article}     \usepackage{tikz}     \begin{document}     Let's see if this prints: \pgfmathparse{sin(60)}.     \end{document}      Unfortunately the output is just: "Let's see if this prints: ."   **End of Edit** I wanted to populate a table with entries calculated on the basis of constants depending on experiment parameters (like room temperature, pressure and humidity). Instead of hand-calculating the entries each time I make the table, I wanted to code the LaTeX table in the form of expressions that can be evaluated. This way, just by changing the experiment parameters, I can populate the new tables. Somewhat similar questions have been asked before, e.g. example 1, example 2, and example 3. `Sage`, `calc` and `fp` are some of the solutions that have been suggested. Submission to journals forms a very important factor in my consideration. Many journals these days accept the `TeX` files and I am reluctant to make submissions that involve heavy packages. `Sage` in spite of being able to evaluate expression the way I intend them to be, is ruled out for the same reason. I found `calc` too cumbersome. Somehow I am not able to find the documentation for `fp`. All recommendations are welcome. If the `TikZ` package can be somehow employed, that would be perfect. I use it in almost all of my manuscripts.


title: Align Text in Navigation

text: I have a beamer template with following code:               \begin{beamercolorbox}[wd=.24\paperwidth,ht=\@tempdimb]{section in head/foot}%       \vbox to\@tempdimb{\vfill\hskip-17ex\insertsectionnavigation{.22\paperwidth}\vfill\hfill}%     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.24\paperwidth,ht=\@tempdimb]{section in head/foot}%       \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.18\paperwidth}\vfil}%     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.038\paperwidth,ht=\@tempdimb]{section in head/foot}%       \vbox to\@tempdimb{\vfil\hspace*{0.6cm}\pgfuseimage{UT}\vfil}%     \end{beamercolorbox}%      Thats the header.... My problem is, that the text of the Navigation doenst start left align. I want the text all the way to the left in the box. The text always starts always in the middle of the box and kinda types backwards. Could anyone help me please?


title: Is it possible to force dvips to produce an EPS with %%HiResBoundingBox header?

text: Invoking the following command               dvips input.dvi -E -o output.eps      will produce an EPS file with only `%%BoundingBox` header as follows:               %!PS-Adobe-2.0 EPSF-2.0     %%BoundingBox: 85 626 184 729      Unfortunately this bounding box is not so accurate that it cannot be imported by `\includegraphics[hiresbb]{output.eps}`. Shortly speaking, is it possible to force dvips to produce not only `%%BoundingBox` but also `%%HiResBoundingBox`? Actually we can insert `%%HiResBoundingBox` using `epstool --copy --bbox input.eps output.eps`, but I want to minimize the workflow.


title: Does the order of specified key-values matter?

text: The following screen shot shows how the order of specified key-values affects the output.   1. When using `dx=\psPiH,xunit=\psPi`. ![enter image description here](http://i.stack.imgur.com/Fb1ho.png)   2. When using `xunit=\psPi,dx=\psPiH`. ![enter image description here](http://i.stack.imgur.com/mHbOo.png) **Minimal Working Example**               \documentclass[pstricks]{standalone}     \usepackage{pst-plot}          \psset{trigLabels=true,trigLabelBase=2,}          \begin{document}          \begin{pspicture}(-7,-2)(7,2)         \psaxes[dx=\psPiH,xunit=\psPi](0,0)(-2.2,-1)(2.2,1)     \end{pspicture}               \begin{pspicture}(-7,-2)(7,2)         \psaxes[xunit=\psPi,dx=\psPiH](0,0)(-2.2,-1)(2.2,1)     \end{pspicture}               \end{document}      It might be a bug. But does the order of specified key-values matter?


title: Is it possible to add centering and vspace to the caption text of a figure?

text: I have a figure containing a pair of plots that represent data points from 15 referenced papers (indicated in the plots as 1-15). To better indicate the source of each data point, I have added numbered list of the referenced papers at the bottom of the caption within an array as such.               \begin{figure*}     \centering     $\begin{array}{c@{\hspace{0.1in}}c}     \includegraphics[width=2.8in]{./figures/SimoArea} &     \includegraphics[width=2.8in]{./figures/SimoAreaPerOutput}\\     (a) & (b)\\     \end{array}$     \caption[     A comparison of various SIMO DC-DC voltage converter designs.     ]     {     A comparison of various single-inductor multiple-output DC-DC voltage converter designs across five technology generations:      $0.5 \mu m$, $0.35 \mu m$, $0.25 \mu m$, $0.18 \mu m$, $0.13 \mu m$.      (a) Design area verse voltage outputs. (b) Area per output for each design.     \\     {\protect     \vspace{0.5em}     %\centering     %\begin{center}     \tiny{         $\begin{array}{lll}             \text{1: Woo 2-Output Buck/Boost~\cite{woo:dcdc}} &             \text{6: Seol 5-Output Buck/Boost~\cite{seol:multiple-output}} &              \text{11: Belloni 4-Output Buck~\cite{belloni:buck}}             \\              \text{2: Ma 2-Output Boost~\cite{ma:simo-discontinuos,ma:reduction}} &             \text{7: Belloni 2-Output Buck~\cite{belloni:on-design}} &             \text{12: Parayandeh 4-Output Buck~\cite{parayandeh:programmable}}             \\              \text{3: Belloni 4-Output Boost~\cite{belloni:self-boosted}} &             \text{8: Lee 6-Output Buck~\cite{lee:simo}} &             \text{13: Belloni 2-Output Buck~\cite{belloni:on-design}}             \\              \text{4: Belloni 4-Output Buck~\cite{belloni:on-design}} &             \text{9: Huang 4-Output Buck/Boost~\cite{huang:simo}} &             \text{14: Zhang 2-Output Boost~\cite{zhang:simo}}             \\              \text{5: Le 5-Output Boost~\cite{le:simo}} &             \text{10: Bondade 3-Output Buck/Boost~\cite{bondade:codesign}} &             \text{15: Bondade 2-Output Buck~\cite{bondade:power-aware}}         \end{array}$     } % end tiny     %\end{center}     } % end protect          }     \label{fig:simo-area}     \end{figure*} I would like to add a little vertical space between my reference list and the formal caption and also center the array containing this list (without centering the rest of the caption). I have had no success so far.


title: How can I fit the original data with exponential or polynomial functions via pgfplots?

text: I am trying to plot the following data with a curve fitting via `pgfplots`. It seems linear regression is not suitable for my case. So I would prefer to have exponential or polynomial curve fitting on these data. How can I implement it? Below is the current code:               % arara: pdflatex: { shell: yes }          \documentclass[border=1mm, png]{standalone}     \usepackage{siunitx}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usepackage{pgfplotstable}     \usepackage{filecontents}     \begin{filecontents*}{myData.dat}     X     Y      2   275.68     3   1175.26     4   1351.60     5   1485.57     6   1583.30     7   1861.28     8   2095.39     9   2574.54     10  2841.74     11  2914.16     12  3965.12     13  3787.68     14  5294.83     21  10504.49     \end{filecontents*}          \begin{document}     \begin{tikzpicture}         \pgfplotsset{%             ,width=10cm             ,legend style={font=\footnotesize}             }         \begin{axis}[%             ,xlabel=Numbers $N$ in \si{\gram\per\liter}             ,ylabel=Ratio             ,ymin=0             ,xmin=0             ,scaled y ticks=base 10:0             ,legend cell align = left             ,legend pos = north west             ]         \addplot[only marks] table {mydata.dat};         \addlegendentry{Ratio of \emph{tfml} to \emph{gGN}}         \addplot+[no markers,red] table [y={create col/linear regression={y=Y}}]{myData.dat};         \addlegendentry{%             Linear trend $(y=\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x             \pgfmathprintnumber[print sign]{\pgfplotstableregressionb})$} %         \end{axis}     \end{tikzpicture}     \end{document}      Which yields: > ![enter image description here](http://i.stack.imgur.com/HPenD.png)


title: Automation of generating pstricks graphics with texclipse before pdf generation

text: When using eclipse with pdflatex I want it to create the pstricks Images automatically. The classical way (without eclipse or texlipse) would be:               latex test.tex     dvips -o test-pics.ps test.dvi     ps2pdf test-pics.ps      and then one would use pdflatex. How can I make texlipse do this automatically for me?


title: Searching for a better workflow to get a cropped PDF and EPS graphics - Stage 1

text: I am using TeX Live 2010. I don't use MikTeX anymore because of many troubles I found in the past. ## Input files: _gridon.tex:_               % gridon.tex     \documentclass{minimal}     \usepackage{pstricks}          \pagestyle{empty}     \begin{document}          \begin{pspicture}[showgrid=true](3,3)     \pscircle(1.5,1.5){1}     \rput[tr](3,3){3}     \end{pspicture}          \end{document}      _gridoff.tex:_               % gridoff.tex     \documentclass{minimal}     \usepackage{pstricks}          \pagestyle{empty}     \begin{document}          \begin{pspicture}[showgrid=false](3,3)     \pscircle(1.5,1.5){1}     \rput[tr](3,3){3}     \end{pspicture}          \end{document}      _main.tex:_               % main.tex     \documentclass{minimal}     \usepackage[hiresbb]{graphicx}     \begin{document}          \includegraphics[scale=2]{gridon}     \vspace{5mm}          \includegraphics[scale=2]{gridoff}     \end{document}      ## Methods: _MethodA.bat:_               echo off     latex %1     dvips %1     ps2pdf %1.ps     pdfcrop --hires %1     pdftops -eps %1-crop.pdf      _MethodB.bat:_               echo off     latex %1     dvips %1 -E -o %1.eps     epstool --copy --bbox %1.eps %1-crop.eps     epstopdf --hires %1-crop.eps      ## Results: ![enter image description here](http://i.stack.imgur.com/7eTUG.png)


title: Paragraph column in tabular working only in the first column

text: I have a two-column `tabular` environment and I'd like for both of these columns to have the text aligned at its middle (both vertically and horizontally), along with increased row height: But with the following input:               \begin{center}     \begin{tabular}{m{1.8cm}|m{1cm}}     Problem & $\beta$ \\[0.2cm]     \hline     LCR-1 & 0.25 \\ [0.2cm]     \hline     LCR-10 & 0.05 \\ [0.2cm]     \hline     LCR-0.2 & 0.575 \\ [0.2cm]     \hline     Airplane & 0.05 \\ [0.2cm]     \hline     DR & 0.27 \\[0.2cm]     \end{tabular}     \end{center}      Only the first column is as required. The text in the second column is still aligned at top left. Any hints?


title: A utility for auto-formatting .bib files?

text: I have a .bib files whose formatting is kind of messy: spacing, upper/lowercase use, order within and among entries... ugh. Is there a simple command-line utility which could arrange it neatly for me in a uniform format?


title: How to make beamer's alert work in \multiinclude[<alert@+| +->]?

text: Beamer user guide says at p140: > Example: For a more interesting usage of the ⟨default overlay > specification⟩, consider the following usage:               \multiinclude[<alert@+|> +->]{gra}       > This will always paint the most recently added part of the graphic in red ( > **assuming you do not use special colors in the graphic itself** ). However, a simple test with gra.pdf files (saved from inkscape) doesn't seem to be rendered red at each overlay. The pdf files contain only black lines. No matter what I try, seems every color is a "special color", and beamer does not correctly alert/highlight elements in the pdfs, like in this (correct) example using xfig: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html What's your experience on this issue? Can I correctly alert pdfs produced by tools like inkscape? I do not have a minimal example right now, but may supply one a while later. Thanks for any help/hint!


title: Use package listing error: Listing.sty not found

text: I want to use the listings package, but every time I compile my document in Texmaker I get the following error: !LaTeX Error: File `listings.sty' not found. Before this happens Texmaker displays me a window asking me to install listings, but even though I click install, the problem persists.


title: Problem in writing the system of equation in LaTeX

text: Here's the code I have and here's the system of equation it creates which is not working as desired. Do you know how I can fix it?               \item For what value of $b$ would the following system fo equations have an infinite number of solutions?\hfill     $$\begin{align*}      3x+5y &=  27 \\      12x+20y &=  3b     \end{align*}$$         \begin{enumerate}         \item $9$            \item $27$          \item $36$         \item $81$          \item $126$                      \end{enumerate}      ![enter image description here](http://i.stack.imgur.com/PHja2.png)


title: Well-maintained BibTeX Databases

text: Looking for properly formatted BibTeX citations for articles or books can be tedious. I used to use the functionality from Google Scholar, but found that for many cases the BibTeX files are poorly formatted, are missing information, or even contain wrong information. For mathematics papers, http://www.ams.org/mathscinet/ appears to be a reasonable alternative. But it is manually maintained and unfortunately a paid service (many universities have access). Are there other similar databases, possibly for other fields of science?


title: BibTeX to endnote bibliography

text: I was working with a software called KNIME and I needed to cite this software for, the citation provided by the website is in the BibTeX format.               @INPROCEEDINGS{BCDG+07,     author = {Michael R. Berthold and Nicolas Cebron and Fabian Dill and Thomas R. Gabriel and     Tobias K\"{o}tter and Thorsten Meinl and Peter Ohl and Christoph Sieb and Kilian Thiel and     Bernd Wiswedel},     title = {{KNIME}: The {K}onstanz {I}nformation {M}iner},     booktitle = {Studies in Classification, Data Analysis, and Knowledge Organization (GfKL 2007)},     publisher = {Springer},     ISBN = {978-3-540-78239-1},     ISSN = {1431-8814},     year = {2007}     }      I am not a BibTeX or even a LaTeX user. But I would like to convert this citation into the endnote format. I tried to find a way to do that online but failed. Can anyone help me with this? Thanks,


title: Creating environments with different colours and sizes

text: At the top of my lecture notes I define the following environments:               %Student copy     \newenvironment{Notes}{\LARGE\color{white}}          %My copy (uncomment out "%" below)         %\newenvironment{Notes}{\LARGE\color{red}}      Throughout my lecture notes I use the `Notes` environment to comment out bits of text, equations, lists, and parts of tables. Sometimes {\Notes ...} will encompass a line, other times half a page. However, I know this really isn't the best way of doing things as {\LARGE ..} doesn't play nicely with equations. But I'm not really sure what to do instead. Any suggestions? **Edit** I only need the sections to _appear_ white, i.e. when I print them off. Students fill in the gaps during lectures. I noticed that when I used my solution to blank off a couple of equations at a time, the colour setting goes _odd_. By odd I mean that sections are incorrectly coloured.


title: Clash between fontspec and l3keys2e with multichoice keys

text: Consider the minimal example:               \begin{filecontents}{test.cls}     \NeedsTeXFormat{LaTeX2e}[1994/06/01]     \RequirePackage{expl3,l3keys2e}     \ProvidesExplClass     {test}     {2013/12/23}     {1.0}     {A test class}          \bool_new:N \g_test_key_bool     \bool_new:N \g_test_key_a_bool     \bool_new:N \g_test_key_b_bool          \keys_define:nn { test } {       test    .bool_set:N = \g_test_key_bool,       key     .multichoice:,       key / a .code:n = \bool_set_true:N \g_test_key_a_bool,       key / b .code:n = \bool_set_true:N \g_test_key_b_bool,     }          \ProcessKeysOptions{ test }          \LoadClass{article}     \end{filecontents}     \documentclass[test,key={a,b}]{test}          \usepackage{fontspec}          \begin{document}     ducks     \end{document}      When `fontspec` is loaded (or likely any package that uses class-level options with `\ProcessOptions`), I get the following error:               ………     (/usr/local/texlive/2013/texmf-dist/tex/latex/fontspec/fontspec.sty     (/usr/local/texlive/2013/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)          ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.271 \ProcessOptions*          ! You can't use `macro parameter character #' in horizontal mode.     \@removeelement #1#2#3->\def \reserved@a ##1,#1,##                                                       2\reserved@a {##1,##2\rese...     l.271 \ProcessOptions*          )     Runaway argument?     {##1,##2\reserved@b }\def \reserved@b ##1,\reserved@b ##2\reserved@b \ETC.     ! File ended while scanning use of \reserved@a.     <inserted text>                      \par      l.28 ^^M          (./cv.test.aux)          ! LaTeX Error: \RequirePackage or \LoadClass in Options Section.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.29 \begin{document}          [1] (./cv.test.aux) )     (\end occurred when \iftrue on line 271 was incomplete)     (\end occurred when \ifx on line 271 was incomplete)     (\end occurred when \ifx on line 271 was incomplete)     (\end occurred when \ifx on line 271 was incomplete)     (\end occurred when \ifx on line 271 was incomplete)     (\end occurred when \ifx on line 271 was incomplete)     (see the transcript file for additional information)     Output written on cv.test.pdf (1 page).     Transcript written on cv.test.log.          LaTeX exited abnormally with code 1 at Sun Jan 19 12:46:17      I suspect this is because the traditional option parsing provided by LaTeX might not be taking brace groups into account. (Is this even possible without messing with catcodes!?) I can see this error coming up if, for example, LaTeX was splitting the options as `[test], [key={a], [b}]`, but I simply don't see how that makes any sense. Is it possible to enable the use of this key style within class-level options, or should I bop out to a separate setup function (along the lines of `\hypersetup{…}`)?


title: Auto align is not straight

text: I have this code:               \documentclass[11pt,a4paper]{report}      \usepackage[utf8x]{inputenc}      \newcommand{\lt}{\latintext}      \newcommand{\gt}{\greektext}     \usepackage[english,greek]{babel}          \begin{document}           \textit{\Large Ερώτημα 2}\\[0.2in]     \lt     (a)\\          \gt      \underline{Πίνακας \lt Orderlines}\\[0.2in]     \lt     R\begin{scriptsize}  orderlines\end{scriptsize}=60.350          r = 50 bytes          bfr = $\lfloor (b/r)\rfloor$          \end{document}      and my result is: ![enter image description here](http://i.stack.imgur.com/37GuA.png) Why is Rorderlines not aligned with the rest of the text? Did I change it by mistake?


title: Macro to multicol section content but not section title

text: \section{Introduction}      I want to write a macro to that makes the above behave the same as:               \usepackage{multicol}     \begin{multicols}{2}[\section{Introduction}]      In praise of code convolution avoidance: The shortest and simplest answer(Most adhering to the KISS philosophy) will be the accepted answer. DON'T use a library if you don't NEED to.


title: Change fontsize class option after being set in a format

text: I use `mylatexformat` to build easily format files. Consider the following file               \documentclass[10pt]{article}     % This is file t.tex     \begin{document}     Test     \end{document}      I then run `pdflatex -ini -jobname="myfmt" "&pdflatex" mylatexformat.ltx """t.tex"""` to get `myfmt.fmt`. Fontsize is now hardcoded in `myfmt.fmt` and set to `10pt`. Now, I have another file:               %&myfmt     \documentclass{NoMatterItIsNotReadAnyway}     % This is s.tex     \begin{document}     Test     \end{document}      When I compile it, the format `myfmt.fmt` is used and fontsize is set to `10pt`. Now, I would like to set it to `11pt`. AFAICS, definitions related to fontsize are set inside `size1?.clo` files. So I thought I could go this way               %&myfmt     \documentclass{NoMatterItIsNotReadAnyway}     \csname endofdump\endcsname % See mylatexformat documentation     \makeatletter     \input{size11.clo}     \makeatother     \begin{document}     Test     \end{document}      Unfortunately, it doesn't work because some macros are already defined and the `\newcommand` check mechanism refuse to go further. Is there a way to circumvent this?


title: pgfgantt - Milestones with different styles

text: Can I have two sets of milestones in one gantt chart? Each with a different style (such as colour, shape, etc.)?


title: How to convert LaTeX in html for Blogger

text: I am trying to embed formulas in Blogger. My system is OpenSuse, and I create a LaTeX file for my formulas, say `filename`. In order to convert the LaTeX code into an html code I run:               pdflatex filename     latex2html filename.tex      This produces a directory with all sorts of files. It appears that the file containing the html code is `images.pl` (is this correct?) But when I insert it into the post in Blogger (in html mode of writing) and save it, it does not produce the desired formula but instead simply presents the code. Any idea?