title: TikZ - How to draw the following

text: Rectangle in TikZ can be easily drawn. But how do I achieve the following using TikZ or pstricks? ![enter image description here](http://i.stack.imgur.com/j4q7Q.png) ![enter image description here](http://i.stack.imgur.com/kTib5.png) Here is what I have worked till now:               \documentclass{beamer}     \usetheme{CambridgeUS}     \useoutertheme{infolines}     \useinnertheme{circles}     \usepackage{tikz}     \usepackage{transparent}     \setbeamercolor{title}{bg=red!65!black,fg=white}     \usetikzlibrary{shadows}     \usetikzlibrary{shadows.blur}     \usetikzlibrary{shapes.symbols}          \newcommand\RBox[1]{%       \tikz\node[draw,rounded corners,align=center,left color=brown!0,right color=brown!40 ]{#1};%     }            \setbeamerfont{author in head/foot}{size={\fontsize{3pt}{4pt}\selectfont}}     \setbeamercolor{normal text}{bg=yellow!20}     \author[Subham \& Mithun \& Karthikeyan \& Shantikumar]     {%        \texorpdfstring{             \begin{columns}                 \column{.45\linewidth}                 \centering \\                 \includegraphics[rounded corners,width=\linewidth]{1}                 \column{.45\linewidth}                 \centering                 \begin{huge}                 Presented By: \\[1ex]                 \end{huge}                 \RBox{Subham Soni S.\\                 \href{mailto:subhamsoni0049@pec.edu}{subhamsoni0049@pec.edu}}\\[0.5ex]                 \RBox{Karthikeyan\\                 \href{mailto:subhamsoni0049@pec.edu}{subhamsoni0049@pec.edu}}\\[0.5ex]                 \RBox{Mithun C.K.\\                 \href{mailto:subhamsoni0049@pec.edu}{subhamsoni0049@pec.edu}}\\[0.5ex]                 \RBox{Shantikumar L.\\                 \href{mailto:subhamsoni0049@pec.edu}{subhamsoni0049@pec.edu}}             \end{columns}        }        {Subham Soni S., Karthikeyanm, Shantikumar L.,  Mithun C.K.}     }     \title{Work Culture}                    \begin{document}     \begin{frame}     \titlepage     \end{frame}     \begin{frame}     \frametitle{Today's Session}     \tableofcontents     \end{frame}     \section{What is Work Culture?}     \begin{frame}     \frametitle{What is Work Culture?}     \begin{definition}     Culture is the learned beliefs, attitudes, values,customs and traditions that are common to a group of people. It is dynamic and transmitted to others and it is the shared qualities of a group that make them unique.     \end{definition}     \begin{definition}     Work culture may be defined as the rules/regulations,traditions/rituals,policies, practices and values/beliefs of an organization. It can be seen in the way of life of a group of people at the workplace.     \end{definition}     \end{frame}     \section{Work Culture - Before and After}     \begin{frame}     \frametitle{Work Culture - Before and After}     \begin{center}       \begin{tikzpicture}         \node[draw=none,shade,           top color=blue!40,           bottom color=blue!5,           rounded corners=6pt,           blur shadow={shadow blur steps=5}         ] {\sffamily\bfseries\large A pretty box};              \node[tape,draw=none,shade,           top color=blue!40,           bottom color=blue!5,           rounded corners=1pt,           blur shadow={shadow blur steps=5,shadow blur extra rounding=1.3pt}         ] at (5,0){\sffamily\bfseries\large Another pretty box};       \end{tikzpicture}     \end{center}     \end{frame}     \end{document}      I get the output like this: ![enter image description here](http://i.stack.imgur.com/2IqwR.png) How to remove the unnecessary black color and bring in the appropriate shadow color and the + sign also?


title: Changing the enumerate numbering style

text: Is it possible to change the enumerate style from: 1. 2. 3. to (1) (2) (3) ? I only know how to change it to roman letters. Thanks. **EDIT:** Right now I try the following               \documentclass{report}     \begin{document}     \section{Bla bla bla}     \begin{enumerate}     \item     \end{enumerate}     \end{document}


title: Instant Preview of Latex to PDF in silent mode with fast compiling

text: Please i am working on a project should provide fast compiling of Latex files in silent mode so the user should not see any process and just preview the final pdf file produced and i need it faster than usual i tried to use pdflatex by hidden command line but it was slow which takes 4-5 seconds to preview pdf then i tried to use TeXWorks it was really fast but i can not hide it so any suggestion guys.


title: How can I add extra \pagemark that marks the number of the page where current chapter starts and where it ends?

text: I'm using KOMA-Script scrbook class. And scrpage2 package for headings:               \usepackage{scrpage2}     \clearscrheadfoot     \pagestyle{scrheadings}     \cfoot[\pagemark]{\pagemark}     \chead[]{\headmark}      I want to add an extra pagemark on ofoot. The extra pagemark I need is like this: pp. 181-195, where 181 is the page number where current chapter starts and 195 is where chapter ends. Of course, I need this to change in every chapter.


title: Equation with \argmin inside table

text: I want the equation to properly show the argmin tag with variable at the bottom inside a table. In my case it is showing as a subscript. I tried everything but cant get this done. The following is a part of my code compiling fine but not as desired               \multicolumn{4}{l}{ $\begin{array} {lcl} \mathbf{r}^i \longleftarrow \argmin_\mathbf{r}\;\Vert \mathbf{r}  \Vert_1 \;\;\;\;\mbox{subject to}\;\;\;\;   \mathbf{y}= \mathbf{A}\mathbf{r} \end{array} $ }     \begin{tabular}{ll|l|l|l|} \hline     \multicolumn{5}{l}{Algorithm:}                                                    \\ \hline     \multicolumn{5}{l}{\begin{tabular}[l]{@{}l@{}}Inputs: CS measurement vector for a speech frame $\mathbf{y}$ \\ Outputs: predictor $\mathbf{a}^i$, residual $\mathbf{r}^i$ \\ $i$ = 0, \\ Initialize dictionary: $h^i=rand, \mathbf{H}^i= conv(h)$             \\\end{tabular}} \\      \hline     \multicolumn{5}{l}{\textbf{while} halting criterion false \textbf{do}}        \\      \multirow{2}{*}{1.}           &                          \\                                   & \multicolumn{4}{l}{$\begin{array} {lcl}                                    \mathbf{x}^i =\mathbf{H}^i\mathbf{r}^i \end{array}$}                           \\     2.                            & \multicolumn{4}{l}{     $\begin{array} {lcl} \mathbf{a}^i \longleftarrow \argmin_\mathbf{a} \; \Vert \mathbf{r}\Vert_2 + \gamma\Vert\mathbf{a}\Vert_1 \;\;\; \mbox{subject to}\;\; \mathbf{x}^i=\mathbf{X}^i\mathbf{a+r} \end{array}$\vspace{1em}}                        \\     \multirow{4}{*}{3.}           & \multicolumn{4}{l}{\; \mbox{Estimate the vocal tract impulse response}}                         \\                                   & \multicolumn{4}{l}{                                  $\begin{array} {lcl}                                    h^{i+1} \;\; \mbox{given the predictior estimate}\;\;\mathbf{a}^i \end{array}$}                           \\                                   & \multicolumn{4}{l}{$\begin{array} {lcl}                                   \mathbf{H}^{i+1}= [conv(h^{i+1})] \end{array}$                                                  }            \\                                   & \multicolumn{4}{l}{$\begin{array} {lcl}                                   i=i+1; \end{array}$         }                              \\     \multicolumn{5}{l}{\textbf{end while}} \\ \hline                                             \end{tabular}      ![enter image description here](http://i.stack.imgur.com/UjUEB.jpg) Desired Output need argmin with variable at bottom not as subscript like this ![enter image description here](http://i.stack.imgur.com/STMAg.jpg)


title: Any good way to write mathematical induction proof steps in LaTeX?

text: I need to write some mathematical induction using LaTeX. Are there any packages that I can use for that purpose? ![enter image description here](http://i.stack.imgur.com/cB4ei.jpg)


title: Spaces between sections and subsections on moderncv

text: I have been trying to get spaces included between sections and subsection as it looks so narrowed down (`moderncv`). Any help would be appreciated. Here is my code:               \documentclass[11pt,a4paper]{moderncv}          % moderncv themes     \moderncvtheme[blue]{casual}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)     %\moderncvtheme[green]{classic}                % idem          % character encoding     \usepackage[english,ngerman]{babel}     \usepackage[utf8]{inputenc}                       % replace by the encoding you are using     \newcommand{\localtextbulletone}{\textcolor{color1}{$\vcenter{\hbox{\tiny$\bullet$}}$}}%Changes Item List bullet size and color     \renewcommand{\labelitemi}{\localtextbulletone}%Sets the new bullet type                    % adjust the page margins     \usepackage[scale=0.8]{geometry}     \usepackage{graphicx}                    \setlength{\hintscolumnwidth}{3cm}                      % if you want to change the width of the column with the dates     %\AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}}  % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details     %\AtBeginDocument{\recomputelengths}                     % required when changes are made to page layout lengths     \renewcommand{\sfdefault}{\rmdefault} %?ndert die schriftart               \begin{document}                    \maketitle               \section{Zu meiner Person}     \cvline{Geboren}{am 07.06.1983 in Berlin}     \cvline{Familienstand}{ledig}          \section{Studium}               \subsection{Masterstudium 'Volkswirtschaftslehre'}     \cvline{09/2009 - 09/11}{\textbf{Birkbeck, University of London, UK, }\newline \emph{Schwerpunkte: Wachstums?konomie, Makroökonometrie und Statistik}}               \subsection{Masterthesis:}     \cvline{Titel}{\emph{Mugabe's Monetized Budget Deficit - The Epitome of Zimbabwe's Economic Tragedy?-An Investigation into the Causes of Zimbabwe's Hyperinflation and the Options     for its Monetary Regime.}}     \cvline{Betreuer}{Prof. Ron Smith and Prof. John Driffle}          \subsection{Bachelorstudium 'Volkswirtschaftslehre \& Finanzen'}     \cvline{09/2006 - 07/09}{\textbf{London Metropolitan Business School, UK,}\emph{ (Note: 1,0)}}     \subsection{Bachelorthesis, durchgef?hrt als zwei Teilprojekte:}     \cvline{1st. Thesis}{\emph{The Yuan: America's Foreign Boogeyman? An Investigation into the Chinese Exchange Rate Regime. (Note: 1,0)}}     \cvline{2nd.Thesis}{\emph{Is Outsourcing really as bad as its critics allege?  (Note: 1,0)}}     \cvline{Betreuer}{Prof. Steven Smith \& Prof. Craig Duckworth}          \section{Beruflicher Werdegang}     \cvline{02/2012 - 04/12}{\textbf{Schneider Trading Associates, London, UK}\newline      {\empty}{Trading Floor Training Programme: Proprietary Trading}}


