title: How to enlarge "fourier" font to match "utopia" package

text: I'd love to exchange the "obsolete" `utopia` package against the `fourier` package for a couple of reasons. Unfortunately, the Utopia font in the `fourier` package renders much smaller compared to the `utopia` package. This looks especially bad when combined with the `avant` package. Here is a (very) minimal example:               \documentclass[a5paper,12pt]{article}          \usepackage{avant}     \usepackage{utopia}  % exchange for "fourier" to see the differences          \usepackage[english]{babel}     \usepackage{blindtext}     \usepackage{sectsty}     \allsectionsfont{\sffamily}          \begin{document}          \section{Section title}          Paragraph with a single \textsf{sans-serif} word.          \blindtext{}          \subsection{Subsection title}          \blindtext{}          \end{document}      Look for the size differences between headings and paragraphs as well as the different size of the word _sans-serif_ in the first paragraph. How can I enlarge the Utopia font in `fourier` to get rid of the problem? Or do you know of other ways to tackle the problem? **EDIT:** Sorry, I forgot to add the package `sectsty`, so the headings were printed in serifs.


title: Table inside table

text: Inside of a Beamer presentation, I want to put a graph side-by-side with a data table. Outline of the code:               \begin{tabular*}{l r}         \begin{center}\includegraphics{graph}\end{center}         &         \begin{tabular}{|p{1cm}|p{1cm}|p{1cm}|p{1cm}|}             1 & 2 & 3 & 4\\\hline             4 & 3 & 2 & 1\\\hline         \end{tabular}\\     \end{tabular*}      This gives the error `Something's wrong, maybe a missing \item`. Earlier in the presentation I used a `tabular*` environment to put a graph side-by-side with some bullet points, and in another slide, I used a `tabular` environment to display data under a graph. Is there a better way to do this? Why doesn't LaTeX allow a `tabular` inside a `tabular*`?


title: French accents in \hl from soul package

