title: Extracting x, y coordinates of an arbitrary point in TiKZ while using yscale and xscale

text: Inspired by Extract x, y coordinate of an arbitrary point in TikZ, I am trying to use the x coordinate of a point to draw another element. However, when I use the `yscale` and `xscale` commands, the extracted coordinates do not similarly scale up. Here is an example:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}          \begin{tikzpicture} % First picture       \draw[->] (0,0) -- (2,0) ;       \draw[->] (0,0) -- (0,2) ;                \coordinate (z) at (0.5,0);       \path (z) node[below] {$z$};       \pgfgetlastxy{\XCoord}{\YCoord};            \coordinate (kink) at (\XCoord,\XCoord);       \draw[gray] (0,0) -- (kink) node[above, red] {$c$};     \end{tikzpicture}          \begin{tikzpicture}[yscale=4,xscale=6] % Second picture       \draw[->] (0,0) -- (2,0) ;       \draw[->] (0,0) -- (0,2) ;                \coordinate (z) at (0.5,0);       \path (z) node[below] {$z$};       \pgfgetlastxy{\XCoord}{\YCoord};            \coordinate (kink) at (\XCoord,\XCoord);       \draw[gray] (0,0) -- (kink) node[above, red] {$c$};     \end{tikzpicture}          \end{document}      ![First picture with no xscale/yscale](http://i.stack.imgur.com/n2Hie.png) ![Second picture with xscale/yscale](http://i.stack.imgur.com/4onCG.png) In the first picture, the extracted coordinate works as expected. In the second picture, I try to scale up the entire picture, but the extracted coordinate now extends off of the page. How do I get the extracted coordinate to scale correctly?


title: Align text to right-hand edge of centered image?

text: I am including an image in a beamer presentation, centred, and want to give an unintrusive attribution link, just under the picture, right-aligned to the right-hand edge of the image. In other words, I’d like something almost like what’s produced by               \documentclass[10pt]{beamer}          \begin{document}          \begin{frame}       \begin{center}          \includegraphics[width=0.6\textwidth]{file_extensions.png} \\          \url{http://xkcd.com/1301}       \end{center}     \end{frame}          \end{document}      except with the url shifted horizontally, so that its right-hand edge is flush to the right-hand edge of the image. How can I achieve this? (Image file for MWE.)


title: \textup command not working inside \textsc

text: I believe it's going to be difficult getting a solution for my issue the way I have to put it, because I'm afraid I cannot provide an MWE for it. The issue is that when I type something like `\textsc{\textup{upshape text} smallcaps text}`, what I get is everything typeset in small caps. I have been able to check that this issue is not dependent on the font I'm using. I cannot provide an MWE because this happens in documents depending on a class where I'm loading a very long list of packages and where I'm doing a lot of processing. So, it'd be helpful if somebody could just say what may be going on here even if it is only as a possibility or as a guess, because everything else works fine. Compilation is on `pdfLaTeX` and in the class I'm using `expl3` code. EDIT: As for my intentions, I'm collecting some token lists and setting everything therein in small caps except for what I may have marked in the original text with `\textup`. Hope this helps. EDIT 2: I've located the source of the problem. It boils down to something within the `biolinum` package. The next MWE replicates the problem:               \documentclass{memoir}          \usepackage{biolinum}          \begin{document}     \textsc{\textup{regular text} small caps}     \end{document}            Now, does anybody know what is the reason why this happens? And, of course, my appreciation to all those who have guessed, hinted, or provided any critical remarks.


title: resizebox doesn't respect linebreaks?

text: I'm trying to scale some text up. It seems like `\resizebox` (from `graphicx`?) and `\adjustbox` (from the `adjustbox` package) ignore line breaks:               \resizebox{5cm}{!}{Hello\\     world}      Is there a way to scale things up that respects line breaks?


title: TikZ "callout" positioning problem

text: I have just recently upgraded my `TeXLive` from version _2010_ to _2011_ (OS versions Ubuntu 10.10/Maverick 32-bit and Windows 7/64 bit).               This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011)     (format=pdflatex 2011.8.10) 15 AUG 2011 09:34      To test the new version I thought it would be a good idea to try to compile some of my older documents. It all went flawlessly until I got to a paper that had some TikZ graphics, which produced errors. After some investigation I had found that the problem was caused by some positioning elements of TikZ. Here is a MWE:               \documentclass{report}          \usepackage{tikz}     \usetikzlibrary{shapes.callouts}          \begin{document}     \begin{figure}[tb]     \begin{center}     \begin{tikzpicture}[remember picture, note/.style={rectangle callout, fill=#1}]     \draw [help lines] grid(3,2);     \node [note=red!50, callout relative pointer={(0,2)}] at (0,0) {Good};     \node [note=blue!50, callout relative pointer={(0,2)}] at (2,0) {Good};     %\node [note=blue!50, callout absolute pointer={(0,2)}] at (2,0) {Error};     \end{tikzpicture}     \end{center}     \end{figure}     \end{document}      The above code is a slightly modified version of the sample found in the TikZ & PGF Manual Version 2.10, page 454 (2nd sample). _The error is caused by the commented line._ Whenever absolute positioning is used, an error is generated like the one below:               ! Undefined control sequence.     \pgf@sh@bg@rectangle callout ...f@sh@np@\pgf@test                                                    \noexpand \endcsname }\ede...     l.24 ...lute pointer={(0,1)}] at (1,0) {Absolute};      I would appreciate any pointers. Cheers.


title: Don't show bibliography heading if there aren't any citations

text: We use LaTeX to generate PDF documents dynamically from the web. Sometimes reports have bibliography citations, and sometimes they don't. At the end of our LaTeX document, we have a bibliography block, where all citations are automatically listed (we use BibTeX). But what we want to avoid is to show the bibliography heading when it is empty (with no bibliography entries). Our actual solution is to add the bibliography block also dynamically, after searching for citations in the final document text, and ensuring that we have, at least, one citation. Is there another way to do that with LaTeX? I'm thinking about some bibliography block setting or something like this ...


title: How to align a long math line without centering text?

text: This is not an equation, it's just a long math line. I want to break it into lines with right alignment. I tried several solutions including `align`, `multline`, but somehow I can't get it to work properly. It always forces the text to center. If I use `equation` \+ `split`, it still force the text center. Is there a way to get rid of the centering property? Thank you. Minimal example               \documentclass{article}     \usepackage{mathtools}     \setlength{\parindent}{0pt}     \setlength{\parskip}{1ex}          \begin{document}         $X \times Y = \{$                 $\{a, b\}, \{a, c\}, \{a, e\}, \{a, f\},$ \\                 $\{b, b\}, \{b, c\}, \{b, e\}, \{b, f\},$ \\                 $\{c, b\}, \{c, c\}, \{c, e\}, \{c, f\},$ \\                 $\{d, b\}, \{d, c\}, \{d, e\}, \{d, f\} \}$      \end{document}      **Edit** (according to Stefan Kottwitz's solution) ![enter image description here](http://i.stack.imgur.com/P1pfv.png)


title: TOC "Appendices" wrongly entry comes after 1st appendix entry when use \include

text: I use the appendix package with its toc option for a book document. If the first of several appendices is inserted by using \include, then the "Appendices" heading in the TOC incorrectly appears after the entries for the first appendix. This happens no matter whether I use the \appendices command, as shown below, or else the appendices environment. The same thing happens if I don't use the appendix package but instead just the \appendix command and use an \addcontentsline to insert the "Appendices" item in the TOC. This behavior does not occur if the body of the appendix is inserted directly in the main document. The behavior does not occur, either, if I use \input instead of \include. However, I really need to use \include. Here's a minimal failing example. (The 2nd appendix is here just to highlight the effect in TOC. In the main file, I have a 2nd appendix right there, but it makes no difference if I put that in a separate file and use another \include for it.)                %%%%% main file %%%%     \documentclass{book}     \usepackage[toc]{appendix}     \begin{document}     \frontmatter     \tableofcontents     \mainmatter          \chapter{First things}     This comes first.          \appendices          \include{appendixA}          \chapter{Another addendum}     This is some more information.          \end{document}      The file appendixA:               \chapter{The initial stuff}     All about `A'.          \section{A section within the initial appendix}     Yet more.     \endinput


title: Transparent image background in beamer

text: I want to add a background image in my `beamer` presentation. The thing is that when I use               \usebackgroundtemplate{     \includegraphics[width=\paperwidth,     height=\paperheight]{cern-logo.jpg}     }      in my `preamble`, the image has its true colors, meaning that it is not opaque or transparent. Is there a way to achieve that? ![](http://i.imgur.com/9wTIH.jpg)


title: Constrain a float to be positioned on right page only?

text: How can I constrain a float to be positioned only on a new right (recto) page and never on a verso page? I'd like behaviour similar to               \begin{figure}[p]      But as if there were a positioning option 'r' like...               \begin{figure}[r]      Which would only allow the float on a new recto page. This is different to the request in this question: Figures on left pages, text on right ones with class book, numbering only on right pages or behaviour in the package `semioneside` which give text only on one side and figures only on the other. As a MWE I'd like my A and B to be on odd pages with text on the even pages.               \documentclass{article}     \usepackage{lipsum}     \usepackage{graphicx}               \begin{document}          \begin{figure}[p]       \resizebox{!}{\textwidth}{A}     \end{figure}     \begin{figure}[p]       \resizebox{!}{\textwidth}{B}     \end{figure}          \lipsum     \lipsum          \end{document}


title: Change edge color of pgfplots patches

text: I am plotting patches and don't them to be colored according to their z-values. Instead, I want to define the colors by myself. Here is an example:               \addplot3[area legend,patch,forget plot,patch type=triangle,color=red,opacity=0.8]     table[row sep=crcr, point meta=\thisrow{c}] {%     x   y   z   c\\     0   0   0   0\\     0   0.3 0   0\\     0.3 0   0   0\\     };      I can override the color with color=red, but the edge color of the patches is still plotted in different Colors: ![Patch Plot](http://abload.de/img/matlab-2zwj5n.png) I can't find the appropriate parameter to change them to black. Has anyone an idea of how to do that? Here is a full example:               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \pagestyle{empty}          \begin{document}          \begin{figure}[htb]     \centering       \begin{tikzpicture}         \begin{axis}[%           width=0.5\linewidth,           height=0.5\linewidth,           view={-213.5}{18},           scale only axis,           xmin=0,           xmax=1,           ymin=0,           ymax=1,           zmin=0,           zmax=1,           axis x line*=bottom,           axis y line*=left,           axis z line*=left]              \addplot3[area legend,patch,forget plot,patch type=triangle,color=white,opacity=0.8]           table[row sep=crcr, point meta=\thisrow{c}] {%           x     y   z   c\\           0     0   0   0\\           0     0.3 1   0\\           0.3   0   0.5 0\\};         \end{axis}       \end{tikzpicture}%     \end{figure}          \end{document}


title: \par in the parameter text (as an argument delimiter) and \vbox{#1} in an \everypar macro

text: This is basically a question about TeX's error messages. I am confused by a cryptic error message that TeX gives me when I try to do the above. I have tried to isolate it, but have come no further than the following:               \def\foo#1\par{\vbox{#1}}     \def\bar#1\par{\hbox{#1}}          \let\macro\foo     \macro A paragraph consisting of text.          \let\macro\bar     \macro A paragraph consisting of text.          \everypar={\macro}     A paragraph consisting of text.          \let\macro\foo     A paragraph consisting of text.          \bye      This is all accepted by TeX, except the last example, which gives the error message:               ! Argument of \macro has an extra }.     <inserted text>                  \par      <to be read again>                     }     l.16       "l. 16" points to the line before the `\bye`, i.e. to the moment where TeX encounters two consecutive newlines (causing it to insert a `\par` token, I assume). I am aware that `\everypar` is inserted _after_ the horizontal list has begun, and that it is not a very wise and clean idea to gobble up the paragraph _after_ it has begun (so "the rest of the paragraph" would be the better description) and to typeset it inside a vbox. But then               \indent\vbox{This is some text.}      is accepted. Of course, if you typeset a whole paragraph inside a vbox inside the paragraph, the whole paragraph is typset to `\hsize` and shifted to the right by `\parindent` as a whole, which looks awful. But that is not my point. What I would like to understand is why it is apparently not possible to a) put a macro in `\everypar` which b) gobbles up the whole (or rather: rest of the) paragraph and c) puts it into a vbox, while all of these things are apparently possible in isolation? In particular, if we only change c) to an hbox instead of a vbox, the error message disappears. In other words: Why does TeX suddenly see an extra `}` when we use a vbox? As I have just typed all of this, something is beginning to dawn on me: Is the problem due to the fact that inside a vbox, TeX starts a new horizontal list, inserting the contents of `\everypar` once more, triggering an endless recursion? In that case, it would have nothing to do with the \par as an argument delimiter but simply with the fact that within `\everypar`, one should not start a new paragraph. Indeed, if I say               \def\macro#1\par{\vbox{\noindent}#1}      (assuming `\macro` is still in `\everypar` as above), the same error happens when the next paragraph is typeset. So now it seems to me I have understood where the error comes from, but what does the error message mean? Why does TeX see an extra `}`? And why does it exactly report it after it has gobbled up the argument to `\macro`? If I say               \everypar={\vbox{\noindent}}     A paragraph consisting of text.      I get the error message               ! TeX capacity exceeded, sorry [semantic nest size=500].     <everypar> \vbox {\noindent                                  }     [many similar lines left out]     ...     l.17 A            paragraph consisting of text.      which seems clear in the context of what I seem to have figured out above. **Edited in response to egreg's excellent explanations:** [As to the point that my code as given above indeed does NOT cause any error messages; it does so -- and illustrates the problem I had -- if you put two empty lines between the examples instead of one.] Your tip of putting \everypar={} inside the vbox is great, because that is local to the vbox, right? What I would still love to know, however, is why in some examples, TeX reports an exceeded "nest size", which I find understandable, and in others (where the reason is the same), that the argument to the macro in everypar has an extra }. I know that TeX's error messages are notoriously cryptic, but I would like to know if it might be possible to make some sense of them anyway. I will have a try: When, after \everypar has been set to {\macro}, TeX encounters the next paragraph, it executes and expands \macro, which gobbles up the paragraph (and discards the implicit \par at the end) and then opens a vbox in which it puts the paragraph. Because the paragraph text in the vbox starts a new paragraph, \everypar is executed again, calling \macro again, which again gobbles up the paragraph text, but encounters the closing } of the vbox before any \par token. Thus, it is the second call of \macro which triggers this error message. Is that the whole story? I would actually have expected that a closing } in a vbox should cause an implicit \par.


title: a way to use bibliography utf8 @string entry keys

text: Any suggestions how to allow UTF-8 `@string` macros in the `mwe.bib` file? [lines 537-539]               @string{          Uà   =   {Università} #.                           }     @string{        Uàdi   =   Uà#di                                     }     @string{      UàdSdi   =   Uà#degli# {Studi} #di                     }          @PhdThesis{mwe,       author =   {Some Guy},       title =    {On something},       school =   Uàdi# {Padova},       %school =      UàdSdi# {Bologna},       year =     2010,     }      I have this setup:               \RequirePackage[T1]{fontenc}     \RequirePackage[utf8]{inputenc}     \RequirePackage{newunicodechar}     \RequirePackage[backend=biber%     ,bibencoding=utf8,texencoding=utf8,style=numeric-comp%     ,sorting=none,sortcites=true,block=none,indexing=false%     ,citereset=none,isbn=true,url=true,doi=true]{biblatex}%      and use this in `mwe.tex`:               \addglobalbib[datatype=bibtex,type=file]{mwe.bib}     \begin{document}     \cite{mwe}     \printbibliography     \end{document}      then run:               biber mwe      and get:               WARN - BibTeX subsystem: /tmp/I5WGNx_9Fe/mwe.bib_16327.utf8, line 537, warning: overriding existing definition of macro "u"     ERROR - BibTeX subsystem: /tmp/I5WGNx_9Fe/mwe.bib_16327.utf8, line 538, syntax error: found "di", expected "="


title: Suppress field using chicago bibliography style

text: I am using the natbib package and chicago style to create my reference list. Some of the references in the bib file contain a field called "note" which is printed if I use the following:               \documentclass{article}     \usepackage{natbib}     \begin{document}          \nocite{*}          \bibliographystyle{chicago}     \bibliography{test}          \end{document}      The bib references look like this:               @article{hambrick_influence_1996,         title = {The Influence of Top Management Team Heterogeneity on Firms' Competitive Moves},         volume = {41},         copyright = {Copyright Â© 1996 Johnson Graduate School of Management, Cornell University},         issn = {0001-8392},         url = {http://www.jstor.org/stable/2393871},         doi = {10.2307/2393871},         number = {4},         journal = {Administrative Science Quarterly},         author = {Hambrick, Donald C. and Cho, Theresa Seung and Chen, {Ming-Jer}},         month = dec,         year = {1996},         note = {{ArticleType:} research-article / Full publication date: Dec., 1996 / Copyright Â© 1996 Johnson Graduate School of Management, Cornell University},         pages = {659--684}     }      How do I suppress this "note" field? Another follow-up question: is there a way to suppress the "month" field in the printed reference? Thanks!


title: Page header alternatively author name and short title

text: I'm using the `a4paper` environment for a scientific article and I want to make headers that display alternatively author names and short title each page, while getting rid of all page numberings. We did get rid of page numbers by using `\pagestyle{empty}` but we can't do the header thing. How should we make a header that displays name and title alternatively each page?


title: How to use a particular field in a specific entry type for sorting in biblatex

text: In answering this question: Creating Entry in Bibtex for Executive Orders I gave a `biblatex` solution which used a new entry type for Executive Orders. This particular entry type has no author, but it's possible (and in fact likely) that in some situations, multiple entries with the same year might be cited in a single document. In this situation, there needs to be some way of deciding the sort order for that entry. In this particular case, it would make the most sense to sort by the Number field. The entry has the following fields:               @executiveorder{Executive-Order2007,             Number = {13423},             Pages = {919},             Volume = {3},             Year = {2007}}      So the question is this: how do I add sorting information for odd entries like this that don't have the normal elements that one would sort on?


title: How do I remove white space above itemize command in beamer using enumitem

text: I am new to \LaTeX. I am trying to use solution give on How to remove the whitespace BEFORE itemize/enumerate? to remove vertical space before itemize environment using enumitem and beamer. But I don't get the desired result. Is there a solution to this problem?


title: Manual exercise question numbering

text: I am using exercise package to list exercises/questions. I am defining exercise list like this:               \begin{ExerciseList}       \Exercise{Exercise title}            \ExeText       Some exercise introduction       \Question{First question}       \Question{Second question}       \Question{Third question}     \end{ExerciseList}      In the output questions are numbered like this:               1. First question      However my desire is to have following output:               (a) First question      Actually it would be best if I could manually define list letter for question as I anticipate some gaps in numbering later. For example `\Question{e}{Some question}`. From the package source I see that questions are translated to list items:               \def\@QuestionHeader{\item[{\makebox[0cm][r]{\begingroup\@getQuestionInfo%     \QuestionHeaderDifficulty\QuestionNB\endgroup}}]%     \begingroup\@getQuestionInfo\QuestionHeaderTitle\endgroup\ignorespaces}      However I am unsure on how to redefine the macro in order to accomplish my goal.. Any ideas or hints?


title: Correct uniform font formatting for included graphics

text: # Uniform Font Formatting for Included Graphics as in the Rest of the Text This question is not about vector or raster imagery, but about the application of **_uniform font_** in the entire file including axis labels of graphics! Has anyone experience with types of graphics files which do that? MWE:               \documentclass{report}     \usepackage{graphicx}          \begin{document}     \includegraphics{PlotGraphics1.eps}     \includegraphics{PlotGraphics2.pdf}     \includegraphics{PlotGraphics3.jpeg}     \includegraphics{PlotGraphics4.png}     \end{document}      I search for one which to which LaTeX can apply correct font formatting (e.g. for legends, axis, ...) at including it in the LaTeX document? Then I do not have to convert my MATLAB plots etc. to tikz at first.


title: How to prevent indent on second line with packed itemize?

text: How to prevent indent on second line with packed itemize instead of itemize? In other words I dont want "Major" to be indented.               \documentclass[letterpaper]{article}     \usepackage[empty]{fullpage}% http://ctan.org/pkg/fullpage     \newenvironment{packed_itemize}     {\begin{itemize}     \setlength{\itemindent}{-10pt}     \setlength{\itemsep}{-0.3pt}}     {\end{itemize}\vspace{-0.5em}}          \newenvironment{packed_inner_itemize}     {\begin{packed_itemize}}     {\end{packed_itemize}\vspace{0.25em}}     \newcommand{\ressubheading}[4]{%     \item\textbf{#1} \hfill #2\null\\     #3 \hfill #4%     }     \begin{document}     \begin{packed_itemize}      \ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}       \ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}       \ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}       \ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}       \end{packed_itemize}     \end{document}


title: How to model {smallmatrix} with {array}?

text: It is pretty normal, I guess, to use `\begin{array} ... \end{array}` to model matrices, when more control is required than you get with `pmatrix`, `bmatrix`, etc., with the proper `\left` and `\right`, and the relevant symbol. Now, I need `smallmatrix`, but I need more control. Basically, I'd like to model `\begin{smallmatrix} ... \end{smallmatrix}` with `\begin{array} ... \end{array}`. It's not as easy as just putting a command left and right of `\begin{array} ... \end{array}`. Should I use `\scalebox`?               \begin{array}{c|c}         a & b \\ \hline c & d     \end{array}      As you can see, I'm using verical and horizonal lines. Now I'd need that, but in this matrix:               \begin{smallmatrix}         a & b \\ \hline c & d     \end{smallmatrix}      Is that even possible?


title: Hyphenation for mixed language document

text: I'm currently writing my Bachelor's thesis in English but have to include a German abstract. Hyphenation will not work for German words unless I include the `ngerman` package. But then English words are not hyphenated. Is there a way to switch the language for a specific chapter only?


title: Geometry: showframe + landscape

text: I'm using `\usepackage[showframe]{geometry}` and I'm seeing that when I use a `landscape` environment (added by `pdflscape` package) the frame doesn't seem to be OK. Is this an erratum? Is there any way to correct this? Here is my MWE:               \documentclass[a4paper,twoside,11pt,openright]{report}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage[outer=25mm,inner=35mm,vmargin=20mm,includehead,includefoot,headheight=15pt,showframe]{geometry}     \usepackage{pdflscape}               \begin{document}     Hello.  First page.  Everything ok.          \begin{landscape}     Why is the frame off?     \end{landscape}          \end{document}      And this is the result: ![enter image description here](http://i.stack.imgur.com/mTLS7.png)


title: TexLive installation unable to find system fonts in OSX Mavericks

text: It seems my TeX system on OSX Mavericks is no longer able to find my system fonts. My tex documents no longer compile, and when I do:               $ xetex opentype-info.tex       I get:               This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)     restricted \write18 enabled.     entering extended mode     (/usr/local/texlive/2013/texmf-dist/tex/xetex/xetexfontinfo/opentype-info.texkpathsea:make_tex: Invalid fontname `Latin Modern Roman/ICU', contains ' '          ! Font \testfont="Latin Modern Roman/ICU" at 12.0pt not loadable: Metric (TFM)      file or installed font not found.     l.26 \font\testfont="\myfontname/ICU" at 12pt      The fonts I'm trying to use ARE in my OSX system fonts. I think the problem is that LaTeX can't locate them. In LaTex I have declarations like:               \setsansfont{ChunkFive}      and               \newfontfamily\mytitlefont[Color=signalflare]{ChunkFive}      This is resulting in errors. Any suggestions?


title: Date not being displayed in title

text: Could anyone tell me why the date is not being shown in the title of my document. The document class is `proc`. If I remove `\date{\today}` my title moves down a return, but no date is displayed when I leave it in.               \title{Title}     \author{Me\\             Email\\}     \date{\today}     \maketitle


title: PDF colour model and LaTeX

text: (Strictly speaking, this is a question about XeLaTeX and the `xcolor` package but I’m assuming that the issue is actually with the color model of PDF.) I’m having the problem that colours in my PDF don’t match. For example, I screen grabbed a colour value as RGB, declared it in my document and the resulting colour was completely different. To illustrate: ![screenshot-1](http://i.stack.imgur.com/uGEMc.jpg) Both colours were grabbed off the screen – on the left, from the PDF generated by XeLaTeX. On the right, the original colour whose RGB value I tried using in LaTeX (in case my issue isn’t clear: the colours on top are differnt, yet they have the same HSB values). So I thought that perhaps RGB doesn’t map without loss to whatever colour model PDF used and tried the obvious alternative – CMYK, which, after all, is often used in print (right?). Again, the colours are off, but now less perceptibly. Another example (this time using CMYK values): ![screenshot-2](http://i.stack.imgur.com/vz3ml.png) The colour is supposed to have the CMYK value (0.94, 0.63, 0.04, 0.07). I have declared the colour in my code as follows:               \definecolor{primary}{cmyk}{0.94,0.63,0.04,0.07}      The bottom half of the picture is created by TikZ. The top half is actually an EPS that I included via `includegraphics`. The EPS was created in Inkscape. Neither of the above colours has the correct CMYK value when examined with a colour picker: The top is (0.96, 0.67, 0.08, 0.19). The bottom is (0.92, 0.61, 0.06, 0.09). (Incidentally, when I try to enter the “correct” CMYK value in Inkscape, it “auto-corrects” my value to some other value. Wut?) Now, this mightn’t seem like a TeX related question at all. But, long story short, **How can I reliably reproduce colours in pdfLaTeX/XeLaTeX?** * * * I know that the issue is confounded by the fact that PNG (which is the format of the above screenshots) uses an own colour model and so the screen shots may look different on your PC than on mine. But since I pasted the colours into the same image, I think that the _difference_ should be preserved.


title: Produce pdf of selected sections

text: I'm writing a commissioned chapter for a handbook and I want to produce a pdf of three specific sections of my document to send to a colleague who is writing a different chapter for the same handbook (this is because there are some issues that span both chapters and we want to minimize overlap). Obviously, I can just copy-paste the relevant sections into a fresh tex file and produce a pdf from there, but I'm curious if there is a way of telling LaTeX "produce a pdf that contains only sections xxx, yyy, and zzz of this tex file". I'm running TeX Live 2009, Emacs 23, and Ubuntu 12.04. I'm happy to use the command line if I need to. EDIT, since some people seem to be thinking along these lines: I know about `\includeonly{}`, and I've used it in the past for this specific purpose with some large documents. I don't want to use it here because this chapter is not long enough to get into the trouble of managing a separate tex file for each section. I just want to know if it is possible to have _one_ tex file and then produce a pdf containing only selected parts of that _one_ tex file.


title: \fbox does not work with images

text: I tray to add a border on a list of images using `\fbox` but it did not work. my code:               \documentclass[conference]{IEEEtran}     \usepackage{graphicx}         \begin{figure}[!h]         \centering         \fbox{           \mbox{\subfigure[Frame 1]{\includegraphics[width=4cm]{im1.png}}                  \subfigure[Foreground silhouette 1]{\includegraphics[width=4cm]{im2.png}}}\\                 \mbox{ \subfigure[Foreground silhouette 1]{\includegraphics[width=4cm]{im3.png}}                  \subfigure[Foreground silhouette 1]{\includegraphics[width=4cm]{im4.png}}}\\                   \mbox{\subfigure[Frame 1]{\includegraphics[width=4cm]{im5.png}}                          \subfigure[Foreground silhouette 1]{\includegraphics[width=4cm{im6.png}}}\\                                               \mbox{\subfigure[Foreground silhouette 1]{\includegraphics[width=4cm{im7.png}}                          \subfigure[Foreground silhouette 1]{\includegraphics[width=4cm]{im8.png}}                          }                          }               \caption{cc.}           \label{fbox}         \end{figure}     \end{document}      I get this error `Something's wrong--perhaps a missing \item. }`. When i remove the \fbox all things are going. thanks to help me.


title: Acronyms only shown in Index when used twice

text: The solution to the original problem was resolved here: Acronyms sorted alphabetically in Index , in which I was trying to include acronyms in the index every time the command `\gls{acronym}` was used. The provided code worked very well, however, I noticed the acronyms are **only displayed** in the Index **when used twice** or more (MWE and output below). I have a long list of acronyms only mentioned once throughout the text and I need them all to be displayed in the Index. Any ideas?               \documentclass[11pt]{article}     \usepackage{makeidx}     \makeindex     \usepackage[acronym,toc,shortcuts]{glossaries}     \makeglossaries          \renewcommand*{\CustomAcronymFields}{%       name={\the\glsshorttok},%       symbol={\the\glsshorttok},%       text={\the\glsshorttok\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%       plural={\the\glsshorttok\noexpand\acrpluralsuffix\protect\index{\the\glslongtok\space(\the\glsshorttok)}},%       first={\the\glslongtok\space(\the\glsshorttok)},%       firstplural={\the\glslongtok\noexpand\acrpluralsuffix\space(\the\glsshorttok)},%       description={\the\glslongtok}%     }          \SetCustomStyle          \newacronym{cd}{CD}{compact disk}     \newacronym{cho}{CHO}{chinese hamster ovary}     \newacronym{bhk}{BHK}{baby hamster kidney}     \newacronym{hek}{HEK}{human embryonic kidney}     \newacronym{hgh}{HGH}{human growth hormone}     \newacronym{scfv}{scFv}{small chain variable fragment}     \newacronym{pi}{pI}{isoelectric point}               \begin{document}     \noindent     First\index{first} use of \gls{cd}\\     subsequent\index{subsequent} use of \gls{cd}     , and     \gls{cho} and     \gls{bhk} and     \gls{hek} and     \gls{hgh} and again \gls{hgh} %used twice and displayed, likewise \gls{cd}     \gls{scfv} and     \gls{pi}.          \printglossaries     \printindex          \end{document}      ![enter image description here](http://i.stack.imgur.com/ymwA9.png)


title: How can I force pairs of brackets [][] to be closer to each other in \texttt?

text: \documentclass{article}        \begin{document}     Normal margin here. Normal margin here. Normal margin here.     Normal margin here. Normal margin here. Normal margin here. Normal margin here.          Abcdefgh abcdefgh abcdefgh abcdefgh abcdefgh abcd: \texttt{float[][]} and     \texttt{double[][]}.     \end{document}      As you can see `[]` is far from other `[]`. How can I get them closer to each other? What is more, `double[][]` extends beyond the margin line. How could this be written better? I'm using minted package. Is it possible to write small code samples inline using it? ![enter image description here](http://i.stack.imgur.com/HiwB0.png)


title: How to use dup which is one of PostScript RPN keywords?

text: According to the pstricks-add manual on near the last page, `dup` is used to duplicate the value of the previous stack. Duplicating can simplify an RPN expression. For the sake of simplicity, let's consider the following example. A line of length 3 unit at a slope of 30 degrees is first drawn. The end point of this line (which is not on the origin) will be marked with a dot. I wrote 4 possible RPN notations for the dot, as follows: ![enter image description here](http://i.stack.imgur.com/dNl4u.png)               \documentclass{article}     \usepackage{pstricks-add}     \usepackage{enumerate}          \def\theta{30}     \def\radius{3}          \parskip=40pt     \parindent=0pt          \begin{document}          \begin{enumerate}[a.]     \item\verb|\theta\space dup cos \radius\space mul sin \radius\space mul|\\[20pt]     \begin{pspicture}[showgrid](3,2)         \psline(\radius;\theta)         \psdot[linecolor=red](!\theta\space dup cos \radius\space mul sin \radius\space mul)     \end{pspicture}\\[20pt]          \item\verb|\radius\space dup \theta\space cos mul \theta\space sin mul|\\[20pt]     \begin{pspicture}[showgrid](3,2)         \psline(\radius;\theta)         \psdot[linecolor=green](!\radius\space dup \theta\space cos mul \theta\space sin mul)     \end{pspicture}\\[20pt]          \item\verb|\radius\space \theta\space cos mul \radius\space \theta\space sin mul|\\[20pt]     \begin{pspicture}[showgrid](3,2)         \psline(\radius;\theta)         \psdot[linecolor=blue](!\radius\space \theta\space cos mul \radius\space \theta\space sin mul)     \end{pspicture}\\[20pt]          \item\verb|\theta\space cos \radius\space mul \theta\space sin \radius\space  mul|\\[20pt]     \begin{pspicture}[showgrid](3,2)         \psline(\radius;\theta)         \psdot(!\theta\space cos \radius\space mul \theta\space sin \radius\space  mul)     \end{pspicture}\\[20pt]     \end{enumerate}     \end{document}      In the first two examples, I got wrong dots. But the last 2 examples, the dots are drawn correctly. How to use the keyword `dup` ?


title: How to rotate as copied in tikz

text: the following code draws three diamonds with their ends fixed at (0,0). Can someone pls suggest a better way to do the same thing, such as drawing one diamond and rotate them as copied? Thanks!               \documentclass[10pt,a4paper]{article}     \usepackage{tikz}     \begin{document}     \begin{figure}     \begin{picture}(215,20)(0,0)     \begin{tikzpicture}          \pgftransformshift{\pgfpoint{90}{0}};      \filldraw[scale=1,color=black](0,0) circle(7cm); % plate     \filldraw[scale=1,white] (0,0)--++(120:2.966)--++(60:2.966)--++(300:2.966)--++(240:2.966) ;     \filldraw[scale=1,white] (0,0)--++(180:2.966)--++(240:2.966)--++(0:2.966)--++(60:2.966) ;     \filldraw[scale=1,white] (0,0)--++(0:2.966)--++(300:2.966)--++(180:2.966)--++(120:2.966) ;          \end{tikzpicture}       \end{picture}       \end{figure}      \end{document}


title: Writing a limit so that the subscript goes directly underneath

text: When I write `$\lim_{x \rightarrow p} f(x) = q$`, the subscript `x \rightarrow p` appears to the right of the limit, instead of directly underneath it. When I try `$\displaystyle \lim_{x \rightarrow p} f(x) = q$`, the subscript of the limit takes up extra space, making the line taller than usual and creating an awkward extra space underneath everything else... Is there a way to write limits in-line with the subscript underneath, and everything squished to the normal height of the line its in?


title: why the sublime text 3 show the warning information?

text: Today ,I use thebibliography environment to writ the reference                  \documentclass{ctexart}            \begin{document }               I use the softwares \cite{           one,two}            \begin{thebibliography }                \bibitem{one}                  mathematica 8.0                \bibitem{two}                 maple8.0             \end{thebibliography}       \end{document }      However,when I write the \cite{one,},the sublime text give the warning information "no bib file found",but when I close the warning window,I write the comma again,the editer appears the list of the bibliography So I want to know to revise it?


title: Import pdf page selected by label instead of page number

text: For each figure in my main document, I import the corresponding page of a multipage `.pdf` containing all pictures (one picture per page). Is there a way to give a label to each picture, in order to import a picture by giving its label instead of its page number ? This means that I would like to do something like               \includegraphics[pagelabel={Figure name}]{pictures.pdf}      instead of               \includegraphics[page=1]{pictures.pdf}      Here is a code producing my file with (some) figures :               \documentclass[multi=true,tikz,border={0pt  0pt 1cm 0pt}]{standalone}          \usepackage{amsmath,amssymb,amsrefs}     \usepackage{t1enc}%\usepackage[svgnames]{xcolor}     %\usepackage{tikz}     \usepackage{tcolorbox}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \newcommand{\x}{14cm}\newcommand{\y}{\x/2.5}     \newcommand{\all}{thick,width=\x,height=\y}     \newcommand{\size}{\small}     \begin{document}          \begin{tikzpicture}         %%% I would like to give a label \label{Figure name}     \begin{axis}[\all,ybar=-10pt,enlargelimits=0.05,ylabel={Volume},ymin=1,xlabel={Price},ymax=20,nodes near coords,nodes near coords align={vertical},xtick={2,3,4,5,6,7,8,9,10,11,12}]\size     \addplot[black,fill=blue] coordinates {(2,7) (3,8) (4, 15) (5, 10) (6,12)};     \addplot[black,fill=red] coordinates { (8, 18) (9, 12) (10,15) (11,5) (12,3)};     \legend{Buy orders, Sell orders}     \end{axis}     \end{tikzpicture}          \newpage          \begin{tikzpicture}     \begin{axis}[\all,ybar=-10pt,enlargelimits=0.05,ylabel={Volume},ymin=1,xlabel={Price},ymax=20,nodes near coords,nodes near coords align={vertical},xtick={2,3,4,5,6,7,8,9,10,11,12}]\size     \addplot[black,fill=blue] coordinates  {(2,7) (3,8) (4, 15) (5, 10) (6,12)};     \addplot[black,fill=red] coordinates  { (8, 8) (9, 12) (10,15) (11,5) (12,3)};     \addplot[black,fill=red, opacity=0.2] coordinates { (8, 18)};     \legend{Buy orders, Sell orders}     \end{axis}     \end{tikzpicture} \end{document}


title: Section reference shows section then subsection number

text: I am labeling a subsection with simply `\label{labelname}`, and referring to it later in my document with `\ref{labelname}`. However, at that point it doesn't print just the subsection number, e.g. `2.1`, but it prints the section number followed by the subsection number, like `2 2.1`. Can it be made to show the desired output? Minimum example (using revtex4 class):               \documentclass[pre,12pt]{revtex4}     \renewcommand \thesection{\arabic{section}}     \renewcommand \thesubsection{\arabic{section}.\arabic{subsection}}     \renewcommand \thesubsubsection{\arabic{section}.\arabic{subsection}     \begin{document}     \section{Section 1}     \subsection{Subsection 1}     \label{subsection1}     Some text.          \section{Section 2}     Previously seen in \ref{subsection1}     \end{document}


title: How do I find memoir's margin settings for twocolumn mode?

text: I have a long document that I don't want to use `twocolumn` mode for, but I like the margins it uses. I'm going to manually use `multicol` to create two columns instead (so I can easily have footnotes and other things be a single column). Compare               \documentclass[12pt,twocolumn]{memoir}     \usepackage{lipsum}          \begin{document}     \lipsum     \end{document}      to               \documentclass[12pt]{memoir}     \usepackage{lipsum}     \usepackage{multicol}          \begin{document}     \begin{multicols}{2}     \lipsum     \end{multicols}     \end{document}      The second has much wider default margins. Is there a way to see what the margins are in a given `memoir` document and copy them into another one? (The reason I'm doing this is because this question leads me to believe that the `twocolumn` option doesn't really do what I need.


title: How can I scale my bibliography section to a specific font size including the section name

text: I would like to resize my bibliography section to a specific font size including the section name and so I'm wondering how can I do it maybe using `\scalebox{scale}{object}`. Here is how I call my bibliography in the manuscript:               \bibliographystyle{abbrv} \bibliography{ref1}


title: Placing images in entries (Friggeri CV)

text: Sorry for another Friggeri CV-related question, this is the last one. I feel like the solution should be really easy with tikzpicture nodes, but I just cannot make it work... I am using Friggeri's CV template with the same `friggeri-cv.cls` (I have only changed all the Helvetica fonts to Arial and added `backend=biber` to the `\RequirePackage{biblatex}` line). What I would like is to place the university logos (the logo is this one, but any image will do) between the 3 lines of text, not at the top. The relevant lines I have been playing with in the `friggeri-cv.cls` file are the following:               %%%%%%%%%%%%%%%%%%%%     % List environment %     %%%%%%%%%%%%%%%%%%%%          \setlength{\tabcolsep}{0pt}     \newenvironment{entrylist}{%       \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}     }{%       \end{tabular*}     }     \renewcommand{\bfseries}{\headingfont\color{headercolor}}     \newcommand{\entry}[4]{%       #1&\parbox[t]{11.8cm}{%         \textbf{#2}%         \hfill%         {\footnotesize\addfontfeature{Color=lightgray} #3}\\%         #4\vspace{\parsep}%       }\\}      And my MWE is the following:               %!TEX TS-program = xelatex     \documentclass[]{friggeri-cv}     \listfiles     \addbibresource{bibliography.bib}               \begin{document}     \header{name}{surname}            {occupation}          % In the aside, each new line forces a line break     \begin{aside}       \section{about}         aaa         bbb     \end{aside}               \section{background}          \begin{entrylist}       \entry         {1991}         {MSc {\normalfont in this and that}}         {\includegraphics[width=2.5cm]{logo.png}}         {{\thinfont Specialized in this and that}\\         Honorary Mention}       \entry         {1993}         {PhD {\normalfont in other stuff}}         {\includegraphics[width=2.5cm]{logo.png}}         {{\thinfont Specialized in other stuff}\\         Honorary Mention}     \end{entrylist}          \end{document}      Which produces ![this](http://i.stack.imgur.com/9MDru.png)


title: mdframed conflicts with \setmainlanguage{arabic}

text: ![enter image description here](http://i.stack.imgur.com/OypZA.jpg) I hope someone can help me with my problems. In the code given below, the `mdframed` width is exceeding the page width. This problem is due to `\setmainlanguage{arabic}`. If I set the main language as English, then no problem arises. When the main language is set to Arabic, then the black line in the frame header and the body is also not complete. Finally the first page is with black background and the rest is having the background I set.               \documentclass[svgnames,12pt]{report}     \usepackage[papersize={10in,5in},top=0.55in, bottom=-0.1in, left=0.1in, right=0.1in]{geometry}          \usepackage[fleqn]{amsmath}     \usepackage{amssymb}     \usepackage{enumerate}     \usepackage{graphicx}     \usepackage[x11names]{xcolor}     \usepackage{pstricks}     %\usepackage[framemethod=PSTricks]{mdframed}     \usepackage[framemethod=tikz]{mdframed}     \usepackage[pstricks]{bclogo}     \usepackage[dvips]{epsfig}     \usepackage{fancybox}     \usepackage{mathrsfs}     \usepackage{cancel}     \usepackage{slashbox}     \usepackage{multirow}     \usepackage{caption}     \setlength{\captionmargin}{10 pt}     \usepackage[tight]{minitoc}     \usetikzlibrary{arrows,backgrounds,positioning,fit,decorations.text,decorations.markings,decorations.shapes,calc,intersections}     \usepackage{pgfplots}     \usepgflibrary{decorations.shapes}     \usepackage{circuitikz}     %\usepackage[colorlinks]{hyperref}     \usepackage{hyperref}     \hypersetup{colorlinks,%         citecolor={Blue1},%         filecolor={Blue1},%         linkcolor={Blue1},%         urlcolor={Blue1}}          %%%%%%%%%%%%%%%%%%%%%%%%          \usepackage{fancyhdr}     \numberwithin{equation}{section}     \usepackage{titlesec}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{setspace}     \usepackage{fontspec}     \usepackage{polyglossia}     %\usepackage{xltxtra}          \setmainlanguage{arabic}     \setotherlanguage{english}          %\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade}     \setmainfont[Mapping=tex-text, Script=Arabic,Scale=1.2]{Scheherazade}          %\titleformat{\chapter}[hang]{\huge}{\thechapter}{1em}{}     \titleformat{\chapter}     {\color{Green1}\normalfont\Large\bfseries}     {\color{Green1}\thechapter}{1em}{}     \titlespacing{\chapter}{0in}{-0.55in}{-0.15in}     \titleformat{\section}     {\color{LightGoldenrod1}\normalfont\Large\bfseries}     {\color{LightGoldenrod1}\thesection}{1em}{}     \titlespacing{\section}{0in}{-0.05in}{-0.05in}     \titleformat{\subsection}     {\color{Orange1}\normalfont\large\bfseries}     {\color{Orange1}\thesubsection}{1em}{}     \titlespacing{\subsection}{0in}{-0.05in}{-0.05in}     \titleformat{\subsubsection}     {\color{SeaGreen1}\normalfont\large\bfseries}     {\color{SeaGreen1}\thesubsubsection}{1em}{}     \titlespacing{\subsubsection}{0in}{-0.05in}{-0.05in}          \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}          %\fancyfoot[RE,RO]{\thepage}     \setlength{\headsep}{0.07in}     \renewcommand{\headrule}{{\color{Yellow1}%     \hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}     %\renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \lhead{\textcolor{Cyan1}{\bf Organisation Name}}     \chead{\it \textcolor{Green1}{\leftmark}}     \rhead{\textcolor{Yellow1}{\thepage}}     \lfoot{}     \cfoot{}     \rfoot{}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%     \newenvironment{framed}[2][]{%     \vskip0.03in         \begin{mdframed}[%             frametitle={             \begin{tabular}{rr}             \hspace{-0.2in}             $\begin{array}{r}\vspace{-22pt}\\             \scalebox{1.00}{}\\             \vspace{-26pt}             \end{array}$ &             \hspace{-0.2in}             $\begin{array}{r}\vspace{-25pt}\\             \mbox{\textcolor{white}{\large #2}}\\             \vspace{-28pt}             \end{array}$             \end{tabular}             },             %skipabove=\baselineskip plus 2pt minus 1pt,             %skipbelow=\baselineskip plus 2pt minus 1pt,             %innerbottommargin=0.01\baselineskip,             %splittopskip=9pt,             splitbottomskip=2pt,             linewidth=0.5pt,             frametitlerule=true,             frametitlebackgroundcolor=#1,             backgroundcolor=#1!20,             fontcolor=black,             shadow=false,shadowsize=4pt,             roundcorner=5,             everyline=true,             settings={\captionsetup{font={color=black}}}         ]%         \hrule height0pt width\hsize\relax%<<<<<<<<<<<<<<FORCE WIDTH         %\begin{minipage}{\linewidth}%  this should not be necessary??     }{%         %\end{minipage}%         \end{mdframed}     \vskip0.03in     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \newenvironment{chap-learnout}{%     \begin{framed}[DeepPink3]     {     %Learning Outcomes From This Chapter     نتائج التعلم من هذا الفصل     }     }     {     \end{framed}     }     %%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%          \makeatletter     \renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{3.0em}}     \renewcommand{\l@subsection}{\@dottedtocline{2}{4.0em}{3.6em}}     \renewcommand{\l@subsubsection}{\@dottedtocline{3}{7.4em}{4.5em}}     \makeatother          \setlength{\parindent}{0in}     \setlength{\parskip}{0.05in}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \renewcommand{\baselinestretch}{1.0}     \renewcommand{\chaptername}{Chapter}     \renewcommand{\figurename}{Fig.}     \renewcommand{\contentsname}{Contents}     \renewcommand{\mtctitle}{Contents}     \def\cosec{\mathop{\rm cosec}\nolimits}     \def\sech{\mathop{\rm sech}\nolimits}     \pagecolor{black}     %\pagecolor{Red4}     %\color{Ivory1}     \makeatletter     \newcommand{\globalcolor}[1]{%       \color{#1}\global\let\default@color\current@color     }     \makeatother          \AtBeginDocument{\globalcolor{Ivory1}}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \fancyput(-0.951in,-4.035in)     {     \begin{pspicture}(25,12)     \psframe[linecolor=black,linewidth=1pt,fillstyle=crosshatch*,hatchcolor=Firebrick4,hatchwidth=1pt,fillcolor=Red4,framearc=0.03](-0.22,0.13)(25.08,12.75)     \end{pspicture}     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          \begin{chap-learnout}     في هذا الفصل سوف تتعلم عن بعض من اللبنات الأساسية للرياضيات.     فضلا عن أن يصبح معتادا على تدوين والرموز المستخدمة في الرياضيات لك     سوف تتعلم القواعد الأساسية للعلم الجبر الذي تقوم عليه الكثير من الرياضيات ويستند.     وعلى وجه الخصوص سوف تتعلم حول المؤشرات وكيفية تبسيط التعابير الجبرية،     باستخدام مجموعة متنوعة من النهج: جمع مصطلحات مثل، إزالة الأقواس وعواملها.     وأخيرا، سوف تتعلم كيفية تبديل الصيغ.     \end{chap-learnout}          \newpage     \begin{chap-learnout}     في هذا الفصل سوف تتعلم عن بعض من اللبنات الأساسية للرياضيات.     فضلا عن أن يصبح معتادا على تدوين والرموز المستخدمة في الرياضيات لك     سوف تتعلم القواعد الأساسية للعلم الجبر الذي تقوم عليه الكثير من الرياضيات ويستند.     وعلى وجه الخصوص سوف تتعلم حول المؤشرات وكيفية تبسيط التعابير الجبرية،     باستخدام مجموعة متنوعة من النهج: جمع مصطلحات مثل، إزالة الأقواس وعواملها.     وأخيرا، سوف تتعلم كيفية تبديل الصيغ.     \end{chap-learnout}          \end{document}


title: How to activate syntax highlighting for multiple references in TexStudio?

text: I want to enable highlighting for multiple references command `\parencites {}` of Biblatex package the same as of a similar command for one reference `\parencite {}` using TexStudio editor. The image below shows that when `\parencite {}` is used the reference key would be conveniently highlighted based on the syntax highlighting scheme setup in TexStudio, light green in this case. However, this was disabled and defaulted to black when I used its cousin command `\parencites {}` for multiple references (underlined with black).   How to get the multiple references also light green highlighted in TexStudio? ![enter image description here](http://i.stack.imgur.com/XwozZ.png) **Note**   Feature request for TexStudio was added under ticket:   `#694 Syntax highlighting will break if \parencites{<label>}`


title: after change \lstset, reset of normal characters can NOT display

text: I met one problem(maybe three, I will describe them in detail), I'm trying to add code list in latex with `listings` package. First with limit configuration:               \usepackage{listings}     \definecolor{myblue}{RGB}{20,105,176}     \lstset{ %         language=C,                % choose the language of the code         basicstyle=\footnotesize,       % the size of the fonts that are used for the code         numbers=left,                   % where to put the line-numbers         numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers         stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered         numbersep=5pt,                  % how far the line-numbers are from the code         backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}         identifierstyle=\bfseries\color{black},         directivestyle=\bfseries\color{violet},         tabsize=4,          % sets default tabsize to 2 spaces     %   captionpos=b,           % sets the caption-position to bottom         breaklines=true,        % sets automatic line breaking         escapeinside={\%*}{*)},      % if you want to add a comment within your code         % Define TYPE-1 Keywords         keywords={},         otherkeywords={\%s, \%d},         keywordstyle=\bfseries\color{violet},         % Define TYPE-2 Keywords         keywordstyle=[2]\bfseries\color{blue}\ttfamily,         keywords=[2]{         auto,break,case,char,const,continue,default,do,double,%         else,enum,extern,float,for,goto,if,int,long,register,%         void,volatile,while,return},     %    literate=     %       {\{}{{{\color{white}{\{}}}}{1}     %       {\}}{{{\color{white}{\}}}}}{1}     %       {(}{{{\color{white}{(}}}}{1}     %       {)}{{{\color{white}{)}}}}{1}     %       {>}{{{\color{white}{$>$}}}}{1}     %       {=}{{{\color{white}{$=$}}}}{1}     %       {;}{{{\color{white}{$;$}}}}{1},         stringstyle=\color{red}\ttfamily,         commentstyle=\color{blue}\ttfamily,         directivestyle=\bfseries\color{violet},         morecomment=[l][\color{magenta}]{\#}     %   escapeinside=!!     }      I show my code above. Use this configuration, everything works fine. Then I need change the background to black, therefore I just change:               backgroundcolor=\color{black},     identifierstyle=\bfseries\color{white},      in above config, but after change, the `{`, `}`,`(`,`)`, and other like operators: `=`, can't be displayed and I think the colour of them keep in black. Therefore, I open the config for `literate`:               literate=*%         {\{}{{{\color{white}{\{}}}}{1}         {\}}{{{\color{white}{\}}}}}{1}         {(}{{{\color{white}{(}}}}{1}         {)}{{{\color{white}{)}}}}{1}         {>}{{{\color{white}{$>$}}}}{1}         {=}{{{\color{white}{$=$}}}}{1}         {;}{{{\color{white}{$;$}}}}{1},      after this modification, I have one problem, the `)` colour can't be changed. therefore, I found some topics here and I found some of people write `literate` as:               literate=*%         {\{}{{\color{white}{\{}}}{1}         {\}}{{\color{white}{\}}}}{1}         {(}{{\color{white}{(}}}{1}         {)}{{\color{white}{)}}}{1}         {>}{{\color{white}{$>$}}}{1}         {=}{{\color{white}{$=$}}}{1}         {;}{{\color{white}{$;$}}}{1},      with one Pair of `{` `}` less in each line. I applied this and it do changed the `)` colour, but it makes all rest characters can't be displayed, also the line number display has problem:               I type some characters here and no problem to display        \begin{lstlisting}     \end{lstlisting}     I type some characters here and it can NOT be displayed and I think colour of these characters changed to white.      how can I modify the configuration of listing and solve this issue? ===============UPDATE=============== I just shared a sample code which can reproduce this issue:               \documentclass[a4paper,11pt]{book}          \usepackage{caption}     \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}     \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}          \usepackage{xcolor,colortbl}     \usepackage{listings}          \usepackage{listings}     \definecolor{myblue}{RGB}{20,105,176}     \lstset{ %         language=C,                % choose the language of the code         basicstyle=\footnotesize,       % the size of the fonts that are used for the code         numbers=left,                   % where to put the line-numbers         numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers         stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered         numbersep=5pt,                  % how far the line-numbers are from the code         backgroundcolor=\color{black},  % choose the background color. You must add \usepackage{color}         identifierstyle=\bfseries\color{white},         directivestyle=\bfseries\color{violet},     %   showspaces=false,               % show spaces adding particular underscores     %   showstringspaces=false,         % underline spaces within strings     %   showtabs=false,                 % show tabs within strings adding particular underscores     %   frame=signal,           % adds a frame around the code         tabsize=4,          % sets default tabsize to 2 spaces     %   captionpos=b,           % sets the caption-position to bottom         breaklines=true,        % sets automatic line breaking     %   breakatwhitespace=false,    % sets if automatic breaks should only happen at whitespace         escapeinside={\%*}{*)},      % if you want to add a comment within your code         % Define TYPE-1 Keywords         keywords={},         otherkeywords={\%s, \%d},         keywordstyle=\bfseries\color{violet},         % Define TYPE-2 Keywords         keywordstyle=[2]\bfseries\color{yellow}\ttfamily,         keywords=[2]{         auto,break,case,char,const,continue,default,do,double,%         else,enum,extern,float,for,goto,if,int,long,register,%         void,volatile,while,return},         literate=*%             {\{}{{\color{white}{\{}}}{1}             {\}}{{\color{white}{\}}}}{1}             {(}{{\color{white}{(}}}{1}             {)}{{\color{white}{)}}}{1}             {>}{{\color{white}{$>$}}}{1}             {=}{{\color{white}{$=$}}}{1}             {;}{{\color{white}{$;$}}}{1},         stringstyle=\color{red}\ttfamily,         commentstyle=\color{green}\ttfamily,         directivestyle=\bfseries\color{violet},         morecomment=[l][\color{magenta}]{\#}     %   escapeinside=!!     }          \begin{document}     I type some characters here and no problem to display        \begin{lstlisting}[frame=single, label=118x_power_off,caption=213x platform power ON event detection]     int main(/*@ unused @*/int argc, /*@ unused @*/char *argv[]) //comment for lint     {     #if defined(test)   //howchen, for SHUTDOWN module         /* test comment, (, ), >, <, -, =, .*/                /* test keyword */         auto,break,case,char,const,continue,default,do,double,         else,enum,extern,float,for,goto,if,int,long,register,         void,volatile,while,return;              item.a[1] = 0;         item->b[1] = 1;              foo();              /* test string */         printf(" >> test <<\r\n");                return 0;        #endif     }     \end{lstlisting}     I type some characters here and it can NOT be displayed and I think colour of these characters changed to white.     \end{document}      pls use above code to see the result. ![enter image description here](http://i.stack.imgur.com/rksOY.png) you can find characters after `\end{lstlisting}` can't be displayed and line number stop at 1


title: Editing images using TikZ

text: Can I edit images from the internet or pdf files (snapshots) using TikZ to get this non blury good quality graphics in my pdf file?


title: glossaries texstudio and miktex portable

text: I am not quite sure if this question is on the right sx site but since it is heavily tex related I figured I ask here. My setup consists of a windows machine with `texstudio` and `miktex`, both in the `portable` version. I am trying to use the `glossaries` package. To do so I want to run `makeglossaries` by means of a custom user command. However when I try this it complains about not finding `makeindex` on the path. However i added `miktex`'s bin folder to the _user_ -path variable and if i type `makeindex` from a commandprompt outside miktexs bin folder it works just fine. * * * **What is the proper way of using`makeglossaries(.bat)` with the portable `miktex/texstudio` setup?** * * * Edit: I expiremented with changing the command line. If I supply the `-d` `option to makeglossaries`, which sets the path in which to run `makeindex`, i can get it to _find_ `makeindex`, however, this causes several further issues: I need to supply absolute paths for the index style with `-s`, and absolute paths to the temporary files, which then can't be written due to miktexs security feature.


title: Creating a Color Key?

text: How can I create a colour key in LaTeX to show what the colours of this table mean? ![enter image description here](http://i.stack.imgur.com/z5k13.png)


title: "č" character in the word "Koláč" is not output

text: I am having problems with the "č" character in the word "Koláč" when typesetting cooking recipes. I am using XeTeX right now. Here is my MWE:               \documentclass[]{article}     \usepackage[T1]{fontenc}     \usepackage{a4wide}     \usepackage[czech]{babel}     \usepackage{ifxetex,ifluatex}     \usepackage{xcookybooky}          \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex       \usepackage[utf8]{inputenc}     \else % if luatex or xelatex       \usepackage{fontspec}       \ifxetex         \usepackage{xltxtra,xunicode}       \fi       \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}     \fi          \title{Recepty}     \author{Václav Zeman a Ludmila Zemanová}     \date{\today}          \setHeadlines{       inghead = Ingredience,       prephead = Příprava,       hinthead = Tip,       calory = energetický obsah,       continuationhead = Pokračování,       continuationfoot = Pokračování na další stránce     }          \begin{document}     \begin{recipe}[       ]{Koláč bramborový}       \ingredients{         \unit[30]{dkg} & vařených brambor \\       }     \end{recipe}     \end{document}      The "č" character does not get output, while many other Czech national characters do. What can I do about it?


title: Comment character in datatool AND ignore empty lines?

text: Here is a minimal example on using the `datatool` package:               \documentclass[a4paper,10pt]{minimal}     \usepackage[utf8]{inputenc} \usepackage{datatool}     \begin{document}              {\DTLsettabseparator%         \DTLloadrawdb[noheader,keys={T,R}]{data}{data.csv}}% Brackets necessary in conjunction with some other packages that don't like what DLTsettabseparator does              \begin{tabular}{c|c}             \DTLforeach{data}{\first=T,\last=R}{ $\first\ K$ & $\last\ k\Omega$ \\ }         \end{tabular}          \end{document}      `data.csv`:               # This is 'data.csv'     # I'd like comments like this to be ignored by datatool          # And empty lines as well!          # Now comes the data     # Format:     # T[K]    R[kΩ]     1.4 12.79     8.1 8.81     11.4 8.24     17.3 6.63     25.7 5.27     31.2 3.58     39.0 3.03     44.3 2.38     54.7 1.72     61.2 1.21     69.7 0.987     81.0 0.718     88.5 0.626     99.6 0.491      Is there a way to suppress output of lines that start with a `#` and also suppress the output of empty lines? Or even define a comment character? **Edit:** Added a sample `.csv` file.


title: Tab separated files with datatool package?

text: The documentation of the package `datatool` says that the `\DTLsettabseparator` command changes the separator in `.csv`-Files from the default comma to the tab character. **What it really does for me is change it to space. Tabs are simply ignored by datatool.** Datatool requires space as separator even with the tabseparator command. **Is there a way to change it to tabs for real?** Also is there a way to tell `datatool` to **ignore multiple, consecutive separators** (i.e. multiple tab characters in a row)? When I write "1,,,3" in my `.csv` file (for readability comma being the separator here instead of the desired tab), I don't mean datatool to think the "1" is in the first column and the "3" in the fourth. That should be just do columns.


title: How to include the book of a @inbook in a biblatex-managed bibliography?

text: I have the requirement, that a `inbook` entry should be listed together with its "parent" `book` entry, even if the book is not cited directly. The bibliography should list **both** entries. My idea is to add the books as separate entries in the bibliographa database and issue `\nocite{bookkey}` or each book key. Is there a better way? Maybe assigning a keyword to each book and then issue `\nocite{<keyword>}`. That is, however, not possible with biblatex.


title: Drawing a circle on a non xy-plane with TikZ

text: Say I'm drawing a 3D picture. Now I would like to draw a circle, perspectively correct, on the yz-plane, but TikZ does not seem to be capable of this. All one can do is drawing circles on the xy-plane. Also ellipses, which take two radii, are drawn on the xy-plane only. I know I can use `rotate` to rotate ellipses, but this is not really straightforward, as it involves calculating rotation angles and radii. So is there anyway to tell `TikZ` to draw on a certain plane? Or is there any other fancy package fo it? Just for illustration:               \documentclass[parskip]{scrartcl}     \usepackage[margin=15mm]{geometry}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}     \draw (0,0,0) -- (0,4,0) -- (0,4,4) -- (0,0,4) -- cycle;     \draw (0,2,2) circle (2);     \end{tikzpicture}          \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/UXXQy.png) Obviousely, I would like to draw the circle in the yz-plane. This would look like an ellipse, fitting perfectly in the yz-plane square (which, due to perspective looks like a parallelogram).


title: How to add copyright notice (in a box with borders) at bottom of first page?

text: I want to add a box with some copyright statement at the bottom of my paper. What is the easiest/best way to do this? Ideally, the box would have the width of the text, and be horizontally centered. Also, I don't want it to interact with any potential (IEEE-based) style files that might set footers etc. (I've looked into the `fancyhdr` package, but `\fancyfoot{copyright statement...}` puts a footer at every page except the first one; and I only want the statement to appear on the first page)


title: Incorrect font for ligated glyphs, bold-italics combination, Libertine font

text: Would appreciate your help with the following code:               \begin{definition}     The \textbf{confidence interval (CI)} for ...     \end{definition}      The problem is that the letters "fi" within the word "confidence" are typeset as a ligature without adhering to the \textbf command, see: ![](http://i.stack.imgur.com/Q0pXi.png) I'm using scrbook, anything else I should specify? Thanks in advance! Update: here is sample text with all the packages and the relevant definitions. As you can see, the problematic text is in the beginning, before the fill text.               \documentclass[twoside,12pt,a4paper,pointlessnumbers,headsepline,idxtotoc]{scrbook}          \usepackage{blindtext}          \usepackage{array,epsfig,amssymb, amsbsy, amsxtra,amsmath}     \usepackage{comment}     \usepackage{graphicx}     \usepackage{bm} %Access bold symbols in maths mode     \usepackage{longtable} %Support for tables longer than a page     \usepackage{multicol} %Intermix single and multiple columns     \usepackage{epsf} %basic eps graphics     \usepackage{float} %Improved interface for floating objects     \usepackage[usenames,dvipsnames]{color}               \usepackage{listings}     \usepackage{alltt} %A verbatim environment other commands, and environments can appear within     \usepackage[latin1]{inputenc} %Control input encoding          %\usepackage{harvard}     \usepackage[authoryear,round]{natbib} %Bibliography style with author-year and numbered references     \usepackage{url} %Verbatim with URL-sensitive line breaks          %package for changing the chapter headings to arial     \usepackage[T1]{fontenc}      \usepackage{libertine}           \addtokomafont{pagenumber}{\small\sffamily} % set page number font to sf           %package for shaded boxes     %\usepackage{color}     %\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{framed,color}     \definecolor{shadecolor}{gray}{0.9}          %% Following package and definitions are for changing \ref to links and PDF features     \usepackage[         pdfpagemode=UseOutlines,            % enable TOC PDF feature         pdfdisplaydoctitle=true             % PDF has document title instead of file name     ]{hyperref}          \definecolor{LinkColor}{rgb}{0,0,0.5}     \definecolor{ListingBackground}{rgb}{0.9,0.9,0.9}          % Colors for Links      \hypersetup{         colorlinks=true,                % Enable colored links (without frame)     linkcolor=LinkColor,            % set color.     citecolor=LinkColor,            % set color.     filecolor=LinkColor,            % set color.     menucolor=LinkColor,        % set color.     urlcolor=LinkColor,         % set color for URLs.     bookmarksnumbered=true  % Headline numbering in FOC     }          \usepackage{nomencl}     \renewcommand{\nomname}{Symbols and Notations}          \def\definitionname{DEFINITION}     \newtheorem{definition}{\definitionname}[chapter]          %Index     \usepackage{makeidx}          \begin{document}          \mainmatter          \begin{definition}     The \textbf{confidence interval (CI)} for...\end{definition}          \Blindtext          \backmatter          \end{document}


title: List of problem title same style as list of figures title?

text: I have custom made list of problems, and list of figures generated by `tocloft`. I want the two list titles to be of the same style. I looked into source of `tocloft.sty` and added a new command there:               \newcommand{\@loptitle}{%       \addpenalty\@secpenalty       \if@cfthaschapter         \vspace*{\cftbeforeloftitleskip}       \else         \vspace{\cftbeforeloftitleskip}       \fi       \@cftpagestyle       {\interlinepenalty\@M       {\cftloftitlefont\listproblemname}{\cftafterloftitle}       \cftmarklof       \par\nobreak       \vskip \cftafterloftitleskip       \@afterheading}}      (based on `\@cftmakeloftitle`) It doesn't work -- during compilation I get               ! Undefined control sequence.     l.45 \loptitle      I'm sure I have `\usepackage{tocloft}` before I call `\loptitle`. I guess my mistake is that it's not enough to `usepackage` to load it all.


title: How to convert an SVG image with LaTeX in Inkscape, to PNG?

text: I'm using Inkscape to draw images, together with the ability to produce the separate LaTeX file with all the text, as described here. So far, this has been working great, but now I am restricted to use `.png`, `.jpeg`, or `.bmp` for my figures. Is there a way for me to keep using Inkscape with SVG + LaTeX and then convert to other formats from the SVG + LaTeX image (e.g. to `.png`) in such a way that the LaTeX fonts and their scaling are unchanged when compared to the included SVG in the document? Additional info: If I just draw SVG in Inkscape, add the LaTex stuff to the picture and export it to a bitmap, the LaTex text will of course not be processed. If I use TexTex, the scaling of the fonts is lost, which is usually there for an included SVG.


title: Multiple references in LaTeX

text: I'm writing a paper and using the `IEEEtran.cls` in LaTeX. I need to have my references to appear like:               \cite{test1,test2,test3}     I want : [1-3]      I searched and found that I need to include cite package. However, after I have used cite packages... I got :               [1]-[3]      How can I get [1-3] instead of [1]-[3]? without using new commands ? Here is an example of what I have :               \documentclass[conference]{IEEEtran}      \usepackage{cite}      \begin{document}      \section{Test}      \cite{test1,test2,test3}.       \bibliographystyle{IEEEtran}      \bibliography{test}      \end{document}      the test.bib file:               @MISC{test1,     title = {Reference test1}     }     @MISC{test2,     title = {Reference test2}     }     @MISC{test3,     title = {Reference test3}     }      output :                      I. TEST        [1]–[3].            REFERENCES       [1] “Reference test1.”       [2] “Reference test2.”       [3] “Reference test3.”


title: NewDocumentCommand-defined command in bookmark

text: I have a scenario where xparse's `\NewDocumentCommand` has a regression compared to any alternative I know, including ones defining robust commands. So I'm avoiding `\NewDocumentCommand` in this case, but I would like to understand where the problem lies. I am trying to understand the difference between robust commands and commands defined by `\NewDocumentCommand`, from the point of view of hyperref's processing of bookmarks. Consider the following MWE and the comments inside.               \documentclass{article}          \usepackage{xparse}          \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage[unicode=true]{hyperref}          \usepackage{bookmark}     % The problem appears also without bookmark, but you need to compile twice to      % see the correct result.          % Allow using \lambda in section headers, in two parts.     % Part one (no problem here):     \PrerenderUnicode{λ}          % Part two:     % Problem: The following command can be robust, but cannot be defined via      % \NewDocumentCommand.          % All these definitions work:          %\def\TitleLambda{\texorpdfstring{$\lambda$}{λ}}     %\newcommand{\TitleLambda}{\texorpdfstring{$\lambda$}{λ}}     %\DeclareRobustCommand{\TitleLambda}{\texorpdfstring{$\lambda$}{λ}}          % This one doesn't:          \NewDocumentCommand{\TitleLambda}{}{\texorpdfstring{$\lambda$}{λ}}          % Done!          \begin{document}     \section{The \TitleLambda{}-calculus}     \end{document}      The above MWE gives the warning:               Package hyperref Warning: Token not allowed in a PDF string (Unicode):     (hyperref)                removing `\TitleLambda' on input line 34.      As a consequence, the bookmark in the resulting file will contain no lambda character, unlike intended. Replacing `\NewDocumentCommand` by any alternative avoids the problem. So the problem does not happen simply because `\NewDocumentCommand` defines robust commands, though what is happening appears similar. I've even tested using `\def` \+ `\MakeRobustCommand` from the `makerobust` package:               \usepackage{makerobust}     \MakeRobustCommand\TitleLambda      and everything still worked. Who's at fault? I see three possibilities:   * me;   * xparse;   * hyperref. **Edit** : I should have phrased my question better. I'm mainly curious about what happens, given that I have a working solution.


title: Match upper horizontal line of two fractions with different roots

text: I'm learning LaTeX and encountered a problem which I'm not able to solve after reading several related problems (e.g.: Align \sqrt with baseline of other mathematical input). I will present my actual problem: ![Top drawn lines of roots](http://i.stack.imgur.com/P15dG.png)               \[\left(1 - \frac{\sqrt{2}}{π}\sqrt[4]{\frac{R_\text{out}}{R_\text{l}}}\right)\]      I use XeLaTeX (MikTeX 2.9) with the XITS fonts, `amsmath` loaded. As you can see the topmost drawn line of the roots are not alligned. I think that this occurs because _R_ out generates another height for the box on which the drawing of the root depends. I would like to 'align' the top lines of the roots (preferably in a way that the second fraction root is on the same level as the single root on the left). I have read about the commands which helps achieving this:               \strut \mathstrut \vphantom[ ]      I am not sure if for this problem `\smash` or `\mathclap` could help. I really need a new input because sadly I can't solve the problem by myself :-(


title: Line breaking and alignment in list

text: Consider the following code:               \documentclass[       a4paper,       12pt     ]{article}               \usepackage[       hmargin=2.4cm,       vmargin=3cm     ]{geometry}     \usepackage{amssymb}     \usepackage{enumerate} % better to use enumitem     \usepackage{totcount}     \usepackage[       colorlinks=true,       urlcolor=black     ]{hyperref}               \newcommand*\ops[1]{\textbf{\textsf{#1}}}     \newcommand*\options[3]{\color{#1}\ops{#2}\fontsize{#3}{#3}}     \newcommand*\film[4]{%      \item \fontsize{12pt}{12pt} \selectfont \textsf{[#4] \enskip \href{#1}{#2}~(#3)}}     \setlength{\labelsep}{0em}     \renewcommand*\labelenumi{\options{blue}{\ops}{10pt} $\maltese$ \quad}          \regtotcounter{enumi}               \begin{document}          \begin{enumerate}       \film{http://www.imdb.com/title/tt0134273/}{8MM}{1999}{6,4}       \film{http://www.imdb.com/title/tt0050083/}{12 Angry Men}{1957}{8,9}       \item\fontsize{12pt}{12pt}\selectfont \textsf{[2,1] \enskip \href{http://www.imdb.com/title/tt0057181/}{Incredibly Strange Creatures Who Stopped Living and Became Mixed-Up}}\\ \verb++\hspace{9.9mm} \textsf{{\href{http://www.imdb.com/title/tt0057181/}{Zombies, The}} (2006)}     \end{enumerate}          \noindent I have \total{enumi}~films.          \end{document}      How do I get automatically line breaking if a title is too long _and_ left alignment of the title (as I have done manually for the last item) if it spans more than one line? **Follow-up question** Consider David's code:               \documentclass[       a4paper,       12pt     ]{article}               \usepackage[       hmargin=2.4cm,       vmargin=3cm     ]{geometry}     \usepackage{amssymb}     \usepackage{enumitem}     \usepackage{totcount}     \usepackage[       colorlinks=true,       urlcolor=black     ]{hyperref}               \newcommand*\film[4]{%       \item[\refstepcounter{enumi}\textcolor{blue}{$\maltese$}\quad\textsf{[#4]}] \textsf{\href{#1}{#2}~(#3)}}               \regtotcounter{enumi}               \begin{document}          \begin{enumerate}[       leftmargin=5em,       labelindent=-5em     ]       \film{http://www.imdb.com/title/tt0134273/}{8MM}{1999}{6,4}       \film{http://www.imdb.com/title/tt0050083/}{12 Angry Men}{1957}{8,9}       \film{http://www.imdb.com/title/tt0057181/}{Incredibly Strange Creatures Who Stopped Living and Became Mixed-Up Zombies, The}{2006}{2,1}     \end{enumerate}          \noindent I have \total{enumi}~films.          \end{document}      What options do I have to give to `enumerate` in order to get the same alignment as in my initial code? The problem is that with David's approach, there is too little space between the symbol and [x,y], and between [x,y] and the title. If I try to add some space, the symbol goes into the left margin. **Update 2** One last question: I would like an `\if` loop; something like               \if \total{enumi} = 1       I have 1~film.      \else       I have \total{enumi}~films.     \fi      but it doesn't work. How do I do this?


I'm running Arch Linux and installed texlive 2013 via `tlmgr`. My file is this:               \documentclass{paper}     \usepackage{lipsum}     \usepackage{xltxtra}     \usepackage{polyglossia}     \setmainlanguage{english}     \begin{document}     \lipsum[1]     \end{document}      Running `xelatex` on my file yields this:               Package polyglossia Warning: No hyphenation patterns were loaded for `English'     (polyglossia)                I will use \language=\l@nohyphenation instead on i     nput line 6.          ! Undefined control sequence.     <recently read> \adddialect       I have consulted the other answers dealing with similar problems. Most concern babel, which I am not using. Some suggest installing a language, but this error only concerns english (and I installed collection-langenglish anyway). I tried running `tlmgr fmtutil --all`, but this changes nothing. How can I fix this?


title: Questions about chapter section and their formation

text: ![formats of chapter and section](http://i.stack.imgur.com/T9ouu.png) Hello, everyone, I want to arrange the chapter and section as the picture shown and The font should be Times New Roman, 12 point, could anyone give me some tips.


title: How can I get rid of space after a tabular, aligned to the right via \hfill?

text: I'd like to get rid of the additional empty space on the right between `\begin{tabular}{ll} \textsc{place,} & \textsc{date}\\ Place, & \today \end{tabular} %` and the right page margin/border: ![enter image description here](http://i.stack.imgur.com/fFeeU.png) The title isn't the best I admit, if anyone knows a better one feel free to edit it and this line please. **MWE**               \documentclass[     fontsize=12pt,     a4paper,     DIV=15,     parskip=half     ]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{     lmodern,     lipsum     }          \listfiles          \begin{document}     %\vspace{0.5cm}     \begin{flushleft}     Words\\     More Words     \end{flushleft}%     \begin{tabular}{@{}l}     \textsc{code}\\     11-22-33-44     \end{tabular}%     \hfill     \begin{tabular}{ll}     \textsc{place,} & \textsc{date}\\     Place, & \today     \end{tabular}     \begin{flushleft}     \bfseries Words     \end{flushleft}     \begin{flushleft}     Something,     \end{flushleft}     \lipsum[3]     \end{document}


title: Numbers as markers with \foreach and additional macro based on counter

text: **First issue** I would like to plot several curves using the `\foreach` command and have their number in the sequence as markers. Here is the code I came up with :               \documentclass{article}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \begin{document}     \begin{tikzpicture}       \pgfplotstableread{     1 4   0.2  0.1     2 4.2 0.1  0.5     3 3.1 0.3  0.4     4 2.5 0.25 0.35     }\table          \begin{axis}       \foreach \i in {1,2,3}     \addplot+[text mark={\i}, mark=text] table[x index=0, y index=\i]{\table};     \end{axis}     \end{tikzpicture}     \end{document}      and here is the result it raises : ![enter image description here](http://i.stack.imgur.com/dGbh6.png) My problem is that for some reason the `text mark={\i}` is stuck to `1`. A solution is to use the `\pgfplotsinvokeforeach` command (see my answer). **Second issue** But now if I need some other index computed from the counter using for instance               \pgfmathsetmacro{\j}{\i+1}% with the \foreach command      I would write               \pgfmathsetmacro{\j}{##1+1}% with the \pgfplotsinvokeforeach command      but this last one does not work. I think the problem is that the `#1` is interpreted as if it is supposed to represend an argument of `\pgfmathsetmacro`. My attempt of doubling the hash did not solve this second issue.


title: includegraphics and xstring package

text: I would really like to do something like the following:               \includegraphics{\StrSubstitute{No Spaces}{ }{}}      However, this gives me an Undefined control sequence error. I saw some other posts about `includegraphics` not evaluating macros in arguments. So, I tried this:               \newcommand{\imageFoo}[1]{       \includegraphics{#1}     }          \begin{document}          \imageFoo{\StrSubstitute{No Spaces}{ }{}}          \end{document}      This also gives me the Undefined control sequence error. To test further, I defined:               \newcommand{\identityMacro}[1]{#1}      The following then all work as expected:               \includegraphics{NoSpaces}     \imageFoo{NoSpaces}     \imageFoo{\identityMacro{NoSpaces}}     \includegraphics{\identityMacro{NoSpaces}}     \StrSubstitute{No Spaces}{ }{}      Can anyone help me understand why `includegraphics` never works with `StrSubstitute`?


title: How to control the order of fields in bibtex?

text: I have a bibtex entries like this:               @inproceedings{x1,       author    = {Dave Madengly and Johny Depp},       title     = "{Using new Context}",       booktitle = {Proceedings of 1st Conference of the XXX (XXX' 01)},       year      = {2001},       crossref  = {2},       pages     ="12 -- 20",     }          @proceedings{x2,       editor    = {John Doe},       title     = {XXX 2001, Proceedings},       booktitle = {Proceedings of 1st Conference of the XXX},       publisher = {The XXXX},       address =  {USA},       year      = {2001}     }      and using plain bibliography style. The problem is that the publisher appears at the end. What I want is that the name of publisher appears before the page numbers. How can I do it?


title: Normal \relax vs. frozen \relax

text: With               \edef\x{\ifnum0=0\else\fi}      being `\relax` and with               \def\y{\relax}      we see that `\ifx\x\y` is false. Why? See also \ifcsname when it isn't apparent that the command is \relax'ed.


title: change caption in tufte class full-page figure

text: I've tried to change the caption in a full-width float with `tufte-book`, but to no avail. I want the caption in this figure to be like more common LaTeX classes. Here is a MWE and the result:               \documentclass[a4paper,nohyper]{tufte-book} %abstracton     \usepackage{fontspec}     \defaultfontfeatures{Ligatures={TeX}}     \setmainfont[Numbers={OldStyle}]{Minion Pro} %or any other font     \setsansfont{Myriad Pro} % or any other font     \setmonofont[Scale=MatchLowercase]{Menlo}     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{sidecap}     \usepackage[dvipsnames]{xcolor}     \usepackage{polyglossia}     \setmainlanguage{brazil}     \usepackage[bookmarks]{hyperref}     %\usepackage[font=sf, labelfont={sf}, margin=1cm]{caption}     \newfontfamily{\A}{Al Bayan}          \begin{document}          \begin{figure*}     \centering     \includegraphics[width=.9\textwidth]{./camp-scene}     \caption{Cena de Acampamento. Mir Sayyid Ali, séc. XVII. 28,4 x 20 cm. Harvard University Art Museums, 1958.75. Os tecidos preenchiam a vida tanto dos nômades quanto dos habitantes das cidades, cobrindo o chão e definindo o espaço. O papel onipresente dos tecidos é visto numa pintura de um acampamento nômade, atribuído ao pintor persa do século XVI Mir Sayyid Ali.}     \label{fig:camp-scene}     \end{figure*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/T1vIY.png)


title: parametrized variable with if else statements

text: I need to create parametrized variable `\mycolor` like in this example. The variable `\mycolor` defined colour based on an argument. I need to compare `#1` with values 1, 2 and so forth, but how to use if else statement in latex? Google gives result about various algorithmic packages.


title: Creating custom citation style

text: I want to built a citation definition identical to this form: `[Author, [x], Year]`, where `x` is the citation number. Is it possible to do such thing? I am using `openbib`. Also is there a way that i can find which commands are valid with `openbib`, a Google search did not give me much. I use the `cite` package. EDIT: I tried replcacing `cite` with `natbib` and used the `\citet` command, which gives following output: `(author?) [15]`, reference number is valid, and the reference has a author.


title: Footnotes being rendered as letters inside tabular

text: I wrote a couple of footnotes inside a table using `minipage`, but they are rendered as letters instead of numbers. I couldn't find anything about it in Google. I tried using               \renewcommand{\thefootnote}{\arabic{footnote}}      inside the `minipage`, but it didn't help. What can I do?


title: How to break a bordermatrix into multiple matrices?

text: I have a border matrix that is too large to fit on one page. I want to break it into multiple matrices. ![enter image description here](http://i.stack.imgur.com/74kLg.png)


title: Circling/framing and referring to a bunch of nodes

text: The end goal: drawing paths between nodes like in the example there but the difference is the nodes are inside a picture here and in particular, the other node is a bunch of nodes in the same picture. So a minor goal is to be able to refer to some nodes as a whole. ![enter image description here](http://i.stack.imgur.com/rwN1z.png) My first attempt was just to wrap the said bunch of nodes in a big node but bizarrely, that didn't work ;). So I had a look at   1. How to typeset a TikZ picture inside a node?   2. How to nest a graph within a node in TikZ and draw edges between the graphs? but I still have problems. See the related questions, in particular Q5-Q8 in the example code below. I tried two approaches, the preferred approach would be the one called first try below but that didn't work (Q5). The second approach (using the fit library) is close to what I want but there are still a few flaws left (Q6-Q8).               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{arrows,shapes,fit}          \begin{document}          \tikzstyle{every picture}+=[remember picture]          \begin{tikzpicture}[scale=1.4]            \begin{scope}[>=stealth]         %% Timeline         \draw (0,0) -- (2.2,0);%         \draw[loosely dotted] (2.5,0) -- (3.5,0);%         %%% Q1: In fact, it would have been great if I could just position         %%% the second part of the graph after the continuation dots in         %%% the next scope. See Q4         \draw (3.8,0) -- (7.2,0);%         \draw[loosely dotted] (7.2,0) -- (7.5,0);%         \draw[->] (7.5,0) -- (7.7,0);%         %%% Q2: Is it possible to use calc or something else to just say 5/N+\x-4          \foreach \x/\xtext in {0,...,2,4/N,5/N+1,6/N+2,7/N+3} {%           \draw[shift={(\x,0)}] (0, +0.2) -- (90:0);%           %%% Q3: How do I put this above the tick without manually           %%% setting 0.3? I'm not sure the draw command allows to write           %%% beyond the path ...            \node at (\x,0.3) {$\xtext$};%         }       \end{scope}            \begin{scope}[>=stealth]         %%% Q4: In fact, I wish I could just say continue at any point,         %%% say 3.5 and just start at 1 instead of 4 in this scope. Is         %%% there a way to say this scope should start at 3.5 in the         %%% current picture?         \draw[shift={(4,0)}] (0,0) -- %         node[very near end,right] {$Div_N$} +(90:-0.2);%         \node[right,fill=red!15,baseline] (continuation) at (4,-0.5) {$+           P_N$};%              % ### First try         %%% It's really what I want to do but I can't succeed in         %%% positioning precisely the nested tikzpicture environment.         %%% Q5: What's going wrong here?         % % Maturity phase         % \node[right,fill=red!15] (maturity) at (5,0) {         %   \begin{tikzpicture}         %     \draw[shift={(5,0)}] (0,0) -- %         %     node[very near end,right] (5) {$Div_{N+1}$} +(90:-0.2);%         %     \foreach \x/\xtext in {6/(1+g),7/(1+g)^2} {%         %       \draw[shift={(\x,0)}] (0,0) -- %         %       node[very near end,right] {$Div_{N+1}$} +(90:-0.2);%         %       \node[right] (\x) at (\x,-0.5) {$\times \xtext$};%         %     }         %   \end{tikzpicture}         %   };         % ### Alternative solution with the fit library.         %%% It's very close to the end result but 3 problems here:         %%% Q6: Even playing with the opacity, I can't get the same thing         %%% as with the (continuation) node: I can't see the text as well.         %%% Q7: Adding the inner sep option (see why in Q8) gives         %%% underfull \hbox warning???         %%% Q8: But much worse is the fact that if I get rid of the         %%% ellipse and the inner sep options, the rectangular draw         %%% doesn't include the first $Div_{N+1}$ perfectly         % Maturity phase         \draw[shift={(5,0)}] (0,0) -- %         node[very near end,right] (5) {$Div_{N+1}$} +(90:-0.2);%         \foreach \x/\xtext in {6/(1+g),7/(1+g)^2} {%           \draw[shift={(\x,0)}] (0,0) -- %           node[very near end,right] {$Div_{N+1}$} +(90:-0.2);%           \node[right] (\x) at (\x,-0.5) {$\times \xtext$};%         }         \node[fill=red!15,fill         opacity=0.5,anchor=base,thick,ellipse,fit=(5)(6)(7),inner         sep=3.5pt] (maturity) {};%       \end{scope}            %%% Link both parts       \begin{scope}[overlay,>=stealth,very thick,red!15]         \path[->] (maturity) edge [bend left] (continuation);       \end{scope}          \end{tikzpicture}          \end{document}


title: how to change language within the .cls file

text: The problem is this: I want to use in the custom class file (named `thesis.cls`), a different language than English, Greek to be specific. In the `.tex` file I loaded the `babel` package with the command               \usepackage[greek,english]{babel}      that is, English as my main language. Also to change language in the `.tex` file I use               \newcommand{\gr}{\selectlanguage{greek}}     \newcommand{\en}{\selectlanguage{english}}      Now inside the `.cls` file I want to create the text below for the `.tex` file.               %%%%%%%%%%%%%%%%%%     \newcommand\Declaration[1]{     \btypeout{Declaration of Authorship}     \addtotoc{Declaration of Authorship}     \thispagestyle{plain}     \null\vfil     %\vskip 60\p@     \begin{center}{\huge\bf{\gr{Δήλωση Προστασίας Πνευματικών Δικαιωμάτων}}\par}\end{center}     %\vskip 60\p@     {\normalsize #1}     \vfil\vfil\null     %\cleardoublepage     }     %%%%%%%%%%%%%%%%%%%      My problem is that the Greek sentence > <<Δήλωση Προστασίας Πνευματικών Δικαιωμάτων>> is output in a machine-like language. How can I write it in Greek?               %%%%%%%%%%     %thesis.cls (excerpt)     %%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \NeedsTeXFormat{LaTeX2e}[1996/12/01]     \ProvidesClass{Thesis}                   [2007/22/02 v1.0        LaTeX document class]          % declaration of options     \newif\ifdext@languagechosen          \DeclareOption{greek}{%       \PassOptionsToPackage{greek}{babel}       \dext@languagechosentrue     }     \DeclareOption{english}{%       \PassOptionsToPackage{english}{babel}       \dext@languagechosentrue     }          \def\baseclass{book}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}     \def\@checkoptions#1#2{       \edef\@curroptions{\@ptionlist{\@currname.\@currext}}       \@tempswafalse       \@tfor\@this:=#2\do{         \@expandtwoargs\in@{,\@this,}{,\@curroptions,}         \ifin@ \@tempswatrue \@break@tfor \fi}       \let\@this\@empty       \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi     }     \@checkoptions{11pt}{{10pt}{11pt}{12pt}}     \PassOptionsToClass{a4paper}{\baseclass}     \ProcessOptions\relax     \LoadClass{\baseclass}     \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}          \newcommand\Declaration[1]{     \btypeout{Declaration of Authorship}     \addtotoc{Declaration of Authorship}     \thispagestyle{plain}     \null\vfil     %\vskip 60\p@     \begin{center}{\huge\bf{\tg{Δήλωση Προστασίας Πνευματικών Δικαιωμάτων}}\par}\end{center}     %\vskip 60\p@     {\normalsize #1}     \vfil\vfil\null     %\cleardoublepage     }      Here is my LaTeX file               %%%%%%%%%%%%%%%%%%%%%%%%%%%     .tex file     %%%%%%%%%%%%%%%%%%%%%%%%%%%     \documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper     \usepackage{kmath,kerkis} % The order of the packages matters; kmath changes the default text font     \usepackage[greek,english]{babel}     \usepackage[utf8x]{inputenx}