title: How to adjust macro to respect current \linewidth?

text: I'm having issues with text going past the end of the specified `\textwidth`. I posted this question about why text was being placed beyond the specified line width. The MWE provided there produced situations similar to mine. Adding `\sloppy` fixed all the problems posted in that MWE, but when I used that in my larger document, it had absolutely no effect on the output. Narrowing my problem down further, I see that the problem stems from the `\iteminput` macro which is a solution provided to an issue related to the alignment of item number in a list containing a minipage that was originating in a `standalone` file. I have been using this to input my files. This macro was necessitated by the fact that the imported `standlalone` files were not being aligned within enumerated lists. It appears that `\iteminput` is ignoring that fact that the `\linewidth` has modified since it is now within an `enumerate` list. So, my question is: How do I adjust the `\iteminput` macro to respect the current `\linewidth`. The MWE for this requires two files. The first file here is the `standalone` file called Item-from-File.tex:               \documentclass[preview=false]{standalone}     \usepackage{standalone}     \usepackage{paralist}          % geometry settings identical to main file.     \usepackage{geometry}     \geometry{top=0.5in}     \geometry{bottom=0.5in}     \geometry{paperheight=11.0in}     \geometry{paperwidth=8.5in}     \geometry{textwidth=6.0in}     \geometry{left=1.125in}     \geometry{right=1.125in}     \geometry{showframe=true}          \begin{document}       Here is a line of text, but one that is from a separate standalone file.       This file typeset by itself is fine. When this is input into an enumerated list        via the normal input macro, things are also fine. But the text goes past the end       of the line if input with modified input macros.       %       % Updated to include following:       \begin{enumerate}[(a)]          \item First item: If this sentence is long enough things are not so good when                 this is included in another file. But things are fine in this standalone                 file.          \begin{enumerate}[(i)]            \item First sub-item: If this sentence is long enough things are not so good                   when this included in another file. But things are fine in this                   standalone file.          \end{enumerate}       \end{enumerate}     \end{document}      The second is the main document:               \documentclass{article}     \usepackage{standalone} % Needed for the standalone file     \usepackage{paralist}          % geometry settings identical to standalone file.     \usepackage{geometry}     \geometry{top=0.5in}     \geometry{bottom=0.5in}     \geometry{paperheight=11.0in}     \geometry{paperwidth=8.5in}     \geometry{textwidth=6.0in}     \geometry{left=1.125in}     \geometry{right=1.125in}     \geometry{showframe=true}          \newcommand{\iteminput}[2][\topskip-1bp]{%       \leavevmode\vtop{\hrule height 0pt\kern-\dimexpr#1\relax         \input{#2}}}               \begin{document}     Text in this file, things work great:     \begin{enumerate}       \item When this text appears in the same file things are ok.             The line goes to the end of the correct spot on the page and wraps around.       \item \input{Item-from-File.tex}% This is ok       \item \iteminput[2.5ex]{Item-from-File.tex}% This is a problem     \end{enumerate}     \end{document}


title: Vertical align \underset