text: I'd like to use the `\hl` command from the soul package in a French text. However, it does not work whenever the part to highlight contains French accents (e.g.: `\hl{é}`). I could use `\'e` instead of `é` (`\hl{\'e}`) but it would be quite long to substitute all the accents just in case I will have to highlight them later (and there are several accents in French : é, è, ù, à, ...). Do you know whether it's possible to make `\hl` works with accents without substituing all the accents? Here is an example file:               \documentclass[15pt , a4paper]{article}          \usepackage[french]{babel}     \usepackage[utf8] {inputenc}     \usepackage{soul}     \usepackage{color}          \definecolor{y}{RGB}{245, 255, 189}     \sethlcolor{y}          \begin{document}       \hl{\'e} % works       %\hl{é} % doesn't work     \end{document}


title: How to make a line of text in a slightly different color (light gray in my case) in XeLaTeX

text: I Like to add an informal footnote to my document, containing web addresses. Some of the text is to be de-emphasized using gray text. How do I do that for a line or a word in XeLaTeX?


title: How to force to center the table captions?

text: i want to center the table captions. ![enter image description here](http://i.stack.imgur.com/xHzMQ.png) ![enter image description here](http://i.stack.imgur.com/PWOn5.png)


title: (Beamer) Numbering captions by section in beamer

text: I'm writing-up a lecture course in Latex with an essentially identical set of slides in beamer. I'd like to have the figure numbering in the beamer slides to match those of the lecture notes, for the sake of consistency in cross- referencing. The lecture notes are written in the article document style (in particular there are no chapters), and have figures numbered by section (i.e. `\section`.`\figure`). Is there some simple preamble-trick or workaround that will change the way that the captions are produced in beamer to number them consistently with the lecture notes? I'm trying to avoid having to write a new macro to use in the main body, since I'm compiling the notes and slides from the same set of source-files using `\input`.


title: Reduce space between Sinput and Soutput

text: I'm using Sweave in the book document class, and I'm getting really huge spacing between Sinput and Soutput evironments.               \documentclass[11pt]{book}     \usepackage{Sweave}     \usepackage{boxedminipage}               \begin{document}               ...          \begin{boxedminipage}{1\textwidth}     \begin{Schunk}     \begin{Sinput}     > 3 + 3     \end{Sinput}     \begin{Soutput}     [1] 6     \end{Soutput}     \begin{Sinput}     > 2 * 4     \end{Sinput}     \begin{Soutput}     [1] 8     \end{Soutput}     \begin{Sinput}     > (369 - 1)/6     \end{Sinput}     \begin{Soutput}     [1] 61.33333     \end{Soutput}     \end{Schunk}     \end{boxedminipage}          ...     \end{document}      And the end result looks like this: ![enter image description here](http://i.stack.imgur.com/IzM8v.png) Any advice for how to reduce that spacing?


title: Is forward search meant to work from an include file?

text: I am able to forward search from an emacs buffer containing my top level tex file to sumatrapdf by using the f8 key which is bound to Sumatra-jump-to-line. If i visit a buffer with a file included in the first buffer Sumatra incorrectly tries to find a PDF associated with that buffer. Are there any ways to make forward search work from the include file buffer?


title: LyX: How to add command line option/flag for latex compiling?

text: I'm using LyX 1.6.9 with MikTex on Windows XP. I want to use the "minted" package (for colored listings). This package uses Pygmentize to color the output. However, to do so, it uses \immediate\write18, which basically runs a command. By default, Latex is not allowed to execute commands and throws instead the following error:               runsystem(echo testing)...disabled (restricted).      Turns out with Miktex on Windows XP, you must append a flag to the latex command which is to compile your code (cf. Using minted (source code LaTeX package) with emacs/auctex):               -shell-escape      Since I'm using LyX, how do I add a flag / switch / option (whatever you call it) to the Latex command which compiles my LyX code? I am very reluctant to navigating through Windows' CMD for all my further Latex compiling and I'm pretty sure there is a way to add that in LyX. I haven't found anything on their website nor on Google/Duckduckgo. Any help will be appreciated. Thanks!


title: Basic xparse does not seem to be working

text: I can't seem to get basic xparse working. This seems like a bug, but this example feels so basic that I feel that there must be something I am not understanding about how to use this. Here is my test example:               \documentclass{article}     \usepackage{xparse}          \NewDocumentCommand\Row{O{} O{}}{         Token1=#1 Token2=#2\par     }          \begin{document}         \Row{A}{B} \par         \Row{C}    \par         \Row       \par     \end{document}      The output of this is > >     Token1= Token2= >     AB >     Token1= Token2= >     C >     Token1= Token2= >     1. I want the empty {} values ONLY when the tokens are not provided (which is what I thought the 'O{}' meant) so not sure why I am ONLY seeing the default values for the first two cases.   2. Why are lines 2 and 3 showing up in the output? That seems as if I had actually declared > >     \NewDocumentCommand\Row{O{} O{}}{ >       Token1=#1 Token2=#2\par >       **#1#2** >     } >   which is not that case.


title: Snugshade Environment too wide

text: I'm using the snugshade environment to draw a quote box, but it's a little to wide and not flush with the text on both sides. I have absolutely no idea if i can fix this with this environment or if i have to use something else - which i would not prefer as a solution. MWE:               \documentclass[12pt,a4paper]{scrbook}          \usepackage[svgnames]{xcolor}     \definecolor{lightgray}{gray}{0.95}     \definecolor{quoteColor}{gray}{0.15}          \usepackage{libertine}     \usepackage{graphicx}     \usepackage{framed}     \usepackage{lipsum}          \newcommand*\openquote{\makebox(0,-45){\scalebox{5}{``}}}     \newcommand*\closequote{\makebox(0, -5){\scalebox{5}{''}}}     \colorlet{shadecolor}{lightgray}          \makeatletter     \newif\if@right     \def\shadequote{\@righttrue\shadequote@i}     \def\shadequote@i{\begin{snugshade}\begin{quote}\openquote}     \def\endshadequote{%       \if@right\hfill\fi\closequote\end{quote}\end{snugshade}}     \@namedef{shadequote*}{\@rightfalse\shadequote@i}     \@namedef{endshadequote*}{\endshadequote}     \makeatother          \begin{document}          \lipsum[3]          \color{quoteColor}     \begin{shadequote}     \begin{quote}     \lipsum[4]     \end{quote}     \end{shadequote}          \lipsum[5]          \end{document}      Picture: ![Picture of MWE](http://i.stack.imgur.com/KYvq3.jpg)


title: Removing blank page before chapter

text: When I start my chapter by including a figure, the preceeding page automatically becomes blank. I'm using the report document class. I have a main .tex file from which I include other .tex files containing the chapters. For example when I use               \chapter{Chapter 5}          \fbox{ \includegraphics[page=1,scale=1]{mypdf.pdf}}      It will automatically generate a blank page before chapter 5. However if I use               \chapter{Chapter 5}          Just some text ...      It does not include a blank page. How can I remove the blank page in the first case?


title: Table right of TikZ image

text: I created a tree using TikZ and would like to add tabular explanation data to the right of it. The figure definition currently looks like this:               \begin{figure*}[h!]       \input{tikz/praefixeigenschaft}       \label{f:praefixeigenschaft}     \end{figure*}      ...and renders to the following tree: ![tree](http://tmp.dbrgn.ch/screenshots/20121230_141309.png) The explanation text is defined as follows:               \begin{tabular}{l l}       A = 100 & p = 0.2 \\       B = 1101 & p = 0.1 \\       C = 1100 & p = 0.1 \\       D = 111 & p = 0.2 \\       E = 0 & p = 0.4 \\     \end{tabular}          CEBA: 1100 / 0 / 1101 / 100      ...and renders to: ![text](http://tmp.dbrgn.ch/screenshots/20121230_141820.png) I tried both placing the figure in a table and floating the figure using the wrapfig package, but both attempts were not fruitful. How can I add the explanation text to the right of the figure (like in simple HTML table layout)?


title: Small box just surrounding the equation, not the whole line?

text: The following example makes a huge box that's the full width of the text, including the equation number:               \begin{framed}     \begin{equation}       x=y     \end{equation}       \end{framed}      Is there a way to get a box just around the equation itself?


title: How do you accomplish stealth' with the new arrows.meta?

text: \documentclass{memoir}          \usepackage{pgfcore}     \usepackage{pgfplots}     \usetikzlibrary{arrows, arrows.meta}          \begin{document}     \resizebox{\linewidth}{!}{       \begin{tikzpicture}[>=stealth']       \foreach \arrowa [count=\i from 1] in {stealth, Stealth, {Stealth[round]}, >} {         \path (0.0, {-0.3 * \i}) edge [-\arrowa] (1.0, {-0.3 * \i});       }     \end{tikzpicture}     }     \end{document}      How do you make `stealth'` using the new `arrows.meta` library? ![enter image description here](http://i.stack.imgur.com/6an3I.png)


title: Simpler alternative to hyperref?

text: I've been trying to get a hyperlinked table of contents working with a preexisting large book project. I've tried hyperref, and have had problems getting it to work right. In case it's of interest, I'll append a brief description of the problems, but the long and the short of it is that I'm getting the impression of hyperref as a big, complex, fragile package that includes a lot of unrelated functionality such as PDF titling, and I don't want to use it. Is there any alternative that will allow me to do something more low-level and just generate the hyperlinks I want? All I want is something like this:               \target{about-socrates}Socrates was sentenced to execution by drinking hemlock.     ...     We recall that \href{about-socrates}{Socrates} drank hemlock.      That's all I need. I don't need it to do any styling of links for me (colors, boxes, etc.) -- I can handle that myself. I only need it to work with PDF output, not DVI, HTML, etc. I don't need it to automatically generate hyperlinks in the TOC; I think I can do that myself as well. _Description of the problems with hyperref (probably irrelevant)_ I get a cryptic error message if I invoke hyperref after all other packages (`! Package hyperref Error: This should not happen! (hyperref) Missing version of 'hpdftex.def'.`), and although this error goes away if I invoke it before other packages, then some of the page numbers it links to are wrong. Unfortunately I have not had any luck getting a MWE to demonstrate either problem.


title: Centering \vdots in a system of many equations and aligning the equations to the opening brace

text: I have a problem similar to this question. I want to typeset `k` equations with the horizontal `\dots` and the `\vdots` aligned. The problem is that I want the equations to be aligned to the opening brace. For example the following code:               \documentclass{article}     \usepackage{amsmath}          \begin{document}     \begin{equation}     \left\lbrace %     \begin{split}         a + b + &\dots + c = d                                    \\         a + b + &\dots + c = d                                    \\                 &\setbox0\hbox{=}\mathrel{\makebox[\wd0]{\vdots}} \\         aaaaaaa + b + &\dots + c = d     \end{split} %     \right.     \end{equation}     \end{document}      Produces: ![enter image description here](http://i.stack.imgur.com/QCstl.png) As you can see the first two equations start far from the brace. So I tried this:               \documentclass{article}     \usepackage{amsmath}          \begin{document}     \begin{equation}     \left\lbrace %     \begin{split}         &a + b + &\dots + c = d                                    \\         &a + b + &\dots + c = d                                    \\         &        &\setbox0\hbox{=}\mathrel{\makebox[\wd0]{\vdots}} \\         &aaaaaaa + b + &\dots + c = d     \end{split} %     \right.     \end{equation}     \end{document}      That yields what I want, but the vertical dots are not centered under the horizontal dots: ![enter image description here](http://i.stack.imgur.com/KirgP.png) How can I obtain the alignment as in the second image but with the vertical dots aligned as in the first example?


title: Unwanted extra gap in longtable

text: I have finally faced a problem when all googling, this forum and any wittiness could not help me out. I have been working in a `\longtable` environment when in seemingly the most simple table I have ever made an unwanted extra spacing appeared with no visible for me reason. Here is the code:               \usepackage{longtable}     \usepackage{polyglossia}     \setdefaultlanguage{latvian}          \begin{longtable}{ccccc}      \caption{Virknes slēguma bezdimensionālie lielumi} \\ %fixed       \hline        npk & $\omega$ & $i$ & $u_C$ & $u_L$ \\       \hline       \endfirsthead             \multicolumn{5}{c}         {{\tablename\ \thetable{} (turpināta no iepriekšējas lappuses)}} \\ \\       \hline        npk & $\omega$ & $i$ & $u_C$ & $u_L$ \\      \hline       \endhead           \hline \multicolumn{5}{l}{{Tabulas turpinājums nākamā lappusē}} \\      \endfoot          \hline     \endlastfoot       %just data       1  & 1,71 & 0,891 & 0,522 & 1,52 \\       2  & 1,68 & 0,923 & 0,551 & 1,55 \\       3  & 1,62 & 0,995 & 0,614 & 1,61 \\       4  & 1,45 & 1,32 & 0,911 & 1,91 \\       5  & 1,30 & 1,86 & 1,43 & 2,42 \\       6  & 1,21 & 2,51 & 2,07 & 3,05 \\       7 & 1,16 & 3,32 & 2,87 & 3,84 \\       8  & 1,10 & 4,94 & 4,49 & 5,43 \\       9  & 1,01 & 12,8 & 12,6 & 12,9 \\       10 & 0,984 & 12,3 & 12,5 & 12,1 \\       11 & 0,955 & 8,47 & 8,87 & 8,09 \\       12  & 0,941 & 6,98 & 7,42 & 6,57 \\       13  & 0,926 & 5,87 & 6,33 & 5,43 \\       14  & 1,04 & 9,07 & 8,71 & 9,45 \\       15  & 0,868 & 3,41 & 3,93 & 2,96 \\       16  & 0,752 & 1,71 & 2,28 & 1,29 \\       17  & 0,665 & 1,19 & 1,79 & 0,790 \\       18  & 0,578 & 0,867 & 1,50 & 0,501 \\     \end{longtable}      I need to use Latvian language, I don't think, that it is important, but just prefered to show my problem as it is. Will appreciate any help and advice. ![unwanted gap between 4th and 5th column](http://i.stack.imgur.com/avw2t.png)


title: How to draw bigotimes and diamond with tikz?

text: I want to draw two figures using tikz. One is `bigotimes` and the other one is `diamond`, as you can seen in the picture below. But I don't know how to draw them. Could someone help me? ![enter image description here](http://i.stack.imgur.com/J0cvK.png)


title: Cross-references linking to wrong equations using `hyperref`

text: I have two macros I've defined that I use to set the context in which equations are numbered in my document. One that establishes something I call a 'block' in which equations are numbered, by resetting the equation counter to 0 and setting the equation grouping to a string provided as an argument,               \newcommand{\setgroupingsection}[1]{\setcounter{section}{#1}\setgroupingblock{#1}}      and another that sets the section (using `\setcounter{section}`) and then calls my first, block-setting macro:               \newcommand{\setgroupingblock}[1]{\gdef\equationgrouping{#1:}\phantomsection\setcounter{equation}{0}}      I use these for a variety of reasons, to gain section-independent control over numbering of various elements (not just equations), and they use `mathtools` to label all of my equations as expected. However `hyperref` cross-reference links to these equations do not work correctly. Cross-references seem to behave as if they are numbered within sections only, ignoring 'blocks'. I've stared at my code for a while now, but am stumped and would appreciate help sorting out what I'm doing wrong. * * *               \documentclass{article}          \usepackage{mathtools}     \usepackage{hyperref}          % Manually set the section; set a new 'block'     \newcommand{\setgroupingsection}[1]{\setcounter{section}{#1}\setgroupingblock{#1}}     % Set a 'block' for numbering equations, overriding any section, and resetting the equation counter     \newcommand{\setgroupingblock}[1]{\gdef\equationgrouping{#1:}\phantomsection\setcounter{equation}{0}}          % Equation numbering and referencing     \renewcommand{\theequation}{\equationgrouping\arabic{equation}}     \gdef\equationgrouping{}               \begin{document}          \setgroupingsection{10} Section \textbf{10} begins here. Subsequent equations are numbered within this section, until another section is started, or a block is started.          \begin{equation}     q(x)=f(x)\cdot g(x)\label{eq:X}     \end{equation}     \begin{equation}     a(i,j)=a(i,q)\cdot a(p,j)\label{eq:Y}     \end{equation}          \pagebreak{}%To clearly demonstrate hyperlinking jumps in PDF          \setgroupingblock{A} Block \textbf{A} begins here. Subsequent equations are numbered within this block, until another block is started, or another section is started.          \begin{equation}     f(x)=x^{2}+3x\label{eq:Example1}     \end{equation}     \begin{equation}     g(x)=\sin(\gamma^{2})\label{eq:Example2}     \end{equation}     \begin{equation}     f(x)=\cos(\delta^{2})\label{eq:Example3}     \end{equation}          \pagebreak{}%To clearly demonstrate hyperlinking jumps in PDF          \setgroupingsection{20} Section \textbf{20} begins here.          \begin{equation}     a(i,j)=a(i,q)\cdot a(p,j)\label{eq:Z}     \end{equation}          \pagebreak{}%To clearly demonstrate hyperlinking jumps in PDF          \setgroupingblock{B} Block \textbf{B} begins here.          \begin{equation}     f(x)=x^{2}+3x\label{eq:Example4}     \end{equation}          \pagebreak{}%To clearly demonstrate hyperlinking jumps in PDF          Numbering of equations works as desired, but hyperlinks in cross-references do not, Cross-references seem to behave as if they are numbered within sections only, ignoring blocks. For example the links to the first and second equations in block \textbf{A},\eqref{eq:Example1} and \eqref{eq:Example2} go to the corresponding equations in the most recent section before block \textbf{A}, \eqref{eq:X} and \eqref{eq:Y}; though the reference to \eqref{eq:Example3} works correctly (there is no corresponding equation in section \textbf{10} to "confuse" it with. Similarly \eqref{eq:Example4} links to \eqref{eq:Z}.          \end{document}


title: Bibliography failing to appear

text: I am using someone else's code to type the bibliography, I thought it would be a nice idea to see something different from my usual approach. I can always switch back to the safe path but this problem is blowing my mind and iI want it solved. The bibliography fails to appear. I have 3 files, one with bibliography one with the class and the actual tex. In the class file it is written:                  \newcommand{\printbibsection}[2]{        \begin{refsection}         \nocite{*}         \printbibliography[sorting=chronological, type={#1}, title={#2}, heading=subbibliography]        \end{refsection}     }       And in the tex file there is:               \section{publications}          \printbibsection{article}{article in peer-reviewed journal} % Print all articles from the bibliography          \printbibsection{book}{books} % Print all books from the bibliography          \begin{refsection} % This is a custom heading for those references marked as "inproceedings" but not containing "keyword=france"     \nocite{*}     \printbibliography[sorting=chronological, type=inproceedings, title={international peer-reviewed conferences/proceedings}, notkeyword={france}, heading=subbibliography]     \end{refsection}          \begin{refsection} % This is a custom heading for those references marked as "inproceedings" and containing "keyword=france"     \nocite{*}     \printbibliography[sorting=chronological, type=inproceedings, title={local peer-reviewed conferences/proceedings}, keyword={france}, heading=subbibliography]     \end{refsection}          \printbibsection{misc}{other publications} % Print all miscellaneous entries from the bibliography          \printbibsection{report}{research reports} % Print all research reports from the bibliography      After typesetting Xelatex,Bibtex,Xelatex,Xelatex in that sequence the bibliography does not appear. Any suggestions?


title: Consistent alignment of equations throughout entire paper

text: I'm writing a thesis and want all equations to be left aligned but also commence from the exact same distance from the left margin. I desire a (perhaps) 1 inch gap between all my equations and the left margin. At the moment, I do not know how to do this. The distance between the equation and the left margin is dependent on how long the equation is. For example:               \documentclass[a4paper,11pt]{article}     \usepackage{amsmath}          \begin{document}          \begin{align}     &\bf{\hat{\delta}}_\emph{ij} = 123 \\     &i \in \{1,2,...,N\}; j \in \{\textrm{(2.1),(2.2),(2.3)}\}     \end{align}          \begin{align}     &\bf{\hat{\delta}}_\emph{ij} = 123 \\     &i \in \{1,2,...,N\}; j \in \{\textrm{(2.1),(2.2),(2.3),(2.3),(2.3),(2.3)}\}     \end{align}               \end{document}


title: Drawing neural network with tikz

text: I'm trying to draw a neural network diagram with tikz. I found this code online:               \begin{figure}[htp]     \centering     \begin{tikzpicture}[     plain/.style={       draw=none,       fill=none,       },     net/.style={       matrix of nodes,       nodes={         draw,         circle,         inner sep=8.5pt         },       nodes in empty cells,       column sep=0.6cm,       row sep=-11pt       },     >=latex     ]     \matrix[net] (mat)     {     |[plain]| \parbox{1cm}{\centering Input\\layer} & |[plain]| \parbox{1cm}{\centering Hidden\\layer} & |[plain]| \parbox{1cm}{\centering Output\\layer} \\     & |[plain]| \\     |[plain]| & \\     & |[plain]| \\     |[plain]| & |[plain]| \\     & & \\     |[plain]| & |[plain]| \\     & |[plain]| \\     |[plain]| & \\     & |[plain]| \\     };     \foreach \ai [count=\mi ]in {2,4,...,10}       \draw[<-] (mat-\ai-1) -- node[above] {I\mi} +(-1cm,0);     \foreach \ai in {2,4,...,10}     {\foreach \aii in {3,6,9}       \draw[->] (mat-\ai-1) -- (mat-\aii-2);     }     \foreach \ai in {3,6,9}       \draw[->] (mat-\ai-2) -- (mat-6-3);     \draw[->] (mat-6-3) -- node[above] {O1} +(1cm,0);     \end{tikzpicture}          \caption{ANN diagram for Speed Sign recognition.}     \label{fig_m_3}     \end{figure}      It produces following image: ![enter image description here](http://i.stack.imgur.com/bzQb3.png) It has 5 input nodes but I want to generalize this drawing by having n nodes in each of the layer. So in input layer, number of node shown will be 4 with vertical '...' in middle, hidden layer would contain 3 nodes with vertical '...' in middle and output would have 2 nodes with vertical '...' in middle. I want maintain their conical shape. Something like this: ![enter image description here](http://i.stack.imgur.com/V4ndx.png) It is really bad drawing, sorry about that, one can now imagine how bad I must be with tikz. The dots in middle are actually fully filled, in my drawing they are hollow. Any help or advice would be appreciated.


title: Still some of the flows missing in the flowchart

text: I have posted this question few days back but still I can't complete the algortihm. ![enter image description here](http://i.stack.imgur.com/2tnri.png) This is the uncompleted work done so far               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{matrix,shapes,arrows,positioning,chains}          \begin{document}          % Define block styles     \tikzset{     desicion/.style={         diamond,         draw,         text width=4em,         text badly centered,         inner sep=0pt     },     block/.style={         rectangle,         draw,         text width=10em,         text centered,         rounded corners     },     cloud/.style={         draw,         ellipse,         minimum height=2em     },     descr/.style={         fill=white,         inner sep=2.5pt     },     connector/.style={         -latex,         font=\scriptsize     },     rectangle connector/.style={         connector,         to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },         pos=0.5     },     rectangle connector/.default=-2cm,     straight connector/.style={         connector,         to path=--(\tikztotarget) \tikztonodes     }     }          \begin{tikzpicture}     \matrix (m)[matrix of nodes, column  sep=2cm,row  sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]{         |[block]| {Start}              &  \\         |[block]| {Assume that $a=c$ the optimilalty cretierin given by }               &                                            \\         |[desicion]| {Locally optimal}          &                                             \\        |[block]| {Assume that $a=d$ the optimilalty cretierin given by}    &                                             \\         |[desicion]| {Locally optimal}         &           |[block]| {Stop}                                   \\              |[block]| {Assume that $a=e$ the optimilalty cretierin given by}    &    |[desicion]| {Locally optimal}                                          \\                 |[desicion]| {Locally optimal}         &       |[block]| {Assume that $a=k$ the optimilalty cretierin given by}                                      \\                      |[block]| {Assume that $a=f$ the optimilalty cretierin given by}    &   |[desicion]| {Locally optimal}                                         \\     };     \path [>=latex,->] (m-1-1) edge (m-2-1);     \path [>=latex,->] (m-2-1) edge (m-3-1);     \path [>=latex,->] (m-3-1) edge (m-4-1);     \path [>=latex,->] (m-4-1) edge (m-5-1);     \path [>=latex,->] (m-5-1) edge (m-6-1);     \path [>=latex,->] (m-6-1) edge (m-7-1);     \path [>=latex,->] (m-7-1) edge (m-8-1);     \path [>=latex,->] (m-8-1) edge (m-8-2);     \path [>=latex,->] (m-8-2) edge (m-7-2);     \path [>=latex,->] (m-7-2) edge (m-6-2);     \path [>=latex,->] (m-6-2) edge (m-5-2);          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/8p3BY.png) How do I fix the paths according the flow chart shows in first figure?


title: How to type French character in LaTeX

text: I would like to insert "ç". Tried including `\usepackage[utf8]{inputenc}`, and type `\c {c}` , but doesn't work.


title: How can I set uppercase greek letters as italic in math mode by default?

text: This is a follow up question to here. The recommended solution doesn't work for me. I therefore let all my mathematical packages in the MWE. The result is an upright Psi followed by an italic Psi. I would like to have all upper-case Greeks being italic in formulas. The possibility to set one character upright (for a constant, an operator...) would be great. Therefore I wonder, if there is a more beautiful solution around.               \documentclass[]{scrreprt}          \usepackage[final]{microtype}     \usepackage{luatextra}     \usepackage{fontenc}         \defaultfontfeatures{Ligatures={TeX}}     \usepackage[ngerman, english]{babel}     \useshorthands{"}     \addto\extrasenglish{\languageshorthands{ngerman}}     \usepackage{amsmath}     \let\Gamma\varGamma     \let\Delta\varDelta     \let\Theta\varTheta     \let\Lambda\varLambda     \let\Xi\varXi     \let\Pi\varPi     \let\Sigma\varSigma     \let\Upsilon\varUpsilon     \let\Phi\varPhi     \let\Psi\varPsi     \let\Omega\varOmega     \usepackage{mathtools}     \usepackage{amssymb}     \usepackage{commath}     \usepackage[     per-mode=symbol-or-fraction,     locale=DE,     sticky-per     ]{siunitx}      \usepackage{xfrac}     %     \begin{document}     $\Psi \varPsi$     \end{document}      * * * **Edit** My knowledge over the used math-packages is quite small. Don't know, if I use them at all (`amssymb` and `mathtools`). If they are obsolete or not recommended for typesetting in Germany (English and German) or if something is missing for typical formula setting, I would be glad for every advise.


title: Separate \arraystretch value for every table

text: `\arraystretch` defines vertical spacing of tables. If I have several tables, how can I define a separate value of `\arraystretch` for every table? In my case, the last defined `\arraystretch` works for all tables.


title: multiple sets of footnotes

text: I am using a biblatex style that puts the references as footnotes and also adds them to the bibliography at the end (taken from here). In addition I want to use footnotes to move long passages, e.g. urls from tables to the bottom of the page etc. For this I would like a different set of footnotes, identified by symbols rather than numbers, so that they are not confused with the citations. I already found the footmisc package to switch from numbers to symbols, but I haven't found a way to use both numbered footnotes for citations and symbol footnotes for everything else at the same time. Can anyone help?


title: How to create subfloat figures (two in first row and one below)?

text: I want to place three figures like this on the page:               (a) (b)       (c)      How do I achieve this using subfloat or any other method in LaTeX? The three figures need to have a common caption and label. I have tried this:               \begin{figure}[h]     \centering     \begin{tabular}{c c}     \subfloat[] { \includegraphics[scale=0.4]{1.pdf} }     &     \subfloat[] { \includegraphics[scale=0.4]{2.pdf} }     \\     \multicolumn{2}{c}     \subfloat[] { \includegraphics[scale=0.6]{3.pdf} }     \end{tabular}     \caption{Some caption}     \label{some-label}     \end{figure}      But, this is displaying `[]` for the third figure instead of `(c)`. Also it displays `[]` to one side of the page instead of center.


title: TikZ: changing colour of a path half way along

text: Here's the problem:               \documentclass{minimal}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     [scale = 3,     foo/.style={line width = 5pt}]     \draw[foo,red] (0,0) -- (0,1);     \draw[foo,blue] (0,1) -- (1,2);     \end{tikzpicture}     \end{document}      I want a line that changes colour half way along. I could do this with two paths (as above) but as you can see, the picture doesn't look great. ![TikZ problem](http://i.stack.imgur.com/qoVgf.png) I can make the first path go up to `(1,2)` as well, and then just draw over it, but the fundamental problem is that the thick line kind of cuts at the wrong angle. I'd like the transition between the red and blue to be angled nicely. Is there a way to do this with paths, or am I going to have to create custom shapes to achieve the effect I want? Which looks like this: ![TikZ problem 2](http://i.stack.imgur.com/RaEU1.png)


title: inconsistent page numbering position of glossaries page in toc

text: I am preparing a thesis using `book` document class and some package for fulfilling the requirement of university dissertation page layout, such as the roman page number is supposed to be at the up right corner. And I use `glossaries` package to generate a list of abbreviation and insert it after the list of figures. However, the content is good, but the page number is in the middle bottom, instead of up right corner. Below is part of `thesis.sty`, which I assume is responsible for page number positioning.               \renewcommand{\ps@myheadings}{     % Since the default margin is 1'' we move up .25 in for a page number     % at 3/4'' from the top.       \renewcommand{\@oddhead}{ \thepage}     % For twosided, 'even' are the left side pages.     % For onesided, Only 'odd' is used -- the right side pages are all of them.       \renewcommand{\@evenhead}{ \thepage}            \renewcommand{\@oddfoot}{}       \renewcommand{\@evenfoot}{}     }      The other contents, like `\listoftables`, are all good, and `tocloft` package is used to insert them into TOC. I also tried to use `\thispagestyle{myheadings}` and/or `\clearpage` to confine the `\printglossaries` command, but no luck. Problem solved, and below is the MWE:                   \documentclass[12pt,oneside]{book}        %        \usepackage{thesis} % some format specifications define page number in up right corner        \usepackage[acronym,toc]{glossaries} % loaded after hyperref             \newacronym{cvd}{CVD}{chemical vapor deposition}        \newacronym{cft}{CFT}{crystal-field theory}             \makeglossaries          \begin{document}            \title{\LaTeX is great}       \author{me}       \maketitle              \clearpage         \tableofcontents         \clearpage         \listoftables         \clearpage         \listoffigures              \begin{singlespace}         %\thispagestyle{myheadings} % before, this does not work         \renewcommand{\glossarypreamble}{\thispagestyle{myheadings}} % after, this works.          \printglossary[type=\acronymtype]         \clearpage         \end{singlespace}              \include{./ch-intro/ch-intro}             %\glsaddallunused         \appendix         \chapter{math}         \renewcommand{\bibname}{REFERENCES}         \begin{singlespace}         \printbibliography         \end{singlespace}          \end{document}


title: Problem with classicthesis and small caps

text: # Obtaining the example code I tried compiling the `classicthesis` example documents, especially `classicthesis-book.tex`. Therefore I copied the directory to my home folder with               cp -R $(kpsewhich -var-value TEXMFDIST)/doc/latex/classicthesis ~/      Then I went to `~/classicthesis/Examples/` and adjusted `classicthesis- book.tex`, such that               %\usepackage[linedheaders,parts,pdfspacing]{../classicthesis} % ,manychapters     \usepackage[linedheaders,parts,pdfspacing]{classicthesis} % ,manychapters      because `classicthesis.sty` is not in the directory above. Then I compiled using               pdflatex classicthesis-book.tex      It completed without errors. I reran this some times to get the index updated. # Problem When executing the above work flow, there are no small caps in the TOC for the part numbers. Compare these two ### Original > ![enter image description here](http://i.stack.imgur.com/wLjQA.png) ### Self compiled > ![enter image description here](http://i.stack.imgur.com/x0KUD.png)


title: Behavior of \\ inside center environment

text: While trying to compile a title page for my dissertation I realized that I do not understand the behavior of `\\`. Consider the following MWE               \documentclass{memoir}     \begin{document}     \begin{center}       {\Huge\bfseries%         Eat fresh tires to\\[0.25\baselineskip]         Get Ready to the Ultimate\\[0.25\baselineskip]         Victory Against the\\[0.25\baselineskip]         Dragons       }% Title     \end{center}     \end{document}      which yields a bad spacing before the last line. It seems like either:               {\Huge\bfseries%       Eat fresh tires to\\[0.25\baselineskip]       Get Ready to the Ultimate\\[0.25\baselineskip]       Victory Against the\\[0.5\baselineskip]       Dragons     }% Title      or               {\Huge\bfseries%       Eat fresh tires to\\[0.25\baselineskip]       Get Ready to the Ultimate\\[0.25\baselineskip]       Victory Against the\\[0.25\baselineskip]       Dragons\\     }% Title      can serve as a workaround. Neither of them is intuitive for me.   * What is the right way to handle the line breaks here (with a manually tuned vertical spacing)?   * Why is it happening? Teach me how to fish. Why `\\` behaves this way? Where is it _documented_?


title: How to reference the arguments defined in a "newcommand"?

text: **What I am doing:**   I want to draw a picture (as shown below) to illustrate the contraction of some intervals to nodes in a line.   ![Intervals](http://i.stack.imgur.com/CXmhY.jpg) First, I define a `newcommand` for interval (i.e., \op) with three arguments: start point, end point, and the name. Then, a line (or a chain) is drawn. At last, the interval and its corresponding node in the line are connected. The whole code is: ( _Note:_ you can also read and modify the shared code at SharedLatex before any answer is accepted.)               \documentclass{article}     \usepackage[utf8]{inputenc}          \usepackage{tikz}     \usetikzlibrary{calc, chains}          \title{Reference Arguments in Newcommand}     \author{hengxin}     \date{31 December 2013}          \begin{document}     \begin{tikzpicture}[]          % new command: inverval     \newcommand{\op}[3] % #1: start point; #2: end point; #3: interval name     {       \coordinate (start) at #1;    % start point       \coordinate (end) at #2;  % end point       \coordinate (mid) at ($0.5*#1 + 0.5*#2 + (0,0.8cm)$);            \draw[ultra thick, blue, |-|] (start) -- (end); % draw the interval       \node (#3) [font = \huge] at (mid) {#3};  % attach the operation name     }          % define three intervals     \op{(0,2)}{(2,2)}{$a$};     \op{(4,3)}{(6,3)}{$b$};     \op{(7,2)}{(10,2)}{$c$};          % contract them into single nodes in a line (or a chain)     \begin{scope}[font = \huge, start chain = schedule, node distance = 3.0cm, every     join/.style = {very thick, ->, red}]       \foreach \opi in {a, b, c}         \node (\opi) [circle, draw, on chain, join, label = {[] below : $\opi$}] {};     \end{scope}          % connect interval and its corresponding node in the line     \begin{scope}[cedge/.style = {->, dashed, draw, thick}]       \draw [cedge] (0,2) to (a);       \draw [cedge] (2,2) to (a);            \draw [cedge] (4,3) to (b);       \draw [cedge] (6,3) to (b);            \draw [cedge] (7,2) to (c);       \draw [cedge] (10,2) to (c);     \end{scope}          \end{tikzpicture}     \end{document}      **What I want to do:**   As you can see, in the last step (connecting interval and its corresponding node in the line) I have hard-coded the coordinates of the start points and end points of each interval like `\draw [cedge] (0,2) to (a); \draw [cedge] (2,2) to (a);`. It is surely tedious and error-prone. Therefore, > Is there some elegant way for me to reference the two points (as arguments > of `newcommand`) of each interval without hard-code?


title: Change background color for only a section of the page?

text: I understand one can easily change the background color for text portion easily, but I would like to do the same for an entire portion of the page. How does one change background color for only a section of the page?


title: Vertical Spacing using \subcaption package

text: I have a simple problem. I'm trying to add a little bit of vertical spacing between the top two and bottom two subfigures. Here's my code:               \documentclass{article}     \usepackage[demo]{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \begin{document}     \begin{figure}     \centering     \begin{subfigure}{.5\textwidth}       \centering       \includegraphics[scale=0.2]{CHRe100t0_5.jpg}       \caption{t = 0.5 s and Re = 100}     \end{subfigure}%     \begin{subfigure}{.5\textwidth}       \centering       \includegraphics[scale=0.2]{ChRe100t1.jpg}       \caption{t = 1.0 s and Re = 100}     \end{subfigure}     \begin{subfigure}{.5\textwidth}        \centering        \includegraphics[scale=0.2]{CHRe100t1_5.jpg}        \caption{t = 1.5 s and Re = 100}     \end{subfigure}%     \begin{subfigure}{.5\textwidth}     \centering        \includegraphics[scale=0.2]{CHRe100t2.jpg}        \caption{t = 2.0 s and Re = 100}     \end{subfigure}     \caption{y vs. u}     \end{figure}     \end{document}      Any suggestions would be greatly appreciated!


title: Manually change caption label in subfig

text: In the example:                 \documentclass{article}       \usepackage[demo]{graphicx}       \usepackage{subfig}            \begin{document}                 \begin{figure}[h]       \centering       \subfloat[]{\label{first}       \includegraphics[width=1cm]{logo}       }       \subfloat[]{\label{second}       \includegraphics[width=1cm]{logo}       }       \caption{       Some label referring to       \protect\subref{first}.       }       \end{figure}                 \end{document}      I would like to manually label e.g. the second figure with a label like (ii-z) instead of (b). Note that I do not want it to be automatically labelled and \subfig* does not seem to help. How do I do this?


title: Bold small caps with XeLaTeX and LuaLaTeX

text: I am having some issues with `LuaLaTex` and/or `fontenc` and bold small caps while using the Adobe Garamond Pro font. Here are my files: ![enter image description here](http://i.stack.imgur.com/F6twK.png) When I compile with XeLaTeX and these options:               \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont{Adobe Garamond Pro}      Everything works fine (except for the italic small caps, but I have no use for it): ![enter image description here](http://i.stack.imgur.com/ChaXR.png) But when I try to compile with LuaLaTeX and these options:               \usepackage{fontspec}     \setmainfont[%         Path           = /home/.../Fonts/Adobe Garamond Pro/,         Extension      = .otf,         Ligatures      = TeX,         BoldFont       = AGaramondPro-Bold,         ItalicFont     = AGaramondPro-Italic,         BoldItalicFont = AGaramondPro-BoldItalic,     ]{AGaramondPro-Regular}      Bold small caps don't work: ![enter image description here](http://i.stack.imgur.com/SzvoP.png) Here is the log:               LaTeX Font Warning: Font shape `EU2/AGaramondPro-Regular(0)/bx/sc' undefined     (Font)        using `EU2/AGaramondPro-Regular(0)/bx/n' instead on input      line 31.          [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./smallcaps.aux)          LaTeX Font Warning: Some font shapes were not available, defaults     substituted.      I looked into the `fontspec` manual and did not find anything that solved this issue. Clearly it's not font-related because XeLaTeX manage to produce bold small caps but not LuaLaTeX. Thanks for your help.


title: How can I automate the generation of this dynamic-programming graph?

text: I would like to draw the following dynamical programming graph. I believe it could be sped by using the `foreach` syntax. ![enter image description here](http://i.stack.imgur.com/b0J1E.png) The code I have started to write is               \documentclass[tikz, convert = false]{standalone}     \begin{document}     \begin{tikzpicture}       \foreach \x/\y/\lab in {0/0/5, 1/1/6, 2/2/10, 3/3/7, 4/2/8, 5/1/10, 6/0/11,         5/-1/9, 4/-2/7, 3/-3/6, 2/-2/9, 1/-1/7, 0/0/}{         \draw (\x, \y) -- ??     \end{tikzpicture}     \end{document}      The issue is I need to index the next point so it goes `(x_1, y_1) -- (x_1, y_2) node[font = \small, pos = .5, fill = white, inner sep = .01] {\lab};` How can this be done? Then I will have to create other `foreach` loops to cut across. Is there a way to do this entire process in one loop? If so, how, because I don't see how can I do it.


title: How can I use unusual non-English characters individually?

text: I would like to user very unusual characters and after some research I still have no idea how it is done. I want, for example the write the word Shīʿah, as in Shīʿah Islam in my dissertation (Note that's a ʿ character, not a single apostrophe ' nor an opening single quote `). Sadly I can't figure out, how to do that. Can anyone help me?


title: TikZ: normal and tangent vectors added to ellipse 2

text: In Tikz: unit tangent vectors to a curve, Jake helped with adding a tangent vector to the ellipse. However, in that question, the ellipse was oriented with the semi-major and minor axis in line with the x and y axis. In this question TikZ: Drawing an ellipse through two points, Percusse helped with the constructing of a random elliptical arc which is what I am using here. So we don't know the alignment of the semi-major and minor axis. Maybe we can find the rotation of it, but I am not `100%` on that yet. In the absence of this information, my question is how can I add a normal and tangent vector to the path ending at `P2`? Can Jake's answer be adapted, or do we need a different method due to the ambiguity of the elliptical orientation?                 \documentclass[tikz]{standalone}       \usetikzlibrary{arrows,calc}            \begin{document}            \begin{tikzpicture}[         dot/.style = {outer sep = +0pt, inner sep = +0pt, shape = circle, draw = black, label = {#1}},         small dot/.style = {minimum size = 1pt, dot = {#1}},         big dot/.style = {minimum size = 2pt, dot = {#1}},         line join = round, line cap = round, >=triangle 45         ]         \node[ fill = black, big dot = {below: \(F\)}] (F) at (0, 0) {};         \node[ fill = black, big dot = {below: \(P_1\)}] (P1)  at (2, 0) {};         \node[ fill = black, big dot = {above right=.25cm:\(P_2\)}] (P2) at (-2, 2) {};                  \begin{pgfinterruptboundingbox}                           \begin{scope}[decoration = {markings,             mark = at position 0.5 with {\arrow{>}}           }]           \clip (2, 0) -- (-2, 0) -- (-2, 4) -- (2, 4) -- cycle;           \draw[name path global = ellp, postaction = decorate] let             \p0 = ($(P2) - (F)$),             \p1 = ($(P1) - (P2)$)           in (P2|-P1) ++ (\x1, 0) arc (0:100: \x1 and \y0);                                                \end{scope}     \end{pgfinterruptboundingbox}          \path[name path = aux1] (P2) circle [radius = 1bp];     \draw[name intersections = {of = ellp and aux1}, -latex] (P2) --     ($(intersection-2)!.75cm!(intersection-1)$);                 \end{tikzpicture}       \end{document}       ![enter image description here](http://i.stack.imgur.com/yG4TA.png)


title: node on top of Gauss distribution

text: following this thread: gauss curves inside minipage and node I have the following working example with a very specific problem. I want to include the sigmas above the double arrows, but without the tick line (remove the `\node` lines to see what I am talking about), is it possible? Besides, I do not really understand the coordinates specified in the node lines (why can't the `y` coordinate of the node be 0.2 instead of -0.1 as in the corresponding double arrow?). Many thanks in advance! See the code below:               \documentclass[ignorenonframetext, xcolor={dvipsnames,table}]{beamer}     \mode<presentation> {     \usetheme{Berkeley}     \usecolortheme{dolphin}          \usepackage{tikz} %for transparency     \usetikzlibrary{positioning,shadows,calc}     \usepackage{pgfplots}     \pgfmathdeclarefunction{gauss}{2}{%         \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     }               \begin{document}               \begin{frame}     \begin{tikzpicture}             \begin{axis}[                 no markers, domain=0:10, samples=100,                 axis lines*=left, xlabel=\empty, ylabel=\empty,                 every axis y label/.style={at=(current axis.above origin),anchor=south},                 every axis x label/.style={at=(current axis.right of origin),anchor=west},                 height=3cm, width=4.25cm,                 xtick={3,6}, ytick=\empty,                 xticklabels={\tiny{$\mu$1},\tiny{$\mu$2}},                 enlargelimits=false, clip=false, axis on top]                 \addplot [fill=pink, draw=none, domain=3.75:4.5] {gauss(3,0.5)}                 \closedcycle;                 \addplot [fill=pink, draw=none, domain=3:4.5] {gauss(6,1)}                 \closedcycle;                 \addplot [cyan!50!black] {gauss(3,0.5)};                 \addplot [cyan!50!black] {gauss(6,1)};                 \addplot[<->] coordinates {(2.25,0.2) (3.75,0.2)};                 \node[coordinate, pin={\tiny{$\sigma$1}}] at (axis cs: 3,-0.1){};                 \addplot[<->] coordinates {(4.5,0.12) (7.5,0.12)};                 \node[coordinate, pin={\tiny{$\sigma$2}}] at (axis cs: 6,-0.17){};                 \end{axis}     \end{tikzpicture}     \end{frame}               \end{document}


title: How to detect if there is one or multiple pages in a glossaries entry's number list?

text: I'd like to be able to print e.g. "p. 1" if an acronym is only used on one page and e.g. "pp. 1, 2" if it is used on multiple pages. I have tried to define a new counter and use its value in the `ifthenelse` but I don't know where to hook up the incrementing code. There is probably a less complicated solution anyway... :) The MWE below needs to be built with `pdflatex mwe.tex ; makeglossaries mwe ; pdflatex mwe.tex`.               \documentclass{article}     \usepackage[         shortcuts,     ]{glossaries}          \newglossarystyle{mylist}{         \renewenvironment{theglossary}{\begin{description}}{\end{description}}              \renewcommand*{\glossaryentryfield}[5]{%             \item[\glsentryitem{##1}\glstarget{##1}{##2}] ##3\glspostdescription \space \footnotesize (%             \ifthenelse{\equal{1}{1}}{p}{pp}. ##5)%         }     }          \makeglossaries          \newacronym{bt}{BT}{Bluetooth}     \newacronym{usb}{USB}{Universal Serial Bus}     \begin{document}          \ac{bt}     \ac{usb}     \clearpage     \ac{usb}          \printglossary[type=\acronymtype,style=mylist]          \end{document}


title: Is there a math symbol for right(-angled) triangle?

text: Cannot find one, all triangle symbols are equilateral triangles.


title: Vertically center \makebox

text: Code:               \documentclass{article}     \usepackage{xcolor,hyperref}     \makeatletter     \def\Fld@bordercolor{0 0 0} % this works.     \makeatletter     \begin{document}     \begin{Form}     \setlength\unitlength{1cm}       \begin{tabular}{|l|}          \hline          S + \makebox(4,1){\TextField[name=textfield,width=3cm,height=0.5cm]{Text}} \\          \hline       \end{tabular}     \end{Form}     \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/tLyLl.png) The input box is shifted upwards. How to center it vertically, so it was on the same line with 'S +'?


title: amsrefs package problem

text: I am using the `amsrefs` package with the `author-year` option. I want to delete the author's initial from the `\cite` command by using the `amsrefs` package. can anybody suggest how to achieve this? e.g. `\cite{CR11}` \--> output is Alfread A, 1997 but I want the output to be: Alfread 1997


title: LaTeX: Syntax highlighting for Maple, Mathematica, Sage

text: I'm typing up a short comparison of Maple, Mathematica, and Sage in LaTeX. My problem is this: I'd like to include highlighted source code in one column (left) and output in another (right). I know how to split the view with `minipage`, and about the `listings` and `minted` packages. I've got nice highlighting for Sage by using the `python` language setting for `minted` and would like to stick with that package. However, I have not been able to get `minted` to properly highlight Maple or Mathematica code. Since these two programs are well-known among TeX users, I was thinking that someone might have a solution. It would be nice if I could download the Maple and Mathematica styles. Otherwise, is there some "best fit" style that I could use for acceptable highlighting?


title: Problems printing bibliography with \nocite{*} and biblatex/biber

text: I'm having trouble getting the entire bibliography to show up when using `\nocite{*}`. Here's an example:               \documentclass{article}          \usepackage{biblatex}          \begin{filecontents}{test.bib}     @ARTICLE{Doe2009,     author = {Jon Doe},     journal = {Transactions on Stuff},     month = 03,     number = {3},     pages = {1--11},     title = {{Example 1}},     volume = {5},     year = {2009}     }          @ARTICLE{Doe2010,     author = {Jon Doe},     journal = {More Transactions on Stuff},     month = 05,     number = {4},     pages = {1--11},     title = {{Example 2}},     volume = {7},     year = {2010}     }     \end{filecontents}          \addbibresource{test.bib}          \begin{document}          \section{Test}          %\cite{Doe2010}          \nocite{*}     %\nocite{Doe2009}     \printbibliography          \end{document}      The bibliography won't show up at all for me when it is like this. However, if I cite something in the document, for example I place `\cite{Doe2010}` somewhere in there, the entire bibliography will then print. Or if I add `\nocite{Doe2009}` the entire bibliography will also print. What am I missing here? Why won't `\nocite{*}` work on its own? Update: I am using MiKTeX 2.9 with latest updates and TeXstudio. ![enter image description here](http://i.stack.imgur.com/vlz1U.png)


title: Special tree in tikz

text: I'm trying to draw a tree like this: The root has three children and every of this two... The nodes in the first two tiers has additional informations.. I searched for examples like that, but could only find trees, which children always have the same amount of children (for example here: http://www.texample.net/tikz/examples/feature/trees/). I thank you for your help! ![enter image description here](http://i.stack.imgur.com/ByTsz.jpg)


title: Is this layout feasible in LaTeX?

text: I run a cheat sheet website, and at the moment producing PDFs of the cheat sheets is a nightmare. I would like to find an easier system, and I'm wondering if LaTeX might be it. I've not used LaTeX a lot, though I do find it very useful when I do use it, so I've not got the experience to be able to tell if LaTeX can handle the kind of layout I need to reproduce. Enough waffling ... this is how the cheat sheets are laid out: http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/pdf/ Can anybody tell me if LaTeX could handle this kind of layout?


title: How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule?

text: I'm using consecutive `\cmidrule` commands in conjunction with `\arrayrulecolor` to alternately hide and unhide horizontal rules in a table. However, when `\arrayrulecolor` is used with `\cmidrule`, some odd vertical spacing is introduced. I'd like to eliminate it. (I'm using `longtable`, so a `colorbox`, `minipage`, or anything else tied to a page won't work.) Below is an image that introduces the challenge. The first block shows a `\toprule`. My goal is to create a shaded border around the table, so I've added a dummy column. The second rule shows a `\cmidrule` that skips the first column. The third block shows how I can use a `\cmidrule` to fill in the whitespace with a shorter `\cmidrule`. Finally, I want to recolor this short `\cmidrule` to the background color and restore the color later. Note the jagged vertical skipping in case 4 compared to case 3. Why would `\arrayrulecolor` change vertical alignment? How can I eliminate the jagged edges? ![enter image description here](http://i.stack.imgur.com/2ABaA.jpg) Here is the code:               \documentclass[11pt]{article}          \usepackage{longtable}     \usepackage{booktabs}     \usepackage{color}     \usepackage{xcolor}     \usepackage{colortbl}          \setlength{\aboverulesep}{0pt}     \setlength{\belowrulesep}{0pt}     \setlength{\extrarowheight}{0.25ex}          \newcolumntype{L}{>{\columncolor[gray]{0.8}}l}     \newcolumntype{C}{>{\columncolor[gray]{0.8}}c}     \newcolumntype{R}{>{\columncolor[gray]{0.8}}r}          \begin{document}          \textsf{     \begin{longtable}{LLLLL}      & \multicolumn{3}{@{}L}{\small {\tablename\ \thetable{}} - demonstration of odd vertical alignment with arrayrulecolor} & \\%      & \multicolumn{3}{@{}L}{\small {case 1: the line below is a toprule}} & \\%     \toprule      & \multicolumn{3}{@{}L}{\small {case 2: the line below is a cmidrule that spans the middle 3 columns.  Note the whitespace!}} & \\%      & \multicolumn{3}{@{}L}{\small {The challenge: hide the widespace giving the appearance of a spacing around a longtable.}} & \\%     \cmidrule[\heavyrulewidth]{2-4}      & \multicolumn{3}{@{}L}{\small {case 3: the line below is 3 cmidrules, 1 each for the first and last columns and 1 for the middle}} & \\%      & \multicolumn{3}{@{}L}{\small {note how the cmidrules align vertically ... perfect!}} & \\%     \cmidrule[\heavyrulewidth]{1-1}\cmidrule[\heavyrulewidth]{2-4}\cmidrule[\heavyrulewidth]{5-5}      & \multicolumn{3}{@{}L}{\small {case 4: Now, lets try recoloring the first and last cmidrules}} & \\%      & \multicolumn{3}{@{}L}{\small {how do I eliminate the odd vertical alignments?}} & \\%     \arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{1-1}\arrayrulecolor[gray]{0.0}\cmidrule[\heavyrulewidth]{2-4}\arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{5-5}\arrayrulecolor[gray]{0.00}     \endfirsthead      &  Arizona State University &  & ASU &\\       &   Baylor University &  & BAYLOR &\\       &   Boston University & 164988 & BU &\\       &   Brown University & 217156 & BROWN &\\       &   California Institute of Technology & 110404 & CALTECH &\\       &   Carnegie Mellon University & 211440 & CMU &\\       &   Case Western Reserve University & 201645 & CASE &\\       &   Columbia University & 190150 & COLUMBIA &\\       &   Cornell University & 190415 & CORNELL &\\          & Yale University & 130794 & YALE & %     \label{tab:schools}     \end{longtable}     }          \end{document}


title: Avoiding double dots in glossaries package

text: I would like to incorporate the suggested solution by Herbert, that can be found HERE, within certain glossary records. Consider the following example:               \documentclass[a4paper]{book}          \usepackage{glossaries}     \makeglossaries     \makeatletter         \newcommand{\fs}{\@ifnextchar.{}{.}}% test of next token      \makeatother          \newglossaryentry{pg}{         name={pg.},         description={pg.},         first={pg.},         firstplural={pp.},         plural={pp.}     }     \newglossaryentry{fig}{         name={fig.},         description={fig.},         first={fig.},         firstplural={figs.},         plural={figs.}     }               \begin{document}         as can be seen in the \glspl{fig} on the following \gls{pg}.     \end{document}      Which typesets without issue, however it creates a double dot at the end of the sentence. A solution that I had in mind would be to try and put the defined macro `\fs` into the glossary records, however errors get returned, ie, the following causes the above to not compile:               \newglossaryentry{pg}{         name={pg\fs},         description={pg\fs},         first={pg\fs},         firstplural={pp\fs},         plural={pp\fs}     }      Another approach could be to modify the `\gls{...}` and similar commands, to check if the evaluated record ends in a '.', and if so, replace by the `\fs` macro, but there are many commands as part of the glossaries package, not sure how to do it this way. How can this be achieved. I use glossaries as a means to host many such abbreviations on a document-wide basis.


title: TeXMaker shows errors after compilation for deleted lines

text: I'm using an old TeX document as a template. As I did just copy the TeX related files and none of the pictures of the former document it always gave me errors for the "legacy chapters" of the document, but it always created the `.pdf`. Now I decided to get rid of the legacy parts to not get any errors and have a useful log file, to actually check for errors in my part. But TexMaker continues to give me errors for lines that don't even exist anymore in the document. On top of that it doesn't create the `.pdf` file anymore and I couldn't tell why (not even from the messy log). Does someone know if I have to delete some other files belonging to the document? Cheers for any help, Peter


title: Defining a command for drawing contours

text: I have seen a lot of questions asking about how to draw arrows along curves. The decoration libary can help with this, but the solution seems very manual.. Is it possible to make a command that draws an arc, and places two arows on the arc? If one calls S1 the start of the arc, S4 the end. And the placement of S2, and S3 for the points where the arows are placed. Then the arclength between S1 and S2, S2 and S3, S3 and S4 should be equal. Eg the placement of the arrows should always be equally spaced along the arc. I gave this problem a go using a mix between tikz, and euclide. But any solutions is fine.               \documentclass[12pt,a4paper]{standalone}     \usepackage{tikz,tkz-euclide,pgfplots}     \usetikzlibrary{decorations.markings}     \usetkzobj{all}     \newcommand{\tkzkonturS}[5]{%         \draw[domain=#4:#5,smooth,style={postaction={decorate},decoration={markings,mark=at position 0.33 with {\arrow{stealth}}},                decoration={markings,mark=at position 0.66 with {\arrow{stealth}}}}             ]             plot ({#1+#3*cos(\x)}, {#1+#3*sin(\x)});     }     \newcommand{\tkzkonturR}[5]{%         \draw[domain=#4:#5,smooth,style={postaction={decorate},decoration={markings,mark=at position 0.33 with {\arrow{stealth reversed}}},                decoration={markings,mark=at position 0.66 with {\arrow{stealth reversed}}}}             ]             plot ({#1+#3*cos(\x)}, {#1+#3*sin(\x)});     }     \begin{document}              \begin{tikzpicture}             \def\radius{2} \def\radiuss{0.5}             \pgfmathsetmacro{\k}{1.2*\radius}                  \pgfmathsetmacro{\P1}{0.70710*\radiuss}             \pgfmathsetmacro{\P2}{1.2*\radiuss}                  \tkzDefPoint(0,0){S1}              \tkzDefPoint(0.4,0){S11}              \tkzDefPoint(\radius,0){A}             \tkzDefPoint(1,0){S2}             \tkzDefPoint(1.4,0){S22}                  \tkzDefPoint(-\k,0){x1}             \tkzDefPoint(\k,0){x2}             \tkzDefPoint(0,-\k){y1}             \tkzDefPoint(0,\k){y2}             \tkzDrawSegments[thick,-stealth](x1,x2 y1,y2)                  \tkzkonturS{0}{0}{2}{0}{360}             \tkzkonturR{0}{0}{1}{0}{360}             \tkzkonturR{1}{0}{1.5}{0}{360}                  \tkzDrawPoints[color=red,shape=cross out,size=10pt](S1,S2)             \tkzLabelPoint[above right](x2){$x$}             \tkzLabelPoint[right](y2){$y$}         \end{tikzpicture}        \end{document}      The problem with my code is that I often run into `dimensions to large`, if I use too small of an radius, the arrows are not equally spaced. Also using this approach one needs a seperate command to plot the arrows reversed.


title: How to set a new clean arara rule that circumvents Dropbox interference in Windows?

text: `arara` is a cool tool for LaTeX automation, it works by setting your directives (i.e., a code line in tex document) to tell arara what to run next in a specific order that best suits your LaTeX compilation needs. These directives should contain rules (i.e., configuration files that are written in YAML language, default rules ship already with the package but you can create your own) One of the default written rules, called `clean`, which I found useful to get rid of the auxillary as well as other files which are normally generated during the process of PDF compilation. The problem arises, when one is working inside a Dropbox folder (a reasonable way to keep your files in the cloud synchronized, updated, and shared), as `arara` is trying to delete these auxiliary, etc.. files by the clean rule, Dropbox is trying to synchronize them, and synchronization will take some time depending on the size of your files, here comes the problem, arara clean rule will fail, reporting that files are used by another program.   One workaround is to add a `sleep` command before the delete command in the clean rule file. The below code was generously given from Paulo Cereda, one of the authors of `arara` fantastic package:               !config     # requires arara 3.0+     identifier: clean     name: NewCleaningTool     commands:     - <arara> COMMAND HERE @{wait}     - <arara> @{remove}      arguments:     - identifier: remove       default: <arara> @{isFalse(file == getOriginalFile(), isWindows("cmd /c del", "rm -f").concat(' "').concat(file).concat('"'))}     - identifier: wait       flag: <arara> @{parameters.wait}       default: 10        The above code should replace the default clean.yaml file in the `arara` rules directory, or a better approach, thankfully suggested by Marco Daniel, one of the authors of `arara` package, is to provide a new path in `araraconfig.yaml` for the new rule. Directives in `tex` file should look like this:               % arara: xelatex: { shell: true }     % arara: makeglossaries     % arara: biber     % arara: xelatex: { shell: true }        % arara: xelatex: { shell: true }     % arara: clean: { wait: 15, files: [phdmain.aux, phdmain.idx, phdmain.glg, phdmain.ilg, phdmain.bbl, phdmain.ind, phdmain.log, phdmain.gls, phdmain.glo, phdmain.bcf, phdmain.blg, phdmain.run.xml, phdmain.lof, phdmain.lot, phdmain.out, phdmain.toc, phdmain.xdy]}       \documentclass[oneside]{scrbook}      \begin{document}     This is just a MWE to show if clean rule of arara package is waiting the specified seconds passed as a wait argument in the clean directive above, the default was set to 10 seconds in the clean.yml file, however if you have large files you might need longer waiting periods until Dropbox is done with syncronization of your files, leaving them ready to be deleted by clean rule directive of arara package. An elegant way to keep your messy tex folder as clean as possible.     \end{document}        **Question:**   What command should replace the `COMMAND HERE` in 6th line of the YAML file above that works in Windows 7 platform? I tried the following but didn't work:               - <arara> TIMEOUT @{wait}        and also:               - <arara> powershell -command "Start-Sleep -s @{wait}"        **Notes:**   To comment out `arara` directives you can add ! before arara like this:               % !arara: biber


title: Emulate tabular vertical spacing with parskip package

text: I would like to emulate the vertical spacing of `tabular` without using `tabular`. When the `\parskip` package is used, using `\par` leaves too much vertical space, so I thought I'd emulate it with use of a `\newline`: ![enter image description here](http://i.stack.imgur.com/eOLqC.png) Now, this seems to work just fine, most of the time. But am running into a _Missing number, treated as zero_ which I suspect is related to using a `\newline`. Plus I recall something about using a `\\` or `\newline` outside of a `tabular` or `array` type of environment being a _bad_ thing. So, my question is: Is using `\\` or `\newline` a _bad_ thing, and if so, why? What alternative ways can I emulate the vertical spacing of `tabular` when using the `parskip` package? ## References   * Parskip: Suppressing parskip in some places suggest to adjust `parskip`, but this is considered a "deadly sin" as per Too much whitespace before lists when changing the \parskip length ## Code:               \documentclass{article}     \usepackage{parskip}          \newcommand{\ColumnA}[2][l]{\makebox[2.5em][#1]{#2}}%          \begin{document}     Output using \verb|tabular|:          \begin{tabular}{@{}ll}     abc & def \\     uvw & xyz \\     \end{tabular}          Using \verb|\par| leaves additional vertical space:          \ColumnA{abc}  def \par     \ColumnA{uvw}  xyz \par          \medskip     Emulating \verb|tabular|:          \ColumnA{abc}  def \newline     \ColumnA{uvw}  xyz \newline          \end{document}


title: algorithm2e indentation / line break

text: I have the following problem: I am writing a couple of algorithms using algorithm2e. I have a bunch of longer if statements and longer if conditions. The lines are broken, but the new lines are not indented properly:               \begin{document}            \begin{algorithm}[H]         \SetAlgoLined         \KwInput{Parameters...}              \KwOutput{$\emptyset$}              \If{the lines through $x_{1}, x_{2}$ and $y_{1}, y_{2}$ intersect in a single point $z$             which lies on the circle $C$            }         {           Do something \;         }         \caption{Algoritm test...}       \end{algorithm}          \end{document}      I could force line breaks at certain positions using \, but that does not fix the indentation problems either. I saw the solution provided here: How to break lines in conditions using algorithm2e? But I don't understand what is happening in that code and I was not able to reproduce the result with my problem. How can I indent the code correctly (is it possible to use something like an mbox?)?


title: Orgchart in tikz

text: The questions below arose after trying to use code from an answer to the question at TikZ-tree: edge-alignment in horizontal org-chart Question 1: As you can see I changed paper format to use B (11x17) and the picture scaled accordingly including text inside the boxes. As smaller text size is required, I tried changing 12pt to 10pt. Instead of changing text size, it changed width of the boxes. What is required in the code to use smaller text without changing tree layout? Question 2: Why does new line `\\` work in the teammate and subordinate styles, but not in Supervisor node? Does it need its own style? Question 3: Is it possible to keep the units uniform, i.e. not use `pt, cm, ex, em` but limit the use of units to the minimum required? Question 4: I could not find Tikz package and trees library at CTAN. Where can I find documentation?               \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[landscape,paper=ansibpaper]{geometry}     \usepackage{tikz}     \usetikzlibrary{trees}     \tikzstyle{every node}=[draw=black,thick,anchor=west, minimum height=2.5em]          \begin{document}          \begin{figure}[!htb]     \resizebox{\linewidth}{!}{          \begin{tikzpicture}[     teammate/.style={text centered, text width=3cm, fill=gray!10},     subordinate/.style={%         grow=down, xshift=0em,         text centered, text width=3cm,         edge from parent path={(\tikzparentnode.225) |- (\tikzchildnode.west)}},         level1/.style ={level distance=8ex},         level2/.style ={level distance=16ex},         level3/.style ={level distance=24ex},         level4/.style ={level distance=32ex},         level5/.style ={level distance=40ex},         level 1/.style={sibling distance=10em}]         % Supervisor         \node[anchor=south]{Supervisor \\ Supervisory position}         [edge from parent fork down]              % Teammate and Subordinates         child{node [teammate] {Teammate1}             child[subordinate,level1] {node {Subordinate\\Position1\\Location1}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Subordinate3}}             child[subordinate,level4] {node {Subordinate4\\Position4\\Location4}}             child[subordinate,level5] {node {Subordinate5\\Position5\\Location5}}}         %         child{node [teammate] {Teammate2}             child[subordinate,level1] {node {Subordinate1}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Third\\Teammate}}             child[subordinate,level4] {node {Longtext-\\teammate}}}         %         child{node [teammate] {Teammate3}             child[subordinate,level1] {node {Subordinate\\two lines}}             child[subordinate,level2] {node {Subordinate2}}                  child[subordinate,level3] {node {Subordinate3}}}         %         child{node [teammate] {Teammate4}             child[subordinate,level1] {node {Subordinate1}}             child[subordinate,level2] {node {Subordinate2}}}         %         child{node [teammate] {Teammate5}             child[subordinate,level1] {node {First\\Subordinate}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Third\\Teammate}}             child[subordinate,level4] {node {Longtext-\\teammate}}};     \end{tikzpicture}}     \caption{This is an org chart}     \end{figure}          \end{document}


title: How change the header size of a frankfurt slide?

text: How can I increase the header size of a `Frankfurt` slide? I want two lines of dots. With that height they are cut in half. Thanks ![enter image description here](http://i.stack.imgur.com/bf63a.png)               \documentclass{beamer}     \usepackage{graphicx}     \usepackage{subfig}     \usepackage[portuguese]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{indentfirst}     \usepackage{setspace}     \usepackage{mathtools}     \usepackage{float}     \usepackage[pdftex]{hyperref}          \setbeamertemplate{caption}[numbered]     \setbeamertemplate{footline}[frame number]     \usetheme{Frankfurt}               \makeatletter       \beamer@compressfalse          \makeatother          \usefonttheme{serif}     \definecolor{darkred}{rgb}{0.8,0,0}     \setbeamercolor{structure}{fg=darkred}     \setbeamercolor{block title}{fg=white}     \setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!100!bg, fg=white}     \setbeamertemplate{frametitle}{\insertframetitle\\     \usebeamerfont{framesubtitle}\insertframesubtitle}     \setbeamerfont{frametitle}{size=\scriptsize}     \setbeamerfont{framesubtitle}{size=\Large}               \title{Previsão da Taxa de Câmbio através de modelos baseados na Regra de Taylor}     \date{14 de Fevereiro de 2014}          \begin{document}     (...)     \end{document}


title: Changing display angle of a node label

text: I'm trying to draw a diagram in TikZ with 45-degree lines, and I want to label these lines in such a way that the text of the label is also angled at 45 degrees. However I'm also interested in how to set it to a general angle. Basic example:               \documentclass{report}     \usepackage{tikz}     \begin{document}     \draw[thick] (-3,3) -- (3,-3)     \end{document}      I want to create labels at either end of this line, which have been rotated -45 degrees from horizontal, and which lie above-right of the line. Can anybody help me, please?


title: Floating figures placement

text: I am using TeXnicCenter with MiKTeX and the compiler that I am using is XeLaTeX to Pdf. I am having a problem with the placement of figures. That is, even when I use the `\usepackage{float}` and the placement specifier `h`, the figures tend to fly around. Even though, I am using the correct code, it doesn't work. It works in TeXStudio but not in TeXnicCenter. Does anybody have a solution?


title: Faking small caps in XeLaTeX

text: In the post Fake small caps with XeTeX/fontspec? I have found the following definitions to fake small caps                  \def\mycommand{\bgroup\obeyspaces\mycommandaux}        \def\mycommandaux#1{\mycommandauxii #1\relax\relax\egroup}        \def\mycommandauxii#1{%        \ifx\relax#1\else         \ifcat#1\@sptoken{}          \expandafter\expandafter\expandafter\mycommandauxii\else        \ifnum`#1=\uccode`#1 {\normalsize #1}\else {\footnotesize \uppercase{#1}}\fi           \expandafter\expandafter\expandafter\mycommandauxii\expandafter\fi\fi}             % ...             \mycommand{This text is set in fake small caps.}      `\mycommand` works properly in the main text. However, when `\mycommand` is used inside other commands like `\title` of `\footnote` it removes the spaces between the words. So I wonder if there is any way to make the above command to work inside other commands or if there are other ways to achieve the same result. In the code above `\normalsize` and `\footnotesize` can be replaced some `\fontspec` instructions. An advantage of the approach (or similar) is that it could work for generic fonts without small caps (I am aware of `fontinst` and the support for creating small caps in fontforge)


title: How to repeat automatically last marginnote on a new page?

text: I have some margin notes and want the last one to be repeated on a new page. Is there a way to do this automatically?


title: Shaded region between the area and a circle

text: How can I draw a square whose side is 6 inscribed in a circle and make the program display the shaded region between the square and the circle


title: Continued Fractions as an operator.

text: In dealing with continued fractions in LaTeX, I've become less and less enamored of the `\cfrac` construct. Especially in my case where I deal with complicated numerators and denominators, listing a few terms can get unwieldy. I encountered a nice notation for CFs in Lorentzen and Waadeland's "Continued Fractions with Applications" that seemed to be adaptable to my needs. I have no digital copy of the book, so I offer Wolfram's approximation on how this operator is rendered: ![continued fraction](http://i.stack.imgur.com/6fzKZ.gif) (the only difference is that the b terms come before the a terms, and they are separated by a backslash (this is why I asked this question, so I now know how to render the operands and the delimiters properly)) My question now, then, is how can I construct a "continued fraction operator" that acts like `\sum` and `\product`? Somehow, trying to use a large letter K and then putting the limits as over- and underscripts has been a bit of a mixed bag (and of course, if the operands themselves are fractions, I have to manually tweak the size of the "K" again!). Might there be a more elegant approach to this?


title: MikTex CJK Windows font issue

text: I usually use the MS Mincho font for doing Japanese stuff. However, with XeLatex the following creates gobbledegook:               \documentclass{article}     \usepackage{xeCJK}     % Font should be available on windows     \setCJKmainfont{MS Mincho}          \begin{document}     見た     \end{document}      ![enter image description here](http://i.stack.imgur.com/FCBR9.png) But when I change out the "MS Mincho" for "SimSun" it renders perfectly fine. I have MS Mincho installed on my computer, so why can't I use it?


title: combine macro arguments with text

text: I have a macro where I need to combine one of it's arguments with text to form a string that is used in lua.               \newcommand{\mymacro}[1]{\directlua{         myfunc("#1 4")     }      if I call `\mymacro{alpha}` I need myfunc to receive `alpha4` and **not** `alpha 4` any ideas?


title: Filter by value when reading and calculating data using pgfplotstable

text: I am trying to plot data from a file, using `pgfplots` for the plot and `pgfplotstable` to read in the data and calculate a new column (cummulative values from another row), which is plotted as well. My data sometimes has bad values (negative values when all values should be non-negative) and I would like to filter those values from the plot and the calculation, either by ignoring them or setting them to zero. `pgfplots` has a convenient filter option for the plots, but this has no effect on the calculated column. Here's a MWE of what I am trying to accomplish. There should not be any negative values in the plots. How should I filter the values?               \documentclass{minimal}           \usepackage{filecontents}      \begin{filecontents}{data.csv}                   Time,TemperatureC,DewpointC,PressurehPa,WindDirection,WindDirectionDegrees,WindSpeedKMH,WindSpeedGustKMH,Humidity,HourlyPrecipMM,Conditions,Clouds,dailyrainMM,SoftwareType,DateUTC,     2012-10-26 00:51:00,26.9,26.1,1009.4,SSE,163,8.0,22.5,95,0.0,,,0.0,weatherlink.com 1.10,2012-10-26 04:51:00,      2012-10-26 01:06:00,26.9,26.1,1009.0,SW,231,8.0,20.9,94,0.0,,,0.0,weatherlink.com 1.10,2012-10-26 05:06:00,      2012-10-26 01:21:00,26.9,26.1,1009.0,SSE,151,14.5,-1607.4,94,-2539.7,,,0.0,weatherlink.com 1.10,2012-10-26 05:21:00,      2012-10-26 01:36:00,27.0,26.1,1009.0,SSE,155,4.8,22.5,93,0.0,,,0.0,weatherlink.com 1.10,2012-10-26 05:36:00,      2012-10-26 01:51:00,27.1,26.1,1009.4,South,174,6.4,19.3,93,0.0,,,0.0,weatherlink.com 1.10,2012,      \end{filecontents}          % UNITS      \usepackage{siunitx}          % PGFPLOTS and TABLES      \usepackage{tikz}      \usepackage{pgfplots}        \pgfplotsset{          width=10cm,          compat=1.7}        \usepgfplotslibrary{dateplot}        \usepgfplotslibrary{groupplots}          \usepackage{pgfplotstable}        \pgfplotstableset{          col sep=comma,          create on use/SumP/.style={            create col/expr={\pgfmathaccuma + \thisrow{HourlyPrecipMM}}            }        }     % ------------------------------------------------- Document starts here     \begin{document}          \pgfplotstableread{data.csv}\data                      \begin{tikzpicture}         \begin{groupplot}[           group style={%             group size=1 by 2,             horizontal sep=0pt,             vertical sep=10pt,             xticklabels at=edge bottom,             xlabels at=edge bottom,             ylabels at=edge left,           },           legend style={draw=none},            legend pos=north west,            legend cell align=left,            date coordinates in=x,            xtick=,           xticklabel style={rotate=90,anchor=near xticklabel},           xticklabel=\month-\day. \hour:\minute,            date ZERO=2012-10-23,            minor tick num=12,            footnotesize,           width=10cm,           xlabel=Time / \si{\hour},            ylabel=P / \si{\mm},           ybar           ]           \nextgroupplot[]           \addplot+[const plot mark left,fill=none] table[x=Time,y=HourlyPrecipMM]           {\data};           \addlegendentry{Rainfall depth}           \addplot+[const plot mark left, fill=none,dashed] table[x=Time,y=SumP]           {\data};            \addlegendentry{Mass Rainfall}           \nextgroupplot[ymax=100,height=4cm]           \addplot+[const plot mark left,fill=none] table[x=Time,y=HourlyPrecipMM]           {\data};           \addlegendentry{Rainfall depth}              \end{groupplot}       \end{tikzpicture}          \end{document}          %%% Local Variables:      %%% mode: latex     %%% TeX-engine: xetex     %%% TeX-master: t     %%% End:


title: Incompatibilities of cmap with fontenc/hyperref?

text: The following code doesn't compile (with `pdflatex`)               \documentclass{article}     \usepackage{cmap}     \usepackage[T1]{fontenc}     \usepackage[pdfa=true]{hyperref}          \begin{document}          Hello.          \end{document}      unless I omit either the `fontenc`-line or the `pdfa=true`-option from the `hyperref`-line. The error message I get says: `! pdfTeX error (setup): \pdfminorversion cannot be changed after data is written to the PDF file.` Is there something I can do or is this an incompatibility?


title: Putting Left-to-right reference in right-to-left document in XeLatex using BibTex

text: The whole document in XeLatex is in a right-to-left language, but all the references are in English. I want those references to be left-to-right.


title: (How) can I include the file somedir/file.tex in the file somedir/subdir/anotherfile.tex

text: I know that it is possible to include `somedir/subdir/anotherfile.tex` in `somedir/file.tex` by using `\include{subdir/file}`. Is it possible to do it the other way around? A Linux workaround that I'm aware of is a symbolic link of `somedir/file.tex` to `somedir/subdir/file.tex`.


title: longtable in beamer environment (lacks headers/footers)

text: In `Beamer`, I wish to use the `longtable` package to break up tables across multiple frames automatically. I am aware of the `xtab` package, which works fine in `Beamer`, but I prefer `longtable` as it is the tool that is used internally by the powerful `tabu` package. `longtable` breaks up tables just fine in `Beamer`, but fails to include headers and footers (with the exception of the first header). Is this a bug in `Beamer`?, `longtable`? Does anyone have a workaround for this? Here's a short file that demonstrates this issue:               \documentclass{beamer}     \usepackage{verbatim,longtable}     \begin{document}     \begin{frame}[t,fragile] \small %       In Beamer, the \texttt{longtable} package       successfully breaks up tables, but fails to       include headers and footers (except for the       first header).  Here's the source of this file,       go to next frame to see how \texttt{longtable}       fails: \tiny       \verbatiminput{\jobname.tex}     \end{frame}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{frame}[t,allowframebreaks] \large          %       \begin{longtable}{cc}                           %         FirstHeadA & FirstHeadB \endfirsthead         %         HeadA & HeadB \endhead                        %         LastFootA & LastFootB \endlastfoot            %         FootA & FootB \endfoot                        %         01A&01B\\02A&02B\\03A&03B\\04A&04B\\05A&05B\\ %         06A&06B\\07A&07B\\08A&08B\\09A&09B\\10A&10B\\ %         11A&11B\\12A&12B\\13A&13B\\14A&14B\\15A&15B\\ %         16A&16B\\17A&17B\\18A&18B\\19A&19B\\20A&20B\\ %         21A&21B\\22A&22B\\23A&23B\\24A&24B\\25A&25B   %       \end{longtable}                                 %     \end{frame}                                       %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \end{document}      EDIT: The `xtab` package is an extension of the `supertabular` package, which also works fine in `Beamer`.


title: \xskakget with \newchessgame is failing

text: I'm trying to get the last move id of a chess game using `\xskakget` and `\newchessgame` like this.               \newchessgame[id=someid, moveid=10b]      and after sometime, use `\mainline` to display the move.               \newchessgame[id=someid, moveid=\Xskaksomeidnextmoveid]\mainline{10...Nf6}      When compiled with xelatex, I'm getting 'Undefined control sequence error \@nnil ->\@nil. `\Xskaksomeidnextmoveid` itself is showing the correct value, but when inside \newchessgame, I'm getting this error. Please bear with me if this is a silly question. I'm a latex newbie. EDIT: Simple working example is here. The commented out line before `\end{document}` is the culprit.               \documentclass[9pt]{book}     \usepackage{caption}     \usepackage{floatrow}     \usepackage{xskak}     \usepackage{chessboard}          \begin{document}     \begin{figure}[H]       \begin{floatrow}[2]         \newchessgame[id=da, moveid=1w]         \ffigbox{\caption{}}{\chessboard[             setfen=rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR         ]}       \end{floatrow}     \end{figure}          \newchessgame[id=da, moveid=1w]\mainline{1. e4 e5}          \Xskakdanextmoveid          %% \newchessgame[id=da, moveid=\Xskakdanextmoveid]\mainline{2. Nf6}     \end{document}


title: Understanding what contour package does

text: In `contour` package, the macro `\con@put` is defined as:               \newcommand*\con@put[3]{%       \rlap{\hskip#1\raisebox{#2}[0pt]{#3}}%     }      But if one changes that `\rlap` to `\llap`, then you no longer get contour. For instance, try               \documentclass{article}     \usepackage{contour}     \makeatletter     \renewcommand*\con@put[3]{%       \llap{\hskip#1\raisebox{#2}[0pt]{#3}}%     }     \makeatother     \begin{document}     \colorbox{black}{This text is not visible     \contour{white}{but this is.}}     \end{document}      This is what you get: ![enter image description here](http://i.stack.imgur.com/DSxRi.png) Why this does not work? What is the special effect of that `\rlap` that makes contour? and if one decides to go with `\llap` instead `\rlap` in the example above, what changes are required so you still get contour?


title: Comma-separated list

text: I would like to produce comma-separated lists, like "a, b, c, d" or "a, b, c, and d". Requirements:   * In the Latex source code, each line of the source code should contain one list element, and as little additional markup as possible.   * It should be easy to re-order the entries by changing the order of source code lines. For example, I could simply write the list elements like this:               a,     b,     c, and     d.      This would (almost) satisfy the first requirement, but it would fail on the second requirement. I would have to remember to fix the punctuation whenever I re-order the entries (or simply add a new entry). It sounds trivial, but it is surprisingly easy to forget to replace the full stop with a comma, and not that easy to spot the mistake. And I have a longish Latex document that mixes other content and such lists, so it would not be convenient to use an external script to generate the appropriate Latex code – I am really looking for something that is as easy as possible to maintain in the long term. I do not really know what would be an appropriate interface; hence this can also be seen as an interface-design challenge. Perhaps something like this:               xxx\begin{commasep}[and]         \item a         \item b         \item c         \item d     \end{commasep}yyy      would produce:               xxxa, b, c, and dyyy      (Note: no whitespace after "d", so that I can add appropriate punctuation right after the list.) I wonder if, e.g., `paralist` can be tweaked to produce what I want?


title: Insert a TikZ picture from an external file

text: I tried to search a bit, but i guess my poor English prevented me from finding the answer. I made a few tikz pictures that i want to use in my report. I made the tikz pictures in separate tex files so i don't have to compile my whole report just to check the image. But now, when copy pasting the tikz code into my report the image looks different. Some stuff moved or is not in the right position. I was hoping this could be fixed by instead of putting the tikz code in my report, inserting the tikz.tex file similar to `\include` or `\insert`. This way i hope my picture will look like it does in the separate file and i will not have to compile it when i compile my report. I guess this is possible, but i just don't know how and i could not find it. Does anyone know_


title: Merging \newcommand and \renewcommand

text: Is there a merged command `\maybenewcommand` that is either `\newcommand` or `\renewcommand`, depending on the situation: if the command is not yet defined, use `\newcommand` and use `\renewcommand` otherwise. I currently merge multiple papers into a large document. I use the same commands in several of them, with slightly different meaning. I would now like to avoid to check for each `\newcommand` if it has been used in earlier places and then replacing them by `\renewcommand` by hand. Thanks, Christian


title: How to make two 2x1 matrices in the same column?

text: I'm using LaTeX to show the butterfly visualization of fast Fourier transformation and I'm stuck at drawing the matrix. I want something like this: ![enter image description here](http://i.stack.imgur.com/knU6X.png) i.e. if I have a vector of length 8, in the next column (after the equal sign), I want two matrices each of length 4 on the same column one below the other, how can I achieve this?               \documentclass{article}     \begin{document}          \left[ \begin{array}{ccc}     1 \\     0 \\     0 \\     0 \\     3 \\     0 \\     0 \\     0 \\      \end{array} \right]          \end{document}


title: Make hyphenated words in PDF searchable

text: Is there a way to make hyphenated words in a PDF generated by LuaTeX searchable? If the MWE below is converted to a PDF, searching for "lexicon" (in Acrobat X for example) will not find the word since it now contains a hyphen followed by a space character.               \documentclass{article}     \begin{document}     \parbox{2cm}{Break lexicon here.}     \end{document}


title: using CJK text inside mecard produces errors

text: I am trying to use `\psbarcode` to generate a MECARD QR code with CJK characters in the name field. tex:               \documentclass[12pt]{memoir}     \usepackage{CJKutf8}          \usepackage{pstricks}     \usepackage{pst-barcode}          \begin{document}          %\CJKfamily{goth}          \textbf{\begin{CJK}{UTF8}{min}トレバー・アレクサンダー\end{CJK}}\\          \rule{75mm}{1mm}\\     \begin{minipage}[t]{30mm}         \vspace{-1mm}%         \begin{pspicture}(30mm,30mm)             % The MECARD format is used to exchange contact information. More information at:             % http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/addressbook/index.html             \psbarcode{MECARD:N:トレバー・アレクサンダー;EMAIL:throwaway@mailinator.com;URL:http://www.whatsmyip.org;;}{eclevel=L width=1.181 height=1.181}{qrcode}         \end{pspicture}     \end{minipage}     \end{document}      The above MECARD section does not work, but the CJK text earlier in the document does. Specifically, the error from pdflatex (called from Gummi) is:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)     ...     /home/trevor/Dropbox/.temp2.tex.swp:18: Undefined control sequence.     \GenericError  ...                                                                                #4  \errhelp \@err@     ...     l.18 ...=L width=1.181 height=1.181 parse}{qrcode}      If you replace the name field with, say, `N:Aso Taro;` a QR code is properly generated. This related thread has a similar problem, but the asker's problem was within the ASCII set and the answerer suggested using the `parse` option in the `psbarcode` line, then specifying each character as an ASCII code value. Is it possible to enter a UTF-8 code value instead? I tried the hexadecimal `N:\x30C8;` with parse in the options, but that didn't work either. I am fine with any way I can get CJK text into these fields. edit: This is definitely accepted by MECARD itself, as seen in the NTTdocomo example here (newlines added for clarity):               MECARD:     N:ドコモ,太郎;     SOUND:ト゛コモタロウ;     TEL:03XXXXXXXX;     TEL:090XXXXXXXX;     EMAIL:docomotaro@△△.□□□.co.jp;     EMAIL:docomo.taro.△△@docomo.ne.jp;


title: Vertical alignment through all document

text: I am processing a text, which is the specification for my mathematical package. The typical style for the specification looks as follows: ![](http://i.stack.imgur.com/wXxmo.png) I can align expressions only in a single environment, using `align` or `array` and so. But I want, that all examples from presented image, will be aligned with respect to `\to` symbol _through all document_. Is there any way to do so? The code of the presented image (sorry that it rather complicated):               \documentclass[a4paper,titlepage,11pt,oneside]{book}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{latexsym}     \usepackage{array}     \usepackage{xargs}     \usepackage{xparse}     \usepackage{xcolor}     \usepackage{empheq}     \usepackage{courier}          \newcommand{\mkey}[1]{{\mbox{\small\ttfamily #1}}}     \newcommand{\mobj}[2]{\mbox{\ttfamily\small #1}\left [\,#2\,\right]}               \definecolor{boxcolor}{rgb}{.95, .95, 1}          \newsavebox{\mysaveboxM} % M for math     \newcommand*\MetaBox[2][Example]{%      \sbox{\mysaveboxM}{#2}%      \sbox{\mysaveboxM}{%       \parbox[b][\ht\mysaveboxM][b]{%       \wd\mysaveboxM}{#2}%      }%      \sbox{\mysaveboxM}{%      \fcolorbox{black}{boxcolor}{%       \makebox[\linewidth-4em]{\usebox{\mysaveboxM}}%       }%      }%      \usebox{\mysaveboxM}%     }          \NewDocumentEnvironment{meta}{O{equation*}O{}}{%      \setkeys{EmphEqEnv}{#1}%      \setkeys{EmphEqOpt}{box=\MetaBox,#2}%      \EmphEqMainEnv}%      {\endEmphEqMainEnv}               \begin{document}     \subsection{Product}     ....     \subsubsection{Indices}     \begin{meta}     \begin{array}{rcl}     \mobj{}{H^{kj}M_jQ_k{}^{\mu}{}_{qa}}\mkey{.indices}&\to&     \mobj{UnorderedIndices}{{}^{kj}{}_{jk}{}^{\mu}{}_{qa}}     \end{array}     \end{meta}     The interesting point introduced here is a special type of product     indices. We will discuss it in section. The general idea here is that        from the mathematical point of view the order of resulting product indices               is undefined.     \subsubsection{List access operations}     \begin{meta}     \begin{array}{rcl}     \mobj{}{V_{\alpha\beta}M_\sigma     Ric^{\kappa\delta}\,\delta^\alpha{}_{\kappa}}\mkey{.size()}&\to&4\\[12pt]     \mobj{}{H^{kj}M_jQ_k{}^{\mu}{}_{qa}}\mkey{.elements}&\to&     \mobj{List}{H^{kj},\,M_j,\,Q_k{}^{\mu}{}_{qa}}     \end{array}     \end{meta}     One of the important (and really hard) decisions we've made is to     consider only commutative theories. So, while processing products, the order        of elements is not taken into account! However, there are some tricks to            work with non-commutative theories.\newline Indeed, you can take an element      by index:     \begin{meta}     \begin{array}{rcl}     \mobj{}{H^{kj}M_jQ_k{}^{\mu}{}_{qa}}\mkey{.get(2)}&\to&     \mobj{SimpleTensor}{Q_k{}^\mu{}_{qa}}     \end{array}     \end{meta}          \end{document}