title: Problem with numbering of questions in exsheets

text: When using :               \documentclass[11pt,letterpaper,oneside]{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{enumitem}     \usepackage{verbatim}     \usepackage{varwidth}     \usepackage{exsheets}     \SetupExSheets[points]{name=points}     \SetupExSheets[question]{name=}         \begin{document}              \section*{}         \setcounter{question}{0}         \begin{enumerate}           \item Limits:         \begin{enumerate}            \item \includequestions[random=1]{limit1}             \item \includequestions[random=1]{limit2}             \item  \includequestions[random=1]{limit3}           \end{enumerate}                   \end{enumerate}               \end{document}      I get something like in the picture:![enter image description here](http://i.stack.imgur.com/Mv7Jh.png) I want to remove question labels 1, 2, 3 so I wrote :               \SetupExSheets[question]{name=}      but still question numbers remain. How to get rid of them? My questions are all extracted from files like :               {limit1.tex}          \begin{question}[type=exam,topic=easylimit]{1}     \SetQuestionProperties{cikli=I2014}         $\lim_{x \to \infty} \frac{x^4-5x}{x^2-3x+1} \, $     \end{question}          \begin{solution}     \end{solution}      Regards


title: Using glossaries (acronyms) with Beamer

text: I would like to use the glossaries package for acronyms in Beamer presentations. However, when using Beamer's overlay mechanisms, I run into trouble. An acronym (used for the first time) on a slide with overlays will have its long form printed on the first overlay but then be shown in its short form on the following overlays of that slide. This looks wrong, as it changes text between overlays that was supposed to appear static for the entire slide (across overlays). So, I guess what I would like is for glossaries to print the long form of an acronym on its first occurrence, but for all consecutive overlays displaying that first occurrence. I include a minimal example of what I mean:               \documentclass{beamer}          \usepackage[acronym]{glossaries}     \newacronym{AMA}{AMA}{a meaningless acronym}          \begin{document}          \begin{frame}       \begin{itemize}       \item<1-> The first occurrence of the acronym \gls{AMA}.       \item<1-> The second occurence of the acronym \gls{AMA}.       \item<2-> Something else.       \end{itemize}     \end{frame}          \end{document}      As you can see, the problem is that the first occurrence of the acronym gets printed in short on the second overlay. I guess it may be difficult to keep track of since the acronym (here) effectively has to be printed in "long- short-long-short" form across the two overlays. Can this be done? And hopefully, how?


title: What do \m@ne and \@M do in the definition of \@makechapterhead?

text: What do `\m@ne` and `\@M` do in the definition of `\@makechapterhead` in book class?   I took a quick look at `latex.ltx` and couldn't find any explanation.


title: How to print keywords into margin?

text: Many documentations and textbooks print essential keywords of a paragraph into the margin. Is there any package for this? Of course it wouldn't be all too complicated to define a custom command based on `\marginpar`, but you'd think there's already something out there with nice features like automatic index integration.


title: Determine text width

text: For sizing figures in LaTeX it's helpful to know how wide the text is so that figures can be sized to match without rescaling. LaTeX provides `\textwidth` for reference by other commands, e.g.   `\includegraphics[width=\textwidth]{figure}`   but including `\textwidth` "raw" in the document produces errors. Is there a way to determine what this value is?


title: What is the command \csname used for?

text: Maybe a stupid question...but I often see the usage of `\csname` in code -- especially in packages. Can someone explain what its purpose is? As far as I see it generates a new command based on an argument.


title: \vfill and vertical space

text: In a two-column document, I would like some text to be positioned at the bottom right of the right column. The text is inside `tabular` and `flushright`. An MWE is:               \documentclass[twocolumn]{article}     \usepackage{lipsum}     \begin{document}          \lipsum[1-4]     \vfill     \begin{flushright}       \begin{tabular}[b]{p{3cm} r}         some text & 0       \end{tabular}     \end{flushright}          \end{document}      However, there is some vertical space below (see image) which I would like to remove so the part "some text 0" fully aligns with the left column at the bottom. I believe I would need to edit the spacing for both `flushright` and `tabular` in this instance but don't know how (other than just manually adding a negative space via `\vspace{-1.5em}`). Help appreciated! * * * **EDIT:** To explain why I use/need the `tabular`, here is working example less minimal but more similar to my needs. It already uses some of the answers below.               \documentclass[twocolumn]{article}     \usepackage{lipsum}     \usepackage[demo]{graphicx}     \usepackage{array}     \begin{document}          \lipsum[1-4]     \vspace*{\fill}          \noindent     \makebox[\linewidth][r]{       \begin{tabular}[b]{ b{3cm} r@{}}       some long, line-wrapped text &     \includegraphics[width=2cm]{img}     \end{tabular}     }          \end{document}      But there still seems to be some small space below the box. ![MWE](http://i.stack.imgur.com/wZEhv.jpg)


title: Should I move to biber? Should I move to biblatex?

text: I've been using LaTeX and BibTeX since 1985. Over the past year or so I've noticed that a lot of the examples I'm finding online are using `biblatex`, a nearly complete reimplementation of BibTeX in LaTeX, and `biber`, another nearly complete reimplementation of BibTeX. I know that `biblatex` can be used with either `bibtex` or with `biber`. And all come with the standard LaTeX distribution now. So my question:   * Should I move from `bibtex` and `pdflatex` to `biblatex`?   * Should I move from `bibtex` to `biber`?   * Should I move from `bibtex` to both `biblatex` and `biber`?   * What should I worry about?


title: Animating a TikZ picture

text: I would like to animate the following picture so that the length of the blue box becomes smaller and smaller. Using the `overprint` environment along with `\transduration{0.2}` makes the job. However, this requires to copy and paste the piece of code, each time reducing the x-coordinate of `topRight_corner`. I am sure there is a proper way to do that... PS: I am using this to illustrate the limit as 'delta t' goes to 0. * * * Here is the `TikZ` picture ![enter image description here](http://i.stack.imgur.com/XCZik.png) and here is the piece of code I wrote for that               \documentclass{beamer}          \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}          %------ tikZ ------%     \usepackage{tikz}     \usetikzlibrary{positioning, arrows}     %------------------%          \begin{document}          \begin{frame}[c]          \begin{center}     \begin{tikzpicture}     \node[coordinate] at (0, 0) (bottomeLeft_corner) {};     \node[coordinate] at (2.50, 1.25) (topRight_corner) {};     \path[fill=blue!20] (bottomeLeft_corner) rectangle (topRight_corner);     \node[above left=0.625cm and 2cm of bottomeLeft_corner, coordinate] (start1) {};     \node[above left=0.625cm and 0cm of bottomeLeft_corner, coordinate] (end1) {};     \draw[semithick] (start1) -- (end1);     \node[above right=-0.625cm and 0cm of topRight_corner, coordinate] (start2) {};     \node[above right=0.625cm and 4.5cm of bottomeLeft_corner, coordinate] (end2) {};     \draw[->, >=stealth', semithick] (start2) -- (end2);     \draw[semithick, black!40] (end1) -- (start2);     \node[below=0cm of end2, xshift=0.25cm] {time};      \node[yshift=-0.25cm] at (bottomeLeft_corner) {$t$};     \end{tikzpicture}     \end{center}          \end{frame}          \end{document}


title: Per line text gradient (ala beeline reader)

text: I've looked at the demo of Beeline reader and would like to test it out on a physical version of my books, which are done in LaTeX. I'm wondering if it would even be possible. Beeline reader takes online test a puts a slight gradient on the letters for a single line of text. On the next line it reverses the direction of the gradient. The idea being that it helps tracking text and improves speed of reading. Any hints or suggestions as to how to do this in LaTeX? What follows is an example taken from http://www.beelinereader.com/ ![enter image description here](http://i.stack.imgur.com/OedGT.png)


title: Cannot edit .tex file unless delete produced files

text: I have just upgraded to `MiKTeX 2.9`from v2.8, where I was using TeXnic Center as my main tex editor. Now I am trying to build a simple document to check if basic packages are loaded as well as test greek fonts, since my documents are in Greek. My simple code is               \documentclass{article}     \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}          \begin{document}             This is the first \LaTeX{} document!\\             Το πρώτο κείμενο \LaTeX!\\             Πάμε στην δεύτερη γραμμή!     \end{document}      The thing is that in order to change/edit something(either in the preamble or within `document` environment) I have to delete all produced files(excepr the `.pdf`). Unless I do so, the `pdflatex` in texmaker keeps building for ever. This behaviour remains the same also in TeXniC Center. Has anyone seen something like that in `MikTeX 2.9`? How can it be fixed? **EDIT** `.aux` file               \relax      \select@language{greek}     \@writefile{toc}{\select@language{greek}}     \@writefile{lof}{\select@language{greek}}     \@writefile{lot}{\select@language{greek}}      log file               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9) (preloaded format=pdflatex 2013.9.6)  6 SEP 2013 16:31     entering extended mode     **LaTeX1.tex     (C:\Users\thanos\Desktop\LaTeX1.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, arabic, armenian, assamese, basque, bengali     , bokmal, bulgarian, catalan, coptic, croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, galic     ian, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, icelandic, indonesian, interlingua, irish, italian,      kannada, kurmanji, latin, latvian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, ngerman     -x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, sloven     ian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usenglishmax, w     elsh, loaded.     ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@section=\count80     \c@subsection=\count81     \c@subsubsection=\count82     \c@paragraph=\count83     \c@subparagraph=\count84     \c@figure=\count85     \c@table=\count86     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     ) ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.sty"     Package: babel 2008/07/08 v3.8m The Babel package          *************************************     * Local config file bblopts.cfg used     *     ("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\bblopts.cfg"     File: bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration     )     ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\english.ldf"     Language: english 2005/03/30 v3.3o English support from the babel system      ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.def"     File: babel.def 2008/07/08 v3.8m Babel common definitions     \babel@savecnt=\count87     \U@D=\dimen103     )     \l@canadian = a dialect from \language\l@american      \l@australian = a dialect from \language\l@british      \l@newzealand = a dialect from \language\l@british      ) ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\greek.ldf"     Language: greek 2005/03/30 v1.3l Greek support from the babel system      Loading the definitions for the Greek font encoding     ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\lgrenc.def"     File: lgrenc.def 2008/06/17 v2.3 Greek Encoding     ))) ("C:\Program Files\MiKTeX 2.9\tex\latex\base\inputenc.sty"     Package: inputenc 2008/03/30 v1.1d Input encoding file     \inpenc@prehook=\toks14     \inpenc@posthook=\toks15      ("C:\Program Files\MiKTeX 2.9\tex\latex\greek-inputenc\iso-8859-7.def"     File: iso-8859-7.def 2000/05/28 v1.2 Greek input encoding file     ))     (C:\Users\thanos\AppData\Roaming\MiKTeX\2.9\tex\latex\kerkis\kerkis.sty     File: kerkis.sty 2000/02/25 v1.5 Package `kerkis.sty'          *********************************************** ******** Loading The Kerkis FontFamily ********     ********** Department of Mathematics ********** *********** University of the Aegean **********     ***********************************************     LaTeX Info: Redefining \LaTeX on input line 156.     LaTeX Info: Redefining \LaTeXe on input line 166.     )     No file LaTeX1.aux.     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for LGR/cmr/m/n on input line 6.     LaTeX Font Info:    Try loading font information for LGR+cmr on input line 6.     ("C:\Program Files\MiKTeX 2.9\tex\generic\babel\lgrcmr.fd"     File: lgrcmr.fd 2008/06/17 v2.3 Greek Computer Modern     )     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Try loading font information for OT1+mak on input line 6.          (C:\Users\thanos\AppData\Roaming\MiKTeX\2.9\tex\latex\kerkis\ot1mak.fd)     LaTeX Font Info:    Font shape `OT1/mak/m/n' will be     (Font)              scaled to size 8.99994pt on input line 6.     LaTeX Font Info:    Try loading font information for LGR+mak on input line 6.          (C:\Users\thanos\AppData\Roaming\MiKTeX\2.9\tex\latex\kerkis\lgrmak.fd)     LaTeX Font Info:    Font shape `LGR/mak/m/n' will be     (Font)              scaled to size 8.99994pt on input line 6.     LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <7> on input line 7.     LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <5> on input line 7.     LaTeX Font Info:    Font shape `OT1/mak/m/sc' will be     (Font)              scaled to size 8.99994pt on input line 7.      [1          {C:/Users/thanos/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (C:\Users\thanos\Desktop\LaTeX1.aux) )      Here is how much of TeX's memory you used:      833 strings out of 493921      11820 string characters out of 3147280      60064 words of memory out of 3000000      4169 multiletter control sequences out of 15000+200000      6660 words of font info for 20 fonts, out of 3000000 for 9000      841 hyphenation exceptions out of 8191      24i,4n,20p,191b,113s stack positions out of 5000i,500n,10000p,200000b,50000s     {C:/Users/tha     nos/AppData/Roaming/MiKTeX/2.9/fonts/enc/dvips/kerkis/kerkis.enc}{C:/Users/thanos/AppData/Roaming/MiKTeX/2.9/fonts/enc/d     vips/kerkis/gpkerkis.enc}<C:/Users/thanos/AppData/Roaming/MiKTeX/2.9/fonts/type1/public/kerkis/Kerkis-SmallCaps.pfb><C:/     Users/thanos/AppData/Roaming/MiKTeX/2.9/fonts/type1/public/kerkis/Kerkis.pfb>     Output written on LaTeX1.pdf (1 page, 22862 bytes).     PDF statistics:      18 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)      When build stops, in the build output windows in TXC, the message               *********************************************** ******** Loading The Kerkis FontFamily ********     ********** Department of Mathematics ********** *********** University of the Aegean **********     ***********************************************      stays there forever. If I remove both kerkis and babel-inputenc then everything works fine! I also found out that if I remove babel-inputenc still everything works fine. It seems that babel is to blaim, but why?


title: Tikz-UML include and extend not compiling

text: For some strange reason `\umlinclude` and `\umlextend` are not compiling.. I've been trying to fix this problem for quite some time, without any success. Also couldn't find anything on the internet.. So I figured I'd ask here. Here is the minimal not working example:               \documentclass{article}           \usepackage[english]{babel}          \usepackage{tikz}     \usepackage{tikz-uml}          \begin{document}          \begin{tikzpicture}     \begin{umlsystem}[x=4, fill=gray!10]{System}          \umlusecase[name=case-1]{Case 1}     \umlusecase[x=2, y=-2, name=case-2]{Case 2}     \umlusecase[x=-2, y=-2, name=case-3]{Case 3}          \umlextend{case-1}{case-2}     \umlinclude{case-2}{case-3}          \end{umlsystem}     \end{tikzpicture}          \end{document}      Produces the error message:               ! Undefined control sequence.     \save@sf@q #1->\leavevmode \begingroup \edef \@SF                                                        {\spacefactor \the \spacef...     l.17 \umlextend{case-1}{case-2}          ?      ! Emergency stop.     \save@sf@q #1->\leavevmode \begingroup \edef \@SF                                                        {\spacefactor \the \spacef...     l.17 \umlextend{case-1}{case-2}          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on uml-test.log.      Which leaves me clueless.. Please help!


title: Set initial line after chapter title relative to top margin, not relative to end of chapter title

text: I want to set the initial line of text in every chapter to start at the same position on the page relative to the top margin of the page, and not relative to the last line of the chapter title. I just can't figure out how to do this, and would be grateful for any ideas. Here's a minimal working example:               \documentclass{scrbook}          \usepackage[papersize={130mm,210mm},top=13mm,showframe]{geometry}          \usepackage[]{titlesec}     \titleformat{\chapter}[hang]{\MakeUppercase}{}{0mm}{}[]     \titlespacing{\chapter}{0pt}{-1\baselineskip}{3\baselineskip}          \begin{document}          \chapter{Short chapter title}     This initial line of the chapter’s text is 3 lines below the end of the title,      and 4 lines below the top margin.          \chapter{Long chapter title that keeps going on so long that it ends up on two lines}     This initial line of the chapter’s text is also 3 lines below the end of the title,      but \textit{I want it to be 2 lines below since the chapter title, being longer,      has moved the text down, too}.      It should start at the same distance from the top margin as the first line of text      in chapters with single-line titles.          \end{document}


title: Can't overwrite Unicode character definition

text: I want this Unicode symbol `〈`, left-pointing angle bracket, to be interpreted as `\langle`. On TeX Live on my Mac, I tried this:               \documentclass[11pt]{article}     \usepackage[utf8x]{inputenc}          \DeclareUnicodeCharacter{2329}{\langle}          \begin{document}     $ 〈  $     \end{document}      which produces this error:               ./foo.tex:7: Package ucs Error: Unknown Unicode character 9001 = U+2329,     (ucs)                possibly declared in uni-35.def.     (ucs)                Type H to see if it is available with options.     Unicode character 9001 = U+2329:     Unicode character 9001 = U+2329:     LEFT-POINTING ANGLE BRACKET     BRA     Character available with following options:        postscript.      But I don't want to use the option `postscript`, I just want to define that Unicode character 2329 should emit `\langle`. What am I doing wrong?


title: How to get numeric bullets in a Master document in LyX which contains input Lyx documents

text: I want to create a master document in LyX. From there, I want to input (using the meaning of input as in LyX) 4 different LyX documents. Each one of these other LyX documents contains a list of publications, bulleted with numbers. Then I want to get a full list of all the publications that these LyX documents contain, bulleted with numbers, or in other words, sorted using numbers. What I try is, in the master document, input all of them consecutively. But then I get a list of publications like "1, 2, 3, 1, 2, 3, 4, 5, 1, 2, 3, ...", and what I want to get is the full list like "1, 2, 3, 4, 5, 6, 7, 8, ...". I do not know how to do this. I tried not using bullets with or without numbers on the input documents, but then I can not get bullets in the master document, any help? P.S. If there is no LyX solution, I wonder whether this can be done in plain Latex.


title: Image not centering in fullwidth even page

text: My MWE is,               \documentclass[a4paper,twoside,openright,11pt]{scrbook}          \usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}          \usepackage[utf8]{inputenc}     \usepackage{caption}     \usepackage{ifoddpage}     \usepackage{tikz}     \usetikzlibrary{positioning}     \usepackage{calc}     \usepackage{showframe}          \newlength\fullwidth\fullwidth=\textwidth \advance\fullwidth by \marginparwidth     \advance\fullwidth by \marginparsep     \newlength\extraWd     \setlength\extraWd{\dimexpr\marginparwidth+\marginparsep\relax}          \begin{document}          \begin{figure}[h]     \captionsetup{margin={0cm,-\extraWd}}     \checkoddpage     \edef\side{\ifoddpage c\else l\fi}     \makebox[\fullwidth][\side]{%     \fbox{\includegraphics[keepaspectratio=false,width=6cm]{example-image-a}}     }%     \caption{In the previous paragraphs, we mentioned the word “charge”. However, we need to look at its meaning in more detail.}     \end{figure}          \newpage          \begin{figure}[h]     \captionsetup{margin={0cm,-\extraWd}}     \checkoddpage     \edef\side{\ifoddpage c\else l\fi}     \makebox[\fullwidth][\side]{%          \fbox{\includegraphics[keepaspectratio=false,width=6cm]{example-image-a}}     }%     \caption{In the previous paragraphs, we mentioned the word “charge”. However, we need to look at its meaning in more detail.}     \end{figure}          \end{document}      And no problem odd page output, exactly centering, {left space 10cm, right space 10cm} ![enter image description here](http://i.stack.imgur.com/F5EuQ.png) But there is a problem even page. Not exactly centering. {left space 11cm, right space 9cm} ![enter image description here](http://i.stack.imgur.com/dC0Ir.png) As a matter of fact, the image is 1 cm (\marginparwidth) left shifting. Or do centering of \fullwidth. I cannot do, a few days. I am sure, easy for you but not for me. I didn't find duplicate another question. I found like its, don't working in full my code. Does anyone know how to fix it? **Related:** Let caption float into margin


title: Smart Art diagram in Tikz

text: I was trying the following code from the `smartdiagram` package, but I can't see the same result as in the manual. My code is               \documentclass[12pt,a4paper]{article}     \usepackage{smartdiagram}     \usesmartdiagramlibrary{additions}          \begin{document}     \begin{minipage}[t][3.5cm]{\textwidth}     \begin{center}     \smartdiagramset{     uniform color list=gray!60!black for 3 items,     back arrow disabled=true,     additions={     additional item offset=0.85cm,     additional item border color=red,     additional connections disabled=false,     additional arrow color=red,     additional arrow tip=stealth,     additional arrow line width=1pt,     additional arrow style=]-latex’,     }     }     \smartdiagramadd[flow diagram:horizontal]{%     PGF,Ti\textit{k}Z,Smartdiagram%     }{%     below of module1/Low Level, below of module3/High level%     }     \end{center}     \end{minipage}     \end{document}


title: Smart cross-references between 2 volumes using Zref package

text: Following the post How to enable smart references when using xr-hyper package for producing multi-volume book? I tried to elaborate required solution using `zref` package as was suggested by @Andrew Swann. Unfortunatly, I ran into another problem which seems to be a bug in `zref`. So I decided to post the problem description here. I am not sure if is it a proper place for posting such a question but Heiko Oberdiek, the author of `zref` did not answer to my email. As suggested by @Andrew Swann, I tried to provide cross-references between 2 volumes of a multivolume book using Heiko's package `zref`. I addition, I introduced a property `chaptervalue` in order to provide smart references, which hide a chapter part of an equation number in case when the equation goes from the same chapter where it is referred from. Here is MWE. It contains 3 files. Common code is saved in `test-zref-common.tex`:               % Load packages abd declare external docs.     \usepackage[user,xr]{zref}     \ifnum\Volume=1         % comment the line below to avoid errors         \zexternaldocument{test-zref-2}% <============         \makeatletter             \zref@ifpropundefined{volume}{                 \zref@newprop{volume}{\Volume}                 \zref@newprop{chaptervalue}{\the\value{chapter}}             }{}             \zref@localaddprops{main}{volume,chaptervalue}         \makeatother     \else         \zexternaldocument{test-zref-1}         \makeatletter             \zref@ifpropundefined{volume}{                 \zref@newprop{volume}{\Volume}                 \zref@newprop{chaptervalue}{\the\value{chapter}}             }{}             \zref@localaddprops{main}{volume,chaptervalue}         \makeatother     \fi          % Reset default equation numbering     \usepackage{amsmath}     \numberwithin{equation}{chapter}     \renewcommand{\theequation}{\arabic{equation}}          % Define \sref and \seqref macros for smart cross-references of equations     \makeatletter     \newcommand\ifcurrentchapter[3]{%       \def\temp@a{\number\value{chapter}}%       \def\temp@b{\zref@extract{#1}{chaptervalue}}%       \if\temp@a\temp@b%         #2%       \else%         #3%       \fi%     }     \newcommand{\sref}[1]{\hbox{\ifcurrentchapter{#1}{}{\zref[chaptervalue]{#1}.}\zref{#1}}}     \newcommand{\seqref}[1]{(\sref{#1})}     \makeatother          % Define a macro to print test text     \newcommand{\testtext}{         Compare \number\value{chapter} with \zref[chaptervalue]{ch:1}. Equal: \ifcurrentchapter{ch:1}{Yes}{No}         \par\noindent         Compare \number\value{chapter} with \zref[chaptervalue]{ch:2}. Equal: \ifcurrentchapter{ch:2}{Yes}{No}         \par\noindent         Compare \number\value{chapter} with \zref[chaptervalue]{ch:17}. Equal: \ifcurrentchapter{ch:17}{Yes}{No}         \par\noindent         Compare \number\value{chapter} with \zref[chaptervalue]{ch:18}. Equal: \ifcurrentchapter{ch:18}{Yes}{No}     }      The common file is read in by Volume 1 (`test-zref-1.tex`)               \documentclass[oneside]{book}     \newcommand{\Volume}{1}     \input{test-zref-common}          \begin{document}     \chapter{1 in Volume 1}     \label{ch:1}\zlabel{ch:1}          \testtext          \begin{equation}       eq1       \label{1.1}\zlabel{1.1}     \end{equation}     \begin{equation}       eq2       \label{1.2}\zlabel{1.2}     \end{equation}          \seqref{1.1}, \seqref{1.2}; \seqref{2.1}, \seqref{2.2}.     \seqref{17.1}, \seqref{17.2}; \seqref{18.1}, \seqref{18.2}.          \chapter{2  in Volume 2}     \label{ch:2}\zlabel{ch:2}          \testtext          \begin{equation}       eq3       \label{2.1}\zlabel{2.1}     \end{equation}          \begin{equation}       eq4       \label{2.2}\zlabel{2.2}     \end{equation}          \seqref{1.1}, \seqref{1.2}; \seqref{2.1}, \seqref{2.2}.     \seqref{17.1}, \seqref{17.2}; \seqref{18.1}, \seqref{18.2}.     \end{document}       and by Volume 2 (`test-zref-1.tex`):               %\documentclass{scrbook}     \documentclass[oneside]{book}     \newcommand{\Volume}{2}     \setcounter{chapter}{16}     \input{test-zref-common}          \begin{document}          \chapter{1 in Volume 2}     \label{ch:17}\zlabel{ch:17}          \testtext          \begin{equation}       eq1       \label{17.1}\zlabel{17.1}     \end{equation}          \begin{equation}       eq2       \label{17.2}\zlabel{17.2}     \end{equation}          \seqref{1.1}, \seqref{1.2}; \seqref{2.1}, \seqref{2.2}.     \seqref{17.1}, \seqref{17.2}; \seqref{18.1}, \seqref{18.2}.          \chapter{2  in Volume 2}     \label{ch:18}\zlabel{ch:18}          \testtext          \begin{equation}       eq3       \label{18.1}\zlabel{18.1}     \end{equation}          \begin{equation}       eq4       \label{18.2}\zlabel{18.2}     \end{equation}          \seqref{1.1}, \seqref{1.2}; \seqref{2.1}, \seqref{2.2}.     \seqref{17.1}, \seqref{17.2}; \seqref{18.1}, \seqref{18.2}.     \end{document}       It works fine if I refer to Volume #1 from Volume #2 (ie. when the line               \zexternaldocument{test-zref-2}      is removed from `test-zref-common.tex`). However it fails when I am trying to refer to both volumes, to Volume #1 from Volume #2 and to Volume #2 from Volume #1. `zref` complains that the `chaptervalue` property has been already defined. Attached files demonstrate this problem. **Is a bug in`zref` or a bug in MWE?**


title: LyX & LaTeX formulas

text: When I open a new project in LyX, i cannot pass LaTeX functions inside my text. e.g. `\sqrt A` or `\frac{A}b` etc. As i know and i have seen in many video presentations when the user insert a LaTeX formula in LyX editor this is compiled directly to a "understood-mathematical" output. Should i activate something? ** (I am new to LaTeX and LyX; until now i was using MS Word. First I tried to install MikTeX, but ran into problems; now I have installed TEXlive and LyX to do my job. It is working nice but the installation TEXlive takes time (~2h))


title: How to obtain formatted page number in ConTeXt?

text: # Problem The `\pagenumber` macro does not reflect the `conversion` attribute value within the context of front matter vs. body matter. The front matter uses Roman numerals, the body matter uses regular text. # Code A minimum working example to show the problem:               \setuppapersize[letter][letter]          % See: http://tex.stackexchange.com/a/128858/2148     \setuplayout[       % Allow text to be flush with the top       topspace=\zeropoint,       % Stretch the text to its maximum (to place page number at very bottom)       height=fit,       % Allow text to be flush with the bottom       footerdistance=\zeropoint,     ]            \setupcolors[state=start]          \definecolor[colourhighlight][h=F5F6CE]     \definecolor[colourtocseparator][colourtertiary]          % Use Roman numerals for the front matter     \definestructureconversionset[frontpart:pagenumber] [] [romannumerals]          % Put a coloured box around the page number     \setuppagenumbering[       command={\inframed[         frame=no,         background=color,         backgroundcolor=colourhighlight,         width=2em,         height=2em,       ]{\pagenumber}},     ]            % Right-align the page number in the footer and assume single-sided pages       \setuppagenumbering[location={footer,right,margin},alternative=singlesided]            % Do not define a double-sided document environment.       % See: http://tex.stackexchange.com/a/122349/2148       \setupmakeup[standard][page=yes, doublesided=no]          \starttext     \startfrontmatter       \setuppagenumbering[conversion=romannumerals]       \setcounter[userpage][1]            % Title page (front cover)       \startstandardmakeup         Title page       \stopstandardmakeup            % Copyright page       \startstandardmakeup         Copyright       \stopstandardmakeup            % Table of Contents       \completecontent     \stopfrontmatter          \startbodymatter       \setuppagenumbering[conversion=numbers]       \setcounter[userpage][2]            \startchapter[         title={chapter},         reference=sec:chapter,       ]            \input knuth            \stopchapter          \stopbodymatter          \stoptext      # Actual Results The output for the front matter shows the normal page number (this is not desirable: it should be a roman numeral) beside the page number converted to a Roman numeral: ![Front Matter Page Number](http://i.stack.imgur.com/R3wr2.png) The output for the body matter shows the normal page number (this is desirable) beside the page number converted to a regular number: ![Body Matter Page Number](http://i.stack.imgur.com/1qPh4.png) # Expected Results I was expecting the page number to keep the context of the conversion value, thus showing up as a roman numeral within the `\inframed` macro. I am trying to accomplish the following in the front matter: ![Roman Numeral within Inline Frame](http://i.stack.imgur.com/U2xv2.png) If possible, I'd rather avoid creating a layer. # Question How can you create a page number in a `\framed` (or `\inframed`) that is formatted according to the conversion value specified by:               \setuppagenumbering[conversion=romannumerals]      # Related   * Eliminate topspace and bottomspace in ConTeXt


title: How to group many nodes? in pstricks

text: I have this code, and would like to know how to group many nodes. ![enter image description here](http://i.stack.imgur.com/J4EOV.png) How to do it? I prefer grouping nodes calling nodes by name but... if it´s not possible, I was thinking about coding any similar to               \pstriangle[linestyle=dashed,linecolor=red,linewidth=0.1cm,framearc=0.2](0,-1.9)(4.8,4.8)      with the option "linearc=0.2" My code               \documentclass[pstricks,border=12pt]{article}     \usepackage{pstricks,pst-node,pst-blur}     \usepackage[utf8]{inputenc}     \usepackage{eurosym}          \newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}     \newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}     \newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}     \newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}          \definecolor{azultenue}{RGB}{65,170,193}     \definecolor{rojotenue}{RGB}{192,2,3}     \definecolor{naranjatenue}{RGB}{241,101,35}          \begin{document}     \psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm,nodesep=0.12cm}     %     \def\pscolhookii{\hskip 1cm}     \def\pscolhookiii{\hskip 1cm}     \begin{psmatrix}[rowsep=2.2, colsep=5.8]% defines the distance between two frames      [name=Inicio]       \psframegray(-2.5,-2.5)(2.5,2.5)     %      \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}     %      \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}      \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}     %      \psdots[dotsize=0.06](0.1,-1)      \psdots[dotsize=0.06](0.4,-1)      \psdots[dotsize=0.06](0.7,-1)     %      \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}     %      \ncline[arcangle=0]{->}{p1}{c1}      \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$}}     %      \ncline[arcangle=0]{->}{p1}{c2}      \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }     %      \ncline[arcangle=0]{->}{p1}{cl}      \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     &[name=Conjunto]     \psframegray(-2.5,-2.5)(2.5,2.5)     %      \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}     %      \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}      \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}     %      \psdots[dotsize=0.06](0.1,-1)      \psdots[dotsize=0.06](0.4,-1)      \psdots[dotsize=0.06](0.7,-1)     %      \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}      \ncarcbox[nodesep=.2cm,boxsize=.4,linearc=.4,linecolor=red,linestyle=dashed]{<->}{p1}{c1}{c2}{cl}     \rput(0,-1.8){Evalución de Aptitud}     \rput(0,-2.25){de padres e hijos}           \end{psmatrix}     \end{document}


title: Compile directive via an included file

text: ## Background: For one project, I store all my header `.tex`/`.sty` files in `../../../Templates`, and all the files need to be at a particular relative directly location so using this relative hierarchy enforces that rule. In order to speed up compilation, I created a pre compiled `.fmt` file. Now to use this, I can either:   1. Add to the command line:              -fmt ../../../Templates/MyPreamble        2. Add the following line as the the first line in my .tex file:              %& ../../../Templates/MyPreamble      and both methods work fine. ## Question: What I would like to do is to to have the first line in the `.tex` file as               \input{../../../Templates/MySetup.tex}      and the content of the `MySetup.tex` invoke the `.fmt` file with something such as:               %& ../../../Templates/MyPreamble      Is there anyway to do this? ## Reasons: I am open to any other suggestions as well, but here is my reasons for this:   1. I used the first method and adjusted the `pdflatex` command in TeXShop to have that directive. However, when I am working on some other project (ex, an TeX.SE answer) I do not want that pre-compiled format, so need a way to disable it. Hence decided not to use this method.   2. I already have ALL file individual files set up to `\input` the `MySetup.tex` file on the very first line. If I can just change that one file, then I can easily switch between using the pre-compiled format or not, by just changing the `MySetup.tex` file. And yes I could use a shell script to update all the files, to add this first comment line, but would prefer to not to do that.


title: Macros with \fi for showing and hiding proofs

text: I would like to be able to globally showing and hiding proofs on a document, and be able to use macros to open and close the proof environments. Here is my current MWE:               \documentclass{article}     \usepackage{amsmath}     \usepackage{amsthm}     \newif\ifshowproof     \newcommand{\bp}{\ifshowproof\begin{proof}}     \newcommand{\ep}{\end{proof}}     \showprooffalse          \begin{document}     Goodbye.     \bp     Hello.     \ep\fi     Test.     \end{document}      As explored here: newcommand does not work with \fi, I cannot simply add `\fi` to the definition of `\ep`, however, I would like to have a "catch-all" macro so to say, that is, ideally something that would execute as `\end{proof}\fi`. Is there an easy way to do this?


title: Cross-referencing a custom environment with two arguments

text: Sorry if my question title is ambiguous. I want to write an environment called "problem" that works as follows. I want to be able to write                   \begin{problem}{1}{2}         this is a problem statement \label{myprob}         \end{problem}              Look at problem number \ref{myprob}      and get the following output:                   Problem 1.2: This is a problem statement.              Look at problem number 1.2.      Any ideas as to how I would do this?


title: Line break long chemical names that contain brackets

text: I have some very long chemical names that are spilling into the margins, and I'd like to just tell LaTeX how to hyphenate them automatically so I don't have to manually go back and insert hard line breaks. I've tried using \hyphenate and it gives me a "not a letter" error, which is probably because these formula names include parenthenses. The chemical names are: tris(tetrachlorocatecholato)manganese(IV), bis(tetrachlorocatecholato)tetrachlorosemiquinonatocobalt(III), tris(tetrachlorosemiquinonato)iron(III), and tris(tetrachlorocatecholato)iron(III) Here's what I've tried in the preamble:               \hyphenation{tris(tetra-chloro-cat-e-cho-la-to)man-gan-ese(IV)}     \hyphenation{bis(tetra-chloro-cat-e-cho-la-to)tetra-chloro-semi-qui-non-ato-cobalt(III)}     \hyphenation{tris(tetra-chloro-semi-qui-non-ato)iron(III)}     \hyphenation{tris(tetra-chloro-cat-e-cho-la-to)iron(III)}      I tried just doing a hyphenation for the parts in the parenthenses:               \hyphenation{tetra-chloro-cat-e-cho-la-to}     \hyphenation{tetra-chloro-semi-qui-non-ato}      But it won't hyphenate those within the longer "word" of the chemical name. Is there a way to automate this or am I just stuck doing hard line breaks by hand?


title: How to remove "Algorithm #" caption prefix but keep list of algorithms?

text: I am using the `algorithm`-package and would like to name my algorithms without any generated prefix. So I would like to remove "Algorithm #" as prefix from my caption, but still keep the list of algorithms listing the captions. I have two minimal working examples, each one doing only a part of the required job.               \documentclass[11pt]{article}          \usepackage{caption}     \usepackage{algorithm}          \begin{document}          \begin{algorithm}     \caption*{My Algorithm}     \end{algorithm}          \listofalgorithms          \end{document}      This removes the caption prefix, but the algorithm is not included in the list.               \documentclass[11pt]{article}          \usepackage{caption}     \usepackage{algorithm}          \begin{document}          \begin{algorithm}     \floatname{algorithm}{}     \caption{My Algorithm}     \end{algorithm}          \listofalgorithms          \end{document}      This removes the caption prefix partially, (the number "1" still remains), but the algorithm is included in the list.


title: How to add text after a forward slash

text: I want to write this; `/camera/image_raw`, but it seems impossible to compile. The forward slash is not the issue, but as soon as I put text behind it doesn't work :( Does anyone know a solution?


title: Table not flushing left as expected

text: I'm trying to make my tables flush left and overall align with the text. Using `to \textwidth` manages to make the table the right size, but it won't align properly with the text sometimes. It is slightly indented, which makes it overhang the margins on the right as well as the undesired behavior seen in my example below. Here is my MNWE:               \documentclass{article}          \usepackage[table]{xcolor}     \usepackage{longtable,tabu}          \newcommand{\TableSetupFourColumns}{     \rowcolors{2}{gray!25}{white}     \begin{tabu} to \textwidth {lccX}         \rowcolor{gray!50}}          \begin{document}          \section{Test 1}     This is the text I want the table to align with after flushing.\par \noindent     \TableSetupFourColumns         Test            & test  & test  & test\\     \end{tabu}          \end{document}


title: Copy the abstract environment for acknowledgments

text: I would like to create an `acknowledgments` environment that's simply the duplicate of the `abstract` environment, with two exceptions:   1. It should print `Acknowledgments` as its heading, not `Abstract`.   2. The `acknowledgments` environment should end with `\clearpage`. The answer to Duplicating Environments shows me how to duplicate an environment, but what do I need to do to accomplish the two points above?               \documentclass{article}     \usepackage{filecontents,lipsum}     \begin{filecontents}{mystyle.sty}     \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{mystyle}     \let\acknowledgments\abstract     \let\endacknowledgments\endabstract     \endinput     \end{filecontents}     \usepackage{mystyle}          \begin{document}     \begin{abstract}     \lipsum[1]     \end{abstract}     \begin{acknowledgments}     \lipsum[1]     \end{acknowledgments}     \end{document}


title: Editing *existing* multipage TeX tables in a spreadsheet-like interface?

text: Is there any GUI/interface/package that will enable me to edit existing data in columns of my super-complicated multipage TeX table? Currently, I count the "&"s to get to the correct column and then edit it. It becomes painful very fast with a ton of columns to edit. Am I missing some obvious trick that pro-TeX-table-makers know of to edit tables? I am using TeXlive on Fedora 15. My frontend TeX editor is primarily TeXStudio (formerly, TeXmakerX). **Edit:** I played with the `datatool` package for a few days. It's notoriously difficult to make it behave with the longtable package. Formats are ripped out. Multicolumn spanning text/strings are sometimes not handled properly. I ended up making a tex file with a tailored header for each of my 27 X 3 tables and cutting and pasting the output of a csv to latex perl tool into the tailored tex files again and again... _sigh_ Maybe there are ways to make the `datatool` package play well with the longtable package but they are not very clear to the new user.


title: Titletoc and Titlesec in just some chapters

text: I have a `twocolumn` document and I should insert the `minitoc` in the first chapters with `titlesec` and `titletoc`. I read the answer to Customize minitoc; however, if I change the `\titleformat` before appendices, all the sections of the appendix chapters will appear within the last `minitoc`:               \documentclass{book}     \usepackage{titlesec}     \usepackage{titletoc}          \newcommand\partialtocname{\contentsname}     % depending on this boolean, \chapter will create or not a partial ToC     \newif\ifchapterwithtoc     \chapterwithtocfalse          \titleformat{\chapter}[display]       {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}       [\ifchapterwithtoc          \vspace*{2pc}\titlerule\vspace*{1pc}%          \startcontents\vbox{\Large\partialtocname}\vskip1ex          \printcontents{l}{1}{\setcounter{tocdepth}{1}}\vspace*{1pc}\titlerule%        \else\fi%       ]          \titlecontents*{lsection}[0pt]     {\small\normalfont}{\thecontentslabel\space}{}     {,~\itshape\thecontentspage}[\space\textbullet\space][.]     \titlecontents*{lsubsection}[0pt]{}{}{}{}          \begin{document}          \frontmatter     \chapter*{Acknowledgements}     \chapter*{Preface}     \tableofcontents          \mainmatter     \chapterwithtoctrue          \chapter{Chapter One}     \section{Section One One}     \section{Section One Two}     \section{Section One Three}          \chapter{Chapter Two}     \section{Section Two One}     \section{Section Two Two}          \appendix     \chapterwithtocfalse          \chapter{Appenix One}     \section{Section A One}     \section{Section A Two}     \chapter{Appenix Two}     \section{Section B One}     \section{Section B Two}          \end{document}      Any suggestion?


title: xelatexmk and emacs

text: For technical reason, I had to set for using emacs as my working environment, as I am able to type directly some Unicode signs that otherwise I cannot code in with Texworks or TeXmaker. At this point, I would like to use xelatexmk in emacs. I have seen some of the actual threads about Latexmk, but I am not really sure how to implement xelatexmk in emacs anyway. My emacs is the last version in Windows (emacs 23.3) and I am using TeXlive. My .emacs is quite basic and I can post it if it needed. I am asking this question as Ancient Historian working with emacs. While I am only asking for a simple setting, I am also raising the point as they might be other users trying to use emacs and latexmk with xelatex, so any answer will be retrievable on line.


title: Subgrid with pgfplots

text: I know how to get a grid in `pgfplots` as shown below, but how can I get additionally a subgrid without labels?               \documentclass{article}          \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}        \begin{axis}[grid=both,no markers,samples=100]           \addplot {sin(deg(x))};        \end{axis}     \end{tikzpicture}          \end{document}      Output: ![output](http://i.stack.imgur.com/zgDRl.png)


title: How can I display two single quotes in LaTeX?

text: I need to display two single quotes without anything between them (I'm preparing computer science lecture slides and I want to display `'\''`), but of course LaTeX wants to translate `''` to closing double quotes. What can I do to bypass what is now a limitation for me?


title: Variadic arguments macro

text: I am trying to make macro with variadic arguments, iterating over them. The final result is supposed to be:               \foreach[x]((var = \x )){foo}{bar}{baz}\null      evals to               var = foo var = bar var = baz      My naive guess is this one:               \def\Macro#1{\if \null#1 . \else ,\noexpand\Macro \fi}     \Macro foogg\null      I expected it to eval to `,,,,,.`, but it evals to `,oogg`. Am I understanding `\noexpand` behavior wrong?


title: enumerate with non-standard numbering (1°, 2°, ...)

text: How can I get a list environment with numbers 1°, 2°, ...? LaTeX does not accept the symbol `°`.


title: Clipping with PSTricks

text: Consider the following example. **Code**               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{figure}     \psset{unit=0.05}      \begin{pspicture}(120,216)       \pnodes{P}(0,0)(0,120)(186,120)(216,120)(216,0)(186,0)(186,30)(186,90)       \pspolygon(P0)(P1)(P3)(P4)       \pcline[offset=12pt]{|<->|}(P1)(P3)       \ncput*[nrot=:U]{216}       \pcline[offset=12pt]{|<->|}(P3)(P4)       \ncput*[nrot=:U]{120}       \pspolygon[linestyle=none,fillstyle=vlines](P2)(P3)(P4)(P5)       \pswedge[linestyle=none,fillstyle=solid,fillcolor=white](P6){30}{270}{90}       \pswedge[linestyle=none,fillstyle=solid,fillcolor=white](P7){30}{270}{90}       \psarc(P6){30}{270}{90}       \psarc(P7){30}{270}{90}       \psdot(P6)       \psdot(P7)      \end{pspicture}     \end{figure}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/6lEvQ.jpg) **Question** The code above seems to be the wrong way of creating the figure. I guess `\pscustom` is the way to go, but I cannot figure out how to use it; how do I produce the figure in the "best" way using PSTricks? (I would very much like to see how it is done and not just get a comment about using this or that.)


title: No indentation after empty line

text: Indentation can be selectively suppressed using `\noindent` or completely with the option `parindent=full` to the KOMA document classes. Books (fiction) are usually structured using paragraphs, indented as the LaTeX default. Additionally, greater changes are indicated by an empty line that is followed by a non-indented paragraph, like the first one in a section. Is there a possibility to insert such a line break into a LaTeX document or automatically omit indentation after empty lines?


title: Tikz: use opacity for fill, yet leave draw (lines) untouched

text: When I use the tikz key `opacity` for a polygon in a tikzpicture, it applies to the drawn fill as well as to the draw lines. I would like to have it this way that the lines remain untouched by the `opacity` key, so that they behave as if they had `opacity=1`. (What I do now is redraw the polygon with `fill=none`, but that is a crippled solution to the problem).


title: scientific report two columns

text: While looking for something on this site I accidentally found a document class which is perfect for a scientific report with two columns layout. Unfortunately I forgot its name. Could someone point me out the document classes which implements two column layout without using `multicol` packages?


title: Small caps with CMSS?

text: How can I use small caps with the CMSS font? When trying to set `fontshape` to "sc" I get a serif font or just no change (if I use `fonthshape`alone): result of example below:   ![screenshot](http://i.stack.imgur.com/doIYE.png)               \documentclass[11pt]{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}               \usepackage[T1]{fontenc}      \newcommand{\changefont}[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}          \newcommand{\Ena}[1]{{\changefont{cmss}{m}{sc}#1}} %Eigennamen     \newcommand{\Enb}[1]{{\fontshape{sc}#1}} %Eigennamen               \begin{document}          \changefont{cmss}{m}{n}      Normal Text and \Ena{Text with Small Caps} or \Enb{Text with Small Caps}          \end{document}


title: pgfplots: "x stick" style

text: I am trying to reproduce the following example. The xbar and ybar options are not really what I am looking for since I am only interested in having horizontal lines as markers of points. Is there any way to do that in pgfplots ? ![enter image description here](http://i.stack.imgur.com/fRMTy.jpg)


title: ConTeXt's user namespace seems somewhat empty

text: With               ConTeXt  ver: 2010.05.24 13:05 MKIV  fmt: 2010.12.18  int: english/english      the ConTeXt code               \starttext        \message{one}        \directlua{print(1)}        \message{two}        \usercode{print(2)}     \stoptext      gives (excerpted)               systems         : begin file minex.tex at line 1     one1      two     ! LuaTeX error <private user instance>:1: attempt to call global 'print' (a nil value)     stack traceback:             <private user instance>:1: in main chunk.     \usercode #1->\directlua 1{protect("userdata")#1}          l.5    \usercode{print(2)}      This I interpret as the `print` variable being bound in the usual way to the Lua basic function in the default namespace, but unbound in Context's `user` namespace; likewise all the other basic Lua functions that I checked are unbound in the user namespace. Is this behaviour intended?


title: hyphenation and utf8

text: from Tex FAQ - hyphenation I see that trying to help Latex in correctly hyphenating words won't work when the utf8 encoding is used. Is there a work around?


title: Customized accent symbol

text: I would like to create a customized accent that is basically the symbol `\therefore`, i.e. I would like to have a letter with the "three-dot `\therefore` symbol" on top of it. I am new to LaTeX and I am not sure if there is an easy way to do this.


title: Table growing with content and automated line break

text: I would like to have a `tabular` or something similar with one cell and the following behavior:   * The cell grows vertically and horizontally to fit the content of the cell but no more than `\linewidth`   * The lines break instead of going out of the cell or the cell itself growing bigger than the page So far I've only found two partial solutions :   * Using a simple tabular with `p{.?\textwidth}` to ensure line breaks and vertical grow but that does not provides me with a box growing horizontally   * Using a simple tabular with `l`, `r` or `c` to ensure automated horizontal grow If you wonder why I want a single cell table, its because I need some sort of "box" that can have borders and a background color.


title: How can I prevent citations with the second author as Firstname Lastname

text: I am using biblatex with the following command:               \usepackage[backend=biber,style=authoryear-comp,           bibstyle=authoryear,citestyle=authoryear-comp]{biblatex}      Now when I do a \textcite I sometimes get the following output: > Smit and John Doe, 2011 And in the bibliography > Smit, Peter and John Doe (May 2011). “Using I find this ugly. How can I get the citation to be: > Smit and Doe, 2011 And the bibliography to be > Smit, Peter and Doe, John (May 2011). “Using


title: Adjust space between entries in LoF and LoT

text: I am trying to adjust spacing between entries in LoF and LoT. My code is               \documentclass[11pt,a4paper]{book}     \usepackage[english,greek]{babel}     \setcounter{secnumdepth}{3}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage[pdftex]{graphicx}     \usepackage[margin=2.8cm]{geometry}     \usepackage[Glenn]{fncychap}     \usepackage{fancyhdr}     %!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     \usepackage{tocloft}     \setlength\cftparskip{-15pt}%For ToC works great     \setlength\cftbeforesecskip{-8pt}%For ToC works great     \setlength\cftbeforesubsecskip{-5pt}%For ToC works great     \setlength\cftbeforechapskip{-1pt}%For ToC works great     \setlength\cftaftertoctitleskip{-50pt}%For ToC works great          % I also tried \renewcommand instead of \setlength     \setlength\cftbeforeloftitleskip{-2cm}%It has no effect in LoF     \setlength\cftbeforelottitleskip{-5cm}%It has no effect inLoT          \makeatletter     \newcommand*{\tocwithouttitle}{\@starttoc{toc}}     \makeatother     %--------------------------------------------------------------------------------     \makeatletter     \newcommand*{\lofwithouttitle}{\@starttoc{lof}}     \makeatother     %--------------------------------------------------------------------------------     \makeatletter     \newcommand*{\lotwithouttitle}{\@starttoc{lot}}     \makeatother     %--------------------------------------------------------------------------------     %!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}          \begin{document}          %~~~~~~~~~~~~~~~~~~~~~~~Front-Page~~~~~~~~~~~~~~~~~~~~~~~~~~     \begin{titlepage}     Εξώφυλλο     \end{titlepage}          \chapter*{\contentsname}     \markboth{\MakeUppercase{\contentsname}}{\MakeUppercase{\contentsname}}     \tocwithouttitle     \addcontentsline{toc}{chapter}{Πειρεχόμενα}          %LoF     \chapter*{Κατάλογος σχημάτων}%List of Figures     \markboth{\MakeUppercase{Κατάλογος Σχημάτων}}{\MakeUppercase{Κατάλογος Σχημάτων}}     %\renewcommand\cftbeforeloftitleskip{5pt}     %\renewcommand\cftbeforelottitleskip{5pt}     \lofwithouttitle     %\setlength\cftbeforefigskip{0pt}     \addcontentsline{toc}{chapter}{Κατάλογος Σχημάτων}          %LoT     \newpage          \chapter*{Κατάλογος Πινάκων}     \markboth{\MakeUppercase{Κατάλογος Πινάκων}}{\MakeUppercase{Κατάλογος Πινάκων}}     \lotwithouttitle     %\renewcommand\cftbeforeloftitleskip{5pt}     %\renewcommand\cftbeforelottitleskip{5pt}     \addcontentsline{toc}{chapter}{Κατάλογος Πινάκων}          \newpage     \end{document}      While some code is working on ToC(See comments in Preamble) I cannot adjust spacing in LoF/LoT. How can this be achieved?


title: How can I clip an image via a bezier-path?

text: I have a rectangular image that I can not change. I'd like to clip the image with a bezier path so I get one that is rectangular at the top and the sides but has a curve at the bottom, preferable without using additional packages.


title: New TX math font symbol: skew underbrace with package newtxmath

text: I found that the New TX math font `newtxmath` could not displace `underbrace`, see: latest Texlive 2012 ![enter image description here](http://i.stack.imgur.com/Cfbst.png) The correct `underbrace` with default CM font: ![enter image description here](http://i.stack.imgur.com/9yiGM.png) * * * It's weird that it works well when I test it with a simple `tex` file.                 \documentclass[12pt]{book}       \usepackage{amssymb}       \usepackage{amsmath}       \usepackage[T1]{fontenc}       \usepackage{newtxtext, newtxmath}  % new TX times            \begin{document}                 \begin{eqnarray}       \frac{\sin^{2}\vartheta}{\Theta_{lm}(\vartheta)}\left(\frac{\partial^{2}}{\partial\vartheta^{2}}+\frac{\cos\vartheta}{\sin\vartheta}\frac{\partial}{\partial\vartheta}\right)\Theta_{lm}(\vartheta)+\sin^{2}(\vartheta)(l(l+1)) =\underbrace{-\frac{1}{\Phi_{m}(\varphi)}\frac{\partial^{2}}{\partial\varphi^{2}}\Phi_{m}(\varphi)}_{blabla} \\       P_l (x)\equiv\frac {1}{2^l}\sum_{k=0}^{\lfloor l/2\rfloor} (-1)^k \frac{(2l-2k)!}{k!(l-k)!(l-2k)!} x^{l-2k}\\       \iint_\Omega \frac{x^2+1}{2y}dxdy = 0       \end{eqnarray}            \end{document}      But it won't work with these packages used for my report:                \usepackage{amssymb}      \usepackage{amsmath}      \usepackage{graphicx}      \usepackage[table]{xcolor}      \usepackage{enumerate}     % numbered items      \usepackage{color}      \usepackage{booktabs}          \usepackage{threeparttable}      \usepackage{multirow}      \usepackage[UKenglish]{babel}  % ngerman: "a "s "o "u      \usepackage{subfigure}      \usepackage[colorlinks]{hyperref}  % ref      \usepackage{natbib}                % bibtex      \usepackage{cases}      \usepackage{algorithm}      \usepackage{algpseudocode}       \usepackage{wallpaper}           % | * * * * * * * * * * * * * * * * * * * * |      % |        fonts with math support          |      % | * * * * * * * * * * * * * * * * * * * * |           \usepackage[T1]{fontenc}      \usepackage{newtxtext, newtxmath}  % new TX times           \usepackage{esint}     % Alternate integrals signs      \usepackage{ngerman}  % after package mathdesign !      The rest packages and setting are for page layout, margin, etc. * * * I am sure `newtxmath` conflicts with some certain packages, How to figure this out? * * * Partial solution: Putting `esint` before `newtxmath` will eliminate this issue, but it produces the unchanged `\iint` symbol: ![enter image description here](http://i.stack.imgur.com/BnqHo.png)


title: How to fix BibTeX warning about missing author or key fields for webpage-type entries?

text: I need to reference some online databases in my LaTeX report. I have them included in my `.bib` file in this format:               @misc{StanfordScanRep,     title = {{The Stanford 3D Scanning Repository}},     howpublished = {\url{http://graphics.stanford.edu/data/3Dscanrep/}}     }      Compiling the LaTeX document gives **warnings** from **BibTeX** of this form:               Warning--to sort, need author or key in StanfordScanRep      There is no author for these databases. Is there any other way to fix this warning?


title: Switching math & text fonts mid-document

text: I would like to use the fonts given by `cmbright` for part of my document, and the default CM fonts or perhaps `mathpazo` for another part. What is the easiest, best way to do this? I have seen usually in other answers that changing math fonts can be a big ordeal. I am looking for a modern, clean approach to this (as much as possible). Thanks for your help!


title: References to lists in theorem-like environments/writing # symbol to files

text: A little warning in advance: This will be quite lenghty. I spent quite some time over the last few days trying to solve the following problem: I'm typesetting mathematical lecture notes and have used the `ntheorem` package to define various theorem-like environments and frequently encounter situations of the form               \begin{mythm}\begin{enumerate}       \item\label{a}       \item\label{b}     \end{enumerate}\end{mythm}      and ideally typing (in my case, as I use the `cleveref` package)               \cref{b}      should produce something of the form "Theorem 3 (b)" (i.e. including the name and number of the theorem environment the label is placed in). This turned out to be quite difficult and also not very well documented. The main problem is that there are two counters (`enumi` and the theorem-counter, lets call it `thmcnt`), as well as the theorem name involved. My first try was to, with the `etoolbox` package, hack myself into the `mythm`-environment, create a new macro every time it's started, which saves the theorem name and number and can be formated (and referenced) with the `cleveref` commands, i.e. something like               \BeforeBeginEnvironment{mythm}{        \crefname{\labelcode}{Theorem~\thethmcnt}        \edef\Label#1{\noexpand\label[\labelcode]{#1}}     }      Additionally, `\labelcode` should be something unique to this call of the environment, such as               \edef\labelcode{ctr@thm@\roman{chapter}@\roman{section}@\arabic{thmcnt}      and, as we're _before_ the execution of the environment, we need to remember to raise the counter by one (and set it back down once we're done), otherwise the theorem counter as saved in `\crefname` will be off by one. So ideally, in our above example, we could write               \begin{mythm}\begin{enumerate}       \item\Label{a}       \item\Label{b}     \end{enumerate}\end{mythm}      and `\cref{b}` should do just what we want it to. Unfortunately, as far as I could tell, `cleveref` ignores all `\crefname` commands after `\begin{document}`, so it's not quite that easy. What I tried then was to write all the formating information into a file and let LaTeX read it the next time round so that after upon compiling the document twice, all link information is accessible. Something like               \newread\foo     \immediate\openin\foo=\filename     \ifeof\foo\relax\else\input\filename\relax\fi     \immediate\closein\foo     \newwrite\blah     \immediate\openout\blah=\filename     \AtEndDocument{\immediate\write\blah{\string\endinput}\relax        \immediate\closeout\blah}      and then replace the corresponding line above by               \immediate\write\blah{\string\crefname{\labelcode}{Theorem~\thethmcnt}{}}      and that seems to work, although it seemed to me rather complicated for a (what I believed to be) relatively common problem. If anyone (is still reading ;)) and knows a more simple solution, I'd be glad and interested to know! There's still one small fault, however. When `cleveref` is used together with `hyperref` it also turns all references into clickable links. However, in the current solution, only the "(b)" is turned to a hyper-reference. The obvious approach is to use `cleveref`s `\crefformat` command, which has an, for this purpose, impractical syntax, namely, we would have to write something of the sort               \crefformat{\labelcode}{#2Theorem~\thethmcnt~#1#3}      in our `\BeforeBeginEnvironment` block, but of course this has the same problem as before that `\thethmcnt` produces the number of the theorem we're at _when referencing_ and not the one of the theorem we are making reference to. So I tried, as above to simply write it to our file with               \immediate\write\blah{\noexpand\crefformat{\labelcode}{#2Theorem~\thethmcnt~#1#3}}      but unfortunately this doesn't work and this is the point where I'm stuck: Writing this to a file doesn't work, as the `#` get replaced with `##` and that results in an error when LaTeX reads the file. It actually works if one manually replaces `##` by `#` in the output file, before rerunning LaTeX, but that's not a very satisfying solution. I guess one could write an external script and call it together with LaTeX upon every compilation or with the `\write18` command or something similar, but that isn't good for collaboration or cross-platform implementation, so does anyone know a LaTeX-internal solution? I already tried changing the catcode of `#` or trying to access it via `\char` and similar commands, but none of that worked, it always resulted in something like               ! Illegal parameter number in definition of \@groupformat.      Does anyone have any comments or ideas? Thank you for reading this far :) EDIT: This functionality is now incorporated in the `coolthms` package, available on CTAN.


title: tocloft and list of figures: get rid of page number of apperance

text: I would like to get rid of the page number of appearance in my List of figures, since it should only reference to the sources of the figures. I am working with tocloft. Following code gets rid of the first number, but I have the feeling, that it is the right way to handle that problem.               \renewcommand{\cftfigpagefont}[1]{}     \renewcommand{\cftfigafterpnum}{\cftparfillskip}


title: Is it safe to use \texorpdfstring from package hyperref, outside the sectioning commands?

text: I have several commands with some math that I use inside and outside the sectioning commands (`\section`, etc.). Of course, package `hyperref` complains. I do not want to scan the sectioning commands to put `\texorpdfstring` inside them. I thought to change the definitions so my commands use `\texorpdfstring`. In this case `\texorpdfstring` will appear outside the sectioning commands. I wonder wheter this will work, or I need another solution.


title: Configuring the section with \renewcommand in the appendix won't work

text: My appendix consits of a chapter which tells the TOC that an appendix exists. All other headings in my appendix are sections. Now I want that a section header looks like: > Appendix A. Some Text > > Appendix B. Some Text > > Appendix C. Some Text But the following line               \renewcommand{\thesection}{\Alph{section}}      which can be found on most of the appendix articles won't work. My minimal example looks like the following:               \documentclass[a4paper,12pt,headsepline,smallheadings,parident, numbers=noenddot, appendixprefix=true]{scrreprt}     \usepackage{appendix}     ...          \begin{document}     \chapter{Chapter1}     \section{Section1}     \section{Section2}          %Appendix     \appendix     \renewcommand\thesection{\appendixname\ \Alph{section}}     \pagestyle{empty}          %for linking the appendix to toc without pagenumber     \phantomsection     \hypertarget{link.appendix}{}     \addchap*{Anhang}     \addtocontents{toc}{\protect\usekomafont{chapterentry}%       \protect\hyperlink{link.appendix}{Anhang}}          \refstepcounter{chapter}     \newpage          %other try ...     %\renewcommand{\thesection}{\Alph{section}}          \section*{Class diagram} \label{class-diagram}     \section*{List of UI-Elementen} \label{list-ui-elements}     \section*{CD}     \end{document}


title: Using \Alph on \foreach loop argument

text: Here's basically what I try to do:               \begin{tikzpicture}       \foreach \x in {1,2,3,4,5}       {         \draw (\x,1) node{\Alph{\x}};       }     \end{tikzpicture}      However if I do that, I get               ERROR: Missing number, treated as zero.      I tried to prefix the number with `\the`:               \begin{tikzpicture}       \foreach \x in {1,2,3,4,5}       {         \draw (\x,1) node{\Alph{\the\x}};       }     \end{tikzpicture}      and got:               ERROR: You can't use `the character 1' after \the.      After searching around on TeX.SE, I thought the following solution should work:               \begin{tikzpicture}       \foreach \c [count=\x] in {{A},{B},{C},{D},{E}}       {         \draw (\x,1) node{\c};       }     \end{tikzpicture}      However that got me an error that `\x` is not defined. So, how do I get the desired result?


title: Language dependent custom command

text: I would like to define a command that slightly differs depending on the currently selected language in my document. My code:               \documentclass{article}      \usepackage[english,french,german]{babel}          \newcommand{\mynewcommand}[4]{%         \newcommand{#1}{%             \iflanguage{english}{#2}{%             \iflanguage{french}{#3}{%             \iflanguage{german}{#4}{}%             }}%         }%     }          \mynewcommand{\uno}{one}{une}{eins}     \newcommand{\whatever}{whatever} % if this is commented out the code works as desired          \begin{document}           \selectlanguage{english}     \uno     \selectlanguage{french}     \uno          \end{document}      Why do I get an error thrown at `\newcommand{\whatever}{whatever}` and how do I avoid that? ## Note: > In an earlier version I oversimplified my MWE using only two languages, in > that case no error is thrown


title: Filling polygons with color

text: Is there any good tutorial/approach in LaTeX for drawing polygons filled with color? **EDIT** : I would like to use **pdfLaTeX** interpreter


title: Using custom symbols

text: As comprehensive as the existing set of symbols is, it doesn't have _every possible_ symbol that could exist, and it really takes the fun out of inventing a new symbol if you can't typeset it nicely. One option I know of is "combining" existing symbols in some fashion, such as negative spaces. So I could write something like `m \gg\\!\\!= k`, but that technique has obvious limitations. What's the best approach here? ("Stop making up new symbols for no good reason" is a valid answer.) **Edit:** For a bit of context my actual interest is in nicer display for typeset source code, particularly making common operators written as multiple ASCII characters look more like a single symbol. This often results in symbols not otherwise used--but recognizable to other programmers--and for which the negative spacing technique suffices. As mentioned in a comment on vanden's answer, I was curious about the more general case.


title: Placing text inside graphs using pgfplot

text: My node markers disappear using this code. Is there a better way to do this?               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}[domain=0:3]     \begin{axis}[xlabel=Frequency(GHz), ylabel=Output Power(dBm)]     \addplot[color=blue,only marks]       table[x=x,y=y] {     x         y             100  12.9             130  7.7          140  8     144  5          150  6.3      150  12.2      213  -3.2                  };     \node[red,above] at (axis cs:102,12.9){\small{'12 MTT}};     \node[red,below] at (axis cs:104,12.9){\small{65nm CMOS}};          \node[red,left] at (axis cs:130,7.7){\small{'12 MWCL}};     \node[red,below left] at (axis cs:130,7.7){\small{0.13$\mu$m CMOS}};          \end{axis}     \end{tikzpicture}     \end{document}


title: Can a \newcommand Definition Contain Braces as Substitution Text?

text: The following example is completely counter-intuitive, but I need this in a bigger definition I'm not including here.               \newcommand{\openbrace}{{}      I need this to start a nested scope. Is this possible in LaTeX? I'm getting an error because the TeX engine is viewing this as unbalanced number of braces.


title: Tabu part of text in cell not visible

text: I have problems with the tabu, when I make a table with the code below, the contents of the last column in the first row is not all visible. Why is this? ![Screenshot from the table](http://i.stack.imgur.com/d0IcV.png)               \begin{table}[h]     \caption{Explanation }     \label{table:browsing_history}     \begin{center}     \begin{tabu} to 1.0\textwidth{|c|c|c|c|X[m,c]|}     \hline     User & Contacts & Timestamp & Restaurant & Ranking of selected restaurant \\ \hline     1 & ~ &  13.6.2013.10.33.43  & Restaurang Upper East & 3    \\ \hline     1 & 2,3 & 13.6.2013.10.34.2  & World Class  & 2  \\ \hline     3 & 4 &  14.6.2013.11.10.19 & Secret Recipe &  10   \\ \hline     \end{tabu}     \end{center}     \end{table}


title: Memoir boxed example environment

text: Memoir's manual has this example of _frame with title_ environment. I was wondering how can I add a counter to it? Say, to mimic the AMS theorem environments. Any better way of achieving this in memoir is also welcomed.                \documentclass[12pt,twoside,openright,a4paper]{memoir}      \newcommand{\FrameTitle}[2]{%      \fboxrule=\FrameRule \fboxsep=\FrameSep      \fbox{\vbox{\nobreak \vskip -0.7\FrameSep      \rlap{\strut#1}\nobreak\nointerlineskip% left justified      \vskip 0.7\FrameSep      \hbox{#2}}}}      \newenvironment{framewithtitle}[2][\FrameFirst@Lab\ (cont.)]{%      \def\FrameFirst@Lab{\textbf{#2}}%      \def\FrameCont@Lab{\textbf{#1}}%      \def\FrameCommand##1{%      \FrameTitle{\FrameFirst@Lab}{##1}}%      \def\FirstFrameCommand##1{%      \FrameTitle{\FrameFirst@Lab}{##1}}%      \def\MidFrameCommand##1{%      \FrameTitle{\FrameCont@Lab}{##1}}%      \def\LastFrameCommand##1{%      \FrameTitle{\FrameCont@Lab}{##1}}%     \MakeFramed{\advance\hsize-\width \FrameRestore}}%     {\endMakeFramed}     \begin{document}     \begin{framewithtitle}{Test} This is a test.     \end{framewithtitle}      \end{document}


title: Using \newcommand and \input

text: I like to use variables for my paths, so that if I migrate to another system/username, I don't have to change every path name. This does not seem to be working with the `input` command. I have the following in my `main.tex` file:               \newcommand{\rootFolder}{/home/user/Documents/tex}     ....     \input{\rootFolder/foo/bar.tex}      But I get the following error.               1 || ** \rootFolder/foo/bar.tex:          2 main.tex|86 error| Could not open "\rootFolder/foo/bar.tex"      My spider senses tell me it is not expanding `\rootFolder`. Can anyone tell me what I am doing wrong? **EDIT** User Peter Grill asked me for a minimal working example (MWE) so here it is. Also, I should have mentioned that I am getting this error from inside Vim. **test.tex** :               hello world      **main.tex (local path)** :               \documentclass{article}     \begin{document}     \input{test.tex}     \end{document}          % Works Fine      **main.tex (variable)** :               \newcommand{\rootFolder}{/home/user/Documents}          \documentclass{article}     \begin{document}     \input{\rootFolder/test.tex}     \end{document}          % Vim Error:     % 1 || ** \rootFolder/test.tex:                                                                                % 2 main.tex|5 error| Could not open "\rootFolder/test.tex"      **main.tex (edef)** :               \newcommand{\rootFolder}{/home/user/Documents}          \documentclass{article}     \begin{document}     \edef\ExpandedFileName{\rootFolder/test.tex}\input{\ExpandedFileName}     \end{document}          % Vim Error:     % 1 || ** \ExpandedFileName:                                                                                % 2 main.tex|5 error| Could not open "\ExpandedFileName"      **main.tex (no edef)** :               \newcommand{\rootFolder}{/home/user/Documents}          \documentclass{article}     \begin{document}     \ExpandedFileName{\rootFolder/test.tex}\input{\ExpandedFileName}     \end{document}          % Vim Error:     % 1 || ** \ExpandedFileName:                                                                                % 2 main.tex|5 error| Could not open "\ExpandedFileName"     % pdflatex Error:     % Undefined control sequence.     % l.5     \ExpandedFileName{\rootFolder/test.tex}\input{\ExpandedFileN...      **main.tex (expandafter)** :               \newcommand{\rootFolder}{/home/user/Documents}          \documentclass{article}     \begin{document}     \expandafter\input\expandafter{\rootFolder/test.tex}     \end{document}          % Vim Error:     % 1 test.tex|5 error| Don't use "\expandafter" in LaTeX documents


title: tipa with fontspec redux: tilde above characters

text: I'm trying to use the `tipa` package with `fontspec`, but they don't play nice together. I've read previous questions trying to solve the issues that come up (like this one), and that's the solution I've been using so far. However, I've bumped into a problem that I can't really understand. Below I include a (unrealistically brief) MWE taken from the question linked to above. The real document is much more complex, but this illustrates the problem nicely. The following document compiles with no warnings or errors for me:               \documentclass{article}     \usepackage{tipa}     \usepackage{fontspec}          \AtBeginDocument{       \renewcommand\textipa[2][r]{{\fontfamily{cm#1}\tipaencoding #2}}     }     \renewenvironment{IPA}[1][r]     {\fontfamily{cm#1}\tipaencoding}     {}          \begin{document}       \textipa{f@"nEtIks}     \end{document}      But adding a line like               \textipa{\~an\~a}      breaks it. What is really puzzling is that compilation halts without any sort of warning, even with `-interaction=nonstopmode` enabled. In the above example I could simply use `\~an\~a`, without the `tipa` environment, but in other cases this is not an option. I've read the recommendations for linguistics papers, but since all my transcriptions are already typed out using `tipa`, I'm reluctant to give it up and start doing the charmap spelunking that would be necessary. Is there a way to use `\~` in a `tipa` environment while still using `fontspec`?


title: Problem with TeXnicCenter and MikTeX

text: I had installed MiKTeX 2.7 and TeXnicCenter 1 Stable RC1. I had made my Ph.D. thesis files in that but due to an accident my hard drive is crashed and I have to make my thesis again. I am trying to install MiKTeX 2.9 and TeXnicCenter 2 Alpha 2. It is installed but when I am running my LaTeX file it is showing error that the source file is more than five years old. Please tell me what to do?


title: How to show subsubsections and paragraphs in table of content

text: I have a table of content that shows the chapters, section and subsections. However, I want to list the subsubsections and paragraphs too. In the document all of them are listed (enumerated) but for some unknown reason they are not displayed in the table of content. I have set the counters:               \setcounter{secnumdepth}{5}        \setcounter{tocdepth}{5}         I don't have anything else that explicitly tells to LaTeX to display the chapters, section, etc. in the table of content. The current result is something like: > Chapter   >  ...Section   >  ......Subsection The expected result would be: > Chapter   >  ..Section   >  ....Subsection   >  ......Subsubsection   >  ........Paragraph Sorry for my ugly list :P I'm using the following packages:               \usepackage[spanish,activeacute]{babel}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage[letterpaper]{geometry}     \usepackage{titlesec}     \usepackage{fancyhdr}     \usepackage{fix-cm}     \usepackage{setspace}      \usepackage{amsmath}     \usepackage{fmtcount}     \usepackage{threeparttable}     \usepackage{float}     \usepackage[font=small,format=plain,labelfont=bf,it]{caption}     \geometry{top=2.5cm, bottom=2.5cm, left=3.0cm, right=2.5cm}     \renewcommand{\rmdefault}{cmr} % Roman     \renewcommand{\encodingdefault}{T1}     \newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}     \setstretch{1.5}


title: Remove top rule from algorithm package

text: How can I remove only the top rule, which is above the caption, from the algorithm package? So not the two rules which are above and below the algorithm. I borrowed the mini example from: http://www.latex- community.org/forum/viewtopic.php?f=4&t=15388 And the question Remove the rule below the algorithm title - using Algorithm2e is similar only it is for the algorithm2e package and the solution didn't work.               \documentclass{article}     \usepackage[noend]{algorithmic}      \usepackage{algorithm}     \begin{document}     \begin{algorithm}     \caption{Iterate} \label{alg:it}     \begin{algorithmic}     \STATE n = 1     \FOR { $i=1$ \TO $n$ }        \STATE $print(i)$     \ENDFOR     \end{algorithmic}     \end{algorithm}     \end{document}      --edit-- The solution provided by egreg does not seem to work in combination with the floatrow package. How do I solve this?               \documentclass{report}          % url: http://www.ctan.org/pkg/floatrow      \RequirePackage{floatrow}          % url: http://www.ctan.org/pkg/algorithms     \RequirePackage{algorithm}          % url: http://www.ctan.org/pkg/algorithmicx     \RequirePackage{algorithmicx}          % url: http://www.ctan.org/pkg/algpseudocode     \RequirePackage[noend]{algpseudocode}          % url: http://www.ctan.org/pkg/listings     \RequirePackage{listings}          % url: http://www.ctan.org/pkg/etoolbox     \RequirePackage{etoolbox}          %% Setup list of algorithms     % ref: http://tex.stackexchange.com/questions/115023/combine-listoflistings-and     % -listofalgorithms-into-one-list     \newcommand{\algCaption}[1]{%       \caption{#1}       \addcontentsline{lol}{lstlisting}{\protect\numberline{\thealgorithm}#1}       \addtocounter{lstlisting}{1}     }     \AtBeginEnvironment{lstlisting}{\addtocounter{algorithm}{1}}     % ref: http://tex.stackexchange.com/questions/65993/algorithm-numbering     \renewcommand{\thealgorithm}{\arabic{chapter}.\arabic{algorithm}}     \renewcommand{\lstlistingname}{Algorithm}     \renewcommand{\lstlistlistingname}{List of Algorithms}          %% Setup source code formatting     \lstset{%       basicstyle=\ttfamily\scriptsize,       numbers=left,       numberstyle=\tiny,       stepnumber=1,       numbersep=5pt,       showspaces=false,       showstringspaces=false,       showtabs=false,       frame=tb,       tabsize=2,       captionpos=t,       breaklines=true,       breakatwhitespace=false,       title=\lstname,       xleftmargin=12pt,       framexleftmargin=12pt     }          \makeatletter     \newcommand\fs@ruled@notop{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled       %\def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}% <----removed       \def\@fs@pre{}%       \def\@fs@post{\kern2pt\hrule\relax}%       \def\@fs@mid{\kern2pt\hrule\kern2pt}%       \let\@fs@iftopcapt\iftrue}     \renewcommand\fst@algorithm{\fs@ruled@notop}     \makeatother          \begin{document}          \chapter{test}          \begin{algorithm}     \algCaption{Iterate} \label{alg:it}       \begin{algorithmic}[1]         \Require{$x$ and $y$ are packed DNA strings of equal length $n$}         \Statex         \Function{Distance}{$x, y$}           \State $z$ $\gets$ $x \oplus y$ \Comment{$\oplus$: bitwise exclusive-or}           \State $\delta$ $\gets$ $0$           \For{$i \gets 1 \textrm{ to } n$}             \If{$z_i \neq 0$}               \State $\delta$ $\gets$ $\delta + 1$             \EndIf           \EndFor           \State \Return{$\delta$}         \EndFunction       \end{algorithmic}     \end{algorithm}          \end{document}


title: Automatically placing TikZ in a float/figure

text: Is there a way to insert a diagram generated by Tikz/PGF directly from within a LaTex file? Currently, I am writing it in its own file, compiling it with `pdflatex` and then including the generated output file as an image.


title: pdfpages/hyperref - Contents link jumps to wrong part of page

text: I'm using pdfpages to combine multiple pdf documents; I would also like a front 'contents' page for the new file, using hyperref to allow me to jump directly to the correct page. The 'addtotoc' option in pdfpages almost works... the link produced by that goes to the correct page, but a few lines down from the start. Any suggestions? The sample code below also shows a workaround using `\hyperlink` - but this file will potentially have to be maintained/updated by other people who may not be so familiar with `\LaTeX`, so the more that can be automated (ie the less changes needed for each additional file), the better.               \documentclass{article}     \usepackage{pdfpages}     \usepackage[pdfstartview=FitH,bookmarks=true,colorlinks=true,linkcolor=blue]{hyperref}     \usepackage{bookmark}     \bookmarksetup{color=blue}     \setlength\parindent{0pt}          \begin{document}     \tableofcontents     \LARGE\hyperlink{Core1.pdf.1}{{Core 1}}\\     \LARGE\hyperlink{Core2.pdf.1}{{Core 2}}\\     \LARGE\hyperlink{Core3.pdf.1}{{Core 3}}\\     \LARGE\hyperlink{Core4.pdf.1}{{Core 4}}\\          \includepdf[pages=-,link,linkfit=FitH,addtotoc={1, section, 1, Core 1, Core1}]{Core1.pdf}     \bookmark[dest=Core1.pdf.1]{Core 1}     \includepdf[pages=-,link,linkfit=FitH]{Core2.pdf}     \bookmark[dest=Core2.pdf.1]{Core 2}     \includepdf[pages=-,link,linkfit=FitH]{Core3.pdf}     \bookmark[dest=Core3.pdf.1]{Core 3}     \includepdf[pages=-,link,linkfit=FitH]{Core4.pdf}     \bookmark[dest=Core4.pdf.1]{Core 4}     \end{document}


title: \perp and \parallel with equal height

text: I'm looking for a way to get symbols for perpendicular and parallel with an equal height. I want to use the symbols as a superscript to a function like               \Psi^{\perp/\parallel}      However, it looks kind of awkward since the two symbols are not displayed at the same height (the parallel sign is way larger). If I use               \scriptstyle\parallel      the symbols have approximately the same height but are not aligned properly in the vertical direction. * * * **Update:** I found out that               \Psi^{\perp/\raisebox{0.5pt}{$\scriptscriptstyle\parallel$}}(x)      produces what I'm looking for. Still this is kind of a hack and more consistent solution would be really appreciated.


title: Tikz: Arrow description closer to arrow

text: I want $Q(g)$ closer to the diagonal arrow in this tikz-picture. How can I manage that? Thanks.               \begin{tikzpicture}[description/.style={fill=white,inner sep=2pt},baseline={([yshift=1.5em]current bounding box.south)}]                   \matrix (m) [matrix of math nodes, row sep=2em,                   column sep=3em, text height=1.5ex, text depth=0.25ex]                   {                             Q(I^\pr) & Q(\quot{B}{B^\pr}) \\                             Q(I) & Q(B)\\                   };                         \path[->,font=\scriptsize]                         (m-1-1) edge node[auto] {$Q(f)$} (m-1-2)                         (m-1-1) edge node[auto,swap] {$Q(\iota^{I'}_{I})$} (m-2-1)                         (m-1-2) edge node[auto] {$Q(g)$} (m-2-1)                         (m-2-1) edge node[auto,swap] {$\bar{f}$} (m-2-2)                         (m-2-2) edge node[auto,swap] {$Q(p^{B}_{B/B'})$} (m-1-2)                         ;       \end{tikzpicture}      ![](http://i.stack.imgur.com/BR95v.jpg)


title: indenting exercises

text: I am typing up homework problems and I would like a very specific format but I'm not sure where to begin. I'd like the exercise numbers to line up in a column and then have the questions and the answers flush left with another "column" so to speak. To get an idea of what I mean this simple code works:               \documentclass{article}          \begin{document}     \begin{tabular}{l l}         5.  & This is the question          \\             & This is where the answer goes \\              11. & Another Questions             \\             & Another Answer                     \end{tabular}     \end{document}      This looks like what I want, but its annoying to put my whole assignment in a tabular environment and worry about alignment characters, ect. What I would really like is an environment where I can specify the exercise number and it will create the proper layout for the question and answer. Is this possible? Thanks!


title: How to add a picture onto an existing pdf file?

text: I have a scanned pdf file which is an application form, and a picture which is the scanned version of one's signature (for example, this one) and can be in any image format such as eps or png. I would like to put the signature picture on the blank space right to "APPLICANT:" on the second page of the application form. I wonder how to do that in TeX? I have tried the following non-TeX methods, but none succeeded.   1. The first way is using gimp. I first import the application form into gimp, and then paste the signature picture on the space right to "APPLICANT:" on the second page of the application form.  But the problems are that:     * It seems that I can only import one page of the application form into gimp, not all of the two pages.      * Also when I save the modification, the closest format to pdf I can save to is ps, and the resolution has been downgraded and the storage size of the saved file is 10 times bigger than the original application form and the signature picture.   2. The second way is using Libreoffice Draw. I have installed the libreoffice-pdfimport package. But after I import the application form into Libreoffice Draw,      * all the scanned content is not imported, and      * the layout is different from the layout of the original application form. So can TeX help? Can it lay the signature picture directly on the application form pdf file,   * without having to convert between formats,    * without having to create much bigger files while keeping the original resolution,   * without having to split and combine pages of a multi-page pdf file,   * without having to rasterize other parts of the pdf file, i.e. without losing the text I later added to the application form pdf file by having to convert the whole pdf into images. Thanks!


title: Option "abnt-year-extra-label" of package "abntcite" does not work

text: Just did as recommended by the `abntcite` package docs, and set `\usepackage[alf,abnt-year-extra-label=yes]{abntcite}` in order to have references with same author and same year identified as `year + letter`, e.g.: citation `(Silva, 2011a)` and reference `Silva, A. M. <title> ... 2011a.` However, it didn't work. Other people complained as well, but no solution til now. Sugestions, please?


title: Overlapping tikz nodes with background fadings

text: Following the first tutorial in the TikZ manual, I tend to take steps to improve the legibility of tick labels when placed over gridlines. I prefer to use a fading rather than a plain white rectangle. However, if two nodes with faded background get placed right next to each other, one will "fade" over the text of the other. Putting them all in a transparency group just seems to kill the fading effect altogether. How do I make the fadings in two overlapping nodes not act on each other's text? (Preventing their fadings from stacking would be nice also, but is less important.) Unfortunately, I was unsuccessful in uploading images that demonstrate the transparency, but here's the code for some minimal working examples: What it's supposed to look like, more or less:               \documentclass[tikz]{standalone}     %     %With the following code (from the TikZ manual) installed,      %the option "path fading=fade out"     %will cause a filled shape or node to be opaque in the center and      %gradually fade to transparency at the edges.     \usetikzlibrary{fadings}     \tikzfading[name=fade out,                 inner color=transparent!0,                 outer color=transparent!100]     %     \begin{document}     \begin{tikzpicture}[scale=1.0]         \draw[help lines] (-4.9,-4.9) grid (4.9,4.9);         \draw[thin,->] (-5,0) -- (5,0) node[right]{$x$};         \draw[thin,->] (0,-5) -- (0,5) node[above]{$y$};         \begin{scope}[ticklabel/.style={fill=white,path fading=fade out,text opacity=1.0}]         \foreach \x in {-4,-3,-2,-1,1,2,3,4}         {             \node[below,ticklabel] at (\x,0) {$\x$};         }         \foreach \y in {-4,-3,-2,-1,1,2,3,4}         {             \node[left,ticklabel] at (0,\y) {$\;\y$};         }         \end{scope}     \end{tikzpicture}     \end{document}      What it looks like when nodes are too close together, with background rectangles to help illustrate the effect:               \documentclass{standalone}     \usepackage{tikz}     %     %With the following code (from the TikZ manual) installed,      %the option "path fading=fade out"     %will cause a filled shape or node to be opaque in the center and      %gradually fade to transparency at the edges.     \usetikzlibrary{fadings}     \tikzfading[name=fade out,                 inner color=transparent!0,                 outer color=transparent!100]     %     \begin{document}     \begin{tikzpicture}[scale=0.4]         \fill[black!20] (-5,-5) rectangle (5,5);         \draw[help lines] (-4.9,-4.9) grid (4.9,4.9);         \draw[thin,->] (-5,0) -- (5,0) node[right]{$x$};         \draw[thin,->] (0,-5) -- (0,5) node[above]{$y$};         \begin{scope}[ticklabel/.style={fill=white,path fading=fade out,text opacity=1.0}]         \foreach \x in {-4,-3,-2,-1,1,2,3,4}         {             \node[below,ticklabel] at (\x,0) {$\x$};         }         \foreach \y in {-4,-3,-2,-1,1,2,3,4}         {             \node[left,ticklabel] at (0,\y) {$\y$};         }         \end{scope}     \end{tikzpicture}     \begin{tikzpicture}[scale=0.4]         \fill[black!20] (-5,-5) rectangle (5,5);         \draw[help lines] (-4.9,-4.9) grid (4.9,4.9);         \draw[thin,->] (-5,0) -- (5,0) node[right]{$x$};         \draw[thin,->] (0,-5) -- (0,5) node[above]{$y$};         \begin{scope}[ticklabel/.style={fill=white,path fading=fade out,text opacity=1.0},transparency group]         \foreach \x in {-4,-3,-2,-1,1,2,3,4}         {             \node[below,ticklabel] at (\x,0) {$\x$};         }         \foreach \y in {-4,-3,-2,-1,1,2,3,4}         {             \node[left,ticklabel] at (0,\y) {$\y$};         }         \end{scope}     \end{tikzpicture}     \end{document}      The example on the right shows the effect of putting the nodes inside a transparency group.


title: Suggestions for transitioning from paralist to enumitem package

text: Based on the suggestions on What are the differences between using paralist vs. enumitem, I am transitioning from using `paralist` to `enumitem` and have encountered a few issues.   1. There are a few places where I use paragraph mode list `inparaenum`, so was wondering if I can have both packages loaded, and use `enumitem` for the `enumerate`, `itemize`, and `description` environments, but still be able to use `inparaenum` from the `paralist` package? Are there any problem in loading both packages? It seems that the `paralist` has to be loaded **before** `enumitem`.   2. I noticed that there is at least one small difference in spacing between the two packages. The standard `enumerate` leaves a little extra space on the left hand side prior to the item label. That's just one thing I noticed, and there might be other spacing issues that I have not yet encountered. So, are there settings that I can use to have {enumitem} produce spacing as identical as possible to what was produced by {paralist}. Or has someone else had this issue and come up with a bunch of settings to do this? This can be seen by switching which one of the list environments are commented out. MWE:               \documentclass{article}          \usepackage{paralist}     %\usepackage[shortlabels]{enumitem}          \begin{document}     \begin{enumerate}[(a)]         \item One         \item Two     \end{enumerate}     \end{document}