text: I have this equation:               \lim_{d \rightarrow \infty} \left [ \underset{a\leq x\leq b}{\mathrm{max}_p} \left | f(x) - m(x) \right | \right ] = 0      which produces this: ![equation](http://i.stack.imgur.com/rFv3I.png) As you can see the max part is not vertically aligned inside the brackets. The lim is also not aligned with the brackets. I want it to look something like this: ![equation2](http://i.stack.imgur.com/inskp.png) As you can see, the lim and max part is now properly aligned. The absolute | | height should also be adjusted to fit the height of the \underset part of max. Anyone know how to do this?


title: Battery symbol in circuitikz

text: Is it possible to make `circuitikz` draw battery-symbols like this: ![enter image description here](http://i.stack.imgur.com/LMMWp.png)


title: One column figure blocks text in adjacent column

text: I am facing this strange problem where a figure in one column of a two-column page is blocking the second column. In other words, text is not going there in other column with a figure in the adjacent column. This happens only when the figure happens to be on top of a page. Any clues?


title: How to add IEEEtran.cls to be read automatically?

text: I am using a MacOS and I want to copy the `IEEEtran.cls` file into the latex directory such that it is read automatically. I have a file in the directory `/opt/local/share/texmf-texlive- dist/tex/latex/IEEEtran/IEEEtran.cls` But when I do `\documentclass{IEEEtran}` it fails to read the file. Please help if anyone has seen this.


title: Regular Expression for logical implication?

text: I am massively unfamiliar with the usage and syntax of regular expressions so the following problem is making my brain bleed. **Background:** I am taking logical expressions, parsing them, making some replacements, and then evaluating them using `\fp_eval:n`. For example, `-a*(b+c)--1-> !a&&(b||c)--2-> !0&&(1||0)--3-> \fp_eval:n {!0&&(1||0)}--4-> 1` where `--i->` is just a step in the process. **Problem:** I would like to also include implication, where `a->b` would be parsed and turned into `(!a)||b`. The problem is that the replacement in step 1 above is not so simple any longer. I don't know the best way to do this but it seemed like something `l3regex` might be good at. Thus, I would like a method (whatever might work) of turning expressions of the form `(stuff1)->(stuff(2))` into, `(!(stuff1))||(stuff2)` The ability to have these nested to deal with more complicated expressions like `((a)->(b))->(c)` would be amazing but I'm not sure if it's possible. My (probably laughably bad) attempt is below:               \documentclass{article}     \usepackage{xparse}     \usepackage{l3regex}     \ExplSyntaxOn     \regex_new:N \l_tt_impl_regex          % I want to match (stuff1)->(stuff2) and get: (!(stuff1))||(stuff2)     % My thinking, I want to capture the stuff between \( and \)     \regex_set:Nn \l_tt_impl_regex {(\([.] \))->(\([.] \))}          \NewDocumentCommand{\imptruth} {m}         {             \tl_set:Nn \l_tmpa_tl {#1}             \regex_replace_all:NnN \l_tt_impl_regex {(!(\1))||(\2)} \l_tmpa_tl                 % just to check while mucking around             \tl_show:N \l_tmpa_tl             \fp_eval:n {\l_tmpa_tl}         }          \ExplSyntaxOff     \begin{document}          \imptruth{(1)->(0)}          % is nesting possible??     \imptruth{((0)->(1))->(0)}          \end{document}


title: Nested axis: several concatenated axis with different ticks

text: I'm trying to convert a so called "dotplot" into latex. This plots are used in biology to compare sequences. Each axis represents a sequence and the coordinates of a dot are the actual X and Y position, similar to a plot without markers. While the overall plot is quite easy, I'm struggling, again, with the axis. One axis (either X or Y) consist of several concatenated axis, .e.g. the X-axis harbors three sequences which have a total length of N whereby the length of each subsequence varies. What I want is to plot the axis for each subsequence (from 0 - end) on the X axis. Or simpler: How can I plot several small X-axis on one long X-Axis. \-----UPDATE:   I saw that my MWE created some confusion. I attached a picture of an example I'd like to reproduce using pgfplot. The X-axis is one sole sequence while the Y-axis has two subsequences: one is indicated on the right and one on the left Y-axis. Both start with 0 and cover the length for each subsequence. The first sequence stops where the second begins. As Jake pointed out, the nested loop should add the possibility to add the minor ticks. Also, there are only the first two subsequences in the MWE (out of 17). I have to mention that the MWE is not the data I show in the attached picture but it should indicate my problem   ![DotPlot with one subsequence on the X-axis and two subsequences on the Y-axis](http://i.stack.imgur.com/cyAob.png) \---\UPDATE I calculated the corresponding start and length for each subsequence:                      start   length     Seq0   0.00     47.81     Seq1   47.82    59.93     Seq2   107.76   49.29     Seq3   157.06   52.94      I tried nested loops. The outer for the beginning of each subsequence and the inner to plot the ticks:                 \foreach \start/\len  in {0/47.81, 47.82/59.93, 107.76/49.29} % subsequences          \foreach \j  in {0,100,...,\len} %% the minor ticks of the subsequences      However, I did not succeed in replacing the ticks with this construct, either by placing it into `x coord trafo/.code` or drawing directly. The pgfmanual mentions different kinds of foreach loops, e.g. `\pgfplotsforeachungrouped`, but I do not understand how I can use them to plot selfmade axis. I tried the approach as described in plot within a plot: zoom into a plot so that the magnified part is framed by axis with ticks and tick labels. This is the most promising approach until now, but I cannot get the two axis for the subsequences side -by-side and properly scaled. I have the suspicion it's something similar to my previous question Two different scales on stacked barplot, but I cannot figure it out. **The MWE**               \documentclass[11pt, a4paper]{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepgflibrary{fpu}     \usepackage[margin = 1cm]{geometry}     \begin{document}     \begin{figure}       \begin{tikzpicture}        [rotate = -90]%% the origin (0/0) of the original plot and pgfplots differ             %%-----------             %%plotting dots             %%-----------        \begin{axis}[        enlargelimits = false,        only marks,        width = \linewidth,        hide x axis,        hide y axis,        ]            \addplot      coordinates {     (704 , 704)%% lower right corner     (704 , 698)     (704 , 691)     (704 , 47)     (703 , 703)     (703 , 698)     (702 , 702)     (702 , 655)     (702 , 337)     (702 , 53)     (702 , 52)     %% more coordinates here. removed for simplicity     (11 , 11)     (10 , 10)     (9 , 9)     (8 , 8)     (7 , 7)     (6 , 6)     (5 , 5)     (4 , 4)     (3 , 3)     (2 , 2)     (1 , 1)     (1 , 0)     (0 , 0)%%upper left corner     };     \end{axis}     \node[anchor = east] at (0,0){\begin{axis}[%%<-- First subsequence                    xmin = 0, xmax = 47.81,                    ymin = 0, ymax = 1,                    scale only axis,                    hide y axis,                    axis x line* = bottom,                    enlargelimits = false,                    ]       \end{axis}};       \node[anchor = east] at (47.82,0){\begin{axis}[%%<-- Second subsequence                    xmin = 0, xmax = 59.93,                    ymin = 0, ymax = 1,                    scale only axis,                    hide y axis,                    axis x line* = bottom,                    enlargelimits = false,                    ]       \end{axis}};            \end{tikzpicture}      \end{figure}     \end{document}


title: How can I distribute beamer overlayareas in handout mode across multiple frames?

text: I have a beamer frame with an `overlayarea` environment. Inside that environment are some bits marked `\only<n>` so that they appear on consecutive slides.               \begin{frame}     \begin{theorem}          There are infinitely many primes.     \end{theorem}     This has many ramifications:     \begin{overlayarea}{\textwidth}{0.3\textheight}         \only<2>{\begin{corollary}Corollary 1\end{corollary}}         \only<3>{\begin{corollary}Corollary 2\end{corollary}}         \only<4>{\begin{corollary}Corollary 3\end{corollary}}     \end{overlayarea}     \end{frame}      In beamer mode, you get one frame with four slides, the first of which will just have the theorem and the next three with one each of the corollaries under the theorem. The `overlayarea` environment keeps the theorem from jumping as the heights of the corollaries change. In handout mode, all `\only`s are expanded regardless of the slide number, unless you explicitly shut them off with a `<handout:0>` mode specification. So the code above will produce a single too-long frame with all three corollaries one after the other. What I would like instead is to have _three_ frames in handout mode, one with the theorem and corollary 1, one with the theorem and corollary 2, one with the theorem and corollary 3. In other words, the `overlayarea` should "distribute" across the three overlays specified. The brute force way to do this would be to copy, paste, and edit so that only the slide needed is there. But I'm looking for something more elegant. Is there, for instance, a way to make handout mode _not_ overlay all overlay- specfified material, and instead set a frame as if it were slide number _n_? This is related to a question "different overlay specification in different beamer modes?" I asked a while back on SO.


title: save session in texmaker / master mode

text: I have to define every time that the main document is in master mode. I can't find a "save session" in my file menu. Is there a auto save session/auto restore saved session? I run latest texmaker on latest Ubuntu.


title: xspace doesn’t handle \,

text: When using a macro ending with an `\xspace` followed by a small space `\,` `xspace` inserts an extra (normal) space.               \documentclass[parskip=half]{scrartcl}               \usepackage{xspace}     \newcommand{\USB}{USB\xspace}          \begin{document}         \USB-Port (o.\,k.)              Use \USB to \dots (o.\,k.)              \USB\,A-Plug (too much space)     \end{document}      ![xspace](http://i.stack.imgur.com/cjMBp.png) Would it be possible to fix this?


title: Typesetting errors with two wrapfigures on one page?

text: I have a document with the book documentclass, and I'm trying to include two wrapfigures on the same page, one on each side (ideally in adjacent paragraphs, but at this point I'm just trying to get them on the page without screwing up any of the other formatting.) One problem I have seems similar to this question, in that on every page after the one where I use wrapfigure, all of my text gets pushed to the right as if in a column. I tried the solution given there but couldn't get it to work for me. The other is that I can't seem to get both of the figures to wrap properly; it seems as if they're interfering with each other somehow, but no matter what settings I change, I just can't get them right. ![enter image description here](http://i.stack.imgur.com/aiqWV.png)               text text text          \begin{wrapfigure}[9]{r}{0.4\textwidth}     \vspace{-20pt}       \begin{center}         \includegraphics[width=0.38\textwidth]{images/hausdorffShapes}       \end{center}     \vspace{-20pt}       \caption{An example showing $\vec{d}_H(B, A)$ and $\vec{d}_H(B, A)$}       \label{hausdorffShapes}     \vspace{10pt}     \end{wrapfigure}          text text text          \begin{wrapfigure}[7]{l}{0.4\textwidth}     \vspace{-20pt}       \begin{center}         \includegraphics[width=0.38\textwidth]{images/hausdorffBadExample}       \end{center}     \vspace{-20pt}       \caption{An example where the Hausdorff distance fails}       \label{hausdorffBadExample}     \vspace{-10pt}     \end{wrapfigure}          text text text      I get all sorts of other positioning problems if I try different lineheights, or vspace, or widths, etc. Or if I try moving the position of the wrapfigure commands around. No combination I've found has worked. And, in addition, in the next page on, all of the text is squished to the right, like it's in a column. Any help would be appreciated, please let me know if I should upload a copy of the ps or pdf or post more of the latex code. EDIT: It turns out that the rest of the text is only forced into a column for the rest of the section, not the rest of the paper. Here's a link to an example tex file and the corresponding pdf output.


title: Commutative diagram with blank spacing and crossing-layer arrows

text: Related to a previous post, now pardon me to go to a specific example, here is my output ![enter image description here](http://i.stack.imgur.com/A1jjw.png) and my Minimum Working Environment               \documentclass[onecolumn,amsmath,amssymb,nofootinbib,superscriptaddress,floatfix]{revtex4}     \begin{document}                    $$     \begin{CD}     1+1 @>>> 2+1 @>>> 3+1 @>>> \dots @>>> d+1 \dots\\     12 @<<< 123 @<<< 1234 @<<< \dots @<<< 123(d+1)\\     @| @| @|\\      @>>> xy  @<<< xyz @<<<     \end{CD}     $$               \end{document}      > **Question** : what I wish is that the similar diagram as above: but having > the following conditions: > > (i) all the **leftarrow @>>> removed** , but keeps the same spacing as > before. > > (ii) all the down equal line removed @| removed, but the same (or smilier) > spacing > > (iii) connecting xyz to 12 from the right to the left arrow (<\---) **(iii) may be challenging, so it is fine to neglect this (iii), and your reply on (i)(ii) still count as an answer.** Thank you, any comment is welcome and helpful! :)


title: Error occurs when I rerun a tex file without closing the pdf file

text: When we make a file, we write a tex file, run it, check the pdf file, fix the tex file, rerun it, and check the pdf file again. Whenever I rerun the file without closing previous version of pdf file, it occurs an error. If I close the pdf file, it works well. But it is bothering to close the pdf file every time. How can I fix it? I am using Adobe X reader in Windows XP


title: How do I add custom beamer actions that change an argument?

text: The beamer manual says: > You can easily add your own actions: An action specification like ⟨ _action_ > ⟩@⟨ _slide numbers_ ⟩ simply inserts an environment called ⟨ _action_ ⟩`env` > around the `\item` or parameter of `\action` with `<`⟨ _slide numbers_ ⟩`>` > as overlay specification. Thus, by defining a new overlay-specification- > aware environment named ⟨ _my action name_ ⟩`env`, you can add your own > action: >   >   >     \newenvironment{checkenv}{\only{\setbeamertemplate{itemize item}{X}}}{} >   > > You can then write >   >   >     \item<beamer:check@2> Text. >   > > This will change the itemization symbol before `Text.` to `X` on slide 2 in > `beamer` mode. The definition of `checkenv` used the fact that `\only` also > accepts an overlay-specification given after its argument. I'd like an action like `\alert` which instead colors its input gray. So I tried:               \documentclass{beamer}          \newenvironment<>{grayenv}{%       \color#1{gray}}{}          \begin{document}          \begin{frame}     Text is \begin{grayenv}<2-> grayed out\end{grayenv}.     \end{frame}          \begin{frame}     Who's \action<alert@+| gray@+(1)>{gray} now? \action<+(1)->{And now?}     \end{frame}               \begin{frame}     Who's \action<alert@+| grayenv@+(1)>{gray} now? \action<+(1)->{And now?}     \end{frame}     \end{document}      The first frame has the expected output: "grayed out" is grayed out on slide 2. The second frame has "Who's ¡all:¿ **gray** now?" (bold is red), followed by no coloring on the next two slides. The third frame has "gray now?" (not "gray" as desired) grayed out on slide 2. The only working examples of custom action I have seen are written as `checkenv` is: not as an overlay-aware environment, but a regular environment that ends its begin code with an `\only{...}` (see also this longer example). Is there anyway to pass the overlay specification to the custom environment?


title: How to set vertical margins for beamer frame?

text: My talk slides use a mostly-white background image (supplied by organizers) that has some visual patterns at the bottom. I would like to tell `beamer` to not cover these patterns (as it makes text less readable). I can set horizontal margins with `\setbeamersize`. But how can I set _vertical_ margins for all my slides?


title: How to prevent a jumping picture when using tikz overlays

text: I have the following tikz picture in Beamer               \usetikzlibrary{fit,calc,positioning,matrix,decorations.pathmorphing}     \begin{tikzpicture}[scale=0.8,system/.style={draw,rectangle,rounded corners=3,minimum width=2cm,text width=1.8cm,text centered}]         \node [system] (fe) {Feature Extraction};         \node [system] (am) [right=of fe] {Acoustic Model};                   \draw[->] (fe) |- (am);         \draw[<-,decorate,decoration={snake,pre length=6mm,segment length=2mm,amplitude=3mm}] (fe.west) -- ++(-2cm,0);             \node<2-> [above=of fe.north] {Fast Fourier Tranform};     \end{tikzpicture}      As you can see I add a node in a second slide. However, the whole picture will jump when this is added. How can I prevent my picture from jumping?


title: Ligatures with Century Schoolbook L in xetex [Ubuntu]

text: I don't get any ligatures, like the fi ligature. I'm using:   * URW Century Schoolbook L (afai can determine anyway)   * XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)   * Ubuntu 10.04 This is the relevant part, I think:               \usepackage{fontspec}     \usepackage{wasysym}     \setsansfont{FluxBold}     \setmonofont[Scale=0.85]{Bera Sans Mono}     \setmainfont{Century Schoolbook L}      If I drop fontspec and use fouriernc it works fine, I get ligatures, but I can't specify the other fonts. If I use both fouriernc and fontspec, this seems to clash so I get neither New Century Schoolbook, nor Century Schoolbook L. I've also tries things like:               \setmainfont[Mapping=tex-text, Ligatures={Common, Rare, Historical}]{Century Schoolbook L}      To no avail. Setting Ligatures=TeX fails, it doens't know what TeX ligatures are. I've tried switching to luatex, but it seems to not be able to use the fontspec package. I'm stuck.


title: Vertical Justification of Elements of Enumerate Environment?

text: How do I automatically vertically justify (evenly vertically space in a page) the `\item`s of an `enumerate` environment? Is adding `\vfill` after each `\item` the only way to do this?


title: Text over rectangular node

text: I am trying to create a new environment that will contain the following displayed counter (at least something like it):               \documentclass[letterpaper]{article}     \usepackage{amsmath,amssymb}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node[draw, rounded corners=1pt,fill,text=white] at (0,0) {\large 9} node at +(0,0.35) {\footnotesize\sc practice};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/rIJzK.png) The problem I have is how to put the word `PRACTICE` immediately above (at a reasonable height above) the boxed node and so that node is of the same width as the word `PRACTICE`. The node will eventually be a square box. Of course the number 9 will be a counter who's size will be determined to match the aesthetics of the display and which I will work its settings later. I am looking for a simple way of doing this. I am thinking right now of defining a length in the for `\settolength{PRACTICE}`.


title: catchfile(betweentags) and obeylines

text: I'm writing two large documents, both containing much of the same text. To ease the maintenance, I'd like no redundant paragraphs, but rather to use catchfilebetweentags. Everything works well, except that catchfilebetweentags (Or possibly catchfile) break the obeylines enviornment. Minimum working example:               \documentclass[12pt]{report}     \usepackage{catchfilebetweentags}     \usepackage{graphicx}          \begin{document}          \ExecuteMetaData[getfromthisfile.tex]{getthissection}          \begin{obeylines}       Line 1       Line 2     \end{obeylines}          \end{document}      And the file to catch from, getfromthisfile.tex               %<*getthissection>     \begin{obeylines}       Line 1       Line 2     \end{obeylines}     %</getthissection>      The resulting document:               Line 1Line 2     Line 1     Line 2      This obviously also apply to other environments using obeylines. Any workarounds or suggestions how to fix this?


title: How can I convert structured LaTeX file *to* CSV data

text: I am using a structured format to print patient's documenatation using LaTeX. The structure is like this: **Demography** Name Surname   Age/Sex   Address **Clinical Details** History, Past History, Personal History, Family History and others (as subsections) er: **Examination** **Diagnosis** Provisional Final **Investigations** available and suggested **Treatment** I used koma article class (`scrartcl`) with `section`, `subsection`, `enumerate`. I am aware of the `datatool` package which I could have used to get the things done, while I would have documented the visit to csv/excel/calc. I could not figure out how a csv entries could be filtered so that I could print an individual patient record. My question is, if I follow above mentioned simple structure, is there any way to export the data of all patient to csv file/excel/calc for analysis? I am typing the structure of `tex` file :               \documentclass[12pts]{scrartcl}     \usepackage{fontspec}     \usepackage[a4paper]{geometry}     \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=1cm,rmargin=1cm}     \usepackage{array}     \usepackage{fixltx2e}     \setmainfont[Script=Devanagari]{Sanskrit 2003}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     %% Because html converters don't know tabularnewline     \providecommand{\tabularnewline}{\\}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \usepackage{enumitem}       % customizable list environments     \newlength{\lyxlabelwidth}      % auxiliary length      \@ifundefined{lettrine}{\usepackage{lettrine}}{}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.          \usepackage[us,24hr]{datetime}          \makeatother          \usepackage{xunicode}     \usepackage{polyglossia}     \title{Consultation Report}     \begin{document}     \maketitle          \section*{Clinical details}          \subsection*{Present history}          \subsection*{Past History}          \subsection*{Personal history}          \subsection*{Family history }          \subsection*{Examination}     examination finding      \section*{Diagnosis}     \begin{enumerate}     \item  Disease     \end{enumerate}          \section*{Rx}     \begin{enumerate}     \item here goes teatment     \item tab abc दिवसातून दोनदा      \end{enumerate}     \begin{flushright}     My Name \\     {\footnotesize Qualification     }\\     {\footnotesize designation}\\     {\footnotesize Ph: }     \par\end{flushright}{\footnotesize \par}          \end{document}      * * * I think I need to elaborate. Till date I was using the template provided to create a regular consultation. The receptionist used to create a folder named after the patient and insert a `demography.tex` file containing               Name surname \\\ dob\\\address\\\Phone.      I used to create small tex files named as `yymmdd.tex` where I used to enter clinical data. Clinical data included history, examination and diagnosis. We use to create a third small file `Rx.tex` where itemised treatment used to go. The three files used to be compiled by placing `\input` commands in a template provided. The advantage of having three small files was I could use demography in a follow up visit. Treatment mostly had to be modified a little bit. The clinical data used to change, so I had to change the input file everytime in a template. Overall, the text generated used to have consistent patern. I could share the folders on intranet. But possibly there is better way of doing this using data tool. I had two problems using data tool.   1. Though I understood how to create tables using data tool, I failed to understand how an individual entry can be used. E.g. presenting history for presenting history in already provided template, past history at past history template.    2. If I use unique identification no for every patient and visit, how can I export only the data for the visit day to latex template.  If I can figure it out, then may be all my patient data can be entered on excel and exported to latex templates to create a needed document. The question, why not use a MySQL like database? It seems beyond my capacity and available time to learn new tool, though it may be worth it. In no way I am creating emr. That is way beyond. If you can help me out in getting cvs to LaTeX template I provided I will be obliged. For technical reason I would like `|` to be separator and not the comma.


title: LaTeX Class / Package / Template for programming project report

text: I'm looking for any useful class or package or style (template) to help me write up a programming project report. I've found many LaTeX tutorials but I found it quite hard to start from scratch.


title: single thick arrow bent 90 degrees instead of two double thick arrows

text: I would like to draw such arrows in my tikz document - ![enter image description here](http://i.stack.imgur.com/znq4d.png) and I have done it using the following code -               \documentclass{minimal}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[node distance=2.5cm,auto,>=latex]     \usepgflibrary{shapes.arrows}     \node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.5cm,anchor=west,rotate=90] at (-3.25,-1) {};      \node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.6cm,anchor=west] at (-3.12,-0.845) {};           \node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.5cm,anchor=west,rotate=90] at (4.25,-1) {};     \node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.60cm,anchor=west,rotate=180] at (4.12,-0.845) {};               \end{tikzpicture}     \end{document}      However, I find a gap between two arrows, especially when I use `scalebox`. I don't want to have this gap between the arrows, rather I want to make it feel like one single arrow. Could anyone tell me how to do it please? Thanks !


title: quiver plot on hyperboloid surface

text: Using `pgfplots`, I'm trying to create a quiver plot on a hyperboloid surface something like this. ![enter image description here](http://i.stack.imgur.com/kMTy8.png) I was able to generate the hyperboloid surface using parametric equations. I could'nt find out how to generate the quiver plot tangent to the surface. Any help would be greatly appreciated. I'm okay with using any other package like `asymptote` etc if I can get this working. The MWE is here               \documentclass[12pt]{book}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}          \begin{document}     \begin{tikzpicture}       \begin{axis}[view={110}{20}, %           scale = 1.2, y post scale = 1.5,         xlabel = $x$, ylabel = $y$, zlabel = $z$]         \addplot3[surf, samples=25, variable = \u, variable y = \v, z buffer = sort,           y domain = 0:2*pi]({sqrt(1+u^2)*cos(deg(v))}, {u}, {sqrt(1+u^2)*sin(deg(v))});      \end{axis}     \end{tikzpicture}     \end{document}      Surface of revolution of y=1/x. quiver plot code.                \addplot3[surf,domain=1:2, y domain = 0:2*pi, z buffer=sort, samples = 10, quiver = {           u = {(x+0.01)*cos(deg(y)) - x},           v = {(x+0.01)*sin(deg(y)) - y},           w = {1/(x+0.01) - z},         }       ]       ({x*cos(deg(y))}, {x*sin(deg(y))}, {1/x});


title: (How) can CSV data be transposed for display in tabular

text: I can use the csvsimple package to automatically display data from a CSV file in a tabular environment. Can the same be achieved in transposed (rows to columns and vice versa) form , as shown by the second hand-coded example?               \begin{filecontents*}{transpose.csv}     course,J,Js,F,Fs,G,Gs,T,Ts     1,4,4,4,4,3,3,5,5     2,3,7,2,6,2,5,4,9     3,4,11,3,9,5,10,2,11     4,2,13,7,16,3,13,7,18     5,7,20,3,19,7,20,7,25     6,5,25,3,23,7,27,2,27     7,3,28,5,28,2,29,3,30     8,6,34,4,32,7,36,3,33     9,4,38,2,34,3,39,7,40     10,4,42,2,36,6,45,2,42     \end{filecontents*}          \documentclass{article}     \usepackage{booktabs}     \usepackage{csvsimple}          \begin{document}     \centering          \begin{tabular}{rcccc}       \toprule       \# & Subj J & Subj F & Subj G & Subj T \\       \midrule         \csvreader[head to column names,late after line=\\]{transpose.csv}{}%         {\course & \J & \F & \G & \T}       \bottomrule     \end{tabular}          \vspace{2em}          \begin{tabular}{lcccccccccc}       \toprule       \# & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\       \midrule       Subj J & 4 & . & . & . & & &  &  &  & 4 \\       Subj F & 4 & . & . &  & & &  &  & . & 2 \\       Subj G & 3 & . &  &  & & &  & . & . & 6 \\       Subj T & 5 &  &  &  & & & . & . & . & 2 \\       \bottomrule     \end{tabular}          \end{document}      Graphically: top shows the current behaviour, bottom the desired output: ![Top table from CSV file, desired bottom table with transposed rows/columns](http://i.stack.imgur.com/PFdQr.png)


title: Different background for section page in Beamer

text: On this picture you can see a titlepage, a section page and a content page done in Powerpoint: ![powerpoint template](http://i.stack.imgur.com/Tloyo.png) How to modify this code so that the section page has the background shown on the image? I can do the text positioning by myself later on.               \documentclass{beamer}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tikz, datetime, textpos}     \yyyymmdddate \renewcommand{\dateseparator}{.}          \definecolor{MedianBrown}{RGB}{119,95,85}     \definecolor{MedianLightBrown}{RGB}{235,221,195}     \definecolor{MedianLightBlue}{RGB}{148,182,210}     \definecolor{MedianOrange}{RGB}{221,128,71}     \setbeamercolor*{title page header}{fg=white}     \setbeamercolor*{title}{fg=MedianLightBrown}     \setbeamercolor*{author}{fg=white}     \setbeamercolor*{date}{fg=white}     \setbeamercolor*{item}{fg=MedianOrange}     \setbeamercolor*{frametitle}{fg=MedianBrown}          \setbeamertemplate{navigation symbols}{}     \setbeamertemplate{blocks}[rounded][shadow=true]     \setbeamertemplate{background}{       \begin{tikzpicture}       \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);       \ifnum\thepage>1\relax% Not the title page             \fill[color=MedianOrange] (0,8) rectangle(0.8,8.3);             \fill[color=MedianLightBlue] (0.9,8) rectangle(\the\paperwidth, 8.3);       \else% Title page           \fill[color=MedianBrown] (0,1.5) rectangle (\the\paperwidth,\the\paperheight);           \fill[color=MedianOrange] (0,0.1) rectangle(3.45,1.4);           \fill[color=MedianLightBlue] (3.55,0.1) rectangle(\the\paperwidth,1.4);        \fi       \end{tikzpicture}     }          \setbeamertemplate{title page}     {         \begin{textblock*}{12cm}(3cm,2.8cm)         \begin{beamercolorbox}[wd=8cm]{title page header}           \usebeamerfont{title}\usebeamercolor{title}\inserttitle%         \end{beamercolorbox}%         \end{textblock*}         \begin{textblock*}{12cm}(-0.5cm,4.9cm)             \begin{beamercolorbox}{date}               \usebeamerfont{date}\insertdate%             \end{beamercolorbox}         \end{textblock*}         \begin{textblock*}{9cm}(3cm,4.9cm)             \begin{beamercolorbox}{author}               \usebeamerfont{author}\insertauthor%             \end{beamercolorbox}         \end{textblock*}     }          \setbeamertemplate{frametitle}     {         \vskip0.3cm         \begin{beamercolorbox}{frametitle}             \insertframetitle         \end{beamercolorbox}     }     \setbeamertemplate{items}[square]     \setbeamertemplate{sections/subsections in toc}[square]          \author{Author Name}     \title{Quite A Long Title For A Simple Beamer Presentation}     \date{\today}           \begin{document}     \frame{\maketitle}     \section{Introduction}     \frame{\sectionpage}     \begin{frame}{My presentation is about\ldots}     \begin{itemize}     \item Some stuff     \item And some other stuff     \end{itemize}     \end{frame}     \end{document}


title: Unload a LaTeX package

text: Is it possible to unload a LaTeX package? I have a preamble file which I use for most documents. Now suppose I want to use a preamble file `preamble.tex` and explicitly don't want to use one of the packages loaded in it. For example in this file there is a line:               \usepackage{mypackage}      and then I want to have a file `test.tex` which contains something like this:               \input{preamble}     \unloadpackage{mypackage}     \usepackage{myotherpackage} %myotherpackage can only be loaded when mypackage is not present


title: Errors using standalone package to create a table

text: I'm learning using standalone package. I tried to create a page including a table but I got errors: **Error**               Something's wrong--perhaps a missing \item. \begin{table}     Something's wrong--perhaps a missing \item. \begin{table}     Something's wrong--perhaps a missing \item. \begin{table}     Missing \endgroup inserted ...l mese per dispositivo in \si{\tera\byte}}     Missing \endgroup inserted ...l mese per dispositivo in \si{\tera\byte}}     Missing } inserted ...l mese per dispositivo in \si{\tera\byte}}     Undefined control sequence ...l mese per dispositivo in \si{\tera\byte}}     Extra \endgroup ...l mese per dispositivo in \si{\tera\byte}}     Something's wrong--perhaps a missing \item. \end{table}     \begin{document} ended by \end{table}. \end{table}     Extra \endgroup \end{table}     Too many }'s \end{document}      **Code**               \documentclass[12pt,a4paper]{standalone}          \usepackage{booktabs}     \usepackage{multirow}     \usepackage{siunitx}     \sisetup{         binary-units = true     }          \begin{document}              \begin{table}[htp]             \centering             \sisetup{table-format=7.0}             \addtolength{\tabcolsep}{-1.0pt}             \begin{tabular}{lS[table-format=6.0]                              S[table-format=6.0]                              S[table-format=6.0]                              SSS}                 \toprule                 Device & 2011 & 2012 & 2013 & 2014 & 2015 & 2016 \\                 \midrule                 Non-smarthphones & 22686 & 55813 & 108750 & 196262 & 357797 & 615679 \\                 Smarthphones & 104759 & 365550 & 933373 & 1915173 & 3257030 & 5221497 \\                 Laptops e Netbooks & 373831 & 612217 & 917486 & 1340062 & 1963950 & 2617770\\                 Tablets & 17393 & 63181 & 141153 & 300519 & 554326 & 1083895\\                 Home gateways & 55064 & 108073 & 180562 & 267545 & 376494 & 514777 \\                 M2M & 23009 & 47144 & 92150 & 172719 & 302279 & 508022 \\                 Altri devices & 525 & 1460 & 5429 & 22966 & 84204 & 242681\\                 \bottomrule             \end{tabular}             \caption{Traffico mobile globale al mese per dispositivo in \si{\tera\byte}}         \end{table}          \end{document}      Do I forget some package? Where could be the error?