title: How can I use renewcommand for toprule of the booktabs package?

text: I have a LaTeX document and want to change the thickness of `\toprule` and `\bottomrule` to 1.5pt. Is there a way to do this with the `\renewcommand` or do I have to change every `\toprule` to `\toprule[1.5pt]`?


title: how to write content of a command into a file

text: This question is a possible solution to question Code fails with Emergency stop, when using \expandafter\csname and such in listings, though not really an answer. I have defined a command which may contain up to hundred lines of code including paragraph lines breaks, but basically it is just a lot of LaTeX Code. Let's assume this command is called `\printhis` Now I want to export the content of `\printthis` into a file, which can be loaded by `listings` afterwards. I have not worked before with any tex code that exports something to a file. If anyone can provide and example or link to a tutorial that would be great. EDIT: Approach using answer package.               \documentclass{scrbook}          \makeatletter     \providecommand{\packagename}{templatedemo}          \RequirePackage{etoolbox}     \RequirePackage{answers}          \providecommand\demo@filename{demofile}     \providecommand\AddDemo[2]{%       % #1 : package/identifier       % #2 : content       \ifcsdef{demo@content@#1}{         \expandafter\renewcommand\csname demo@content@#1\endcsname{#2}%       }{         \expandafter\newcommand\csname demo@content@#1\endcsname{#2}%       }     }          \providecommand{\demo@printhis}{}     \newcommand{\outputtofile}[1]{       \Opensolutionfile{\demo@filename}       \scantokens{\begin{Filesave}{\demo@filename}#1\end{Filesave}}       \Closesolutionfile{\demo@filename}     }          \providecommand\PrintDemo[1]{%       \ifcsdef{demo@content@#1}%       { % print          \renewcommand{\demo@printhis}{\csuse{demo@content@#1}}         To file: \demo@printhis         \outputtofile{\demo@printhis}       }%       { % error if not defined          }     }          \AddDemo{text}{Sample text in file}%     \makeatother     \listfiles          \begin{document}     \PrintDemo{text}\par     From File: \IfFileExists{demofile.tex}{\input{demofile.tex}}{}     \end{document}


title: pgfplot: Customize the axis wide scientific notation multiplier