title: Easy curves in TikZ

text: I find myself needing to draw lots of elegantly curved paths in TikZ. Ideally, I'd just specify a series of points, and TikZ would calculate the extra data itself to draw a nice series of curves passing smoothly through these points, perhaps with an optional "looseness" parameter that I could specify. But the only way I can find to draw nice curves is by explicitly giving control points, or by manually specifying in and out angles. I can think up a simple algorithm to do this, which would certainly be within TikZ's power to perform: just choose the in and out angles in a simple fashion based on the relative angles between each adjacent pair of line segments. Is something like this already built-in? Or can someone cook something up that does the job? **Edit:** Jake has provided an answer using the `plot [smooth]` functionality. This is almost perfect! But it can't do what I need, because it doesn't let me specify tangent angles manually where needed, which is especially important at the beginning and end of the curve. I would have thought this would be a natural and straightforward addition to the existing `plot [smooth]` algorithm: for every coordinate, an optional angle should be able to be specified as an argument, which if supplied is treated as the tangent angle for the curve at that point. And while we're at it, it wouldn't hurt to also allow the tension to be modified along the path. A minimal extension to the algorithm would just accept two optional parameters, for the curve tangent at the beginning and end.


title: How to include an animation produced by Mathematica to a powerdot slide set?

text: Studying the documentation of media9 package left me with the impression that it should be possible to embed an SWF-video into a slide set to be shown by Adobe Reader. Unfortunately that document contained no examples that I could find, so I'm half-guessing the syntax. This is the first time I'm trying to embed a video, so don't assume that I know anything. Here's the source code:               \documentclass{powerdot}     \usepackage{lmodern}     \usepackage[utf8]{inputenc}     %\usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[finnish]{babel}     \usepackage{amsmath,amssymb}     %\usepackage{psfrag}     \usepackage{media9}     \begin{document}     \begin{slide}{Animation}     \includemedia[           width=250pt,           activate=pageopen,           addresource=ellipsi.swf,           flashvars={source=ellipsi.swf}         ]{}{VPlayer.swf}     \end{slide}     \end{document}      The file ellipsi.swf was exported from Mathematica9, and resides in the same directory as this TeX-source. System: MikTeX ver 2.9, WinEdt ver 7.0, Windows 7 When I click TeX->LaTeX, this compiles all right. The DVI->PS conversion also goes smoothly. But clicking PS2PDF causes a slide of errors starting with               Error: /undefinedresult in --currentpoint      and ending with               MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1.      Usually I include psfrag substitutions in still images, so that's why I'm used to going the DVI->PS->PDF route. I also tried a direct DVI2PDF, but it gave               ** WARNING ** 50 memory objects still allocated     You may want to report this to tex-k@tug.org      Mind you that last message does not concern me much, because I always get that if I hit DVI2PDF, usually with a lower number of allocated memory objects though.


title: Circle with a fill in CircuiTikz

text: I have a schematic that I'm trying to draw. It uses a custom symbol which is not listed in CircuiTikz manual. It should basically be a circle with 'N' in it. My current code is:               \begin{circuitikz}         \draw             (0, 0) to[sV] (0, 6)             (0, 6) -- (7, 6)             (7, 6) -- (7, 5)             (7, 5) to[R] (5, 3)             (5, 3) to[R] (7, 1)             (7, 1) -- (7, 0)             (7, 0) -- (0, 0)             (7, 1) to[R] (9, 3)             (9, 3) to[R] (7, 5)             (5, 3) -- (7, 3)             circle [radius = 10pt]             (7, 3) -- (9, 3)              ;     \end{circuitikz}      The image it produces is: ![enter image description here](http://i.stack.imgur.com/Wi2hB.png) However, I can't make a circle without these lines in it and I don't know how to add an 'N' in the middle.


title: Is it possible to give colors to big (automatic) parenthesis in math mode?

text: In the following code I can't make the right parenthesis to have arbitrary colors.               \documentclass{article}     \usepackage{amsmath}     \usepackage{xcolor}     \begin{document}     \begin{equation}     \left(\frac{44}{55}{\color{blue}\right)}     \end{equation}     \end{document}      As soon as I add `color` around `\right)` (or `\left(`) I get an error: `! Missing } inserted.` Is there a work around for this? (I prefer not to touch other parts of the equation).


title: Wrapfigure not wraping around caption

text: I am kinda new to tex and I am confussed that wrapfigure is not wraping around caption properly. Here is my text :               \begin{wrapfigure}{r}{0.5\textwidth}       \vspace{-20pt}       \begin{center}         \includegraphics[width=0.48\textwidth]{kamdomesta.png}       \end{center}       \vspace{-20pt}       \caption{RegisterActivity}       \vspace{-10pt}     \end{wrapfigure}     \subsection*{KamDoMesta}     Aplikácia poskytuje používateľom prehľad prebiehajúcich filmových predstavení, výstav, prednášok a pod. vo zvolenom meste v daný deň. Za výhody považujem jednoduché používateľské rozhranie, ktoré tvorí v hlavnej aktivite jeden ListView využívajúci knižnicu StickyHeader, ktorá pomáha rozdeliť záznamy do kategórií. Nevýhod je na druhej strane oveľa viac. Chýba vyhľadávanie podľa zadanej ulice, alebo mesta. V aplikácií sa síce dá zvoliť mesto, ale ich zoznam je celkom priemerný a obsahuje len zopár vybraných miest, dokonca pri spustení aplikácie sa stále zobrazujú výsledky pre mesto Košice. Tak isto chýbajú možnosti pre používateľom pre hodnotenie udalosti, resp. komentovanie, pričom webová verzia aplikácie ponúka pridávanie komentárov pomocou pluginov spoločnosti Facebook, ich zahrnutie do aplikácie by nebolo vôbec náročné.       This results into this : http://imgur.com/UhlGlJL I don't know what is wrong, this same code works in other parts of document


title: Combine reference citations

text: I would like the reference citation to appear like [1-4], rather than [1], [2], [3], [4]. Here is my MWE               \documentclass[a4paper,10pt]{book}     \begin{document}           Some text          \bibliographystyle{unsrt}        \bibliography{refer}         \end{document}      How to solve this pooling of citations?


title: Detect which text "mode" (normal, italic, bold, etc.) is currently in use?

text: In my document, I'm often setting upper case words and abbreviations in small caps because it avoids breaking the flow (which upper case words does). Also, many words (like `CUDA`, for instance) are also entered as commands instead of directly as text. Up to this point I have manually set these words in small caps where appropriate (like `\textsc{\cuda}`), but this becomes unnecessarily repetitive. What I would like to be able to do is to define a command like `\cuda` which prints `CUDA` in small caps where the text "mode" is normal roman, and sets `CUDA` in upper cases if the text mode is italics. The reason for doing this is the font I'm using doesn't support small caps in italics. Hence I would like to be able to detect which text "mode" is currently in use, and act accordingly. I've included a minimal example below to illustrate my point:               \documentclass{article}          \usepackage{textcase}          \newcommand{\cudaString}{CUDA}     \newcommand{\cuda}{\textsc{\MakeTextLowercase{\cudaString}}}          \begin{document}     Set \cuda in small caps here,     \itshape but do not set \cuda in small caps here.     \end{document}


title: LaTeX color package: wrong spacing