text: Hy Guys, I'm experiencing two problems with ticklabel formats. First, if I explicitly set `scaled y ticks = true`, the base ten notation still appears at every tick. Here's the diagram: ![Problem Child](http://i.stack.imgur.com/1Mbte.png) Here the used code for the picture:               \begin{tikzpicture}          \begin{axis}[%     scaled y ticks = true,     width=4.52083in,     height=3.56562in,     xmin=0, xmax=0.01,     ymin=-0.0025, ymax=0,     xlabel={Time t [s]},     ylabel={TopNode Displacement [m]},     xmajorgrids,     ymajorgrids,     zmajorgrids,     legend entries={$D=0$},     legend style={nodes=right},     scaled x ticks = true,     x tick label style={     rotate=90,anchor=east,},     y tick label style={/pgf/number format/.cd,sci,precision=5}]     \addplot [     color=green,     solid,     line width=1.0pt     ]     coordinates{     (0,0)(9.9173e-005,-3.01301e-005)(0.000199171,-0.000141203)(0.000299992,-0.000335604)      ....     (0.0997007,-0.0021914)(0.0998004,-0.00218975)(0.099901,-0.00218216)(0.         100001,-0.00216898)      };          \end{axis}     \end{tikzpicture}      I dismissed the majority of the coordinate information, otherwise this post would be some 100 lines long. If this should ever be solved my second question is if there is a way to set the exponent of the axis multiplier to a specific value, e.g. from 10^-3 to 10^-2?


title: cvitem \hbox overfull in moderncv

text: Is it possible to change the length or size of the box where the first text is placed in \cvitem{this text is too long}{...} I doesn't fit and it looks kinda stupid. I get this message:               Overfull \hbox (6.6563pt too wide) in paragraph at lines 102--102      So is it possible to add 6.6563pt points of lenght to the first box in \cvitems entry. MWE               \documentclass[11pt,a4paper,sans]{moderncv}                \moderncvstyle{classic}                                \moderncvcolor{blue}                                         \usepackage[scale=0.75]{geometry}          \name{John}{Doe}               \begin{document}     \section{Basic info}     \cvitem{this is fine}{derp}     \cvitem{verylongworddd}{Derpderpdep}     \end{document}      The second item is a bit too long and doesn't fit into the cvitem box. Can I make the word fit there and align better.


title: How to put 2 correlation matrices on the same page in landscape?

text: I am trying to fit 2 correlation matrices on the same page on a landscape format. Here is what I use:               \begin{landscape}          \begin{table}[htbp]\centering \caption{Correlation matrix, group 1\label{corrtable}}     \begin{tabular}     .....     \end{tabular}     \end{table}          \begin{table}[htbp]\centering \caption{Correlation matrix, group 4\label{corrtable}}     \small     \begin{tabular}     ...      \end{tabular}     \end{table}          \end{landscape}      I obtain 2 pages: one correlation table on each page. I'd like to have them both on the same landscape page. Thanks for any help,


title: Unable to compile index using OSCOLA bibliographic style

text: I am trying to generate tables of cases and legislation in a document that cites legal materials. I am using the OSCOLA style for BibLaTeX which generally works well. However, I am having difficulty inserting tables of cases etc. As the documentation for the style notes, in legal writing, these must come before the main text of the document, which is the opposite of normal behaviour. The style (I think) provides a command for this, \printindexearly, which should work but I continue to encounter an error:               ! Package imakeidx Error: Misplaced \printindex[test].      Figuring this out is made somewhat more complicated by the fact that I cannot seem to customise the commands for indexing in TeXShop, so I am running makeindex from the command line. This is a MWE: LaTeX file:               \documentclass[12pt, a4paper]{book}               \usepackage[style=british]{csquotes}     \usepackage[style=oscola,    citereset=chapter, ibidtracker=true,          indexing=cite,         backend=biber,        babel=hyphen]{biblatex}     \usepackage[splitindex,            nonewpage]{imakeidx}          \makeindex[name=cases, title={Table of Cases}]          \DeclareIndexAssociation{eucases}{cases}          \addbibresource{Bibliography.bib}     \title{Test Document}     \begin{document}          \printindexearly{cases}           Environmental protection was not mentioned as a policy goal or area of Community powers in the Treaty of Rome and therefore the European Council stated that environmental measures could be harmonised as part of efforts to equalise competitive conditions across the EEC, something which was later affirmed by the European Court of Justice.\autocite[]{C91/79}            \end{document}      .bib file:               @jurisdiction{C91/79,     title = {Commission v. Italy},      shorttitle = {Commission v. Italy},      shorthand = {C91/79},      volume = {},      number = {91/79},      keywords = {eu},      court = {},      journaltitle = {ECR},      series = {},      pages = {1099},      pagination = {},      options = {},      note = {},      additionalreports = {},      date = {1980},      location = {}     }      The command line I am using to generate the index file is:                /usr/local/texlive/2013/bin/x86_64-darwin/splitindex test.idx -- -s oscola


title: Latex Curly braces grouping arrows

text: I'm creating a communication diagram. The desired effect is to have the following in a box:               Alice                                                                     Bob                                           x                     -------------------------------------------->                                           y                      <-------------------------------------------                                           z                      -------------------------------------------->                                       .                                       .                                       .      Also, I need the ability to group two of the arrows together and put curly braces around them to look like this except I want a single set of curly braces around both of them:                                     { -----> }                           { <----- }      I figured out how to make the box and the arrows, but I'm having trouble grouping the arrows with the curly braces. I tried using the `gather` environment but could not figure it out. Here is what I have so far:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{center}     \begin{minipage}{6.5in}         \setlength{\parindent}{0cm}%         \fbox{\vbox{%     \bf Alice \hfill     \bf Bob     \begin{gather*}     \xleftarrow{\hspace*{8cm}} \\      \xrightarrow{\hspace*{8cm}}      \end{gather*}          \[ \xleftarrow{\hspace*{8cm}} \]          \[ \xrightarrow{\hspace*{8cm}} \]          \[ \xleftarrow{\hspace*{8cm}} \]          \[ \xrightarrow{\hspace*{8cm}} \] }}     \end{minipage}     \end{center}     \end{document}      Any help would be appreciated!


title: How can I construct a math alphabet with lowercase and uppercase from different predefined sets?

text: I'm currently using the rsfs letters for caligriphic symbols. However, there is no corresponding lowercase alphabet, so I have begun to experiment with others. Is there a way that I can make it so that I may write `$\mathscr{Ker}$`, as opposed to `$\mathscr{K}\mathcal{er}$`, as I have been doing?


title: Can I set it so that math mode has uppercase letters not italicized?

text: Is there a way to set it so that math mode _automatically_ stops italicizing upper-case letters? That is, so that `$U$` produces the effect of what is now `$\mathrm{U}$`? I am using computer modern. I am aware other fonts have this option, but I would like to do it in computer modern. However, it would be great if some solution is font-independent, so that I can switch between them and keep this setting.


title: Montage multiple PDF images, scaled to each other's dimensions, on a single PDF page?

text: I though "montage" would be the most appropriate term here, since in Latex we mostly deal with multi-page documents (and I was afraid that terms like "concatenate", "append", "collect" etc. could be misunderstood in that context). I'd like to do something similar to the `nup` option of `pdfpages`, just with individual rotation and scaling. Anyways, let me show you what I want, through an example with plain images, using ImageMagick's `convert` and `montage` commands. * * * Let's say I have one input image file, `testred.png`, 350x250 pixels in size, generated like this:               convert -size 350x250 xc:red -pointsize 40 -draw "text 0,40 'testRED'" testred.png      Then, I have a second image file: `testgreen.png`, 300x200 pixels in size:               convert -size 300x200 xc:green -pointsize 40 -draw "text 0,40 'testGREEN'" testgreen.png      What I want to do is: rotate the second image; scale/resize so the second image's rotated width (originally the height) matches the first image's width; place the second image below the first one without any padding; and output a document of that montage without any margins. Using ImageMagick's `montage`, this can be achieved with (note, there must be a space between opening parenthesis `\(` and the filename `testgreen.png`!):               montage \       testred.png \       \( testgreen.png \           -rotate 90 \           -resize $(identify -ping -format "%w" testred.png)x \       \) \     -geometry +0+0 -tile 1x \     testmontage.png          # ... or as single line:          montage testred.png \( testgreen.png -rotate 90 -resize $(identify -ping -format "%w" testred.png)x \) -geometry +0+0 -tile 1x testmontage.png      The output file, `testmontage.png`, has a size of 350x775 pixels:               $ file testmontage.png     testmontage.png: PNG image data, 350 x 775, 16-bit/color RGB, non-interlaced      ... and looks like this: ![testmontage.png](http://i.stack.imgur.com/3gI83m.png) ... which is what I wanted. Note that one of the important things for me here, is that nowhere I had to explicitly calculate numerically the new size of the second file ( _although, I needed to call`identify` in a subshell, to get that information_). * * * Now, I'd like to do the same - but with PDF files. ImageMagick's convert can again be used to generate the same input files, but as PDFs:               convert -size 350x250 xc:red -pointsize 40 -draw "text 0,40 'testRED'" testred.pdf     convert -size 300x200 xc:green -pointsize 40 -draw "text 0,40 'testGREEN'" testgreen.pdf      The sizes, while specified in pixel units, are interpreted as point units in the PDF:               $ pdfinfo testred.pdf | grep 'Page size'     Page size:      350 x 250 pts     $ pdfinfo testgreen.pdf | grep 'Page size'     Page size:      300 x 200 pts      I know that if I use the `standalone` class for a single PDF image, even without any explicit size specifications:               % file: montager.tex          \documentclass{standalone}     \usepackage{graphicx}          \begin{document}       \includegraphics{testred.pdf}     \end{document}      ... the output PDF file will be resized, so it matches (almost exactly) the input PDF size:               $ pdflatex montager.tex     ...     Output written on montager.pdf (1 page, 262127 bytes).     Transcript written on montager.log.     $ pdfinfo montager.pdf | grep 'Page size'     Page size:      349.999 x 249.999 pts      ... which is good. However, I'm not sure how to proceed from here, as in the easiest possible way in respect to positioning, and obtaining the length to scale to. Note that `\paperwidth`, `\linewidth` and the like do not change within the `\begin`/`\end` section (and I cannot tell where else I could obtain width information); and `\par`, `\\` and the like to open a new line (so I position below) are either ignored or crash `pdflatex`. I'm pretty sure `tikz` could be used for this - but it's been a while, and I've forgotten most of it ... so I thought, let me ask a question instead `:)`


title: Cross-reference to the next section, whatever it is

text: Some sections of my document start with a remark such as the following: "This section may be omitted at the first reading." I'd like to add to this text a (hypertext) reference to the next section (page) number and I can do it by labeling the next section (`\label{sec:next}`) and make use of `\ref{sec:next}` and/or `\pageref{sec:next}`. But, because the `sec:next` label is hard coded, the reference could be wrong in case of changes in the order of the sections. Hence my question: is there a way to refer to the next section, whatever it is?


title: Phantom and etoolbox iftoggle

text: Is there a way to conditionally 'phantom' parts of my document (without typing the same 'phantomed' text twice)? Currently, I am using the etoolbox package, newtoggle/settoggle, and iftoggle to selectively expand parts of my document.               \usepackage{etoolbox}     \begin{document}     \newtoggle{flag_name}     \settoggle{flag_name}{true}     \iftoggle{flag_name}{\phantom{long_text}}{long_text}     \end{document}      Notice that if long_text is long, then I have two very long text segments, which is undesirable because the .tex file becomes longer and larger with regard to disk size. I was whether it was possible to 'phantom' long_text without necessarily typing long_text twice. I am trying to do something like this, but I am having difficulty in getting LaTeX to recognize the brace character is part of the .tex file, instead of as a brace character as part of the final document:               \usepackage{etoolbox}     \begin{document}     \newtoggle{flag_name}     \settoggle{flag_name}{true}     \iftoggle{flag_name}     {     \phantom{}\{     }     {}     long_text     \iftoggle{flag_name}     {     \}     }     {}     \end{document}      Logically, I am trying to get the phantom braces around long_text whenever the flag is true. So, long_text will always be outputted, but the phantom will appear around it depending on the truth-hood of the flag. Thanks.


title: Join point by using Tikz in Beamer document class

text: I know my question is trivial. By the way, I can not show points given by their coordinates with a Bezier curve using Tikz.                   \documentclass{article}              \usepackage{tikz}              \begin{document}         \begin{tikzpicture}         \draw [<->,thick] (0,2) node (yaxis) [above] {$y$}                 |- (3,0) node (xaxis) [right] {$x$};         %\draw [gray!50]  (0,0) -- (1,1) -- (3,1) -- (1,0)  -- (2,-1) -- cycle;         \draw [red] plot [smooth] coordinates {(0,0) (1,1) (1.5, 1.5) (2,1.5) (2.5,2) (3,1) (1,0) (2,-1)};              %\draw [gray!50, xshift=4cm]  (0,0) -- (1,1) -- (2,-2) -- (3,0);         %\draw [cyan, xshift=4cm] plot [smooth, tension=2] coordinates { (0,0) (1,1) (2,-2) (3,0)};         \end{tikzpicture}     \end{document}      which gives ![enter image description here](http://i.stack.imgur.com/HRJCS.png) I would like to give a draw like this ![enter image description here](http://i.stack.imgur.com/dM0uV.gif) Many thanks for any help.


title: Is it possible to use the enumerate/itemize environment within the proof/remark environment in a nice way?

text: I wish to use the enumerate/itemize environment within the proof/remark environment, but when I do this the first number/bullet-point is on the same line as the word 'Remark'/'Proof' indented to the right, and all subsequent number/bullet-points are all aligned nicely below. I think it looks a bit clumsy. I tried adding a double backslash immediately after \begin{proof} but sometimes this means I have the word Proof at the bottom of a page and on the next page the bullet points start, which looks terrible. Is there a way round this?


title: Custom page numbering for appendix

text: For an appendix I want a page numbering which goes like A1, A2, ... How to do that? With `\pagenumbering{...}` I can only choose between arabic and roman numbering.


title: How to fix the width of a minipage?

text: I put 2 `minipages` containing `tikzpicture` side by side: one on the left, the other one on the right. And I hope each `minipage`, surrounded by `\fbox`, occupies almost half side of the page, and leave some little space between them. I also want each `minipage` to have a `caption` and `label`. So now I could think of the following code:               \begin{minipage}[t]{0.48\linewidth}%     \centering     \fbox{     \begin{minipage}[t]{0.48\linewidth}     picture1     \end{minipage}}     \captionof{figure}{picture1}\label{fig:picture1}     \end{minipage}\hfill          \begin{minipage}[t]{0.48\linewidth}%     \centering     \fbox{     \begin{minipage}[t]{0.48\linewidth}     picture2     \end{minipage}}     \captionof{figure}{picture2}\label{fig:picture2}     \end{minipage}      However, the problem is the width of the frame or `minipage` is up to the width of the picture. I would like to fix that width, let's say around `0.48\linewidth`, but it seems that `\begin{minipage}[t]{0.48\linewidth}%` could not do that.


title: How to move a whole tikzpicture?

text: I have a `tikzpicture`, rounded by a `fbox`, and embedded in a `minipage`. Is it possible to change the position of the whole picture inside the minipage? for instance, move the picture 1 unit higher and 1 unit on the right? I know that we could always change the coordinates of each elements in the picture (e.g., change (2,3) to (1,2)), but it is obviously not a good solution.


title: Give tikz matrix columns all the same width and the rows all the same height (of the largest cell)

text: \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix}     \begin{document}     \begin{tikzpicture}[align=left, text ragged, transform shape]       \matrix [matrix of math nodes, every node/.style={font=\ttfamily, scale = 1, inner sep = 10pt},             column 1/.style={align=left},             nodes={font=\ttfamily, draw, left, minimum height=3em},             row 1/.style={nodes={align=center}},             ]       {         AAAA & BBB & CCCCCC\\         EE & F & GGG \\         aaaaa & bbbbb & c\\       };     \end{tikzpicture}     \end{document}      Each rectangular box around each cell is of different sizes _because_ each cell has a different width and height. I would like the width of a cell to be the maximum width of the column(which is the width of the maximum cell in that column), similarly, for the height of a row. This way the rectangles are properly sized and centering the text works as expected. I do not want to hardcode the sizes because I do not know beforehand what the will be and this might require tweaking to get it right... and would be a lot of work anyways. Another example is from Vertical align in tikz matrix But in my case I would like the problem cell to actually expand the height of all other cells in the same row(so the 3rd row will have about 1.5(or whatever) the height of the other rows). Again, though, the values should be calculated automatically rather than trying to determine them by hand.


title: Open images from AUCTeX with your favourite image editor

text: Suppose I edit a LaTeX-file with AUCTeX and the point is on a `\includgraphics{myimage.jpg}` line. Is there a possibility in AUCTeX to open `myimage.jpg` with my favourite image editor, say `gimp` by just pressing a keyboard shortcut?


title: The `wrapfigure` environment breaks when put inside another environment

text: I've tried using the `wrapfigure` environment (from the `wrapfig`) package, but it acts in such a way that I can't use it. Consider the following MWE:               \documentclass{article}     \usepackage{wrapfig,mwe}          \newenvironment{testenv}{%       \begin{wrapfigure}{r}{.5\linewidth}%         \vspace{.5\baselineskip}%       }{%       \end{wrapfigure}}          \begin{document}     \begin{wrapfigure}{r}{.5\textwidth}\vspace{.5\baselineskip}       This is some dummy text.  This is some dummy text.       This is some dummy text.  This is some dummy text.     \end{wrapfigure}     \lipsum[1]          \begin{testenv}       This is some dummy text.  This is some dummy text.       This is some dummy text.  This is some dummy text.     \end{testenv}     \lipsum[2]     \end{document}      This produces the output below. What causes this error, and is there any way to fix it? ![enter image description here](http://i.stack.imgur.com/zhnYH.png) * * * While a fix for `wrapfigure` would be cool, if a simpler fix exists for my specific use case, I'd be grateful to have a peek at it `:)`.


title: Python code in LaTeX document

text: I want to include some Python code into LaTex document, so I "imported" the listings package with               \usepackage{listings}      and               \lstdefinelanguage{Python}{      keywords={typeof, null, catch, switch, in, int, str, float, self},      keywordstyle=\color{ForestGreen}\bfseries,      ndkeywords={boolean, throw, import},      ndkeywords={return, class, if ,elif, endif, while, do, else, True, False , catch, def},      ndkeywordstyle=\color{BrickRed}\bfseries,      identifierstyle=\color{black},      sensitive=false,      comment=[l]{#},      morecomment=[s]{/*}{*/},      commentstyle=\color{purple}\ttfamily,      stringstyle=\color{red}\ttfamily,     }      when compiling, I get:                Illegal parameter number in definition oof \lstlang@python$ }      I googled, but I didn't understood how to work the problem out. it speaks about a command or something similar.


title: TikZ: Using a line with thickness as clipping region?

text: In TikZ, is it possible to clip away a line? I would like to create a thin layer around an arrow in which nothing should be drawn (i.e. keep what is there at the moment the arrow is drawn) to create the feeling that the arrow lies above all shapes that are drawn there afterwards. I have figured that I want to clip away a region that looks like the arrow but is just a bit thicker in order to get the effect that I want. How can I achieve that?


title: Submit a manuscript to Geombinatorics journal

text: I am going to submit a paper to Geombinatorics. I found on their web page to know How to Submit a Manuscript  the following: > Your essay should be camera-ready in the following format: > > paper: 5.5" by 8.5"; hyphen on; left, right, & top margins: 0.35"; bottom > margin: 0.5"; font: Times New Roman scaleable 12 pt (if unavailable, use > similar font from Times family); line spacing: single; Start with the title > in bold, followed on the next line by the author(s)' name(s), followed by > the address and e-mail. Please note that thanks to MATHEMATICAL REVIEWS, > ZENTRALBLATT FÜR MATHEMATIK, MATHEMATICS ABSTRACTS, many more colleagues > throughout the world will learn about our geombinatorial games. Actually I'm still confused with the above instructions. That would be great if someone could provide me a template latex codes in order get a standard format of Geombinatorics submission. I post here a `minimal example' to describe what format I have at the moment               \documentclass[12pt]{article}     \usepackage{amsmath,amsxtra,amssymb,latexsym, amscd,amsthm}               \begin{document}     \title{\textbf{\MakeUppercase{The paper title}}}     \author{Author 1\\     Address of author 1\\     e-mail address: author1@gmail.com \\     Author 2\\     Address of author 2\\     e-mail address: author2@gmail.com      }          \date{}     \maketitle      \abstract {Abstract goes here.}\\     \noindent {Keywords: }     \section{Introduction}          \section{Main Result}     \section*{Acknowledgement}     \begin{thebibliography}{99}          \end{thebibliography}     \end{document}


title: How to get the opposite direction of \rightsquigarrow?

text: The command `$\rightsquigarrow$` produces a funny looking arrow that points to the **right**. I want to get an arrow of the same style but points to the **left**. One would think that `$\leftsquigarrow$` will do the job, but LaTex saids it is an _Undefined control sequence_. Am I missing something here? How do you get an arrow like `$\rightsquigarrow$` but points to the **left**?


title: how to create switch structure comparing strings in latex

text: I want to process options that get passed to a package with `kvoptions`. The string is then saved in `\bugs@errorlevel`. I want to test if it contains one of [info, warning, error] and set a command accordingly. I could think of setting a bool variable to false and test as long as it has been set true or remains false. That could be done by cascading if expressions. Testing strings for being equal can for example be done with `etoolbox`'s `\ifstrequal` or `xstring`'s `\IfStrEq`. Both are of the `\ifthen` package type using brackets. On the other hand a 'real' switch could be done with the package `boolexpr`. However in that case I need commands which return a pure bool expression, which neither of the above commands do. The sequence principle would be:               \switch     \case{6>1 \AND 6<=5}$\geq 1$ and $\leq 5$%     \case{3<10}$> 5$ and $< 10$%     \case{3>10}$\geq 10$%     \endswitch      However I do not now what to enter in the case structure for comparison of strings. In the end it should be something like               \switch     \case{\isequal{\bugs@errorlevel}{info}}        \renewcommand\tplbugs@BugAction[1]{\PackageInfo{templatebugs}{#1}{}}%     \case{\isequal{\bugs@errorlevel}{warning}}        \renewcommand\tplbugs@BugAction[1]{\PackageWarning{templatebugs}{#1}{}}%     \case{\isequal{\bugs@errorlevel}{error}}        \renewcommand\tplbugs@BugAction[1]{\PackageError{templatebugs}{#1}{}}%     \otherwise        \PackageError{templatebugs}{          \MessageBreak          value >\bugs@errorlevel< unkown \MessageBreak          possible values are: info,warning,error. \MessageBreak        }{}     \endswitch      but that code does not work, since `\isequal` does not exist.


title: Need text to overlay tikz header

text: I'm trying to create a title page for a document but I'm having some trouble with the background imaging overlaying the text. This is what it's looking like: ![enter image description here](http://i.stack.imgur.com/btpHb.png) As you can see the words fall under the blue area instead of on top. I'd like to have the words on top of the blue box on the left and just have the entire tikz picture as a background. Here's my code:               \documentclass[11pt]{article}          \usepackage[hmargin=0.5cm,bmargin=2.3cm,tmargin=2cm,centering]{geometry}     \usepackage[contents= ,color=white,scale=1,opacity=1,angle=0]{background}     \usepackage{graphicx}     \usepackage{amssymb}     %\usepackage{xcolor}     \usepackage{here}     \usepackage{framed}     \usepackage{multicol}     \usepackage{wrapfig}     \usepackage{lipsum}     \usepackage[none]{hyphenat}     \usepackage{parskip}     \definecolor{altncolor}{rgb}{.8,0,0}          \usepackage[absolute]{textpos}          \setlength{\TPHorizModule}{4cm}     \setlength{\TPVertModule}{\TPHorizModule}     \textblockorigin{5mm}{10mm} % start everything near the top-left corner          \definecolor{bluey}{RGB}{0,121,194} %Alcon color     \definecolor{lightgray}{RGB}{235,235,235}     \definecolor{alightb}{RGB}{223,233,243}          \usepackage{tikz}     \usepackage{tikzpagenodes}     \usepackage{atbegshi}             \newcommand\Footer{%         \begin{tikzpicture}[remember picture,overlay]             \fill[bluey]               (current page.south west) -- (current page.south east) --               ([yshift=-40pt]current page.south east|-current page text area.south east) --               ([yshift=-40pt]current page.south west|-current page text area.south west) -- cycle;             \node[yshift=0.5cm,font=\bfseries\color{white}] at (current page.south) {\fontsize{15}{24}\selectfont};;         \end{tikzpicture}%     }     \newcommand\HeaderCurve{%         \begin{tikzpicture}[remember picture,overlay]             \path [fill=alightb]                   ([xshift=0cm]current page.north west) -- ([xshift=10cm]current page.north west) -- ([xshift=10cm]current page.south west) -- ([xshift=0cm]current page.south west) -- cycle;             \path [fill=lightgray]                   ([yshift=-2cm]current page.north west) .. controls (4,9) .. (current page.north east) --                   ([yshift=-9.5cm]current page.north east) .. controls (2,5.7) ..                   ([yshift=-10.5cm]current page.north west) -- cycle;         \end{tikzpicture}%     }          \pagestyle{empty}     % add header depending on the value of the page modulo 3     \AddEverypageHook{%       \ifnum\value{page}=1\relax         \backgroundsetup{contents={\HeaderCurve}}       \else         \ifnum\value{page}=2\relax         \backgroundsetup{contents={\HeaderHalf}}       \else         \ifnum\value{page}=3\relax         \backgroundsetup{contents={\HeaderCurve}}       \else         \ifnum\value{page}=4\relax         \backgroundsetup{contents={\HeaderHalf}}       \fi\fi\fi\fi       \BgMaterial     }     % add common footer for all pages     \AddEverypageHook{%       \backgroundsetup{contents=\Footer}       \BgMaterial     }     \begin{document}     \vspace*{2.cm}          \begin{textblock}{2}(2,3)     HEADER ONE          \lipsum[2]     \end{textblock}          \end{document}      Any help would be appreciated.


title: How to produce blank in math mode?

text: I want to type a `matrix` [x y] with a blank between the x and y. But in mathmode it will shrink the black between x and y. What is the easiest resolution around this?


title: How do I test for a character, irrespective of catcode?

text: This came up from Labels in TikZ are incorrectly interpreted, but it's also something I've run into with the braids package, and a couple of other things I've done. Also, from looking at the TikZ code this is something that TikZ does a lot but I don't see that it does it very elegantly! The question is this: how do I test for a particular character in the input stream, irrespective of the category code? The example from the braids package is fairly simple. The package there works by taking a string of the form `a_2 a_3^{-1}` and so forth. As with TikZ, it detects the end of the braid by looking for the `;` character. But some packages, Babel for example, make that active. Frankly, I don't care if `;` is active or not: it's just a placeholder for the end of the braid. So I don't want to have to bother testing all the possible variants of catcodes, I just want to know "is it a semi-colon?". I'm in a similar situation with the `_` and `^` characters, you might notice. So is there a robust (whatever that means) way to test: "Is the token that I have right now a semi-colon?".


title: How to draw 2 similar triangles sharing a vertex using tikz?

text: Something like the picture below: ![Similar triangles sharing a vertex](http://i.stack.imgur.com/hv2fU.png)


title: How to print random text in ConTeXt?

text: I often need to place random elements within a document in ConTeXt. For example, I added some random language variances to a form letter. In each instance, there is a choice of items to be displayed:               Print        a     Or        b     Or        c     Done      In some cases, I need to nest the randomness:               Print        a     Or        Print            b        Or            c        Done     Or        d     Done      I created this code which achieves what I need, but the syntax is not very efficient to work with:               \starttext              \define[2]\loadrandom{%             \getrandomnumber \randomnumber {#1} {#2}%         }              \loadrandom{1}{10}%         %         \ifnum\randomnumber=1%             This will print the first item.         \fi%         %         \ifnum\randomnumber=2%             This will print the second item.         \fi%         %         \ifnum\randomnumber=3%             This will print the third item.         \fi%         %         \ifnum\randomnumber=4%             This will print the fourth item.         \fi%         %         \ifnum\randomnumber=5%             This will print the fifth item.         \fi%         %         \ifnum\randomnumber=6%             This will print the sixth item.         \fi%         %         \ifnum\randomnumber=7%             This will print the seventh item.         \fi%         %         \ifnum\randomnumber=8%             This will print the eigth item.         \fi%         %         \ifnum\randomnumber=9%             This will print the ninth item.         \fi%         %         \ifnum\randomnumber=10%             This will print the tenth item.         \fi%          \stoptext      Is there any way to improve on this code so it is easier to quickly place random text in the page?


title: Interactive (hoverable) 2D plots in PDF

text: It seems that embedding 3D plots in PDFs has been around for a few years now (`misc3d`, for example, and Asymptote), as well as interactive features such as fancy-preview and _optional content groups_ (which could probably be hacked to do what I'm about to ask) but it doesn't seem to be the case for more simplistic 2D plots. I would love to embed interactive 2D plots similar to those seen around the interwebs these days where you hover over a point and the actual value is displayed or trend line is highlighted, etc. Is it possible to do this with LaTeX / Sweave / or whatever? A few examples in case I'm still not clear:   * highlighting when hovering   * values when hovering


title: List of figures \hbox overfull

text: I have an overfull `\hbox` in my list of figures, not because of long captions/page number over run, which is addressed in other postings(addressed in Fix formatting errors of page number > 99 in table of contents? and Figure title in List of Figures, but because the figure number (left hand side of the listing) is too long. Below is a few lines from the `.lof` file. It is only the last three figures that generate an error. Figures 4.6.8 and 4.6.9 generate no overfull box but 4.6.10,4.6.11,4.6.12 all do.               \contentsline {figure}{\numberline {4.6.8}{\ignorespaces Repeat: Model \& Data: Detail}}{164}{figure.4.6.8}          \contentsline {figure}{\numberline {4.6.9}{\ignorespaces High School GPA: Model \& Data}}{165}{figure.4.6.9}          \contentsline {figure}{\numberline {4.6.10}{\ignorespaces Math SAT Score: Model \& Data}}{166}{figure.4.6.10}          \contentsline {figure}{\numberline {4.6.11}{\ignorespaces Timing: Model \& Data}}{167}{figure.4.6.11}          \contentsline {figure}{\numberline {4.6.12}{\ignorespaces sequencing of Physics 7A Effect by Course}}{168}{figure.4.6.12}      Harish Kumar provided a solution. Much thanks


title: XeLaTeX problem with section centering

text: I am trying to center sections and subsections in an article with \begin{center} \end{center} and although it works for one when I try to center the second section or subsection it doesn't work. What am I doing wrong?


title: Multiple use of keyword "node" in TikZ

text: In the follow code section:               \begin{tikzpicture}        \node[black] (a) {A};        \node[black] (b) {B};        \path (a) -- (b) node[blue, above];     \end{tikzpicture}      There are two uses of word "node": one with backslash and another without. Are these two usage related?


title: Displaying first author's name in a bibliographic entry in the form: Surname, Initials and co-authors in the form: Initials, Surname

text: I would like to format my references according to the following specifications: > Author: Surname, Initials, Co-authors: Initials, Surname I am using `natbib`, `abbrvnat` for bibliography style and I guess I have to edit the `.bst` file (`FUNCTION {format.names}`). I would appreciate if someone could help me with this or recommend something else.


title: New environment based on two existing environments (mdframed, spverbatim)

text: I would like to define an environment that puts verbatim text using the `spverbatim` package into a frame defined by the `mdframed` package. Here's my (naive) approach:               \documentclass{scrreprt}     \usepackage{mdframed}     \usepackage{spverbatim}     \usepackage{color}     \definecolor{lightblue}{RGB}{240,248,255}          \newmdenv     [     backgroundcolor=lightblue,     hidealllines=true,     frametitlerule=false,     frametitle=,     ]{notesx}          \newenvironment{notes}     {\begin{notesx}\begin{spverbatim}}     {\end{spverbatim}\end{notesx}}          \begin{document}          % works     \begin{notesx}     \begin{spverbatim}     Test 1     Test 2     \end{spverbatim}     \end{notesx}          % does not work     \begin{notes}     Test 1     Test 2     \end{notes}               \end{document}      When using the defined environment `notes` I get the following error:               Runaway argument?     \end{document}     ! File ended while scanning use of \@xverbatim.      Using the environment `notesx` with added `spverbatim` environment works fine. EDIT: Using `surroundwithmdframed` works but when setting this for a custom defined environment `\newenvironment{notes}{\begin{spverbatim}}{\end{spverbatim}}` instead of `spverbatim` to have a nicer name it does not work: `! File ended while scanning use of \@xverbatim.`


title: What does this error mean in Mathtools-colon?

text: I have not been able to produce the minimal example, but I get this error               * LaTeX warning: "xparse/redefine-command"     *     * Redefining document command \oldstylenums with arg. spec. 'm' on line 128.     *************************************************     * unicode-math warning: "mathtools-colon"     *      * I'm going to overwrite the following commands from the `mathtools' package:     *      *     \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.     *      * Note that since I won't overwrite the other colon-like commands, using them     * will lead to inconsistencies.     *************************************************          ./summary_patology.tex:168: Missing \endcsname inserted.     <to be read again>                         \relax      l.168 \begin{document}          ./summary_patology.tex:168: Missing \endcsname inserted.     <to be read again>                         \relax      l.168 \begin{document}          ./summary_patology.tex:168: Missing \endcsname inserted.     <to be read again>                         \def      l.168 \begin{document}          ./summary_patology.tex:168: Undefined control sequence.     \Hy@temp ...unrestored@protected@xdef \@thefnmark                                                        {\ref {#1}}\endgroup \@foo...     l.168 \begin{document}          ./summary_patology.tex:168: Use of \@BOOKMARK doesn't match its definition.     \new@ifnextchar ...served@d = #1\def \reserved@a {                                                       #2}\def \reserved@b {#3}\f...     l.168 \begin{document}          ./summary_patology.tex:168: Use of \@BOOKMARK doesn't match its definition.     <argument> \def \reserved@a *                                  {\@refstar }\reserved@a      l.168 \begin{document}          ./summary_patology.tex:168: Argument of \@refstar has an extra }.     <inserted text>                      \par      l.168 \begin{document}          Runaway argument?     ./summary_patology.tex:168: Paragraph ended before \@refstar was complete.     <to be read again>                         \par      l.168 \begin{document}               (That makes 100 errors; please try again.)     No pages of output.      Some packages of mine               \documentclass{article}     \usepackage{rotating}     \usepackage{pdfpages}     % \usepackage{background}     \usepackage[log-declarations=false]{xparse}     \usepackage{verbatim}     \usepackage{amsmath, amsfonts, amssymb, textcomp, mathtools, xparse}     \usepackage[T4, OT1]{fontenc}     \graphicspath{ {/Users/masi/Dropbox/Patology_and_Biopsy/images/} }     \usepackage{newunicodechar}     \usepackage{unicode-math}     \usepackage{multirow}     \newcommand{\Int}{\int\limits}     \newunicodechar{ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m f}}     \newunicodechar{Ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m F}}     \DeclarePairedDelimiter{\abs}{\lvert}{\rvert}     \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}     \newcommand{\eqbreak}[1][2]{\\&\hskip#1em}     \usepackage{color}     \usepackage{hyperref}     \usepackage{Tabbing}     \usepackage{doi, natbib}     \hypersetup{     colorlinks=true,     linkcolor=blue,     citecolor=blue,     allcolors=blue     }     \usepackage{enumerate} % alpha numerical ordering     \usepackage{titling} % Two titles in one document     \usepackage[normalem]{ulem} % underline by \uline{lorem}     \usepackage[affil-it]{authblk}     \usepackage{import}     \usepackage[version=3]{mhchem} % To have chemical symbols like \ce{O2^{.-}}     \usepackage{xcolor,colortbl} % rowcolor for tables     \definecolor{Gray}{gray}{0.85}     \definecolor{LightCyan}{rgb}{0.88,1,1}     \definecolor{colori}{RGB}{0,0,0}     \definecolor{colorii}{RGB}{0,0,0}     \NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}     {%     \begin{tikzpicture}[overlay, remember picture]       \draw [->,thick,line width=4pt,#4]         ( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]           ( $ (pic cs:#3) + (-#1,0) $ );     \end{tikzpicture}%     }          %%%%%%%%%%%%%%%%%%%%%%%%%%% Question and Answer %%%%%%%%%%%%%%%%%     \usepackage[framemethod=tikz]{mdframed}     \newtheorem{question}{Question}     \mdfdefinestyle{que}{     %   font = \normalfont,       linecolor=cyan,       backgroundcolor=cyan!20,     }     \surroundwithmdframed[style=que]{question}          % Unicode-math bug fix     % http://tex.stackexchange.com/questions/161809/why-is-unicode-math-not-working-with-tikz     \newtheorem{question}{Question}     \let\masiquestion\question     \AtBeginDocument{%       \let\umquestion\question       \let\question\masiquestion     }               \newtheorem{answer_original}{Answer}     \mdfdefinestyle{ans}{       font = \normalfont,       linecolor=cyan,       backgroundcolor=yellow!20     }     \surroundwithmdframed[style=ans]{answer_original}          \makeatletter     \newsavebox{\@my@box}     \newenvironment{answer}%     {%         \noindent         \begin{lrbox}{\@my@box}%         \begin{minipage}[t]{\linewidth}         \begin{answer_original}     }%     {%         \end{answer_original}%         \end{minipage}%         \end{lrbox}%         \rotatebox{0}{\usebox{\@my@box}}     }%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%% Smaller things          \newtheorem{sidenote}{Sidenote}     \mdfdefinestyle{que}{       linecolor=cyan,       backgroundcolor=cyan!20,     }     \surroundwithmdframed[style=que]{sidenote}               \newtheorem{case}{Case logic}     \mdfdefinestyle{que}{       linecolor=cyan,       backgroundcolor=cyan!20,     }     \surroundwithmdframed[style=que]{case}          \newtheorem{citation}{Citation}     \mdfdefinestyle{que}{       linecolor=cyan,       backgroundcolor=yellow!20,     }     \surroundwithmdframed[style=que]{citation}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               %%%%%%%%%%%%%%% BRACES %%%%%%%%%%%%%%%%     \setmathfont[BoldFont={latinmodern-math.otf}]{latinmodern-math.otf}     \setmathfont[range=\mathscr,Scale=MatchUppercase]{Asana-Math.otf}     \usepackage{tikz}     \usetikzlibrary{tikzmark,decorations.pathreplacing,calc}     \newcommand\MyText[4][0pt]{%     \begin{tikzpicture}[overlay, remember picture]     \draw [decoration={brace},decorate,thick]        ( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --           node[anchor=west,xshift=5pt,text width=5cm] {#4}        ( $ (pic cs:#3) + (#1,0) $ );     \end{tikzpicture}%     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%%%%% Counter Section %%%%%%%%%%%%%%%%%%%%%%     \makeatletter       \def\@part[#1]#2{%         \ifnum \c@secnumdepth >\m@ne           \refstepcounter{part}%         \fi         \addcontentsline{toc}{part}{#1}%         {\parindent \z@ \raggedright          \interlinepenalty \@M          \normalfont          \LARGE \bfseries #2%          \markboth{}{}\par}%         \nobreak         \vskip 3ex         \@afterheading}     \@addtoreset{section}{part}         \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                    %     %          \newtheorem{theorem}{Theorem}     \newtheorem{proposition}[theorem]{Proposition}     \newenvironment{definition}[1][Definition]{\begin{trivlist}     \item[\hskip \labelsep {\bfseries #1}] \emph}{\end{trivlist}}     \providecommand{\keywords}[1]{\textbf{Keywords:} #1}                         \begin{document} % The error refers here!          \title{Introduction to General Pathology Notes}           Lorem     \end{document}      There seems to some problem with braces but I cannot see any alone brace. I think the problem is probably with unicode-math, but I do not understand why. **What may cause this problem?**


title: tocloft conditional spacing

text: This is my first question on stackexchange! I am using the tocloft package for my thesis and my university requires doublespacing before and after the chapter titles in the ToC, but only if the chapter has sections. I am thinking that I will require some way to detect if the chapter has sections, or add a newline before the first section in each chapter. Can somebody suggest a way to achieve this?


title: Tlmgr works but nothing was installed

text: I just installed the latest version of Texlive 2011 from the iso; everything is fine, even **tlmgr** it's ok except the fact that it can't install new packages from the repository.               root@tux-laptop:~# tlmgr update -list     tlmgr: package repository http://ftp.uniRoma2.it/TeX/systems/texlive/tlnet     tlmgr: saving backups to /usr/local/texlive/2011/tlpkg/backups     skipping forcibly removed package l3packages     tlmgr: no updates available     root@tux-laptop:~# tlmgr search fourier      engrec - Enumerate with lower- or uppercase Greek letters.      fourier - Using Utopia fonts in LaTeX documents.      fouriernc - Use New Century Schoolbook text with Fourier maths fonts.      pst-func - PSTricks package for plotting mathematical functions.      pxgreeks - Shape selection for PX fonts Greek letters.      trfsigns - Typeset transform signs.      txgreeks - Shape selection for TX fonts Greek letters.      utopia - Adobe Utopia fonts.     root@tux-laptop:~# tlmgr show fourier     package:     fourier     category:    Package     shortdesc:   Using Utopia fonts in LaTeX documents.     longdesc:    Fourier-GUTenberg is a LaTeX typesetting system which uses Adobe Utopia as its standard base font. Fourier-GUTenberg provides all complementary typefaces needed to allow Utopia based TeX typesetting, including an extensive mathematics set and several other symbols. The system is absolutely stand- alone: apart from Utopia and Fourier, no other typefaces are required. The fourier fonts will also work with Adobe Utopia Expert fonts, which are only available for purchase. Utopia is a registered trademark of Adobe Systems Incorporated     installed:   Yes     revision:    15878     cat-version: 1.3     cat-date:    2008-12-13 14:57:21 +0100     cat-license: lppl     collection:  collection-fontsextra          root@tux-laptop:~# tlmgr install fourier     tlmgr: package repository http://ftp.uniRoma2.it/TeX/systems/texlive/tlnet      Ok, what's wrong with tlmgr? When i try to compile a new document which uses the newly installed package, pdflatex can't find it.


title: Area between curves tikz

text: I am trying to plot a graph using tikz, but I can't seem to be able to highlight the areas between the curves. The result should look something like this: ![enter image description here](http://i.stack.imgur.com/Awb9V.png) This is the code I have so far:               \begin{center}     \begin{tikzpicture}[scale=0.8]          \draw[->] (0,-0.5) -- (0,4.5) node[anchor=east] {};     \draw[->] (-0.5,0) -- (9,0) node[anchor=north] {};     \draw   (1,-0.2) node[anchor=north] {$a$}             (8,-0.2) node[anchor=north] {$b$}                    ;     \filldraw[fill=black!10](1,0)--(1,2)--(8,2)--(8,0);     \draw [](1,3) parabola bend (2.5,1.5)(4.2,2.4);      \draw [](4.2,2.4) parabola bend (5.5,3)(8,0);      \draw[] (1,0)--(1,3);     \end{tikzpicture}     \end{center}      The end result I would like to achieve is to have C and D higlighted in orange, while A and B in a dark grey. Don't worry about the axes labels or else, I mostly need help with the shading. Thanks in advance!!


title: Formatting new environment with borders

text: I have defined myself a new environment as below:               \newenvironment{myquote}{\list{}{\leftmargin=0.3in\rightmargin=0.3in}\item[]}{\endlist}      What I would like to do here is to be able to format this by adding borders. all borders needs to be solid but the left border needs to be thicker. What is the way?


title: Automatically crossing 7's and Z's in mathematical formulae

text: I've been using LaTeX for my math homework and notes for about 6 months now. However, I'm really quite new to anything that uses the real power of TeX. When I used to do my homework by hand, I always meticulously crossed my z's and 7's, like this: ![](http://imgur.com/Tv55x.jpg) and likewise for my z's. Is there a way to make LaTeX automatically cross my 7's and z's (and capital Z's, for that matter) within math mode? I'd like to leave the 7's and z's as normal within body text. ALso, I would prefer not to use a new command; I want a crossed 7 whenever I type 7 as normal, and likewise for Z/z. My first idea for a solution would be to use the "negative space" command somewhat like this:               $7\~-$      However, I'm not sure this is the most elegant solution, and I still don't know how to make LaTeX do it automatically whenever I just type something like               $3+4 = 7.$      Thanks for any help anyone can offer!


title: How to reset footnote counter in each column of a two-column document?

text: Footnote counters can be reset in each page by using either `zref-perpage` or `perpage` packages but how do you reset footnote counter in each column of a two column documents?               \documentclass[twocolumn]{article}     \usepackage{zref-perpage}     \zmakeperpage{footnote}     \begin{document}     This is a test\footnote{Test}     \newpage     This is a test\footnote{Test}     \end{document}


title: Why is redefining a command erring?

text: I am trying to redefine `\emph` to bold its argument:               \renewcommand\emph[1]{{\textbf{\oldemph{#1}}}}      However, after typing this command before `begin{document}`, I get an error every time I use `\emph{Some text.}`: Undefined control sequence. What is a control sequence? How do I fix my redefinition?


title: zref-abspage and perpage incompatibility

text: It seems that `zref-abspage` and `perpage` both defines the `abspage` counter so               \documentclass{article}     \usepackage{perpage}     \usepackage{zref-abspage}     \begin{document}     This is a test      \end{document}      would produce error. How should this be fixed? it seems that changing loading order will fix it.


title: Problem with "equal" sign and glossary entry definition

text: I am using glossaries package and I encountered a problem in the _symbol_ field. When I define it as `$m=1$` I get the following error message:               ! Missing $ inserted.     <inserted text>                      $     l.6 \end{theglossary}                          \glossarypostamble      After carefull analysis I discovered that if I remove the equal sign `=`, everything works perfectly. But I have to use the equal sign... Is there an alternative symbol for the equal sign? If I change the field _symbol_ from `$m=1$` to `$m *(alternative equal sign)* 1$`, my glossary should compile correctly. Here is a MWE, change the _symbol_ field and you'll see the magic... (output after the MWE)               \documentclass{scrartcl}     \usepackage{glossaries}     \makeglossaries          \newglossaryentry{vacuous}     {         name={vacuous},         description={A mass whose bla bla bla},         symbol=$m=1$,     }          \begin{document}          \gls{vacuous}          \glossarystyle{index}  % chose style here     \printglossary[type=main]          \end{document}        ![enter image description here](http://i.stack.imgur.com/ClNXc.png)


title: Customize endnotes

text: For customizing footnotes in LaTeX, I use the `footmisc` package. Specifically, to remove indentation and text justification in footnotes, I add the following to my preamble:               \usepackage[hang, flushmargin, ragged]{footmisc}      The journal I'm submitting to now requires endotes. For that I use the `endnotes` package. But I can't find a package like `footmisc` for endnotes. What should I do to remove indentation and text justification in endnotes?


title: Connect vertices of a regular poly by curved arrows

text: I have a diagram that is simply a set of nodes distributed evenly around a circle. How can I connect the nodes with arrows that are circular? e.g., suppose we have a pentagon with nodes at each vertex. Obviously the vertices of the pentagon all lay on a circle. I want to connect the nodes by arrows that are "parallel" to the circle. (so overall it looks like a cycle)


title: Using OTF/TTF fonts that are installed with TeXLive

text: I've noticed that there are plenty of OTF and TTF fonts packaged with my new TexLive 2012. For example, the Asana-Math OTF font is in               $TEXMFDIST/fonts/opentype/public/Asana-Math      And there is a TTF in a different location. Can I use it in fontspec **without** intalling it in my system fonts, or specifying its absolute path?


title: metauml: Realization link doesn't work

text: \documentclass{article}     \usepackage[shellescape]{gmp}     \begin{document}     \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(association)(B, A);     \end{mpost}     \caption{association}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(associationUni)(B, A);     \end{mpost}     \caption{associationUni}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(inheritance)(B, A);     \end{mpost}     \caption{inheritance}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(realization)(B, A);     \end{mpost}     \caption{realization}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(aggregation)(B, A);     \end{mpost}     \caption{aggregation}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(aggregationUni)(B, A);     \end{mpost}     \caption{aggregationUni}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(composition)(B, A);     \end{mpost}     \caption{composition}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(compositionUni)(B, A);     \end{mpost}     \caption{compositionUni}     \end{figure}          \begin{figure}     \begin{mpost}[use]     input metauml;          Interface.A("Interface")            ();          A.info.iAttributeStack.top := 0;     A.info.iAttributeStack.bottom := 0;          Class.B("Class")            ()            ();                 A.w = B.e + (50, 0);          drawObjects(A, B);          clink(dependency)(B, A);     \end{mpost}     \caption{dependency}     \end{figure}     \end{document}      This example shows all possible links between classes/interfaces as described on page 9 of metauml documentation All links display correctly except for one. It is "realization". That link does not appear. It now looks like this: ![classes](http://i.stack.imgur.com/6b3TX.png) How can it be fixed? I use MetaPost, version 1.504 (MiKTeX 2.9) This is what I get when I compile egreg's solution: ![enter image description here](http://i.stack.imgur.com/dyVHH.png) Here you can find a log from metapost trying to generate realization link. **EDIT:** I found out that I have version older than 0.2.4 because the file `C:\Program Files (x86)\MiKTeX 2.9\metapost\generic\metauml\metauml_class_relations.mp` didn't contain definition of `realization`. Realization support was added in 0.2.4. I did only one thing. I downloaded the newest version and replaced every file in `C:\Program Files (x86)\MiKTeX 2.9\metapost\generic\metauml`. This caused a "little" trouble.   The logs (`tmp+mp000X.log`) say that:               ! I can't open file `metauml_component'.     l.77 input metauml_component                                 ;     Please type another input file name     ! Emergency stop.     l.77 input metauml_component                                 ;     *** (job aborted, file error in nonstop mode)      I checked and mentioned file does exist. What should I do next?


title: Missing $ inserted although I have $

text: I get "Missing $ Inserted" when typing in this:               Genom att undersöka var kurvan ${f_{A}(x)}$ skär linjen T = 20 ser vi att x ≈ 4,3 då ${f_{A}(x)}$ = 20.\\      Where is my fault?


title: metauml installation and usage error

text: This question is a bit broad but I am trying to install metauml (I am using Mac and texlive). I downloaded the package and ran the install script which put a metauml directory under the metapost directory (which I Was expecting). However, I cannot get it to run. I have this code:               \documentclass[a4paper,12pt]{article}     \usepackage{amssymb} % needed for math     \usepackage{amsmath} % needed for math     \usepackage[utf8]{inputenc} % this is needed for german umlauts     \usepackage[ngerman]{babel} % this is needed for german umlauts     \usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf     \usepackage[margin=1.5cm]{geometry} %layout          % this is needed for forms and links within the text     \usepackage{hyperref}            % The following is needed in order to make the code compatible     % with both latex/dvips and pdflatex.     \ifx\pdftexversion\undefined     \usepackage[dvips]{graphicx}     \else     \usepackage[pdftex]{graphicx}     \DeclareGraphicsRule{*}{mps}{*}{}     \fi          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % THE DOCUMENT BEGINS                                                %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     \section{Class diagram}     \includegraphics{metadiagram.mp}     \end{document}      The metadiagram.mp is in the same folder and is defined as follows:               input metauml;     beginfig(1);     Class.World("World")            ("-age: int",             "#ressources: List")             ("+sayHello(): void");          Class.NoHuman("Human")            ("-birthday: Date",             "-nickname: String",             "-secret: String")             ("+code(language: Language): Program");          leftToRight(50)(World, NoHuman);     drawObjects(World, NoHuman);          link(aggregation)(NoHuman.w -- World.e);     item(iAssoc)("1")(obj.n     = .2[World.e,NoHuman.w]);     item(iAssoc)("has >")(obj.n = .5[World.e,NoHuman.w]);     item(iAssoc)("0..*")(obj.n  = .8[World.e,NoHuman.w]);          endfig;     end      I am getting the error: Cannot determine size of graphic in metadiagram.mp (no BoundingBox) Can anyone help ?


title: Embed fonts in XeLaTeX PDF output?

text: How do I embed fonts in XeLaTeX's PDF output? I am printing directly onto my printer, which requires PDF, EPS or PS input with embedded fonts.


title: How to sync animated graphics with beamer next-slide click?

text: Using `\animategraphics` of the **animate** package, I would like to move from one image to the next by clicking on the next slide button instead of clicking on the image (as in script below).               \documentclass{beamer}          \usepackage{hyperref}     \usepackage[step]{animate}          \mode<presentation>          \title{Title}          \date{\today}          \begin{document}          \begin{frame}       \titlepage     \end{frame}          \begin{frame}       \frametitle{Bio}          \begin{block}{Background}     Development assistance\\     Project management and evaluation     \animategraphics[height=5cm]{1}{image/image}{1}{2}      \end{block}          \end{frame}          \end{document}      Is is possible to automatically to create a new slide for each image?


title: Table Numbering And Caption in Same location

text: My table and caption are located on the same line and this started happening after I used a different class file for the conference I am applying towards. Here is a picture of what I mean: (Normally the words "Table 1" go above the caption, not on the same line) ![enter image description here](http://i.stack.imgur.com/U0g39.png) I was wondering what could be some reason for this? What should I look for in the class file to see if this was on purpose or my mistake?


title: smarter hyphenation for narrow columns?

text: I know how to turn off hyphenation via `\nohyphens{.....}` (from hyphenat). But what I'd really like would be to hyphenate smartly. What I mean by this should hopefully be made clear by the following example. On the left is a piece of text from a column in a table, rendered with the `\nohyphens{...}` command. This leaves a lot of open white space. On the right is the same text typeset by vanilla XeLaTeX. As you can see, it _still_ leaves a big white space in the middle of the text, and it also introduces the rather strange hyphenation, "or-phaning", instead of, for example, the more natural "cor-rections".   ![No hyphenation at all](http://i.stack.imgur.com/5MEoz.png) ![Default behavior](http://i.stack.imgur.com/3oxPO.png) Here is a smarter version that is made by me introducing "cor-rections" into the source code: ![some by hand tweaking](http://i.stack.imgur.com/ATuBK.png) To my eye at least, this seems much better than either of the versions above. So the basic question is: Could I get LaTeX to do this for me automatically, for example by specifying the longest acceptable inter-word whitespace? _PS_. Another more complex solution would be to specify a "target width" for the columns in my table, e.g. `.25\textwidth` and then have the system optimize to produce a table that brings me as close to my specified whitespace score and table width as possible, while minimizing the number of hyphenated words... but I don't know if LaTeX can do this sort of dynamic optimization in several variables! Here's one last image where I have gotten rid of the hyphenation entirely, by moving to `.27\textwidth` for columns. This seems to be the most readable version yet. ![enter image description here](http://i.stack.imgur.com/AMrRM.png)


title: How to include EPS figures using pdfLaTeX?

text: I have read the numerous related questions on this site, but I still couldn't get it to work. I followed instructions from this answer:               \documentclass[journal, a4paper]{IEEEtran}          \usepackage{graphicx}     \usepackage{epstopdf}     \DeclareGraphicsExtensions{.eps}          \begin{document}          \begin{figure}[!t]     \includegraphics{overnondomination}     \end{figure}          \end{document}      The output is:               *****     *****     PDFLaTeX output:      *****     cd "/home/martin/MyArticles/Minimum_example"     *****     pdflatex -shell-escape -interaction=nonstopmode example.tex     *****     This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)      \write18 enabled.     ...     ! Package pdftex.def Error: File `overnondomination-eps-converted-to.pdf' not found.      Please, could you help me find out what I am doing wrong? EDIT: As suggested, the problem happened before this error message. It turned out that I had not installed `epstopdf`. Running               sudo apt-get install texlive-font-utils      solved the problem.


title: Error with custom definition

text: I am working on a file on multiple computers, laptop and PC. I am using TexStudio, same version on both. On the laptop, the file compiles fine, but on the PC I am having trouble. On the PC, when I try to pdflatex it, I get an error: "Incomplete \iffalse; all text was ignored after line 79 \include{chapter 1}" When I go to line 79, it is a custom definition defined as follows:               \def\imod#1{\allowbreak\mkern6mu({\operator@font mod}\,\,#1)}      Again, this file compiles fine on the laptop, but on the PC, it has a problem with this line. Am I missing a space or comma or something?


title: fourier: How to get slanted lower and upper case Greek symbols by default

text: The fourier package has an option to slant lower case Greek; the upright lower case Greek symbols are then available as `\other<symbol>` macros. It seems upper case Greek symbols are always upright by default; the slanted symbols are again available as `\other<Symbol>`. Is it possible to also get slanted upper case Greek symbols, i.e., using the standard `\<Symbol>` macros and get the upright variants through `\other<Symbol>` (or another variant macro set). I know the isomath package (officially incompatible with fourier) ensures slanted upper case Greek symbols; however, the `\other<Symbol>` macros then remain slanted.


title: TikZ: How to make a convex lens

text: How can I make a convex lens with `TikZ`? I tried using arcs but this doesn't look right.               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}       \pgfmathsetmacro{\xr}{0.35}       \pgfmathsetmacro{\yr}{2}            \draw (0, 0) coordinate (O) arc[x radius = \xr cm, y radius = \yr cm,       start angle = 90, end angle = 270];       \draw (O) arc[x radius = \xr cm, y radius = \yr cm,       start angle = 90, end angle = -90];     \end{tikzpicture}     \end{document}      I would like the arcs to meet at a sharp corner not rounded. ![enter image description here](http://i.stack.imgur.com/2zBEU.png)


title: How to correctly clip with viewports with includegraphics and beamer columns?

text: I will happily accept any alternative to beamer's columns and `\includegraphics` that produces the intended result in a beamer slide. I'm trying to take the attached eps file and reorganize it so that it fits in to a beamer slide by using viewports and clip to have effectively 3 separately cropped images. PNG version: ![enter image description here](http://i.stack.imgur.com/BfPzY.png) Here is the MWE:               \documentclass[compress,red,notes]{beamer}          \begin{document}          \frame{\frametitle{}     \begin{columns}     \begin{column}{0.5\textwidth}     \includegraphics[width=\textwidth, viewport=13 730 671 1146, clip=true]     {SmatExample}     \\     \includegraphics[width=\textwidth, viewport=13 439 722 722, clip=true]     {SmatExample}     \end{column}     \begin{column}{0.5\textwidth}     \includegraphics[width=\textwidth, viewport=13 13 722 435, clip=true]     {SmatExample}     \end{column}          \end{columns}          }          \end{document}      As you can see, it almost works, but the cropping slightly cuts off the letters, and also cuts in to the bottom of Figure B, putting the bottom of Figure B in to the top of Figure C (it is hard to tell in this low resolution version, but there should be no lines above "S Matrix" in Figure C): ![enter image description here](http://i.stack.imgur.com/8YDxJ.png) When I check the viewport coordinates in gsview, they look correct, both at the original high resolution (100ppi) and the attached 30ppi image. * * * Note: I have recently asked two questions in an attempt to get at this one, which has helped in some ways, but I feel I am no closer to the answer (thanks for the help so far!): Multiple commands in declareGraphicsRule - how to do it? auto-correct bounding box for eps files that simply wrap a bitmap Additionally, playing with `resolution=xxx` did not seem to have an effect for `\includegraphcis`. See Image from \includegraphics showing in wrong image size


title: Negative bar values using psbarchart

text: I'm plotting a barchart using `pst-bar` and               \psaxes[axesstyle=frame,Ox=0,Oy=-1,Dx=1,labels=y,ticks=y](0,-1)(17,5)     \psbarchart[barstyle={red,blue,green},chartstyle=stack]{\data}      I have some negative values in my chart, however they are plotted as positive values in the chart piles. For instance, if I have a dataset A with values 0.64, 1.04, and -0.57, the values plotted will all be positive, and not equal to 1.1127 (the sum of the 3 values). Instead, displayed value is 1.6827 (0.64+1.04) with the negative value plotted positive... Is there a way to overcome this situation? I'd like the negative value to be plotted with a bar from 0 to –0.57 and the two positives values stacked up to 1.6827.


title: How can I escape the scope of an environment?

text: Is there any way to escape the scope of an environment, e.g. to get the `\pgfplotsset` command in the MWE below have an effect on the subsequent plot? (I know that `\newcommand` doesn't have this problem but that isn't the question.) Thanks!               \documentclass{article}     \usepackage{pgfplots}          \newenvironment{foo}{}{\pgfplotsset{axis x line=bottom};} % how can I make this pgfplotsset count?          \begin{document}     \begin{tikzpicture}          \begin{foo}     \end{foo}          \begin{axis}     \addplot[domain=-3e-3:3e-3,samples=201]{exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))};     \end{axis}     \end{tikzpicture}          \end{document}


title: Beamer overlay box around text - the correct way?

text: I have something that "works," but I'm wondering if there's a more elegant solution. I want to box some text after an itemize in beamer, so this is what I'm doing:               \documentclass{beamer}          \begin{document}          \begin{frame}     \begin{itemize}[<+->]       \item Software-as-a-Service?       \item Platform-as-a-Service?       \item \only<-4>{Infrastructure-as-a-Service}\only<5->{\fcolorbox{red}{white}{Infrastructure-as-a-Service}}?       \item Other-stuff-as-a-Service?     \end{itemize}     \end{frame}          \end{document}      I get the effect that I want (with some added space on the boxed slide, which is not ideal), but I'm wondering if there's a more natural way to do this? I tried searching online and the trusty `texdoc beamer`, but maybe I'm looking in all the wrong places. I also tried:               \item \fcolorbox<beamer:6>{red}{white}{Infrastructure-as-a-Service}?      but that left me with a black box until the red one was highlighted


title: Formula expansion symbol / /

text: I need to expand formula in LaTeX using `/ /` symbols, like this: Current version: ![enter image description here](http://i.stack.imgur.com/daBC4.png) Needed version: ![enter image description here](http://i.stack.imgur.com/XlC1L.png) How can I do this?


title: Fixing page number references when adding multiple indices to ToC

text: Friends, I'm stuck with a funny error: when I add multiple indices in my table of contents, all page number references mess up. It's probably something easy to solve, but I can't figure out what it is. Consider this non-so-minimum example (sorry, I had no choice):               \documentclass[twoside]{book}          \usepackage{idxlayout}          \usepackage[useindex]{splitidx}          \makeindex          \newindex[Index A]{ia}     \newindex[Index B]{ib}     \newindex[Index C]{ic}     \newindex[Index D]{id}          \newcommand*\indexall[1]{%     \sindex[ia]{#1}%     \sindex[ia]{#1#1}%     \sindex[ia]{#1#1#1}%     \sindex[ia]{#1#1#1#1}%     \sindex[ia]{#1#1#1#1#1}%     \sindex[ia]{#1#1#1#1#1#1}%     \sindex[ia]{#1#1#1#1#1#1#1}%     \sindex[ia]{#1#1#1#1#1#1#1#1}%     \sindex[ib]{#1}%     \sindex[ib]{#1#1}%     \sindex[ib]{#1#1#1}%     \sindex[ib]{#1#1#1#1}%     \sindex[ib]{#1#1#1#1#1}%     \sindex[ib]{#1#1#1#1#1#1}%     \sindex[ib]{#1#1#1#1#1#1#1}%     \sindex[ib]{#1#1#1#1#1#1#1#1}%     \sindex[ic]{#1}%     \sindex[ic]{#1#1}%     \sindex[ic]{#1#1#1}%     \sindex[ic]{#1#1#1#1}%     \sindex[ic]{#1#1#1#1#1}%     \sindex[ic]{#1#1#1#1#1#1}%     \sindex[ic]{#1#1#1#1#1#1#1}%     \sindex[ic]{#1#1#1#1#1#1#1#1}%     \sindex[id]{#1}%     \sindex[id]{#1#1}%     \sindex[id]{#1#1#1}%     \sindex[id]{#1#1#1#1}%     \sindex[id]{#1#1#1#1#1}%     \sindex[id]{#1#1#1#1#1#1}%     \sindex[id]{#1#1#1#1#1#1#1}%     \sindex[id]{#1#1#1#1#1#1#1#1}}%     \begin{document}          \tableofcontents          \chapter{My text}          Hello world.          \indexall{A}     \indexall{B}     \indexall{C}     \indexall{D}     \indexall{E}     \indexall{F}     \indexall{G}     \indexall{H}     \indexall{I}     \indexall{J}     \indexall{K}     \indexall{L}     \indexall{M}     \indexall{N}     \indexall{O}     \indexall{P}     \indexall{Q}     \indexall{R}     \indexall{S}     \indexall{T}     \indexall{U}     \indexall{V}     \indexall{W}     \indexall{X}     \indexall{Y}     \indexall{Z}          \addcontentsline{toc}{chapter}{Index A}     \printindex[ia]     \addcontentsline{toc}{chapter}{Index B}     \printindex[ib]     \addcontentsline{toc}{chapter}{Index C}     \printindex[ic]     \addcontentsline{toc}{chapter}{Index D}     \printindex[id]          \end{document}      _(every time you run this code, a kitten dies)_ The generated table of contents is as follows: ![My table of contents](http://i.stack.imgur.com/BFYuB.png) At least, this time I got odd numbers in my ToC. The previous attempt raised even numbers (!). The correct reference should be:               Index A -  5     Index B -  9     Index C - 13     Index D - 17      If I put `\cleardoublepage` before the indices, I get this ToC (the first index is fixed): ![Table 2](http://i.stack.imgur.com/DEAVJ.png) I really can't understand what's going on. I can't even establish a pattern. Does anyone have a suggestion? _(no animals were harmed in the making of this question)_


title: \lstlistoflistings doesn't have enough room between numbers and title

text: I'm using the \lstlistoflistings command from the listings package to generate my list of code samples. Unfortunately there isn't enough room between the number and the code listing title. See the example image, it should read 13.10.1 on that last line. How do I adjust the column width? ![Example](http://i.stack.imgur.com/6auoe.png)


title: How to write equation inside text?

text: In the middle of an equation, I need to write to write a very short equation. When I use               \begin{equation}         stuff >= other_stuff power (2)     \end{equation}      I get the equation on the line that follows my phrase (automatic line jump).      How can I write the equation in the middfle of the phrase on the same line ?      Here is the code I used:               Only features with \begin{equation}\chi^2 >=10.83      \end{equation}  are pre-selected.            Here is the result and I want to avoid it: ![enter image description here](http://i.stack.imgur.com/1aSzV.png)


title: Installing TexLive (windows)

text: I most likely caused this problem for myself, but I would welcome any suggestions to help dig me out of this hole. First of all, I tried to install texlive 2011 and got the error message that my local version was different from the version in the repository (should have read the instructions first...). In any case, my easy fix was to just wipe out my entire `C:\texlive` folder. Problem solved, right? Not so much. I then read that I should have used the Add/Remove programs option in Windows to get rid of TeX Live, which I then did. I also removed any reference to `C:\texlive` from the `PATH`. However, I'm still getting               the local installation     and the repository being accessed are not compatible:           local: 2010      repository: 2011     Perhaps you need to use a different CTAN mirror?      Where else do I need to go so that my computer doesn't still think TL 2010 is still installed?


title: Extract problem and solution from files and create problem collection

text: I have a set of problems and solutions, and I wish to include (some of) them in several different documents. I would like to be able to choose if the solutions should be presented last, or immediate after the problem formulation. A possibility is to put each problem and solution in a separate file, and then have some command               \includepart{filename.tex}{problem}      and               \includepart{filename.tex}{solution}      where `\includepart{file}{env}` includes say everything between `\begin{env}`and `\end{env}`. Is there a simple way to do this? Are there better solutions to this? This seems to be a common problem, but I have not found something that does exactly this.


title: Why Horizontal Line in LaTex->dvi->ps->pdf is Thicker than LaTex->dvi->pdf?

text: I try to use this line in both chains of compiling:               \rule{6 cm}{0.02 cm}      but in LaTex->dvi->ps->pdf is thick even if I make 0.02cm lower while in LaTex->dvi->pdf is a nice slim line which I need. But unfortunately I have to use LaTex->dvi->ps->pdf chain in order to use hyperref package correctly, so how to fix that? Note that I'm using TexStudio with MikTex library.


title: Eqn numbers in aligned environment

text: I want to write an equation with multiple cases, but that needs multiple aligned columns within each case. I also want a left brace (of my choosing) on the left. Something like this works:               \begin{equation}     F =      \left\{ \begin{aligned}      1.     & 2.     & \ &\text{First row} \\     3.      & 4.     & \ &\text{Second row}     \end{aligned} \right.     \end{equation}      However, only one number is assigned to the group (simply the equation environment). I'd like to tag each individual row (of the aligned environment). is there a way to do this?


title: Behavior of dot operator in node relative placement

text: In placing a new node using relative positioning, what is the behavior of the dot operator when referring to an existing named node? For example, if `xc` is an existing named node, what does the following mean? `\path (xc.71) +(1,0) node (xd) {$x_4$};` Here's a short example (with such an occurrence) that draws a simple directed chain:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \begin{document}          \begin{tikzpicture}[auto,scale=1.0,%     block/.style = {draw,circle,very thick,minimum size=0.5cm},%     directed/.style ={draw,-triangle 45, shorten >= 0pt, very thick}]          \pgfmathsetmacro{\strch}{1.2}          \path (0*\strch,0) node[block] (xa) {$x_1$}           (1*\strch,0) node[block] (xb) {$x_2$}           (2*\strch,0) node[block] (xc) {$x_3$};     \path (xa) [directed] -- (xb);     \path (xb) [directed] -- (xc);          \path (xc.71) +(\strch,0) node (threedots) {$\ldots$};          \path (threedots) +(\strch,0) node[block] (xn) {$x_n$};     \path (xc) [directed] -- (threedots);     \path (threedots) [directed] -- (xn);          \end{tikzpicture}     \end{document}      Changing the node reference to `(xc.11)` or `(xc.999)` or `(xc.0)`, of course, yields different results, but it isn't clear to me after scouring the PGF manual what exactly the bit after the decimal means. (FWIW, this question arose out of erroneously referring to a node `x3` using a macro that stored the value of 3.0 instead of 3, hence `x3.0`. I've since fixed that bug, but I'm now just generally curious about this behavior.) Thanks in advance!


title: An unexpected value of \clubpenalty

text: In the following MWE, `\clubpenalty` has the expected default value of 150 at the begin of the document. However, a combination of a) a `\section` b) a paragraph c) a `quote` environment – in this particular sequence – will result in a `\clubpenalty` of 10000 (i.e. no orphans are allowed from this point forward). Leaving out any of these three elements will produce the expected value of 150 for `\clubpenalty`. Why is this the case?               \documentclass{article}          \begin{document}          Clubpenalty: \the\clubpenalty\ (should be 150)          % Removing either a) the \section or b) the paragraph following it     %     or c) the "quote" environment following it will produce     %     the expected value of 150 for \clubpenalty     \section{A section}          Some text.          \begin{quote}     Some text inside a \texttt{quote} environment.     \end{quote}          Clubpenalty: \the\clubpenalty\ (should be 150)          \end{document}


title: Source code line numbers in PDF

text: > **Possible Duplicate:**   >  Extended draft mode which includes source information for manual print-out > to source synchronisation I am writing a document in LaTeX which I compile to PDF, which I often proofread in order to find mistakes in equations, tables, etc. When I find a mistake, I have to search the tex files for the text in order to find the position in the source, which is a nuisance. I know there are some "inverse search" solutions, but I'm not sure they are feasible since i prefer to use vim in a console window. Ideally, I would like to use a package that prints out the line numbers of the tex source file in the margin of the PDF file -- unfortunately I haven't found any package that does this. Does anyone have any suggestions or other solutions?


title: How to link images to their entry in list of figures?

text: Right now I embed images like that:               \begin{figure}[htb]         \centering          \includegraphics[width=0.5\textwidth]{images/some.pdf}         \caption[Description in LOF, taken from~\cite{source}]{Caption for Image}         \label{fig:sample_image}     \end{figure}      Using `\listoffigures` and `hyperref` this provides a nice list with every entry linked to the image position. As a requirement the source of the image has to be mentioned in the listoffigures it would be convenient to have the images or their caption linked to the matching entry so see the source without scrolling down the whole pdf. So how do I link images to their entry in list of figures?