text: I'm making a simple drawing, on which high school students have to complete the drawing.It's a drawing in R², so I also made a raster. If I use black lines for my raster, it is too dark, so I loaded the `color` package and changed the color to cyan. But the lines that are colored got shifted by about `1mm`. The weird thing is, if I remove the color for the horizontal lines, the vertical lines are blue but correctly placed. If I make the Horizontal lines blue, the vertical ones or shifted. The only change in code I make is commenting out the color. See the code and images for more info: ![Image 1](http://i.stack.imgur.com/HveoT.png)               \begin{picture}(82,100)     \linethickness{0.02mm}     \textcolor{cyan}     {\multiput(0,0)(5,0){17}%     {\line(0,1){100}}}     \textcolor{cyan}     {\multiput(0,0)(0,5){21}%     {\line(1,0){80}}}     \linethickness{0.3mm}     \multiput(10,9)(10,0){7}%     {\line(0,1){2}}     \multiput(19,10)(0,10){9}%     {\line(1,0){2}}     \linethickness{0.3mm}     \put(20,0){\vector(0,1){98}}     \put(0,10){\vector(1,0){78}}     \put(0,10){\line(2,1){80}}     \put(40,80){\circle*{0.6}}     \put(28,21){$r$}     \put(41,81){$P$}     \put(6,5){$-1$}     \put(16,5){$0$}     \put(29,5){$1$}     \put(39,5){$2$}     \put(49,5){$3$}     \put(59,5){$4$}     \put(69,5){$5$}     \put(74,5){$x$}     \put(16,18){$1$}     \put(16,28){$2$}     \put(16,38){$3$}     \put(16,48){$4$}     \put(16,58){$5$}     \put(16,68){$6$}     \put(16,78){$7$}     \put(16,88){$8$}     \put(16,94){$y$}     \end{picture}      ![Image 2](http://i.stack.imgur.com/2JGLH.png)               \begin{picture}(82,100)     \linethickness{0.02mm}     \textcolor{cyan}     {\multiput(0,0)(5,0){17}%     {\line(0,1){100}}}     %\textcolor{cyan}     {\multiput(0,0)(0,5){21}%     {\line(1,0){80}}}     \linethickness{0.3mm}     \multiput(10,9)(10,0){7}%     {\line(0,1){2}}     \multiput(19,10)(0,10){9}%     {\line(1,0){2}}     \linethickness{0.3mm}     \put(20,0){\vector(0,1){98}}     \put(0,10){\vector(1,0){78}}     \put(0,10){\line(2,1){80}}     \put(40,80){\circle*{0.6}}     \put(28,21){$r$}     \put(41,81){$P$}     \put(6,5){$-1$}     \put(16,5){$0$}     \put(29,5){$1$}     \put(39,5){$2$}     \put(49,5){$3$}     \put(59,5){$4$}     \put(69,5){$5$}     \put(74,5){$x$}     \put(16,18){$1$}     \put(16,28){$2$}     \put(16,38){$3$}     \put(16,48){$4$}     \put(16,58){$5$}     \put(16,68){$6$}     \put(16,78){$7$}     \put(16,88){$8$}     \put(16,94){$y$}     \end{picture}


title: What is splitindex.exe.stackdump and why does changing the name of my document fix my splitindex problem?

text: I recently made some major changes to my custom document class. These changes were mainly visually but not functionally. However, splitindex has started making trouble and I cant figure out why. Here is the thing: My document administration_manual.tex won´t compile its index. If I run splitindex, texworks displays                splitindex 2808 open_stackdumpfile: Dumping stack trace to splitindex.exe.stackdump      If I rename administration_manual.tex to administration_manual_2.tex, it compiles the index without any problems. It seems like the problem is related the name but ist still soemhow arbitrary. A couple of days ago I managed to "fix" this problem by simply rebooting my computer. Also, the problem still remains after deleting all temp. files. I have a bunch of documents and each of them works just fine. Still, it looks like texworks, splitindex.exe or maybe even Windows is having issues with the name. Why is that and what can I do to compile the index of administration_manual.tex? I would like to keep the name since it has multiple dependencies. MME: I know i should post an MME, but this time I dont think it will help. The ability to compile the index seems to be influenced by the name of the document. Update: Her is something funny, which indicates that texworks itself might be the problem: If I use Gradle (most of our documents etc. are automatically build using Gradle), I am able to compile an index, disregarding the document/ file name.


title: Appendices one after another

text: I am writing a document with the following documentclass:               \documentclass[a4paper,twoside,openright,12pt]{report}      Since I have some Appendices to the text and they are rather small, I was thinking if I could make them start one after another, without starting on the next page or without skipping any page (I need the openright behaviour for the rest of the text).


title: Getting layout parameters from the geometry package

text: The `geometry` package provides a simple way to set layout parameters. For example,               \usepackage[margin=1in]{geometry}      will give me a document with 1 inch margins on each side. In particular, it computes the LaTeX parameters like `\textwidth`, `\oddsidemargin`, `\textheight`, and `\topmargin`, among others. Is it possible to retrieve the 'friendlier' values like `left`, `right`, `top`, and `bottom`? Of course, one can compute the values using something like `\dimexpr \topmargin + \headheight + \headsep + 1in \relax`. There's also the further complication that the `includehead` and `includefoot` options influence the setting of the parameters.


title: What is the use of the command \IeC?

text: It is produced in streams by `newfile` when I use special characters.


title: Siunitx: how to deal with invalid numerical input '-'?

text: Thanks to you all, I found `siunitx` for decimal alignment. However, some of the columns in my correlation matrix don't have any numbers and have "-" instead. siunitx gives me an error about invalid numerical input. How can I get around this? This is my code:               \documentclass[6pt]{article}     \usepackage[landscape, total={8.5in, 5.45in}, top=1.5in, bottom=1.25in, right=1.     25in, left=1.25in, centering]{geometry}     \usepackage{longtable}     \usepackage{bm}     \usepackage[table]{xcolor}     \usepackage[none]{hyphenat}     \usepackage[T1]{fontenc}     \usepackage[default]{cantarell}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{siunitx}     \usepackage{array}     \definecolor{tableShade8}{HTML}{78C679}     \definecolor{tableShade9}{HTML}{ADDD8E}     \definecolor{tableShade10}{HTML}{D7E9C0}     \definecolor{tableShade7}{HTML}{F7FCB9}     \definecolor{tableShade2}{HTML}{F1F5FA}     \definecolor{tableShade3}{HTML}{dddddd}          \pagestyle{empty}     \renewcommand{\familydefault}{\sfdefault}     \renewcommand{\arraystretch}{1.2}     \usepackage{arydshln}     \arrayrulecolor{tableShade3}          % this is the column for rotated headers     \newcolumntype{R}[1]{>{\begin{turn}{90}\begin{minipage}{#1}\footnotesize}l%     <{\end{minipage}\end{turn}}%     }     \begin{document}          \begin{center}     \textbf{Tricky longtable with rotated headers for a correlation matrix}\end{center}     \setlength\LTleft{0in}     \setlength\LTright{0in}     \setlength\LTpre{-0.3cm}     \setlength\LTpost{0in}     \rowcolors{1}{tableShade2}{white}     \setlength{\tabcolsep}{8pt}     \centering          \begin{longtable}{lS[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]                    S[table-format=+1.2]}          \hiderowcolors     &&\multicolumn{7}{c}{First Group}&\multicolumn{4}{c}{Second Group}\\\cmidrule(lr){3-9}\cmidrule(lr){10-13}     &\multicolumn{1}{R{2.4cm}}{A long heading}     &\multicolumn{1}{R{2.4cm}}{Another \\ long heading}     &\multicolumn{1}{R{2.4cm}}{Third super long \\long heading}     &\multicolumn{1}{R{2.4cm}}{Fourth heading}     &\multicolumn{1}{R{2.4cm}}{Fifth blah\\loooooong blah}     &\multicolumn{1}{R{2.4cm}}{And another \\ heading}     &\multicolumn{1}{R{2.4cm}}{As if that \\ was not enough}     &\multicolumn{1}{R{2.4cm}}{And so it \\ keeps on going}     &\multicolumn{1}{R{2.4cm}}{When exactly \\ will this end?}     &\multicolumn{1}{R{2.4cm}}{Not exactly \\minimal is it?}     &\multicolumn{1}{R{2.4cm}}{Welcome to my\\ longtable hell}     &\multicolumn{1}{R{2.4cm}}{And this is it\\ I promise}\\     \specialrule{0.01em}{0.0em}{0em}     \endhead     \specialrule{0.01em}{0.0em}{0em}     \noalign{\raggedright     \footnotesize     %Complicated legend begins     \begin{tabular}{llllllllll}     \addlinespace[0.2em]     \hiderowcolors     \multicolumn{6}{l}{\textbf{LEGEND}}\\     {\cellcolor{tableShade8}$\ge$0.8}&:Very high&     {\cellcolor{tableShade9}0.60-0.79}&:High&     {\cellcolor{tableShade10}0.40-0.59}&:Moderate&     {\cellcolor{tableShade7}0.20-0.39}&:Low&     {\cellcolor{tableShade2}$\le$0.19}&:Very low\\     \end{tabular}     }          \endfoot          \multicolumn{13}{l}{\textbf{A subheading for the data}}\\\hline     \showrowcolors     First variable&{\cellcolor{tableShade8}1}&{\cellcolor{tableShade9}-0.72}&{\cellcolor{tableShade2}0.07}&{\cellcolor{tableShade2}0.08}&{\cellcolor{tableShade2}0.04}&{\cellcolor{tableShade2}-0.05}&{\cellcolor{tableShade2}0.14}&{\cellcolor{tableShade2}-0.16}&{\cellcolor{tableShade2}0.13}&{\cellcolor{tableShade2}-0.05}&{\cellcolor{tableShade10}0.58}&{\cellcolor{tableShade10}0.55}\\          Second variable &{\cellcolor{tableShade9}-0.72}&{\cellcolor{tableShade8}1}&{\cellcolor{tableShade2}-0.07}&{\cellcolor{tableShade2}-0.07}&{\cellcolor{tableShade2}-0.01}&{\cellcolor{tableShade2}0.06}&{\cellcolor{tableShade2}-0.09}&{\cellcolor{tableShade2}0.1}&{\cellcolor{tableShade2}-0.09}&{\cellcolor{tableShade2}0.03}&{\cellcolor{tableShade7}-0.32}&{\cellcolor{tableShade7}-0.31}\\          Third variable &{\cellcolor{tableShade2}0.07}&{\cellcolor{tableShade2}-0.07}&{\cellcolor{tableShade8}1}&{\cellcolor{tableShade2}0.06}&{\cellcolor{tableShade2}0.06}&{\cellcolor{tableShade2}0.05}&{\cellcolor{tableShade2}0.07}&{\cellcolor{tableShade2}-0.08}&{\cellcolor{tableShade2}0.06}&{\cellcolor{tableShade2}-0.09}&{\cellcolor{tableShade2}-0.16}&{\cellcolor{tableShade2}-0.19}\\          Whoa what is this&{\cellcolor{tableShade2}0.08}&{\cellcolor{tableShade2}-0.07}&{\cellcolor{tableShade2}0.06}&{\cellcolor{tableShade8}1}&-&-&-&-&-&-&{\cellcolor{tableShade2}0.07}&{\cellcolor{tableShade2}-0.01}\\          Fourth Variable&{\cellcolor{tableShade2}0.04}&{\cellcolor{tableShade2}-0.01}&{\cellcolor{tableShade2}0.06}&-&{\cellcolor{tableShade8}1}&{\cellcolor{tableShade8}0.86}&{\cellcolor{tableShade7}-0.32}&{\cellcolor{tableShade2}-0.11}&{\cellcolor{tableShade7}-0.32}&{\cellcolor{tableShade2}-0.16}&{\cellcolor{tableShade2}0.07}&{\cellcolor{tableShade2}0.12}\\          \end{longtable}     \end{document}      As you can see, I am getting an error about the ! ! Invalid numerical input '-'. I looked at the siunitx manual and I am finding it hard to resolve this error. Any help would be most welcome! Thanks for your time. References: 1\. Question about 'dcolumn' and `siunitx` on tex.stackexchange 2\. `siunitx` for bolded numbers 3\. `siunitx` manual


title: How can I align Tables and Figures vertically with Subfig?

text: ----------                     TABLE           ------------                 | a |  b |           FIGURE 1                  | c |  d |                                     | e |  f |                                     | g |  h |                                     | i |  j |        -------------                | l |  m |       Figure 1: subCaption       ----------       Table 1: subCap       ------------                             FIGURE 2       ----------                         TABLE                                         | a |  b |                                                      | c |  d |         -------------       | e |  f |        Figure 2: subCaption       | g |  h |         | i |  j |              ------------       | l |  m |                FIGURE 3       ----------                        Table 2: subCap                TABLES : Global Caption  -------------                             Figure 3: subCaption                                FIGURES: Global Caption      I'm trying to achieve the layout above. Here we have a minimal example with 4 images and 2 tables separated. I wasn't able to mix these two types.               \documentclass[12pt, a4paper]{article}          \usepackage{graphicx}     \usepackage[lofdepth,lotdepth]{subfig}     \usepackage{calc}     \usepackage{array}     \usepackage{multirow}     \usepackage[table]{xcolor}     \usepackage{lipsum}          \definecolor{color1}{RGB}{255,255,255}     \definecolor{color2}{RGB}{250,245,250}               \begin{document}          % paper margins and stuff of the university dissertation template     \setlength{\topmargin}{0mm}     \setlength{\textheight}{\paperheight-\headheight-\headsep-\footskip-2in}     \setlength{\oddsidemargin}{0mm}     \setlength{\evensidemargin}{0mm}     \setlength{\marginparwidth}{0mm}     \setlength{\marginparsep}{0mm}     \setlength{\textwidth}{\paperwidth-2in}          \listoftables     \listoffigures          \section{Example with tables and figures}          \begin{table}     \centering      \scriptsize     \setlength{\extrarowheight}{3.0pt}      \rowcolors{1}{color2}{color1}     \subfloat[Table 1 list of algorithms results][Big Table 1 caption]{     \begin{tabular}{m{2.0cm}cccc}      \multicolumn{5}{c}{\textbf{ALGORITHMS TYPE 1}} \\     \hline     \textbf{ALGORITHMS}  & \textbf{Test1} & \textbf{Test2} & \textbf{Test3} & \textbf{Test4} \\     \multirow{1}{2.0cm}{ALGO 1} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 2} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 3} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 4} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 5} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 6} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 7} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 8} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 9} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 10} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \hline     \end{tabular}     \label{tab:results1}}     \rowcolors{1}{color2}{color1}     \subfloat[Table 2 list of algorithms results][Big Table 2 caption]{     \begin{tabular}{m{2.0cm}cccc}      \multicolumn{5}{c}{\textbf{ALGORITHMS TYPE 2}} \\     \hline     \textbf{ALGORITHMS}  & \textbf{Test1} & \textbf{Test2} & \textbf{Test3} & \textbf{Test4} \\     \multirow{1}{2.0cm}{ALGO 1} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 2} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 3} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 4} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 5} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 6} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 7} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 8} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 9} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \multirow{1}{2.0cm}{ALGO 10} & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\     & (0.0000) & (0.0000) & (0.0000) & (0.0000) \\     \hline     \end{tabular}     \label{tab:results2}}     \caption{Results for two types of algorithms}      \label{tab:results}      \end{table}          \begin{figure}[!h]     \centering     \subfloat[Subfigure 1 list of figures text][Subfigure 1 caption]{     \includegraphics[width=0.4\linewidth]{./figure1.pdf}     \label{fig:subfig1}}     \subfloat[Subfigure 2 list of figures text][Subfigure 2 caption]{     \includegraphics[width=0.4\linewidth]{./figure1.pdf}     \label{fig:subfig2}}     \qquad     \subfloat[Subfigure 3 list of figures text][Subfigure 3 caption]{     \includegraphics[width=0.4\linewidth]{./figure1.pdf}     \label{fig:subfig3}}     \subfloat[Subfigure 4 list of figures text][Subfigure 4 caption]{     \includegraphics[width=0.4\linewidth]{./figure1.pdf}     \label{fig:subfig4}}     \caption{This is a figure containing several subfigures.}     \label{fig:allfigs}     \end{figure}          Subfigures of figure \ref{fig:allfigs} as \ref{fig:subfig1}, \ref{fig:subfig2}, \ref{fig:subfig3} and \ref{fig:subfig4} and to the sub-index as \subref{fig:subfig1}, \subref{fig:subfig2}, \subref{fig:subfig3} and \subref{fig:subfig4}.          Subtables of table \ref{tab:results} as \ref{tab:results1} and \ref{tab:results2} and to the sub-index as \subref{tab:results1} and \subref{tab:results2}.          \end{document}


title: generating bibliography items when using biblatex with WinEdt 6.0 and MikTeX2.9

text: I just started using the `biblatex` package, it seems to have nice features for a full control over your citations and bibliography. However something I miss from using the native BibTeX with WinEdt and MikTeX, is that after execution of the BibTex command, it would generate automatically my bibliography items so that could access them by citation key in the tree view or the gather view of the WinEdt GUI. It would also, whenever I'd type the `\cite{}` command, come up with a popup menu listing those items. Is there any chance I could get this feature back with the `biblatex` package?


title: What's the best way to do overshadow?

text: I want to have this effect: overshadow an image with a semi-transparent grey/white colored rectangle (say they are the same size and at the same position). So now the key question is: Instead of externally creating an empty eps grey/white figure and then do the overlay, is there any better solution??


title: Can you have hyperlinks to locations in different PDFs?

text: It's possible to hyperlink to another PDF file using Adobe Acrobat using the following LaTeX code:               \href{run:target.pdf}{Click me!}      If this is placed in `source.pdf`, then you can click on the hyperlink to open up `target.pdf` on the front page. Is there any chance of hyperlinking to a _different_ section in another PDF, similar to `second.html#target` in HTML?


title: Framed answer environment

text: I am trying to write a simple environment for the solutions of assessments I give. The code below defines such an environment:                \newenvironment{answerenv}[1][Answer]{% Sets the default "Answer" but can be changed to be reused.        \vskip1.5\baselineskip        \MakeFramed {\FrameRestore}        \noindent\tikz\node[inner sep=1ex, draw=black!20,fill=white,               anchor=west, overlay] at (0em, 2em) {\normalcolor\sffamily#1};}%      {\endMakeFramed}           \newcommand{\answer}[1]{% This is to avoid typing then environment over and over             {\color{red}%             \begin{answerenv}             {#1}             \end{answerenv}             }}      This is how I implement the code above:                \documentclass[letterpaper]{article}      \usepackage[top=1.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm]{geometry}      \usepackage{amsmath,amssymb,enumitem}      \usepackage[dvipsnames]{xcolor}      \usepackage{framed,tikz}      \parindent0pt      \newenvironment{answerenv}[1][Answer]{%      \vskip1.5\baselineskip     \MakeFramed {\FrameRestore}     \noindent\tikz\node[inner sep=1ex, draw=black!20,fill=white, anchor=west, overlay] at (0em, 2em) {\color{black}\sffamily#1};}%      {\endMakeFramed}      \newcommand{\answer}[1]{%             {\color{red}%             \begin{answerenv}             {#1}             \end{answerenv}             }}      \begin{document}         \begin{enumerate}         \item Is $5x\left(x^{-\frac{1}{2}}yz^3\right)^2$ equal to $5y^2z^6$?               \answer{Let us simplify $5x\left(x^{-\frac{1}{2}}yz^3\right)^2$ and verify whether or not it is equal to $5y^2z^6$. Thus,               \begin{align*}               5x\left(x^{-\frac{1}{2}}yz^3\right)^2&=5x\left(x^{-1}y^2z^6\right)\\                                                    &=5y^2z^6               \end{align*}               Hence, $5x\left(x^{-\frac{1}{2}}yz^3\right)^2=5y^2z^6$               }         \item Solve $2x+3=-2(4-7x)-2$.               \answer{               \begin{align*}               2x+3&=-2(4-7x)-2\\               2x+3&=-8+14x-2\\               14x-2x&=3+8+2\\               12x&=13\\               x&=\frac{13}{12}               \end{align*}}         \item Is division commutative? Support your conclusion with an example.               \answer{If division is commutative then this means that \[a\div b=b\div a\] is true. It will suffice to say that \[4=8\div 2\neq 2\div 8=0.25\].}         \item Is 1 prime or composite?               \answer{1 is neither prime nor composite. If it were prime then it would have only two distinct factors, one and itself, which does not have. To be composite would mean to have more than two factors and thus does not satisfy any of the above. }         \end{enumerate}      \end{document}       This is the output:![enter image description here](http://i.stack.imgur.com/suWho.png) As you can see there are several problems:   1. In the first `item` the word Answer is more or less where I would want it but you can still see the red frame. I would want the box containing the word Answer to be centered vertically with the frame line.   2. The red frame is not indented with the enumerate environment. Note I would like the content in the environment to be indented as shown below.   3. Inconsistency of the environment. The below is what I intend to achieve: ![enter image description here](http://i.stack.imgur.com/8e4Ts.png)


title: Alignment problem with algorithmic and hyperref

text: I have some alignment problems in the `algorithmic` environment when I use the `hyperref` package. I like to have my comments left-aligned which I achieve by `\renewcommand{\algorithmiccomment}[1]{\hfill(#1)}` in the preamble. It turns out that comments on lines before `\ENDFOR` or anline break (which I use to identify different blocks of code) are a bit misaligned. Here is a MWE: ![enter image description here](http://i.stack.imgur.com/t805j.png)               \documentclass{article}          \usepackage{algorithmic}     \renewcommand{\algorithmiccomment}[1]{\hfill(#1)}          \usepackage{hyperref}          \begin{document}          \begin{algorithmic}     \STATE foo       \COMMENT{bar}     \FOR{foo}       \STATE foo         \COMMENT{bar}       \STATE foo         \COMMENT{bar}     \ENDFOR     \STATE foo       \COMMENT{bar}     \STATE foo       \COMMENT{bar} \\[0.5em]     \STATE foo       \COMMENT{bar}     \RETURN foo       \COMMENT{bar}     \end{algorithmic}          \end{document}      Please comment `\usepackage{hyperref}` to have the desired output: ![enter image description here](http://i.stack.imgur.com/UzPUZ.png) My guess is some weird interaction between `\end{list}` which is used by `algorithmic` and `hyperref`, but I'm kind of stuck now. Do you have any suggestion?


title: MetaPost: Randomly generated number, distinct from previously generated number

text: # Overview Looking to create random page background colours where the same background colour never appears more than once in succession (i.e., red, green, blue, green, blue, red, etc. -- never red, red, green, blue, blue). # Code Example showing the issue:               % Randomize the seed without having to delete the tuc file.     \ctxlua{math.randomseed( os.time() )}          \setupcolors[state=start]          % Dark green     \definecolor[ThemeColourGreen][h=8DC366]     % Pale blue     \definecolor[ThemeColourBlue][h=79C9EF]     % Yellowy-orange     \definecolor[ThemeColourYellow][h=FFD631]          \startMPinclusions       vardef ThemeBase( expr base_colour ) =         fill Page withcolor transparent(1, .85, base_colour );       enddef;            vardef ThemeStyle( expr base_colour ) =          draw unitcircle withpen pencircle scaled 1cm withcolor           .5[base_colour,white];       enddef     \stopMPinclusions          \startuseMPgraphic{page:ThemeBackground}       color colours[];       color base_colour;            colours[1] := \MPcolor{ThemeColourGreen};       colours[2] := \MPcolor{ThemeColourBlue};       colours[3] := \MPcolor{ThemeColourYellow};            base_colour := colours[ round( uniformdeviate( 2 ) + 1 ) ];            ThemeBase( base_colour );     \stopuseMPgraphic          \startuseMPgraphic{page:ThemeStyle}       ThemeStyle( base_colour );     \stopuseMPgraphic          \defineoverlay[page:ThemeBackground][\uniqueMPgraphic{page:ThemeBackground}]     \defineoverlay[page:ThemeStyle][\uniqueMPgraphic{page:ThemeStyle}]          \starttext       \setupbackgrounds[page][background={page:ThemeBackground,page:ThemeStyle}]       \startchapter[title=One]       \input knuth       \stopchapter            \startchapter[title=Two]       \input zapf       \stopchapter            \startchapter[title=Three]       \input knuth       \stopchapter            \startchapter[title=Four]       \input zapf       \stopchapter     \stoptext      # Problem Sometimes the random value selected is the same as the value generated for the previous page, which causes two pages in a row to have the same background colour. Note that in the code above, the circle has a relationship to the current page's background colour. # Question How would you randomly select a value such that on subsequent pages that same value is not used?


title: How to cross reference with \renewcommand{\theequation}?

text: I change the default numbering of the equation. Instead of default "1" on the right side I put "Eq. (1)". The number inside the parentesis automatically changes. But in the cross reference i need "Equation 1", and I want that the number change automatically too. What i can do is this:               \documentclass[11pt]{article}          \usepackage{polyglossia}     \setdefaultlanguage{brazil}          \usepackage{hyperref}     \hypersetup{colorlinks=true}          \usepackage{amsmath}          %% RETIRE THE PARENTESIS IN THE EQUATION NUMBERING          \makeatletter     \def\tagform@#1{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}     \makeatother          %% PUT THE "EQ. (1)"          \renewcommand{\theequation}{Eq. (\arabic{equation})}     \makeatother               \begin{document}          O grau de compactação é definido como a razão (\%) entre densidade do solo seco e a densidade do solo seco quando compactado em um estado de referência, conforme Equação \ref{eq:grau}. %% HERE I WANT EQUATION 1          \begin{equation}      {D=\frac{\rho_{b}}{\rho_{bs}}\times100}      \label{eq:grau}     \end{equation}          \end{document}      ![enter image description here](http://i.stack.imgur.com/dEOLY.png)


title: How does Google maintains citation records? And how can one extract the BibTex for a paper?

text: Concretely, if you search for this paper on google, it will tell you it has 22 citations. How does google knows about the citations? And more importantly, how can I extract at the BibTex for this paper, since of course google is doing it too?


title: How to use \x from \foreach loop in the parameters of \draw in tikz

text: In order to make it simple, I want to draw concentric circles fading out with something like               \foreach \x in {1,1.5,...,4}     \draw[color=black!{100-10*\x}!white] (0,0) circle (\x);      The problem is I don't know if there is a way to make some maths in the parameters of the \draw function. Is there a way ? (I could solve the problem by doing something like               \foreach \x in {10,15,...,40}     \draw[color=white!\x!black] (5,0) circle ({0.1*\x});      But I really want to know if its possible to do it the other way) Also, why something like               \foreach \x in {10,15,...,40}     \draw[color=white!\x!black] (5,0) circle ({0.1*\x} cm); %note the cm      does not work?


title: Define tikz node based on pagenodes

text: I want to define a tikz node called `current grid area` based on the nodes defined by the `tikzpagenodes` package. This node is a rectangle that contains the 4 nodes defined in the package; `current page footer`, `current page header`, `current page text area` and `current page marginpar`: The north of the grid area should be the north of the header; the south should be the south of the footer. The east and west depend of the recto/verso page. In odd pages the west should be west of the text area and the east of the marginpar. In the even pages the west is the west of marginpar and the east the is the east of the text area. I extract the coordinate values of the corners of each area save them in global macros like `\gl@globalgridareaw`, `\gl@globalgridareae` .... Then I build the node using the code to build `current page` in `pgfmoduleshapes.code.tex`. Is part I don't understand very well :-),               % Special  current grid area bounding box rectangle:     \expandafter\def\csname pgf@sh@ns@current grid area\endcsname{rectangle}     \expandafter\def\csname pgf@sh@np@current grid area\endcsname{%       \def\southwest{\pgfqpoint{\gl@globalgridareaw}{\gl@globalgridareas}}%       \def\northeast{\pgfqpoint{\gl@globalgridareae}{\gl@globalgridarean}}%     }     % % TODO: Should I redefine this?      \expandafter\def\csname pgf@sh@nt@current grid area\endcsname{{1}{0}{0}{1}{0pt}{0pt}}      \expandafter\def\csname pgf@sh@pi@current grid area\endcsname{pgfpageorigin}     }      As the example bellow show the the node is not correctly defined. It seems that some offset should be added.               \documentclass{article}     \usepackage{geometry}     \usepackage{tikzpagenodes}     \usetikzlibrary{calc}          \makeatletter     \newcommand{\calculateparameters}{         \noindent\tikz[remember picture,overlay]{\path (current page header area.north);%         \pgfgetlastxy{\gl@discard}{\gl@gridarean}         \path (current page footer area.south);         \pgfgetlastxy{\gl@discard}{\gl@gridareas}         \global\let\gl@globalgridareas\gl@gridareas%         \global\let\gl@globalgridarean\gl@gridarean%       }         \checkoddpage              \ifoddpage         \noindent\tikz[remember picture,overlay]{           \path (current page marginpar area.east);           \pgfgetlastxy{\gl@gridareae}{\gl@discard}           \path (current page text area.west);           \pgfgetlastxy{\gl@gridareaw}{\gl@discard}           \global\let\gl@globalgridareaw\gl@gridareaw%           \global\let\gl@globalgridareae\gl@gridareae%         }         \else         \tikz[remember picture,overlay]{           \path (current page marginpar area.west);           \pgfgetlastxy{\gl@gridareaw}{\gl@discard}           \path (current page text area.east);           \pgfgetlastxy{\gl@gridareae}{\gl@discard}           \global\let\gl@globalgridareaw\gl@gridareaw%           \global\let\gl@globalgridareae\gl@gridareae%         }         \fi          % Special  current grid area bounding box rectangle:     \expandafter\def\csname pgf@sh@ns@current grid area\endcsname{rectangle}     \expandafter\def\csname pgf@sh@np@current grid area\endcsname{%       \def\southwest{\pgfqpoint{\gl@globalgridareaw}{\gl@globalgridareas}}%       \def\northeast{\pgfqpoint{\gl@globalgridareae}{\gl@globalgridarean}}%     }     % % TODO: Should I redefine this?      \expandafter\def\csname pgf@sh@nt@current grid area\endcsname{{1}{0}{0}{1}{0pt}{0pt}}      \expandafter\def\csname pgf@sh@pi@current grid area\endcsname{pgfpageorigin}     }          \makeatother          \begin{document}     \calculateparameters%     \noindent\tikz[<-,remember picture,overlay] {%       \draw[red] (current grid area.south west) rectangle (current grid area.north);     }%               \tikz[remember picture,overlay] {%     \draw [blue,line width=2mm]     (current page.south west)     rectangle     (current page.north east);     \draw [green]     (current page text area.south west)     rectangle     (current page text area.north east);     \draw [yellow]     (current page marginpar area.south west)     rectangle     (current page marginpar area.north east);     \draw [red]     (current page header area.south west)     rectangle     (current page header area.north east);     \draw [orange]     (current page footer area.south west)     rectangle     (current page footer area.north east);     }%     \end{document}


title: TeX commands and currency symbols

text: Why does the code               \documentclass{memoir}     \usepackage[latin1]{inputenc}     \usepackage[danish]{babel}     \usepackage[T1]{fontenc}     \def£#1£{``#1''}     \def€#1€{<#1>}     \begin{document}     Hi, £this£ is nice, and €this€ is beautiful     \end{document}      work, while the code               \documentclass{memoir}     \usepackage[latin1]{inputenc}     \usepackage[danish]{babel}     \usepackage[T1]{fontenc}     \def /#1/{``#1''}     \def this #1 crashes{<#1>}     \begin{document}     Hi, /this/ is nice, and this this crashes is beautiful     \end{document}      does not?


title: Double chevron instead of guillemets

text: Here's a minimal working example:               \documentclass{article}     \usepackage[T1]{fontenc}     \begin{document}     \texttt{>>}     \end{document}      This makes a right guillemet. I'd like a double chevron. If I comment out the fontenc package, I indeed get a double chevron. Any advice?


title: inconsistent behavior of tikz [fit] and [transform shape]

text: I want to frame a set of nodes with the option [fit] and change the overall size of the drawing with [scale = xx, transform shape] but I have unexpected behavior. the frame is no longer valid the code:               \documentclass[a4paper]{article}                          \usepackage{pgf,tikz}     \usetikzlibrary{fit,calc,positioning}          \begin{document}          \begin{tikzpicture}     \node[draw](A){A};     \node[right=3em of A,draw](B){B};     \node[left=3em of A,draw](C){C};     \node[above=3em of A,draw](D){D};     \node[below=3em of A,draw](E){E};     \node[fit=(A) (B) (C) (D) (E), draw]{};     \end{tikzpicture}     \hfill     \begin{tikzpicture}[scale=0.8,transform shape]     \node[draw](A){A};     \node[right=3em of A,draw](B){B};     \node[left=3em of A,draw](C){C};     \node[above=3em of A,draw](D){D};     \node[below=3em of A,draw](E){E};     \node[fit=(A) (B) (C) (D) (E), draw]{};     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/AOiw1.jpg) what can I do?, is this a bug?


title: Using color with \marginpar

text: I'm using the package `marvosym` and the triangle symbol `\Rewind` with `\marginpar`. To draw attention to the symbol, I would like to have it be in red. How do I do this?


title: Two images next to eachother with caption that spreads over the entire page

text: I want to put two images next to eachother in a two-column layout. I do this by:               \begin{figure*}[htp]       \centering       \subfigure[SGD classifier with modified huber loss when using the crowdsource-label-set. A=`anger', F=`fear', J=`joy', L=`love', S=`sadness', S2=`surprise', T=`thankfulness']{\includegraphics[scale=0.27]{sgd_crowdsource_dataset.eps} \label{confusion_matrix_crowdsource}}\quad       \subfigure[SGD classifier with modified huber loss when using the hashtag-label-set. A=`anger', F=`fear', J=`joy', L=`love', S=`sadness', S2=`surprise', T=`thankfulness']{\includegraphics[scale=0.27]{sgd_hashtag_dataset.eps} \label{confusion_matrix_hashtag}}       \caption{Confusion matrices}     \end{figure*}      This looks like this: ![enter image description here](http://i.stack.imgur.com/gYT4Z.png) These images tend to stick in the middle and the captions only spread under the images themselves. This results in the two images taking up a lot of space. Is there a way to align these image left and spread the caption better ? * * * Edit: With the subcaption package:               \begin{figure*}     \centering     \subcaptionbox{SGD classifier with modified huber loss when using the crowdsource-label-set. A=`anger', F=`fear', J=`joy', L=`love', S=`sadness', S2=`surprise', T=`thankfulness' \label{confusion_matrix_crowdsource}}     [.49\linewidth]{\includegraphics[width=0.30\textwidth, keepaspectratio]{sgd_crowdsource_dataset2.pdf}}     \subcaptionbox{SGD classifier with modified huber loss when using the hashtag-label-set. A=`anger', F=`fear', J=`joy', L=`love', S=`sadness', S2=`surprise', T=`thankfulness' \label{confusion_matrix_hashtag}}     [.49\linewidth]{\includegraphics[width=0.30\textwidth, keepaspectratio]{sgd_hashtag_dataset2.pdf}}     \caption{Confusion matrices}\label{animals}     \end{figure*}      Gives this result: ![enter image description here](http://i.stack.imgur.com/2dCpx.png)


title: stick to the right border of a box

text: I have a problem with a \fbox command: I want to put two right-arrow side to the box so that these two arrows start on the border of the box. I've created the box and the two arrows but if I merge it together there is an annoying space between the end of the border of the box and the starting of the two arrows, as you can see if you compile this MWE:               \documentclass[a4paper,10pt]{article}  \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath}  \usepackage{amssymb}           \begin{document}          \title{TEST 01} \maketitle          \newcommand*{\tto}{\!{\begin{array}{c}\rightarrow\\\rightarrow\end{array}}}      \newcommand*{\block}[1]   {\fbox{\scriptsize ${\begin{array}{c}#1\end{array}}$}}               Hello $\block{test01 \\ test02}\tto$.          \end{document}      How can I stick the two arrows to the right border of the fbox?


title: TikZ library creation

text: I'm wondering about the best (ie faster) way to create a new Tikz library. Let's assume I have the components in a PDF/SVG/whatever vector graphic program. There is a possibility to directly convert from SVG to TikZ code (https://github.com/kjellmf/svg2tikz). I could easily perform that task for each component I have. Then I'd have to add anchors / labels to the created shape by post-processing the obtained code. For example with this shape: ![IGBT](http://i.stack.imgur.com/R1AyY.png) I would get the following code:               \definecolor{c010202}{RGB}{1,2,2}     \definecolor{cFFFFFF}{RGB}{255,255,255}               \begin{tikzpicture}[y=0.80pt, x=0.8pt,yscale=-1, inner sep=0pt, outer sep=0pt]       \path[draw=c010202,line join=round,line cap=round] (311.6780,393.3070) --         (311.6780,404.6450) -- (297.5060,410.3140) -- (297.5060,410.3140);       \path[draw=c010202,line join=round,line cap=round] (311.6780,450.0000) --         (311.6780,438.6610) -- (297.5060,432.9920) -- (297.5060,432.9920);       \path[draw=c010202,line join=round,line cap=rect,line width=1.600pt]         (297.5050,404.6460) -- (297.5050,438.6620) -- (297.5050,438.6620);       \path[draw=c010202] (294.6710,438.6610);       \path[fill=c010202] (300.9860,436.6890) -- (302.5760,432.7140) .. controls         (302.6780,432.4570) and (302.9690,432.3330) .. (303.2260,432.4350) .. controls         (303.2750,432.4560) and (303.3220,432.4840) .. (303.3630,432.5180) --         (308.5310,436.8910) .. controls (308.7420,437.0700) and (308.7670,437.3840) ..         (308.5900,437.5950) .. controls (308.4880,437.7160) and (308.3360,437.7810) ..         (308.1800,437.7720) -- (301.4200,437.3750) .. controls (301.1450,437.3590) and         (300.9360,437.1220) .. (300.9510,436.8470) .. controls (300.9530,436.7930) and         (300.9650,436.7400) .. (300.9860,436.6890) -- cycle;       \path (300.9860,436.6890) -- (302.5760,432.7140) .. controls (302.6780,432.4570)         and (302.9690,432.3330) .. (303.2260,432.4350) .. controls (303.2750,432.4560)         and (303.3220,432.4840) .. (303.3630,432.5180) -- (308.5310,436.8910) ..         controls (308.7420,437.0700) and (308.7670,437.3840) .. (308.5900,437.5950) ..         controls (308.4880,437.7160) and (308.3360,437.7810) .. (308.1800,437.7720) --         (301.4200,437.3750) .. controls (301.1450,437.3590) and (300.9360,437.1220) ..         (300.9510,436.8470) .. controls (300.9530,436.7930) and (300.9650,436.7400) ..         (300.9860,436.6890) -- cycle;           \path[draw=c010202,line join=round,line cap=round] (294.6710,404.6460) --             (294.6710,438.6610) -- (284.7500,438.6610);               \path[fill=cFFFFFF] (284.7500,438.6610) circle (0.0424cm);               \path[fill=c010202] (284.7500,436.9570) .. controls (285.6890,436.9570) and                 (286.4540,437.7220) .. (286.4540,438.6610) .. controls (286.4540,439.6000) and                 (285.6890,440.3650) .. (284.7500,440.3650) .. controls (283.8110,440.3650) and                 (283.0460,439.6000) .. (283.0460,438.6610) .. controls (283.0460,437.7220) and                 (283.8100,436.9570) .. (284.7500,436.9570) .. controls (285.6900,436.9570) and                 (283.8100,436.9570) .. (284.7500,436.9570) -- cycle(284.7500,439.9650) ..                 controls (285.4690,439.9650) and (286.0540,439.3810) .. (286.0540,438.6610) ..                 controls (286.0540,437.9420) and (285.4700,437.3570) .. (284.7500,437.3570) ..                 controls (284.0300,437.3570) and (283.4460,437.9420) .. (283.4460,438.6610) ..                 controls (283.4460,439.3810) and (284.0300,439.9650) .. (284.7500,439.9650) ..                 controls (285.4700,439.9650) and (284.0300,439.9650) .. (284.7500,439.9650) --                 cycle;          \end{tikzpicture}      In order to use it easily I would have to add anchors (1 north, 1 south and 1 for gate), plus a label position. Would this approach be the good way to do it or not? The other way would be to start from any existing library and modify it to my needs.


title: Reduce compilation time for opentype fonts (otf)

text: I have some opentype fonts (`otf`) which I use with `fontspec`. Everything works fine. During the compilation LuaLaTeX load the `otf`-files in a temporary file. For example:               (load: /home/marco/.texlive2011/texmf-var/luatex-cache/generic/fonts/otf/temp-FONTNAME.lua)      Is it possible to install the font via LuaLaTeX or `fontspec` that the compilation will be reduced? I know the script otfins.py but maybe there is an easier way.


title: Avoid line break in section

text: I do have a section name with a pretty long name but which could "nicely" fit on one line. I was wondering, therefore, how I could avoid the line to break, perhaps using some _space compression_ and/or _line overflow_. * * *               \documentclass[12pt,article,oneside]{memoir}     \usepackage[margin=1in]{geometry}     \begin{document}     \mainmatter     \section{Convolutional artificial neural networks --- ConvNets}     \end{document}      ![enter image description here](http://i.stack.imgur.com/oRBYr.png) Basically, I'd like to have a one-line title (I don't like how it looks like, and gaining an extra line would be also quite helpful).


title: How to align the top of two minipages

text: I have two minipages aligned to the top of a frame (I used the option [t] on the frame and the two minipages). If I had elements in one of the minipage, the other minipage goes down. I have reproduced a small example (pdf link):               \documentclass{beamer}          \begin{document}          \begin{frame}[t]         \begin{minipage}{0.58\linewidth}             \begin{tabular}{c}\hline                 \textbf{Header}    \\\hline                 \only<2->{ line2\vspace{6cm}\\\hline}              \end{tabular}         \end{minipage}\hfill         \begin{minipage}{0.4\linewidth}             \begin{block}{Text}                 text\\             \end{block}         \end{minipage}          \end{frame}          \end{document}      Do you know how to avoid this behavior?


title: Warning: \oval, \circle, or \line size unavailable

text: I have been trying to have a border for a whole page I am trying to write in LaTeX and I have used the following two lines:               \thisfancyput(3.25in,-4.5in){%     \setlength{\unitlength}{1in}\fancyoval(8.2,10.5)}      from the package `fancybox`. It worked well, but I keep getting the warning:               myDocument.tex:70:\oval, \circle, or \line size unavailable on input line 118.      My questions now are:   * How may I get rid of this warning?   * How to thicken the border line?   * How to change its color? Here is my Latex file               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{fancybox}     \usepackage{fancyvrb}     \usepackage{amssymb}     \usepackage{pict2e}     \usepackage[tableposition=top]{caption}     \usepackage[english]{babel}     \usepackage{color}     \usepackage{array}     \usepackage{booktabs}     \usepackage{bm}     \usepackage{times}     \usepackage{multirow}     \usepackage{url}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage[cm]{fullpage}     \usepackage[margin=0.4in]{geometry}     %\usepackage{multicolumn}     \usepackage{rotating}     \def\wl{\par \vspace{\baselineskip}}     \definecolor{LimeGreen}{RGB}{64,186,65}     %%%%%%%%% Background %%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{eso-pic}     \newcommand\BackgroundPic{     \put(0,-70){     \parbox[b][\paperheight]{\paperwidth}{%     \vfill     \centering          \vfill     }}}          %%%%%%%%%%%%%% FRAME STARTS HERE  %%%%%%%%%%%%%%%     \thisfancyput(3.25in,-4.5in){%     \setlength{\unitlength}{1in}\fancyoval(8.2,10.5)}     %%%%%%%%%%%%%%  FRAME STARTS HERE  %%%%%%%%%%%%%%               %%%%%%%%%%%%%% Document Starts Here:  %%%%%%%%%%%     \begin{document}     \AddToShipoutPicture{\BackgroundPic}           \thispagestyle{empty}      \vspace{-0.75cm}      \textbf{\footnotesize {\color{LimeGreen}XXX XXXX\\}}           \vspace{-0.5cm}     \hrulefill%\dotfill          \begin{center}     \normalsize       \underline{Some words go here}\\       \vspace{1.0cm}       \large{Something else here}\\            \vspace{0.2cm}            \vspace{0.9cm}           \end{center}          \begin{center}               Something else here     \end{center}     \wl     \wl     \hrule          \end{document}


title: How do you use division in LaTeX to adjust parameters?

text: I would like to define a macro that draw a triangle nested in a triangle. I already have a triangle macro using `TikZ` that draws a nice triangle given a size. For simplicity,               \tr{4}      Will create a triangle of size 4. What I would like is a macro for nested triangles that calls tr twice, once with the size, and then again with half the size.               \newcommand{\trNest}[1]{\tr{#1} \tr{ {#1} / 2}}      There is just one thing, `/` does not perform division. How can I pass the result of dividing argument by a number in LaTeX?


title: Using environment argument inside a new environment doesn't work

text: I know it must be something trivial:               \documentclass{article}          \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{thmtools}          \usepackage[svgnames]{xcolor}     \usepackage{framed} %http://www.latex-community.org/forum/viewtopic.php?f=44&t=5823     \colorlet{shadecolor}{gray!25}     \renewenvironment{leftbar}{%       \def\FrameCommand{\textcolor{shadecolor}{\vrule width 3pt} \hspace{10pt}}%       \MakeFramed {\advance\hsize-\width \FrameRestore}}%     {\endMakeFramed}          \declaretheorem[name=Example]{exampleOri}     \newenvironment{example}[1]{\begin{leftbar}\begin{exampleOri}[#1]}{\end{exampleOri}\end{leftbar}}          \begin{document}          \begin{example}[This is a test]     Bla     \end{example}          \end{document}      Which results in `Example 1 ([). This is a test] Bla`. What is wrong here? **UPDATE** : As it's not directly an answer to the question, but still useful, I wanted to post my final approach using the `mdframed` key in `thmtools`:               \documentclass{article}          \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{thmtools}     \usepackage[framemethod=TikZ]{mdframed}          \usepackage[svgnames]{xcolor}     \colorlet{shadecolor}{gray!25}          \declaretheorem[name=Example,         mdframed={             hidealllines=true,leftline=true,             rightmargin=0pt,innerrightmargin=0pt,             innerlinewidth=0pt,middlelinewidth=0pt,             outerlinecolor=shadecolor,outerlinewidth=3pt,             skipabove=\topskip,skipbelow=\topskip}         ]{example}          \begin{document}     \begin{example}[This is a test]        Bla     \end{example}         \end{document}


title: How to renewcommand in newcommand

text: I have a macro that I use to write units (so that I can write exponents easily), in math or in text mode. I would like to change the definition of `\mu` in `\upmu` (from the `upgreek` package) only in this macro (not for standard math). This is what I wrote:               \newcommand{\U}[1]{%         \renewcommand{\mu}{\upmu}         \ensuremath{\mathrm{~#1}}%     }      It works, but I get an error at compilation:               ERROR: Argument of \@caption has an extra }.          --- TeX said ---     <inserted text>                      \par      l.117 ... bla 30\U{\mu K} bla bla}          --- HELP ---     From the .log file...          I've run across a `}' that doesn't seem to match anything.     For example, `\def\a#1{...}' and `\a}' would produce     this error. If you simply proceed now, the `\par' that     I've just inserted will cause me to report a runaway     argument that might be the root of the problem. But if     your `}' was spurious, just type `2' and it will go away.      for the incriminated code:               \caption{bla bla 30\U{\mu K} bla bla}


title: dblfloatfix with multicolumn

text: I am working with dblfloatfix with multicol packages. Now I need to obtain something like this: http://www.geomechanics.caltech.edu/publications/pdf/andrade_avila_12.pdf There you can see the figures 1 and 2, using the packages described above I obtain the behavior of figure 1 using:                  \begin{figure*}[t]        \centering\includegraphics[width=\linewidth,height=0.1\textheight]{example-image-a}        \caption{B caption}        \end{figure*}      Now I need to obtain the behavior of figure 2, but disappears, when I used the combination of dblfloatfix and multicol packages. Can I get the behavior of figure 2?, using already dblfloatfix and multicol packages.


title: Caption of figure not centred

text: I'm using the template provided by IEEE:               \begin{figure}[!t]     \centering     \includegraphics[width=0.8\columnwidth]{top}     \caption{CAPTION}     \label{fig-top}     \end{figure}      However the caption is not centred. What I get is this: ![enter image description here](http://i.stack.imgur.com/GL7wr.png) Please help!