title: Line tangent to a a curve (using plot or controls), starting at a point

text: I need to draw lines that are parallel to a curve starting at a point. The curve could be a curve drawn using 3 point as my example below did, but alternatively could be a curve drawn using the `\draw () .. controls () and () .. ()` command. Preferably it would work either way. This is the picture of what I am after: ![enter image description here](http://i.stack.imgur.com/hkxaH.png) **Explanation** I have to curves, u_0 and u_1, and a point I_0. I want to find the line that goes from this point (I_0) and is tangent to the first curve (u_0), and the line that goes from (I_0) and is tangent to the second curve (u_1). Then, I want to find a line that is parallel to the line tangent to (u_1), and this line needs to be tangent to (u_0). _If the line can start and stop at the axis without using the shorten commands even better_. For now, I found the tangents and the start and finish points of the parallel line with trial and error, but I have dozens of such pictures to drawn and I need a better way of doing this. Here is my code:               \documentclass{standalone}     \usepackage{tikz,pgfplots}     \usetikzlibrary{calc}          \begin{document}          \begin{tikzpicture}         % axes         \coordinate (origin) at (0,0);         \draw (origin) -- (0,6.5) node[left]{$x_{2}$};         \draw (origin) -- (9.5,0) node[below]{$x_{1}$};         % u_0         \node (e) at (2.2,4.9) {};         \node (f) at (3,3) {};         \node (g) at (5,2.3) {};         \draw[thick] plot[smooth,tension=0.9] coordinates {(e) (f) (g)} node[right]{$u_{0}$};         % u_1         \node (h) at (1.5,4.2) {};         \node (b) at (2.4,2.3) {};         \node (j) at (4.4,1.6) {};         \draw[thick] plot[smooth,tension=0.9] coordinates {(h) (b) (j)} node[right]{$u_{1}$};         % first budget line (I_0 to p_0)         \coordinate[label=left:{\scriptsize$I_{0}$}] (i0) at (0,4.65);         \draw (i0) -- (8.1,0);          % second budget line (I_0 to p_1)         \coordinate (d) at (4.67,0) {};         \draw (i0) -- (d);         % dashed line         \draw[densely dashed,style={shorten >=2.8cm,shorten <=-4.64cm}] (2.68,3.3)   -- +($(i0)-(d)$);     \end{tikzpicture}     \end{document}


title: nameref With Arbitrary Text

text: This is a follow-up question to: Cross-referencing within text @Werner gave a good cross-referencing MWE to return to a certain point of the text in a section and not at the beginning of that section. The 'back' link, however, still contains the name of the section where the return is to happen. How can one place arbitrary text in that 'back' link or, better yet, how can the referenced section title be made into a 'back' link (without it showing in the 'referencing' link)? Something like this:               \documentclass[onecolumn,twoside]{revtex4}          \usepackage{xpatch}% http://ctan.org/pkg/xpatch     \makeatletter     \xpatchcmd{\@ssect@ltx}{\@xsect}{\protected@edef\@currentlabelname{#8}\@xsect}{}{}%    Patch \<section>*     \xpatchcmd{\@sect@ltx}{\@xsect}{\protected@edef\@currentlabelname{#8}\@xsect}{}{}% Patch \<section>     \makeatother     \usepackage{hyperref}% http://ctan.org/pkg/hyperref          \hypersetup{pdfstartview=FitH,pdfpagemode=UseNone}          \begin{document}          \title{Title}     \author{Author}     \affiliation{Affiliation}          \maketitle          \section*{\texorpdfstring{FirstSection}{}}      text text text text text text text text text text text text text text text text text   text text text text text text text text text text text text text text text text   text text text text text text text text text text text text text text text text text text   text text text text text text text text text text text text text text text text   text text text text     \bf I want to return here, not at the beginning of FirstSection \rm      \nameref{sec:marker2} \phantomsection   \label{sec:marker1} (\bf the text CLICK HERE TO GO  BACK shouldn't show up here \rm)     text text text text text text text text text text text text text text text text text     text text text text text text text text text text text text text text text text     text text text text text text text text text text text text           \section*{SecondSection--CLICK HERE TO GO BACK} \label{sec:marker2}      You can also see in \nameref{sec:marker1} that \ldots     \end{document}


title: How to define parallel section-like headings?

text: I am trying to help typeset a book for a friend, and I've converted most to use chapters, sections, subsections and subsubsections. However, some sections are of the form "Digression _N_ : Text". The digression numbering increments independently, and I've managed to define my own style of heading. Here's my LaTeX so far:               \documentclass{article}     \usepackage{hyperref}          \newcounter{dig}     \newcommand{\digname}{digression}     \newcommand{\digautorefname}{Digression} % Found first by hyperref \autoref{...}     \makeatletter     % http://infohost.nmt.edu/tcc/help/pubs/nmtthesis/old/annotated/at.startsection.html     % http://help-csli.stanford.edu/tex/latex-sections.shtml     % http://zoonek.free.fr/LaTeX/LaTeX_samples_section/0.html     \newcommand\dig{\@startsection {dig}{2}{\z@}%                                    {-3.5ex plus -1ex minus -.2ex}%                                    {2.3ex plus .2ex}%                                    {\normalfont\Large\bfseries}}     \makeatother          \newcommand{\digprefix}{\digname\ \thedig :\ }     \newcommand{\digression}[1]{%         \phantomsection%         \refstepcounter{dig}%         \addcontentsline{toc}{dig}{\digprefix #1}%         \dig*{\digprefix #1}     }               \begin{document}     \tableofcontents          \section{You're Number One}     If you're interested, see \autoref{di:putfirst}.          \digression{Putting You First}     \label{di:putfirst}     Yes, but see \autoref{di:look}.          \dig{Strangely Echoed}     \label{di:echo}     This is body text.          \digression{Look Over There!}     \label{di:look}     What is happening in \autoref{di:echo}? The dig counter is currently \thedig . Go back to \autoref{di:putfirst}.          %\section{What's Best}     Choose the good.          \subsection{Huh}     I missed it.          \end{document}      It's a few lines, but there are some problems. I'm processing it with two calls to `pdflatex dig.tex`. Here's the story:   1. If I put a section after the digressions, pdflatex won't process the second run because it snags in the `dig.toc` file. It complains that "Something's wrong--perhaps a missing \item" at `...}{\numberline {2}What's Best}{1}{Section.2}`.   2. The call to `\dig{Strangely Echoed}` confusingly also puts the digression title after the heading (but integrates nicely with `\autoref{...}`).   3. In an attempt to rearrange the digression heading text and remove the duplicate, I defined `\digression`, but I can't make it integrate with the `\autoref` feature of the hyperref package. In the output PDF, `\autoref`s that reference a `\digression` use the "section" prefix.   4. The table of contents doesn't seem to format nicely for `\dig` based headings either. So, please, how can I get a separately numbered sequence of Digression headings of the form "Digression _N_ : Title" that can intersperse between calls to `\section` and work with `\autoref`?


title: Centering a Table

text: I have a `tabular` environment nested within a `table` environment which I'd like to place horizontally centered. What's the best way to achieve this? If the right thing to do is use the `\centering` command, should `\centering` enclose the `table` or just the `tablular` environment?


title: breqn and \brace

text: I was looking forward to using breqn, but it mysteriously fails with the following piece of code:               \begin{dmath*}         {2 \brace 3}     \end{dmath*}      However, this construct outputs a "Missing delimiter" error (`\choose` works without a hitch). What gives? I'm working with TexLive 2011 on OS X.


title: Biblatex: "reading" style is showing the "references in source" of my bib entries

text: As i'm about to make an annotated bibliography, I'm using the "reading" style of Biblatex to show it, and the output is pretty good but there is one problem left : the output shows the reference in source of my bib entries. For instance, if I have in my bib file something like that :               @book{ReferenceInSource1,        author="Doe, John",        title="Original title",     }      The output will show "Doe: Original title" as heading of the entry in the bibliography (that's ok), but also "ReferenceInSource1". Is there a way to hide the "ReferenceInSource1" ?


title: Manipulating the output of \footnote

text: This is in a way a generalization of my earlier question Footnotes (e.g. citations) in the footline of beamer frames? Generally, I would like to know which macros (La)Tex uses to process footnotes and how one can manipulate these. Specifically, that could mean: - Changing the placement of the footnote box - Disabling footnote output in certain circumstances (e.g. in beamer's presentation mode while keeping them in article mode) Does anyone have an idea?


title: Per-word info needed in DVI to create touch rectangles on LaTeX documents in iTeX for the iPad

text: When reading a LaTeX document on an iPad with iTeX, I need to know the position of every word on the page. (I also need to know the positions of images, URLs, footnotes, etc., but they are all manageable by adding \special- s to the appropriate macros.) This could be used for searching, dictionary lookups, etc. What I would love to do is insert a \special with some attribute before each word. This would need some automatic per-word processing, because I want it for the whole document, and damn the expense! A new program, dvigrid, would emit lines needed containing the word's rectangle and other, specifiable information. It needs to be a general solution, something that can live with the popular document classes. A related need is the word ordinal in the output. This would be a new answer to the old word-count question (which use external programs), except here TeX could count the words. There are examples of commands that do this for every word in a parameter, like putting the words in a box. But none seem appropriate for doing an entire document this way. I can't find an appropriate hook or hack, even deep inside the double danger parts of TeX. Does anyone have a suggestion? Can this even be done without modifying TeX? Bill Cheswick ches@cheswick.com For more information in iTeX, see http://itex.cheswick.com My talk at TUG 2010 is at http://river-valley.tv/tex-and-the-ipad/


title: Overlays: Color subformulas successively

text: I want to color different subformulas with overlays successively.               \frame{             \onslide<1>{$$\textcolor{red}{a} \land (\textcolor{red}{b} \lor c)$$}         \onslide<2>{$$\textcolor{red}{a} \land (b \lor \textcolor{c})$$}      }      Unfortunately the formula "jumps" down one line.


title: Unique counter for all foot, side and end notes

text: When used together, as in the MWE, the text might be plagued of identical numbered marks, that is rather confusing. I want to have marks in this MWE ordered from 1 to 9 instead of three indistinguishable series from 1 to 3. More clever solutions (using marks of different colors, mixing arabic and roman numbers with alphabetic marks, other that you can imagine ...) are also welcome.               \documentclass{article}     \usepackage{sidenotes}     \usepackage{endnotes}          \begin{document}          See the sidenote\sidenote{A side note} and the footnote \footnote{A foot note}.      See the sidenote\sidenote{A side note} and the footnote \footnote{A foot note}.      See the endnote\endnote{An end note}. See the endnote\endnote{An end note}.      See the note\sidenote{A side note} (of what type?) and the      note\footnote{A foot note}(what type?) and the note\endnote{An end note}      (where?).          \theendnotes          \end{document}


title: How to make a multiply equation?

text: I need to make a equation like this > >           1011   (this is 11 in decimal) >         x 1110   (this is 14 in decimal) >         ====== >           0000   (this is 1011 x 0) >          1011    (this is 1011 x 1, shifted one position to the left) >         1011     (this is 1011 x 1, shifted two positions to the left) >      + 1011      (this is 1011 x 1, shifted three positions to the left) >      ========= >       10011010   (this is 154 in decimal) >   I tried to code like this               \begin{equation}     \frac{         \frac{             \begin{array}[b]{r}                     1011    \\                 \times 1110             \end{array}             }             {         \begin{array}[b]{r}             0000    \\             0000    \\             0000    \\             + 0000         \end{array}         }     }     {     10011010     }     \end{equation}      But the result is not aligned. Any suggestions?


title: Manipulating variables in TikZ

text: To create points with names P1, P2, ..., P8 at coordinates (1,0), (2,0), ..., (8,0) in TikZ, I can use               \begin{tikzpicture}[scale=1]            \foreach \i in {1,...,8}       {         \path (\i,0) coordinate (P\i);         \fill (P\i) circle (2pt);       }          \end{tikzpicture}      Now, what if I want to create the same eight points, but name them P2, P3, ..., P9 instead? I've tried changing it to               \path (\i,0) coordinate (P(\i+1));      but it didn't work.


title: How to draw a induced charge under soliton - Feynman diagram?

text: Can someone illuminate line-by-line clear, how to draw this diagram? Just a clear LaTex code is enough. Thank you!! Either for the case: (1) in an equation or (2) in the figure. ![enter image description here](http://i.stack.imgur.com/xY2J2.png)


title: Tabularx inside of Table becomes wider than the textwidth

text: I have many tabularx enviornments and have been using \linewidth to keep the table width flush with the text width. I now have a need to insert these tabularx segments inside of a float table enviornment because I neet to include captions and references for the tabularx. A major issue intruduced with the table enviornment is that somehow, the linewidth of the inner tabularx is stretched outside the width of the text. I would like to keep the width of the tabularx the same as the text. I have tried \linewidth and \textwidth modifiers and still the same problem.               % -------------------------------------------------------------------------------     % Preamble     % -------------------------------------------------------------------------------               \documentclass[bibtotocnumbered,abstract=on,paper=a4,fontsize=12pt,parskip=on,%        halfparskip=on]{scrartcl}   % KOMA article          \usepackage[a4paper,pdftex,margin=1in]{geometry}                    % A4paper margins          \usepackage[english]{babel}     \usepackage[protrusion=true,expansion=true]{microtype}       \usepackage{amsmath,amsfonts,amsthm,amssymb}     \usepackage{graphicx}     \usepackage{hyperref} % for links in TOC     \usepackage{tabularx} % for better table spacing     \usepackage{appendix} % appendix in TOC     \usepackage{listings} % for software listings in appendix     \usepackage{xcolor}     \usepackage{float}     % ------------------------------------------------------------------------------     % Definitions (do not change this)     % ------------------------------------------------------------------------------     \AtBeginDocument{\setlength{\parfillskip}{1em plus 1fil}}% instead of 1em plus 1fil     \newcommand{\HRule}[1]{\rule{\linewidth}{#1}}   % Horizontal rule     \makeatletter             % Title     \def\printtitle{%                {\centering \@title\par}}     \makeatother          \makeatletter             % Author     \def\printauthor{%               {\centering \large \@author}}     \makeatother          \hypersetup{} %set up hyperref          \newcolumntype{L}{>{\raggedright\arraybackslash}X}%tabularx custom column     % ------------------------------------------------------------------------------     % Begin document     % ------------------------------------------------------------------------------     %....above here is bulk of the text     \begin{document}          Figure~\ref{fig_asciimessage} above depicts the preliminary data-layout chosen for the scope of each playback sequence. This data represents a sequence of messages that composes a tune being read from the SD in ASCII mode. As a result, filesizes will be much larger, but this is at the expense of creating an easily modifiable human-readable format.          \section{Testing Methods, Results and Evaluation}       \subsection{Subsystem Test Plans}                 \noindent\begin{table}[htb]            \small            \caption{LCD unit test}            \begin{tabularx}{\textwidth}{ |p{2.1cm}|L|L|p{0.7cm}|p{0.6cm}|X| }              \hline              \multicolumn{2}{|l|}{\textbf{Test Writer}} & \multicolumn{4}{c|}{Horatio Phillips} \\              \hline              \multicolumn{2}{|l|}{\textbf{Test Case Name}} & {LCD unit test} & \multicolumn{2}{c|}{\textbf{Type}} & subsystem \\              \hline              \textbf{Description} & \multicolumn{2}{|>{\centering\setlength\hsize{2\hsize} }X|}{Verify correct communication of ASCII text to display screen} & \multicolumn{2}{c|}{\textbf{Date}} & 09/25/13 \\              \hline              \textbf{Setup} & \multicolumn{2}{|>{\centering\setlength\hsize{2\hsize} }X|}{Connect LCD tester using pinout displayed in Appendix J} & \multicolumn{2}{c|}{\textbf{Time}} & 22:     12\\              \hline              \multicolumn{6}{|l|}{\textbf{Test}} \\              \hline              \textbf{Name} & \textbf{Action} & \textbf{Expected output} & \textbf{Pass} & \multicolumn{2}{X|}{\textbf{Comments}} \\              \hline              Poweron test & Apply power to microcontroller & Display lights up? & \checkmark & \multicolumn{2}{X|}{} \\              \hline              ASCII test & No action needed & Will display an ASCII message on LCD & \checkmark &  \multicolumn{2}{X|}{} \\              \hline              Control character test & No action needed & Will display custom characters on the LCD & \checkmark & \multicolumn{2}{X|}{} \\              \hline              Contrast adjust & Adjust rheostat on tester board & Contrast should adjust on screen & \checkmark & \multicolumn{2}{X|}{} \\              \hline            \end{tabularx}            \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/4eEdA.png)


title: Bibtex own Reference Style

text: I just created my own reference Style with the "tex makebst" command of custom-bib. So far so good. I am using Max OSX 10.9.4 and Sublime as an Editor. Where exactly do I have to save the New.bst? I am kinda lost. I found this: Where the .bst file comes in and I put my file to               /usr/local/texlive/2013/texmf-dist/bibtex/bst/meins      Now I tried to call the style with `\bibliographystyle{New}` But I have errors: > ./settings/99_preamble.tex:42: Package biblatex Error: '\bibliographystyle' > invalid. [\bibliographystyle{New}] Seems like I dont even have that bibliographystyle I read about in all the posts


title: What font do you use for writing latex code?

text: While mono-spaced fonts are generally accepted as the best option for programming and coding, I feel they make it to hard to read longer texts and thus are not my preferred font for writing latex. What fonts are a good compromise between the advantages of mono-space (good readability of special symbols like $ ? / \ etc and brackets) versus being nice to the eye and making it a pleasure to read/write longer texts? (I currently use Verdana, 11pt)


title: defining commands of commands

text: if you want to include an image in your chapter title, what follows may be an option:               \newcommand{\thechapterimage}{}     \newcommand{\chapterimage}[1]{\renewcommand{\thechapterimage}{#1}}     \def\thechapter{\Roman{chapter}}     \def\@makechapterhead#1{%     {\centering \normalfont\sffamily     \ifnum \c@secnumdepth >\m@ne     \if@mainmatter     \vspace*{-3.9cm}\hspace*{-3.1cm}% to position the figure     \includegraphics[width=\paperwidth]{\thechapterimage}\par     \rput[lb](0,2){\sffamily\bfseries\thechapter}}\par     \vspace*{30\p@}%     }      then, in the main document, you would call the name of a figure just before the chapter command:               \chapterimage{image.eps}     \chapter{Title}      What is the exact role of the first two commands `\thechapterimage` and `\chapterimage` above?


title: Unpredictable Vertical Spaces

text: I'm writing up a résumé, and I am very particular about making sure that each section is separated by the exact-right-looking amount of spacing. My sections are divided with an `\hrule` (although in my real document I use the `titlesec` package to define their format). The rule makes it easy to notice when one section's spacing is different from another's. The following example shows several of the elements that I need in my document. I have placed the rules very close to the text, to make the difference even more obvious. Depending on whether a section contains text or a list or columns, the subsequent section gets spaced an irregular amount below it. _Edit: I've used`\myrule` instead of `\hrule` and followed other suggestions already given by @Ulrike._               \documentclass[10pt]{article}          \usepackage[letterpaper,margin=1in]{geometry}     \usepackage{enumitem}     \usepackage{multicol}          \newcommand{\sampletext}{Here is some sample text\strut}          \newcommand{\myrule}{\par\vspace{-1\baselineskip}\noindent\strut\rule{\textwidth}{0.4pt}}          \newenvironment{compactlist}%         {\begin{itemize}[topsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0em,partopsep=0pt,leftmargin=*]}         {\end{itemize}}          \begin{document}          \section{Plain}     \sampletext     \myrule          \section{Itemized}     \begin{compactlist}         \item \sampletext         \item \sampletext     \end{compactlist}     \myrule          \section{Itemized With Text}     \noindent\sampletext     \begin{compactlist}         \item \sampletext         \item \sampletext     \end{compactlist}     \myrule          \section{Parbox Itemized}     \hbox{         \parbox[t]{7in}{             \begin{compactlist}                 \item \sampletext                 \item \sampletext             \end{compactlist}         }     }     \myrule          \section{Parbox Itemized With Text}     \parbox[t]{6.5in}{         \sampletext         \begin{compactlist}             \item \sampletext             \item \sampletext         \end{compactlist}     }     \myrule          \section{Multicols}     \setlength{\multicolsep}{0pt}     \begin{multicols}{3}         \begin{compactlist}             \item \sampletext             \item \sampletext             \item \sampletext             \item \sampletext             \item \sampletext             \item \sampletext         \end{compactlist}     \end{multicols}     \myrule          \end{document}      Is there any way to enforce consistent vertical spacing?


title: Side brace around image with underbrace

text: I have an image and I want to put a side brace on the left and an underbrace on the bottom. The underbrace works fine, but the left becomes twice the image height for some reason. I'm sure the image isn't actually that big, I've looked at the pixel height. Is this the wrong way to do it?               $r\left\{\underbrace{\includegraphics{image1.jpg}}_{k/r}\right.$


title: How can I vertically center multiple cells in the same line of a table?

text: For example: ![image](http://i.stack.imgur.com/anxGi.png) I've only found answers that involve centering only one column, such as this one.


title: Align equation with a better method than {split}?

text: I've got the following code that I'm using and wondered if there was a way to get the minus sign (-) of the third term to align with the minus sign of the second term, or if there was a nicer way to set it out in general while keeping to the two column layout? Also, is it possible to make the brackets outside the third term slightly larger?               \documentclass[11pt]{article}     \usepackage{amsmath}     \usepackage{a4wide}     \usepackage{multicol}               \begin{document}     \begin{multicols*}{2}     \begin{equation}     \begin{split}     \frac{d^2x}{d\theta^2}=-r\cos(\theta) - \frac{r^2(\cos^2(\theta) -\sin^2 (\theta))}{\sqrt{l^2-r^2\sin^2(\theta)}}     \\-\frac{r^4\sin^2(\theta) \cos^2 (\theta)}{(\sqrt{l^2-r^2\sin^2 \theta})^3}     \end{split}     \end{equation}     \end{multicols*}{2}     \end{document}


title: Erd\H{o}s with \mathbb

text: I am trying to write `Erd\H{o}s` in a LaTeX file but it gives me an error and says "`\mathbb` allowed only in math mode." Apparently I use a library that has other plans for `\H` is there something I can do?


title: LyX and mathspec gives fontspec error, unicode-math no better

text: I get the following error message whenever using `mathspec` in LyX               ...Package[\eu@zf@math]{fontspec}[2008/08/09]     The package fontspec has already been loaded with options:   [] There has now been     an attempt to load it with options   [no-math] Adding the global     options:   ,no-math to your \documentclass declaration may fix this.     Try typing  <return>  to proceed.      Here is my preamble in LyX               \usepackage[no-math]{mathspec}      \setmathsfont(Latin)[Scale=MatchLowercase,Uppercase=Regular,Lowercase=Italic]{SNsanafonmaruP}     \setmathsfont(Greek)[Scale=MatchLowercase,Uppercase=Regular,Lowercase=Regular]{SNsanafonmaruP}     \setmathsfont(Digits)[Numbers={Lining}]{SNsanafonmaruP}       (n.b. `mathspec` loads `fontspec` with `no-math` by default. I put it in there explicitly, but the error occurs even when it is not there.) The problem is that LyX loads `fontspec` automatically and this is throwing the error. I am not sure how to proceed. I am using XeTeX as my output... **UPDATE 2/29/12** I have tried to use `unicode-math` instead of `mathspec`, as follows:               usepackage[vargreek-shape=unicode]{unicode-math}     \unimathsetup{math-style=TeX} % sets whther vars are upper or lc vars and lating chars in math     \setmathfont{lmmath-regular.otf} % this is obligatory or no math font will be set...     \setmathfont[range=\mathup/{latin, Latin, num}]{SNsanafonmaruP} %  upper and lower case  latin and numbers     \setmathfont[range=\mathup/{Greek,greek}]{SNsanafonmaruP} % upper case Greek     \setmathfont[range=\mathit/{latin, Latin, num}]{SNsanafonmaruP}     \setmathfont[range=\backepsilon]{SNsanafonmaruP}     \setmathfont[range=\mathit/{greek,Greek}]{SNsanafonmaruP}      but `unicode-math` doesn't default (e.g. to computer modern...I am not pleased with the traditional Unicode alternatives Asana and STIX (too fat, especially the summation signs, and I like the default symbols, I just want my own font for the greek and latin and numerals) to anything, which would be nice, so I have to include the first `\setmathfont` and specify a default font, but when I try to put in "Computer Modern" or "Computer Modern Math" it doesn't find it, and I guess it couldn't cause it isn't Unicode??, so I tried `lmmath- regular.otf` or Latin Modern Math, and I probably have to install these, but I cant find a package for it in MikTeX, and anyway, according to the bug list on `unicode-math` this will break `mathcal` so I shouldn't, and to boot it doesn't work, since the font is not found. so it seems like I am so close, and yet so far, as the saying goes...


title: How to align five equations on three lines, e.g., 2-2-1, with the last equation centered?

text: I'm trying to use the alignat environment to arrange five equations on three lines as follows: two equations on the first line, two equations on the second line (aligned with those of the first line), and the fifth equation **centered** on the third line by itself. For what is worth, here's my failed attempt:               \begin{alignat}{3}     a ={}& b      &\qquad &     c ={}& d      \\     e ={}&f      &\qquad &     g ={}& h     \\     {\centering      i = j      }     \end{alignat}      Please note I don't want the equation `i=j` on the third row to be aligned to the left, nor to the right, nor aligned with any particular piece of the other four equations, I really want it by itself on the third row, and centered on that row. I can produce the first two lines with no problem (using either align or alignat), but I can't get the single equation on the third line to be centered!


title: Separate bibliographies with global labels

text: I have several categories of bibliographic entries which I would like to present satisfying the following requirements:   1. Each category goes into its own subsection (for example, journal articles, books, etc.) of my "Bibliography" section.   2. I would like to have entries in each category numbered separately and in reverse, for example [J10]-[J1], [B3]-[B1] etc.   3. Different types of my entries do not necessarily correspond to different `bibtex` types (for example, `@article` entries may be split into two categories). I find it easiest to keep the entries of each category in a separate `.bib` file.   4. References to the various bibliographic entries may appear anywhere in the text. All requirements apart from (4) can be satisfied if each category corresponds to a separate `refsection` (see here for requirement (2), just add the option `prefixnumbers` when printing each bibliography). Unfortunately, `refsection`s seem only to produce local labels and therefore each entry can only be referenced inside its own `refsection`. If the above is correct, `refsection`s cannot be used, and some other way of segregating entries will be required, for example by keywords or using `biblatex` _categories_. But then I don't see how the solution to (2) can be applied since it seems tied to `refsection`s. Any ideas?


title: LaTeX resume/cover letter error

text: I've recently used a LaTeX template to make both a resume and cover letter using `res.cls` and `letter.sty` respectively. However, I would like to have both documents display my name, a horizontal line and my address, all centered, and in the same place place on both documents. The code which does this in `res.cls` is:               % LaTeX resume using res.cls     \documentclass[margin]{res}     %\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)     %\usepackage{newcent}   % uses new century schoolbook postscript font      \setlength{\textwidth}{5.1in} % set width of text portion          \begin{document}          % Center the name over the entire width of resume:      \moveleft.5\hoffset\centerline{\large\bf NAME}     % Draw a horizontal line the whole width of resume:      \moveleft\hoffset\vbox{\hrule width\resumewidth height 1pt}\smallskip     % address begins here     % Again, the address lines must be centered over entire width of resume:      \moveleft.5\hoffset\centerline{1 ABC Street}      \moveleft.5\hoffset\centerline{AUSTRALIA 2000}      \moveleft.5\hoffset\centerline{5555 555 555}          ...      But I'm unsure how to do this in `letter.sty`. Currently the code is:               % Cover letter using letter.sty     \documentclass{letter} % Uses 10pt     %Use \documentstyle[newcent]{letter} for New Century Schoolbook postscript font     % the following commands control the margins:     \topmargin=-1in    % Make letterhead start about 1 inch from top of page      \textheight=8in  % text height can be bigger for a longer letter     \oddsidemargin=0pt % leftmargin is 1 inch     \textwidth=6.5in   % textwidth of 6.5in leaves 1 inch for right margin          \begin{document}     \thispagestyle{empty}     \pagestyle{empty}           \signature{NAME}                           % name for signature      \longindentation=0pt                       % needed to get closing flush left     \let\raggedleft\raggedright                % needed to get date flush left               \begin{flushleft}     {\large\bf NAME}     \end{flushleft}     \medskip\hrule height 1pt     \begin{flushright}     \hfill 1 ABC Street \\     \hfill AUSTRALIA 2000 \\     \hfill 5555 555 555      \end{flushright}      \vfill % forces letterhead to top of page          ...      Can anyone with more experience than I have, suggest a fix that will work identically for both documents?


title: How to lock the position of lines -group of columns-

text: How to fix these columns on their positions?               \begin{frame}     \only<1->{     \begin{columns}     \column{4,7cm}     \hspace{0.6cm}     \includegraphics[width=2.3cm,height=1.7cm]{images/temps_prob}     \column{\dimexpr\textwidth-4.7cm\relax}     \hspace*{-20pt}\parbox{\dimexpr\linewidth+20pt\relax}{%     \begin{itemize}     \item E :     \begin{itemize}     \item D.     \item C.     \end{itemize}     \end{itemize}     }     \end{columns}     }     \vspace{0.1cm}     \only<2->{     \begin{columns}     \column{4,7cm}     \hspace{0.6cm}     \includegraphics[width=2.3cm,height=1.7cm]{images/productivite_prob}     \column{\dimexpr\textwidth-4.7cm\relax}     \hspace*{-20pt}\parbox{\dimexpr\linewidth+20pt\relax}{%     \begin{itemize}     \item B.     \end{itemize}     }     \end{columns}     }     \vspace{0.2cm}     \only<3->{     \begin{columns}     \column{4,7cm}     \hspace{0.6cm}     \includegraphics[width=2.3cm,height=3cm]{images/controle_prob}     \column{\dimexpr\textwidth-4.7cm\relax}     \hspace*{-20pt}\parbox{\dimexpr\linewidth+20pt\relax}{%     \begin{itemize}     \item A.     \end{itemize}     }     \end{columns}     }     \end{frame}      Because, when I click on the down button. I get the last line displayed translated to top and the new line appears on its bottom. Is it possible to make these lines locked at their defined positions from the beginning ? If yes, how to, please ? Thanks a lot!


title: Undefined control sequence in align

text: \begin{align}     \label{eq:x}     x = \sign{a} \cdotp \sign{b} \cdotp \min(\lvert a \rvert,\lvert b \rvert)     \end{align}      Above gives me _Undefined control sequence_. Any ideas would be helpful.


title: tikzpicture blank in preview

text: Using preview-latex to preview the tikzpicture environment shows either a blank rectangle in pdf mode or simply produces no preview file in ps mode. I am using aquamacs 23.3a, using auctex and gs 9.04. I tested multiple file format outputs and preview options. I don't see any errors or warning pop up either, so I can't tell for sure if the error lies with ghostscript, auctex or preview. The following previews a blank for the entire tikzpicture environment.               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}       \node[draw] {tikz rectangle};     \end{tikzpicture}     \end{document}      Is there a way to see what exactly goes wrong where?


title: texindy/imakeidx book marks point to incorrect pages with multiple indices

text: I have two indexes: the `Main Index` and `Name Index`. The PDF books are visually correct: ![enter image description here](http://i.stack.imgur.com/HfHS7.png) Note that the `Name Index` starts on Page 6, and the `Z` entry for the `Name Index` is on Page 7. However, up clicking on the `Z` in the `Name Index` (which appears on Page 7) I am taken to the `Z` for the `Main Index` (Page 6). This code is adapted form Applying \lowercase to index entries. ## Code:               \documentclass{article}     \usepackage{imakeidx}     \usepackage{hyperref}          \newcommand*\lettergroup[1]{%         \clearpage%         \section*{#1}%         \pdfbookmark[0]{#1}{#1}%          \nopagebreak%     }          % http://tex.stackexchange.com/questions/51688/applying-lowercase-to-index-entries     \newcommand*{\AddIndexEntry}[3][]{%       % #1 = indexed term, #2 = word to index this under       \par\noindent       \lowercase{\def\temp{#3}}%       Indexing: #3%       \if!#1!         \expandafter\index\expandafter{\temp!#2}%       \else         \expandafter\indexopt\expandafter{\temp!#2}{#1}       \fi     }     \newcommand{\indexopt}[2]{\index[#2]{#1}}          \makeindex[title={Main Index},columns=1,program=texindy]     \makeindex[title={Name Index},columns=1,program=texindy,name=Name]          \begin{document}          \AddIndexEntry{aardvark}{aardvark}     \AddIndexEntry{Saved by Zero}{Saved}     \AddIndexEntry{Saved by Zero}{Zero}     \AddIndexEntry[Name]{zero}{zero}          \clearpage     \addcontentsline{toc}{}{Main Index}     \printindex          \clearpage     \addcontentsline{toc}{}{Name Index}     \printindex[Name]     \end{document}


title: Cleveref and breqn packages don't play nice together

text: I have been using the `breqn` and `cleveref` packages independently, and I think they are both excellent packages; but recently I have tried using them together, but it appears that `cleveref` cannot identify the `dmath` environment so that all my references to equations reference the containing section. Is there a way to make these package work together? Here's a MWE illustrating the problem:               \documentclass{article}     \usepackage{breqn}     \usepackage{cleveref}          \begin{document}          \section{Content}          \begin{dmath}\label{equ:test}     a=d+c     \end{dmath}     \cref{equ:test}          \end{document}      ![enter image description here](http://i.stack.imgur.com/b1i4q.png)


title: How to install and use simpsons font?

text: How to install and use the simpsons font? I could not use the following command:               \documentclass[a4paper]{scrartcl}      \usepackage{simpsons}      \begin{document}      \Bart      \end{document}      I use TeXLive 2011.


title: minipage breaking, or some other route to layout

text: I'm trying to make a resume with a 2 column layout, where I'll have something like [SECTION NAME] * space * [DETAILS] For example:               Work experience[spaaaaaaaaaaaaaace]Some location, 2 years, etc                    [spaaaaaaaaaaaaaace]Another location, 1 year          Education[spaaaaaaaaaaaaaaaaaaaace]Some degree      Note that I want the right column to be left aligned to the same position. I have been trying this with two minipages for each section. It seems to work well, but the problem is that Latex doesn't split the minipages, and forces them to their own page. I'd like the sections to generally follow each other immediately, and break where necessary. Something tells me that minipage is not up to the task: what's an alternative?


title: How to suppress insertion of letter labels after year for references from the same year

text: I hope this is a simple question, but I've been googling it all evening and haven't made much progress. I am currently working on converting my CV to LaTeX (which is going quite well), but I've come across one hurdle: I have many BibTeX entries from the same year. In a typical paper, these references should be given individual identifiers (e.g. Author, 1990a; Author, 1990b; and so on), however, in a CV, this looks a little silly. Does anyone know how I can disable the automatic lettering of references from the same year? I am using natbib and bibentry and the apalike bibliography style Preamble:               \documentclass[10pt]{article}     \usepackage[NoDate,LabelsAligned]{currvita}     \usepackage[american]{babel}     \usepackage{csquotes, natbib, bibentry, anysize, titlesec}     \usepackage[hmargin=1in,vmargin=1in]{geometry}     \pagestyle{headings}     \setcounter{page}{1}     \titlespacing*{\subsubsection}{10pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}     \newcommand{\bibverse}[1]{\begin{verse} \bibentry{#1}. \end{verse}}      Document:               \begin{document}      \nobibliography*      \begin{cv}{}      \subsection*{Publications}      \bibverse{Sigal2012}      \bibverse{Sigal2012a}      \end{cv}      \bibliographystyle{apalike}      \nobibliography{ReferenceDesk}     \end{document}


title: pitchfork in plain TeX

text: I was asked the following question: > How do I get get `\pitchfork` in plain TeX? He tried `\input mssymb` and `\input amssymb` but neither works. More generally, is it possible to get ams symbols to work under plain TeX?


title: emacs/aquamacs + latex/auctex: how to define one's own environments or commands?

text: I work with Aquamacs (emacs on Mac OS X; latest version) to compile .tex documents. Although AUCTeX provides environments such as enumerate etc., I would like to define a shortcut/macro to get my own environment in the .tex file. Ideally, it should be: I hit a certain keystroke The following code is entered in the .tex file at the current cursor position:               \begin{enumerate}[label=(\arabic*)\ ,leftmargin=*,align=left,topsep=\mytopsep,itemsep=\myitemsep]          \item          \item      \end{enumerate}      The cursor should jump to the first \item [since that is where one wants to continue writing]. I should be possible to do these things, but I have no glue how since I'm only an emacs user for about a week [really like it so far :-)]. I would guess it could be done in Preferences.el (the .emacs for Aquamacs) with a hook to LaTeX mode (?)


title: Indented Code Blocks Have no Background Color When Generating PDF

text: As the title says, when I run:               pandoc -o book.pdf book.md      The code blocks show up in monotype font but with no background color. I've also tried all styles using `\--highlight-style` with no success. Also tried `~~~` and back tick style as well. Nothing is working, any ideas?


title: How to avoid a line-exceeding statement in a description's item tag?

text: Having a description like this:               \begin{description}     \item[One or several threads are operating concurrently on some data structure, which is bad because and also blablabla.]     \end{description}      How is it possible to avoid that this (admittedly long) tag is written to one line? I want it to line break. Currently it is written to one line and goes outside of the document :(


title: TeXniccenter doesn't produce PDF file

text: When i tried to generate view PDF file of my latex file using `TeXniccenter` i got this message as in picture what is the problem? ![message](http://i.stack.imgur.com/HZgcC.png) any suggestion UPDATE: now it produce the PDF file but it doesnt in opened it attached log file log file


title: Set a length that will adopt tikz's global lengths

text: I am trying to draw a rather simple tikz picture that consists of some very acurately defined levels. My code is               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{plotmarks}          \newlength{\offset}     \setlength{\offset}{4.72983cm}          \begin{document}             \begin{tikzpicture}[y=1cm]                     %axis                             \draw (-3,0) -- coordinate (y axis mid) (-3,20);                     %ticks                             \foreach \y in {0,2,...,20}                                 \draw (-3,\y) -- (-3.25,\y)                                  node[anchor=east] {\y};                     %labels                                   \node[rotate=90, above=0.8cm] at (y axis mid) {\textbf{Energy[MeV]}};                     %input channel                             \draw (-2,12.8435) -- (0,12.8435);                             \node[above=0.2cm] at (-1,12.8435) {$p+{}^{19}F$};                     %compound nucleus                             \draw[very thick] (2,20) -- (2,0) -- (5,0) -- (5,20);                             \node[below=0.1cm] at (3.5,0) {${}^{20}Ne$};                     %output channel                             \draw (7,\offset) -- (9,4.72983);%ground state                             \draw (7,5.98765+\offset) -- (9,5.98765+4.72983);%1st state             \end{tikzpicture}     \end{document}      As you can see I have set a length called `offset`. The problem is that at the present point the picture is rather big. What I want is to scale it only on `y axis`. If I change `\begin{tikzpicture}[y=1cm]` to `\begin{tikzpicture}[y=.6cm]` I get the ideal `y` dimension but the levels on the `output channel` are not set correctly. Is there a way to define a length in `tikz` that will adapt tikz's lengths? What I mean is that by default tikz's length is `1cm`. When using `\draw (0,0) -- (0,1);` one does not specify that he's talking about cm. If the global length is changed(i.e. `[y=0.6]) the previous line will have 0.6 cm length. Is something like that possible?


title: Adding Source of Document as Footnote with External Files

text: I have a beamer presentation where I am including a set of external slides using `includepdf` from `pdfpages`. I want to be able to add a footnote to each of these external slides, which attributes them to the correct source. Is there a way to do it in LaTeX?


title: What You See is What You Get (WYSIWYG) for PGF/TikZ?

text: Are there any WYSIWYG editors for PGF/TikZ? Perhaps something similar to LyX but for PGF/TikZ? If there is no WYSIWYG editor for this tandem, is there one perhaps that allows the user to easily generate PGF/TikZ templates? Alternatively, how can I most easily generate PFG/TikZ code from a visual conception? Do people mostly code their PGF/TikZ graphics from scratch?


title: How to find absolute page number as an integer?

text: Is there a simple way to retrieve an absolute page number from a label, where by absolute I mean counting all pages as integers sequentially starting from the first page of the document, without any resets. To be more clear, if I have three pages of front-matter with roman numerals, then 10 pages of content with arabic numbers, and I reference the third page of the content, `\pageref` will return 3, but I want an alternate command that will return 6 since it's the 6th overall page in the document. Furthermore, I'd like the references returned as a basic integer so they can be used in a control statement or for arithmetic comparisons, e.g. I'd like to be able to do something like the following, where `\abspageref` is a hypothetical command that counts from the beginning of the document not the last page counter reset, and returns a simple integer with no unit associated:               if{\abspageref{labelA} > \abspageref{labelB}{Some text.}{Some alternate text.}      I realize that's not a correct if then control statement either, it's just to illustrate what I'm trying to do. Thanks. Bonus question: why is something like `abspageref` not a core part of Latex already? It seems like a predictable feature that advanced users would want, and when I search for solutions online, I see a lot of very complicated solutions that I haven't had any success with yet.


title: Which kind of math font set is used in the picture?

text: ![enter image description here](http://i.stack.imgur.com/kBwzT.png) I like the math font set used in the picture very much, so what is the math font set name and where can I find the font set package or LaTeX Release, thanks. PS: Is is not the MathTimeProII.


title: Align/avoid numeration and labels in a custom biblatex format

text: I need list references with a custom format, with a label showing the type of entry (`@article`, `@book`, etc.) and labeling fix/variable fields in a tabular environment. I have successfully obtained this (see MWE below), but I still need to control/improve some aspects:   1. **Avoid numeration** (How I can suppress `[1]` and `[2]` in the MWE?)   2. **Vertical position** of the number of reference and their label ("Article"). How to move both to the top (unrotated) or at the same level that the first field, but both rotated, to save left space?   3. **How to center correctly the main label** (Article) when rotated 90º as in the MWE?   4. **How to avoid the extra labels** `DOI` and `URL`?  ![enter image description here](http://i.stack.imgur.com/XrRHi.png)               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{textcomp}     \usepackage{xcolor}     \usepackage{csquotes}     \usepackage{rotating}     \usepackage[backend=biber, maxnames=99, sorting=none, hyperref=true]{biblatex}     \usepackage[colorlinks=true]{hyperref}          \begin{filecontents}{\jobname.bib}          @ARTICLE{mwe2012,       author = {Smith, A. and Johnson, B. and Willians, C.},       title = {The three most common surnames in the United States of America},       journal = {Review of Useless Knowledge},       year = {2012},       volume = {8},       number = {1},       pages = {290--290}     }          @ARTICLE{mwe2011,       author = {Miller, J. and Brown, D.},       title = {Most used surnames in fake passports},       journal = {Journal of Nosense Ranks},       year = {2011},       volume = {5},       number = {3},       pages = {1--130},       pmid = {1234567},       url = {http://www.mwe.com/mwe2011},       doi = {http://dx.doi.org/10.1016/jnr.2011.01.01},     }                    \end{filecontents}          \addbibresource{\jobname.bib}            \AtEveryBibitem{     \ifentrytype{article}{\begin{sideways}Article\end{sideways}}{}     }          % \DeclareNameFormat[article]{author}{\dotfill #1 \dotfill}     \DeclareFieldFormat[article,incollection]{title}{\bf #1\isdot}     \DeclareFieldFormat{journaltitle}{\emph{#1}}     \DeclareFieldFormat[article,incollection]{volume}{#1}     \DeclareFieldFormat[article]{number}{#1}     \DeclareFieldFormat{pages}{#1}     \DeclareFieldFormat{year}{#1}               \DeclareBibliographyDriver{article}{%       \usebibmacro{bibindex}%       \usebibmacro{begentry}%     \begin{tabular}{lp{0.75\textwidth}}     \\       \textcolor{gray}{Authors:}   & \printnames{author}       \\       \textcolor{gray}{Title:}    & \printfield{title}        \\        \textcolor{gray}{Year:}       & \printfield{year}         \\      \textcolor{gray}{Journal:}   & \printfield{journaltitle} \\       \textcolor{gray}{Volume:}   & \printfield{volume}       \\      \textcolor{gray}{Number:}    & \printfield{number}       \\      \textcolor{gray}{Pages:}   & \printfield{pages}        \\      \iffieldundef{url}{}{\textcolor{gray}{\sc url:}     & \printfield{url}     \\}%      \iffieldundef{doi}{}{\textcolor{gray}{\sc doi:}     & \printfield{doi}     \\}%     \end{tabular}     \vspace{1em}     \hrule     \usebibmacro{finentry}}          \begin{document}     \nocite{*}     \printbibliography[title=My example articles]     \end{document}


title: how to get the current chapter name, section name, subsection name, etc?

text: How can one get the current name of the following: Chapter, Section, Subsection(s), frame, label, mdframed?


title: How to customize the number in the caption of an algorithm in algorithm2e

text: In `algorithm2e`, if you use the "ruled" option, the caption of algorithms are automatically numbered. E.g. if you write 2 algorithms in one document, the first one will be titled Algorithm 1 and the second one will be titled Algorithm 2. How can I customize this number? Say I only write one algorithm and want it to be titled "Algorithm 3" as shown by the picture below. ![enter image description here](http://i.stack.imgur.com/rZyTr.png)


title: Check whether tableofcontents is empty

text: Inspired by how to check in latex whether the table of content is empty or not before added to the document I would like to have a head, that links to the table of contents if the toc is not empty, and does not link to it if it is empty. In the following I present a code for that. However, the parameter \TableofcontentsIsPrinted is not changed from FALSE to TRUE as it should. If it is renewcommand-ed in the \tableofcontents-definition it works at least in the sense that the head only links to the toc if \tableofcontents has been used in the document - but as I said, I would like to have the code check whether the toc is empty or not. Any help here?               \documentclass[a4paper,10pt,twoside]{article}     \usepackage[utf8]{inputenc}     \usepackage{hyperref}     \usepackage{fancyhdr}     \usepackage{ifthen}          \makeatletter          \newcommand{\TableofcontentsIsPrinted}{FALSE}     \newcommand{\printcontentsnameifnotalreadydone}{%         \section*{\contentsname}%         \renewcommand{\printcontentsnameifnotalreadydone}{}         \renewcommand{\TableofcontentsIsPrinted}{TRUE} % Put in here, it does not work.     }     \AtBeginDocument{%         \let\oldcontentsline\contentsline         \renewcommand{\contentsline}{             \printcontentsnameifnotalreadydone             \oldcontentsline         }         \renewcommand{\tableofcontents}{%             \@starttoc{toc}%     %       \renewcommand{\TableofcontentsIsPrinted}{TRUE} % Put in here, this works half-way.         }     }          \newcommand{\remakehead}{         \ifthenelse{ \equal{\TableofcontentsIsPrinted}{TRUE} }{             \fancyhead[RO,LE]{ \hyperref[sec:tableofcontents]{ Page \thepage } }         }{             \fancyhead[RO,LE]{ Page \thepage }         }     }          \makeatother          \begin{document}     \pagestyle{fancy}          \begin{center} \Huge Heading \end{center}          \phantomsection     \tableofcontents     \label{sec:tableofcontents}     \remakehead          \newpage          \section{First Section}          \newpage          \section{Second Section}          \newpage          \end{document}


title: How to create a command that automatically escapes curly braces?

text: How could I create a command that will automatically escape all curly braces within the current environment? For instance, I would like a command (or environment, I suppose) that allows me to write something like this:               Kuratowski identified the ordered pair $\langle x,y \rangle$ with the set $\{\{x \},\{x,y\}\}$ whereas Wiener identified it with the set $\{\{x,\emptyset\},\{y\}\}$.      Without having to put in all of the obnoxious `\`'s to escape the curly braces. Is there an easy (and, hopefully, versatile) fix to this? I want something that will let me auto-escape the curly braces when I know I'm going to be using a lot of set-theoretic notation in the next few lines (or current environment).


title: How to create this multi-column and multi-row table?

text: How to create this table in latex.               Name    A   B   C         D    Name A   B    C      D               A   0   997 4.167   0.613   B   0   783 1.636   0.150         0.04    1164    4.139   0.676       0.04    959 1.710   0.168         0.08    1332    4.111   0.744       0.08    1135    1.783   0.187         0.12    1499    4.083   0.817       0.12    1311    1.857   0.208         0.16    1666    4.055   0.895       0.16    1487    1.930   0.231         0.2 1834    4.028   0.980       0.2 1662    2.003   0.256     C   0   997 4.167   0.613   D   0   783 1.636   0.150         0.04    1153    4.138   0.660       0.04    948 1.708   0.167         0.08    1310    4.108   0.710       0.08    1113    1.780   0.184         0.12    1466    4.079   0.763       0.12    1278    1.852   0.204         0.16    1623    4.050   0.818       0.16    1443    1.924   0.224         0.2 1779    4.020   0.877       0.2 1608    1.996   0.247     E   0   997 4.167   0.613   F   0   783 1.636   0.150         0.04    1210    4.136   0.688       0.04    1004    1.706   0.169         0.08    1423    4.104   0.769       0.08    1226    1.776   0.189         0.12    1636    4.073   0.857       0.12    1447    1.846   0.211         0.16    1849    4.042   0.953       0.16    1669    1.916   0.235         0.2 2062    4.011   1.059       0.2 1890    1.986   0.262


title: How only one x tick label could be changed in pfgplots?

text: I'd like to have this x axis using `pgfplots`: ![enter image description here](http://i.stack.imgur.com/oGj0C.jpg), where only number 4 has `+` as tick label. I could easily make all numbers have `+` tick label by adding `xticklabel=\pgfmathprintnumber{\tick}\,+,`               \documentclass[12pt,tikz]{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \begin{document}     \begin{tikzpicture}     %If you do not like this style just delete it.     %But you will need to add to \addplot[color] this "line width=2pt, rounded corners" to change line width and add rounded corners.     \tikzset{ every path/.style={line width=2pt, rounded corners}}     \begin{axis}[     title style={text width=10cm,align=center,font=\small},     width=9cm,     height=6cm,     ymin=2,     xtick={0,...,4},     xticklabel=\pgfmathprintnumber{\tick}\,+,     ]     \addplot[blue] coordinates {(0,1) (1,2) (3,4) (4,2)};     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/2bHAW.jpg) What is the way to do it?


title: Drawing the mapping of elements for sets in LaTeX

text: I am looking for a way to do something like ![in the image below](http://i.stack.imgur.com/GKEFs.png)


title: How to indent long comment continuation in the algorithmicx pseudocode

text: In the MWE, I try to add line continuation indent to the answer given in Properly indent comments with no line-numbering in algorithmicx E.g. I am trying to write the `\LineCommentCont` . I am using the `linegoal`package to set the width parameter of the `\parbox`automatically, and `\hangindent` to indent the continuation. I have two problems: 1) `\linegoal` seems to return a little less space than what is available. 2) How should I assign right `\hangindent` amount? Alternatively, you can supply an answer with a totally different approach.               \documentclass{article}     \usepackage{algorithm}% http://ctan.org/pkg/algorithms     \usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx          \usepackage{linegoal}          \makeatletter     \algnewcommand{\LineComment}[1]{\Statex \hskip\ALG@thistlm \(\triangleright\) #1}     \algnewcommand{\LineCommentCont}[1]{\Statex \hskip\ALG@thistlm \parbox[t]{\linegoal}{\hangindent=1em\hangafter=1 $\triangleright$ #1}}          \makeatother     \begin{document}     \begin{algorithm}[!ht]       \caption{My Algo.}\label{myalgo}       \begin{algorithmic}[1]         \State $\epsilon$ = 1.0; \Comment{Explore Latency Dimension}         \While {explorationTime $\leq$ timeLimit}           \State $\epsilon = \epsilon / 2$;           \State calculateIncrements($\epsilon$);           \LineComment{Explore L dimension}           \While {lQuery $\leq$ lUpperLimit}             \State Query (0, Query, bQuery, pQuery);             \If {result = WORKING}               \State mark points                \LineComment{no need to explore more. we just want to stop over here. no need to explore more. we just want to stop over here. no need to explore more. we just want to stop over here. }               \LineCommentCont{no need to explore more. we just want to stop over here. no  to explore more. we just want to stop over here. no need to explore more. we just want to stop over here. }               \State Break             \Else               \If {result = NOT WORKING}                 \State mark from 0 to lQuery as NOT WORKING.               \EndIf             \EndIf             \State lQuery += lEpsIncr;           \EndWhile         \EndWhile         \State calcPoints()       \end{algorithmic}     \end{algorithm}     \end{document}      ![Comment line continuation in algorithmicx](http://i.stack.imgur.com/AP13A.png)


title: How to have hyperref correctly refer to phantom sections without clearing a double page

text: When using starred sections in a double page layout, in order to get the table of contents refer to the correct place, it is usually advised to use the method               \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Introduction}     \chapter*{Introduction}      Yet this creates a blank page if the page is not odd numbered. In my case, I want to have two starred sections side by side and correctly referenced by the TOC and hyperref. Is there an easy way to achieve this ? Edit : Sorry for the lack of precisions. I am working with the book class, and here is an example of this problem:               \documentclass{book}     \usepackage{hyperref}     \begin{document}     \tableofcontents     \clearpage     \phantomsection     \addcontentsline{toc}{chapter}{Left Side}     \chapter*{Left side}     \end{document}      The link to Left Side refers to the wrong page, clearing two pages instead does the trick but that's what I am trying to avoid.


title: Macro evaluating number of arguments without limitation

text: Is it possible to have a macro like this one:               \documentclass{article}     \usepackage{xparse}     \pagestyle{empty}     \ExplSyntaxOn     \NewDocumentCommand{\HowManyArguments}{ oooooooo }         {             \IfNoValueTF {#1} { 0 }{                 \IfNoValueTF {#2} { 1 }{                     \IfNoValueTF {#3}  { 2 }{                          \IfNoValueTF {#4}  { 3 }{                               \IfNoValueTF {#5}  { 4 }{                                    \IfNoValueTF {#6}  { 5 }{                                         \IfNoValueTF {#7}  { 6 }{                                              \IfNoValueTF {#8}  { 7 }{ So many }                                         }                                    }                               }                          }                     }                 }             }         }     \ExplSyntaxOff     \begin{document}          The amount of arguments in this macro is \HowManyArguments[Cake][Chair][Stool][Bicycle] .          \end{document}      Except one that doesn't have limitations, a bit like the `\powertower` thread, where the result is embedded in the rest every time: How do I typeset a tenfold powering (a tower-of-powers) with LaTeX? The idea is then to use the first argument of the macro to define the number of arguments. The reason why I need the "powertower" approach is because of part 2: I want to rotate between colours based on the number of the argument. Try compiling this:               \documentclass{article}     \usepackage{xparse}     \usepackage{xcolor}     \pagestyle{empty}     \ExplSyntaxOn     \NewDocumentCommand{\HowManyArguments}{ oooooooo }         {             \IfNoValueTF {#1} {}{                 \IfNoValueTF {#2} {\textcolor{blue}{#1(}...\textcolor{blue}{)}}{                     \IfNoValueTF {#3}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}...\textcolor{green}{)}\textcolor{blue}{)}}{                          \IfNoValueTF {#4}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}...\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}{                               \IfNoValueTF {#5}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}\textcolor{blue}{#4(}...\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}{                                    \IfNoValueTF {#6}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}\textcolor{blue}{#4(}\textcolor{green}{#5(}...\textcolor{green}{)}\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}{                                         \IfNoValueTF {#7}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}\textcolor{blue}{#4(}\textcolor{green}{#5(}\textcolor{red}{#6(}...\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}{                                              \IfNoValueTF {#8}  {\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}\textcolor{blue}{#4(}\textcolor{green}{#5(}\textcolor{red}{#6(}\textcolor{blue}{#7(}...\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}{\textcolor{blue}{#1(}\textcolor{green}{#2(}\textcolor{red}{#3(}\textcolor{blue}{#4(}\textcolor{green}{#5(}\textcolor{red}{#6(}\textcolor{blue}{#7(}\textcolor{green}{#8(}...\textcolor{green}{)}\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}\textcolor{red}{)}\textcolor{green}{)}\textcolor{blue}{)}}                                         }                                    }                               }                          }                     }                 }             }         }     \ExplSyntaxOff     \begin{document}          Try this one instead: \HowManyArguments[Mandatory][Argument][What][Have][You][Done]          \end{document}      This is the full idea of what I'm trying to build, but without limitations.


title: How to avoid superfluous punctuation for shorthand in bibliography?

text: I would like to have the shorthand printed in the bibliography in square brackets _before_ the bibliography item. I adapted this answer by lockstep which works with one problem: if there is no author, there is a superfluous dot. This comes obviously from the `\labelnamepunct` which is set by the `\setunit` command of the bibliography drivers. Is there an easy way to avoid the output of the `\labelnamepunct`? Here is an example that illustrates the problem (KpV is correct, CTAN has the superfluous punctuation):               \listfiles     \documentclass[ngerman]{scrartcl}     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @InBook{kant:kpv,       shorthand   = {KpV},       hyphenation     = {german},       author      = {Kant, Immanuel},       bookauthor      = {Kant, Immanuel},       title       = {Kritik der praktischen Vernunft},       shorttitle      = {Kritik der praktischen Vernunft},       booktitle   = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},       maintitle   = {Kants Werke. Akademie Textausgabe},       volume      = {5},       publisher   = {Walter de Gruyter},       location    = {Berlin},       date        = {1968},       pages       = {1--163}     }     @Online{ctan,       shorthand       = {CTAN},       hyphenation     = {american},       title       = {CTAN},       subtitle    = {The Comprehensive TeX Archive Network},       date        = {2006},       url         = {http://www.ctan.org},       urldate     = {2006-10-01}     }     \end{filecontents}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{babel,csquotes}          \usepackage[       style=authortitle,       backend=biber     ]{biblatex}     \addbibresource{\jobname.bib}          \renewbibmacro*{begentry}{%       \iffieldundef{shorthand}         {}         {\printtext[brackets]{\usebibmacro{cite}}%          \addspace}}          \begin{document}     \nocite{*}          \printbibliography     \end{document}      And here is what I get: ![enter image description here](http://i.stack.imgur.com/UQevO.png)


title: How do I encircle a partial table in tikz?

text: I am trying to create a diagram that looks roughly like this picture: ![table version](http://i.stack.imgur.com/VLZdK.png) Except that I want it to have rounded corners. It seems that the obvious way to do this would be to use tikz, so I have made an attempt at this:               \documentclass{standalone}     \usepackage{tikz}     \usepackage{braket}     \usetikzlibrary{matrix,fit}          \begin{document}     \newcommand{\objboxthreer}[7]{       \begin{tikzpicture}         \matrix (m) [nodes={inner sep=2pt},matrix of nodes, nodes in empty cells,ampersand replacement=\&, row sep=0pt, column sep=0pt]         {           {#1} \& \& {#2} \& {#4} \& {#6} \& \\                \& \& {#3} \& {#5} \& {#7} \& \\         };         \node [           draw,           rounded corners=.5em,           inner sep=0pt,           outer sep=0pt,           minimum size=0pt,           fit=(m-1-2.north east)               (m-1-2.south east)               (m-1-3.north east)               (m-1-3.south east)               (m-1-4.north east)               (m-1-4.south east)               (m-1-5.north east)               (m-1-5.south east)               (m-1-6.north west)               (m-1-6.south west)] {};         %\draw [rounded corners=.5em] (m-1-2.south east) rectangle (m-3-6.north west);         \draw (m-1-3.north east) -- (m-1-3.south east);         \draw (m-1-4.north east) -- (m-1-4.south east);       \end{tikzpicture}     }     \objboxthreer{d}{$p_s$}{$Y_d$}{$p_d$}{$Y_d'$}{$\{p\}$}{$\Set{ x \in X | x > 5}$}          \end{document}      Which produces the rather unsatisfactory result: ![tikz version](http://i.stack.imgur.com/a343R.png) The vertical lines don't reach the top or the bottom of the enclosing box. The challenge is that the contents of all of the cells of this table are very dynamic in size. Both the height and the width of each element may change significantly (complex formulas, etc), so I cannot simply specify the height and width of each row and column. How can I emulate the first table but with rounded corners? Here is an additional testcase that has taller elements: \documentclass{standalone} \usepackage{tikz} \usepackage{braket} \usetikzlibrary{matrix,fit}               \begin{document}     \newcommand{\objboxthreer}[7]{       \begin{tikzpicture}         \matrix (m) [nodes={inner sep=2pt},matrix of nodes, nodes in empty cells,ampersand replacement=\&, row sep=0pt, column sep=0pt]         {           {#1} \& \& {#2} \& {#4} \& {#6} \& \\                \& \& {#3} \& {#5} \& {#7} \& \\         };         \node [           draw,           rounded corners=.5em,           inner sep=0pt,           outer sep=0pt,           minimum size=0pt,           fit=(m-1-2.north east)               (m-1-2.south east)               (m-1-3.north east)               (m-1-3.south east)               (m-1-4.north east)               (m-1-4.south east)               (m-1-5.north east)               (m-1-5.south east)               (m-1-6.north west)               (m-1-6.south west)] {};         %\draw [rounded corners=.5em] (m-1-2.south east) rectangle (m-3-6.north west);         \draw (m-1-3.north east) -- (m-1-3.south east);         \draw (m-1-4.north east) -- (m-1-4.south east);       \end{tikzpicture}     }     \objboxthreer{d}{$p_s$}{$Y_d$}{$\left\{\frac{p}{q}\right\}$}{$Y_d'$}{$\{p\}$}{$\Set{ x \in X | x > 5}$}          \end{document}      The output of this has similar problems but cannot be solved by using `\strut`: ![enter image description here](http://i.stack.imgur.com/3RuFm.png)


title: Who is willing to help me go step by step to create an image using LaTex?

text: I have not being able to create an images. Can you direct me step by step?


title: Increasing number of ports in circuitikz gate

text: Is it possible to add two ports to the gates (nand, and, or, not) in circuitikz on the top and bottom for reference voltages in a similar fashion to how they exist for the op amp?


title: How to put footnotes in the page where they belong in a mdframed environment

text: I have a large bunch of text in a `mdframed` environment, that span more than one page. As it seems reading the documentation, the mdframed environment put every footnotes at the end of the frame, by design. Is there a way to put each footnotes at the bottom of the page where it belongs, remaining inside the frame? I know it should be possible, using maybe the `\footnotemark` and `\footnotetext` commands, but the `mdframed` internals are too complicated for me... Here a code sample that shows the default behaviour:               \documentclass[]{report}     \usepackage{lipsum}     \usepackage{mdframed}          \begin{document}          \begin{mdframed}              \lipsum[1]         \lipsum[2]\footnote{can I appear in the first page inside the box?}         \lipsum[1]         \lipsum[1]         \lipsum[3]          \end{mdframed}          \end{document}


title: TikZ: drawing a cart on the top of a loop

text: I am trying to draw a cart on top of a loop. I have a system where a cart rolls down an incline and encounters a loop. I then want to look at cart when it reaches the apex of the loop. The problem I am having is how to draw it's wheels touching the loop so that they are tangent to the loop. Here is an image of the bigger picture. ![enter image description here](http://i.stack.imgur.com/zjorG.png) Now here is what I have so far for the just the interaction of the cart and the top of the loop.               \documentclass[tikz]{standalone}     \usetikzlibrary{intersections}          \begin{document}     \begin{tikzpicture}       \draw[name path = circ] (0, 0) circle[radius = 0.05];            \path[name path = line] (-0.1, .04) -- +(0.2, 0);       \path[name intersections = {of = circ and line}];            \coordinate (P1) at (intersection-1);       \coordinate (P1) at (intersection-2);     \end{tikzpicture}     \end{document}      I put in a path that intersects the loop and labelled the points. I did this as the line where the cart wheels should be tangent to the loop. Therefore, if everything is based on these points, we can adjust the path for desired distance from the top that will give the image the best look.


title: Equation alignment

text: I'm a little new at this so bear with me. What I intend to get is this: ![enter image description here](http://i.stack.imgur.com/7U1F9.png) I used the following code to obtain it:               \begin{flalign*}     \quad f(x) &= e^{x} - x - 1     \medspace\medspace\rightarrow\medspace\medspace     f(0) = e^{0} - 0 - 1 = 0 &\\     \quad f'(x) &= e^{x} - 1     \qquad\medspace\rightarrow\medspace     f'(0) = e^{0} - 1 = 0 &\\     \quad f''(x) &= e^{x}     \qquad\qquad\rightarrow     f''(0) = e^{0} = 1 \neq 0 &     \end{flalign*}      I guess there must be an easier way to implement this? I don't want the equations to be stretched across the whole page with a lot of space in between the individual components. When I try using `&\rightarrow` and `&=`, that's how I end up.   * Should I be using alignat instead?   * But then how would I get it flushed to the left?


title: TikZ, multicolumn, and vertical spacing

text: My question is related to the vertical spacing of the objects in the page. I think that in my case TikZ can influence it. Here the MWE:               \documentclass[12pt,letterpaper]{book}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{multicol}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}          \textheight= 21cm     \textwidth= 14cm     \topmargin=-1cm     \parindent=0cm     \oddsidemargin=1.26cm     \evensidemargin=1.26cm          \begin{document}     \paragraph*{Nice paragraph}          This is some text in the par          \begin{figure}[h]     \centering         \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw[<->] (-1,0)--(30,0);         \draw[<->] (0,-1)--(0,6);         \draw[samples=100,domain=0:30,line cap=round,line join=round] plot(\x,{sqrt(\x)});         \end{tikzpicture}     \caption{}\label{fig:funcionRaizCuadradada}          \end{figure}          \begin{multicols}{2}     \begin{small}     \begin{itemize}     \centering     \item[] text una unidad hacia la izquierda, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw (0,4) node[above]{\small $y=f(x+1)=\sqrt{x+1}$};         \draw[<->] (-3,0)--(5,0);         \draw[<->] (0,-1)--(0,4);         \draw[domain=-1:4.7] plot(\x,{sqrt(\x+1)});         \end{tikzpicture}          \item[] More Text tres unidades hacia arriba, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw (0,6) node[above]{\small $y=f(x)+3=\sqrt{x}+3$};         \draw[<->] (-1,0)--(5,0);         \draw[<->] (0,-1)--(0,5);         \draw[domain=0:4] plot(\x,{sqrt(\x)+3});         \end{tikzpicture}          \item[] Some text de $y=\sqrt{x}$, con respecto al eje $y$, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw (0,3) node[above] {\small $y=\sqrt{-x}$};         \draw[<->] (-5,0)--(1,0);         \draw[<->] (0,-1)--(0,2);         \draw[samples=100,domain=-5:0] plot(\x,{sqrt(-\x)});         \end{tikzpicture}          \columnbreak     \item[] Translation dos unidades hacia la derecha, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw (0,4) node[above]{\small $y=f(x-2)=\sqrt{x-2}$};         \draw[<->] (-1,0)--(5,0);         \draw[<->] (0,-1)--(0,3);         \draw[samples=100,domain=2:5] plot(\x,{sqrt(\x-2)});         \end{tikzpicture}          \item[] Reflection de $y=\sqrt{x}$, con respecto al eje $x$, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw[<->] (-1,0)--(5,0);         \draw[<->] (0,-3)--(0,1);         \draw[samples=100,domain=0:5] plot(\x,{-sqrt(\x)});         \draw (0,1) node[above] {\small $y=-\sqrt{x}$};         \end{tikzpicture}          \item[] Reflection de $y=\sqrt{x+1}$, con respecto al eje $x$, esto es,              \begin{tikzpicture}[>=stealth,x=5mm,y=5mm]         \draw[<->] (-5,0)--(1,0);         \draw[<->] (0,-1)--(0,3);         \draw[samples=100,domain=-5.7:-1] plot(\x,{sqrt(-\x-1)});         \draw (0,4) node[above]{\small $y=\sqrt{-x-1}$};         \end{tikzpicture}     \end{itemize}     \end{small}     \end{multicols}          \newpage     \paragraph*{Bad paragraph}          There exist som text to put here\enlargethispage*{20cm}          \begin{figure}[h]     \centering         \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \clip (-6,-6) rectangle (6,6);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{1/\x});         \end{tikzpicture}     \caption{}\label{fig:funcionRacional}     \end{figure}          \begin{multicols}{2}     \begin{small}     \begin{itemize}     \centering     \item[] Traslation una unidad hacia la izquierda, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above]{\small $y=f(x+1)=\dfrac{1}{x+1}$};         \clip (-5,-5) rectangle (5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{1/(\x+1)});         \draw[dotted] (-1,-5)--(-1,5);         \end{tikzpicture}          \item[] Traslation $\frac{3}{2}$ hacia arriba, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above]{\small $y=f(x)+\dfrac{3}{2}=\dfrac{1}{x}+\dfrac{3}{2}$};         \clip (-5,-5) rectangle (5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{(1/\x)+1.5});         \draw[dotted] (-5,1.5)--(5,1.5);         \end{tikzpicture}          \item[] Reflection de $y=\frac{1}{x}$, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above]{\small $y=-\dfrac{1}{x}$};         \clip (-5,-5) rectangle (5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{-(1/\x)});         \end{tikzpicture}          \columnbreak         \item[] Traslation una unidad hacia la derecha, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above] {\small $y=\dfrac{1}{x-1}$};         \clip (-5,-5)rectangle(5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{1/((\x)-1)});         \draw[dotted] (1,-5)--(1,5);         \end{tikzpicture}          \item[] Traslation $\frac{3}{2}$ hacia abajo, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above]{\small $y=f(x)-\dfrac{3}{2}=\dfrac{1}{x}-\dfrac{3}{2}$};         \clip (-5,-5)rectangle(5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{(1/(\x))-1.5});         \draw[dotted] (-5,-1.5)--(5,-1.5);         \end{tikzpicture}          \item[] Traslation horizontal y vertical, elongation de $y=\frac{1}{x}$, esto es,              \begin{tikzpicture}[>=stealth,x=3mm,y=3mm]         \draw (0,5) node[above]{\small $y=f(x)-\dfrac{3}{2}=\dfrac{1}{x}-\dfrac{3}{2}$};         \clip (-5,-5)rectangle(5,5);         \draw[<->] (-5,0)--(5,0);         \draw[<->] (0,-5)--(0,5);         \draw[samples=100] plot(\x,{(3/((\x)-2))+1});         \draw[dotted] (1,-5)--(1,5);         \end{tikzpicture}     \end{itemize}     \end{small}     \end{multicols}\pagebreak     \end{document}      The first page looks like this: ![enter image description here](http://i.stack.imgur.com/cA6vL.jpg) It is that I want. But the next pages looks like: ![enter image description here](http://i.stack.imgur.com/4mHtd.jpg) it is an unpleasant result. That I want is two columns each of them with three images in the same page of the Figure 2. In order to do this I have tried `\enlargethispage*` but it don't works, as you can see there is a lot of wasted vertical space. The only difference between the first page and the next, is that in the second one I use `\clip` command in the plots. I suspect that this causes the vertical space can not be stretched. How can I do it better?


title: where to put .sty and .cls file for project

text: I want to use my own .sty and .cls file in a project. I know of the following two possibilities of placing them:   * in my local tex tree (or the general tex tree, which is worse)   * in the same directory as the .tex file Both of these I find unsatisfactory for the following reasons: The local tex tree is unsatisfactory since the .sty file is specific for the project, so I want it to be close to the project, so I easily remember where it is etc. Also, I am using dropbox to synchronize the project files between different computers automatically, so the .sty file should be in the dropbox folder. The 'same directory' is unsatisfactory since the project is in a directory with many subdirectories. The .tex files in all these subdirectories should be able to access the same .sty file. What I would like to do is: create a subdirectory 'style files' in the project directory, where I put style and class files (there are several for the project), then tell tex somehow where to find them. How can I do this? I am using a recent TexLive on Mac OS X.6 I know there have been questions about placement of .sty files, but I did not find an answer to this question.


title: How to align two entries of a list that appears in the center of the page?

text: Using the Beamer Presentation template I am creating slides, my aim is to make a list environment with the bullet points aligned in the center of the page. How can I do so? Thanks


title: How can I center this formula?

text: Here is my code:               \documentclass[12pt,a4paper]{book}      \usepackage[T1]{fontenc}     \usepackage[chapter]{algorithm}     \renewcommand{\baselinestretch}{1.5}      \begin{document}     \begin{spacing}{1.2}     \tableofcontents     \backmatter      {\listoffigures  \listoftables \listofalgorithms} \end{spacing}     \include{Chapter1}     \include{Chapter2}     \end{document}      In chapter 1, I have:               \textbf{     \center{     \[      %\frac{ax^2+bx+c}{\sin^2y+\cos^2z} \qquad      \text{F-mesure}=\frac{\text{2 * (Précision * Rappel)}}{\text{(Précision + Rappel)}}     \]     }}      The result is here: http://imgur.com/AK2A0C5 How can I center this formula? (i'd like it exactly in the middle)


title: Using tikz: two boxes, two parallel linking edges

text: I'd like to have two boxes with text inside them atop one another with some vertical space, and with two parallel vertical edges linking them. With just one such linking edge, tikz makes it easy: `\draw (node1) -- (node2);` (where node1 and node2 specify the two boxes with text). There's got to be a bit of separation between them; however, I've tried using things like `(node1) +(5pt,0) -- (node2) +(5pt,0)` and frankly it isn't working. I've tried scoping with shift={(5pt,0),transform shape} and the shift was ignored. So, how should I do this? (FYI: there's addtional options on the edges specifying labels and arrows, but I don't believe that they're relevant to this). Example of single link:               \documentclass[12pt]{article}     \usepackage{tikz}     \begin{document}       \begin{tikzpicture}[yscale=-1]         \node at (0,0) (node1) [shape=rectangle,fill=green] {box1};         \node at (0,1) (node2) [shape=rectangle,fill=green] {box2};         \draw (node1) -- (node2);       \end{tikzpicture}     \end{document}      An ascii version...               .  +----+     .  |box1|     .  +----+     .   |  |     . 1 v  ^ 3     .   |  |     .  +----+     .  |box2|     .  +----+      (pls ignore the "."s, I needed them to get the code entry to work) Thank you for your solutions! I'll definitely be trying them out.


title: How to specify a source directory for images and chapter files?

text: I am doing a Thesis report in a modular fashion which includes a lot of different pictures and several chapters. I figured out how to specify a source directory for all my images               \usepackage{graphicx}     \graphicspath{{./ImageDatabase/}}      My current dilemma is, how to the same for tex files?


title: How to use arara with TeXShop

text: I try to use `arara` with TeXShop on my Mac, but I don't understand some steps either javascript, probably because of my english & my programer level. I create first the arara.engine in the /Engines folder :               #!/bin/bash     export PATH=/usr/texbin:/usr/local/bin:${PATH}      arara "$1"      I use Tex Live Utility, & the package `arara` exists. OK. I install the `arara-3.0-installer.jar` with the cross-platform installer. Ok. I put all files from sources in my computer. Ok. But I don't agree the step with Apache Maven, it just seemed too complicated… & isn't it to program complicated things ? :( So ! I choose the compilation mode `arara` & I just put in preamble :               % arara: xelatex     % arara: makeglossaries     % arara: xelatex -shell-escape     % arara: xelatex      & nothing. What I missed ? Thanks


title: Odd interaction of secnumdepth and section-based counters

text: In the following MWE:               \documentclass{book}     \newcounter{exnum}[subsection]     \begin{document}     \chapter*{Chapter}       \section*{Section 1}         \subsection{Subsection A}           \setcounter{exnum}{1}           Exnum is \theexnum.         \subsection{Subsection B}           Exnum is \theexnum.     \end{document}      I get the output I expected; namely, the line printed in Subsection A is `Exnum is 1` and in Subsection B is `Exnum is 0`. However, in the actual code, I didn't want subsection numbers printed, so I changed both occurrences of `\subsection` to `\subsection*`. The output then consisted of `Exnum is 1` in both subsections. As a workaround, starting from the code above, I instead added the line `\setcounter{secnumdepth}{1}` at the top, just after the documentclass, to prevent printing the subsection numbers, but left the `\subsection`s unstarred. Again the output was `Exnum is 1` in both subsections. What is going on here? Are these two manifestations of the same failure, or are they different problems? And, what don't I understand about what secnumdepth does? I thought it simply prevented printing of section numbers, but clearly it does much more than that.


title: \RequirePackage without option clashes because of the package loading order?

text: I am writing a package which requires the `xcolor` package with `table` option. It is loaded in the package with               \PassOptionsToPackage{table}{xcolor}     \RequirePackage{xcolor}      which works if my package is loaded after the user loaded `xcolor` itself. However if my package is loaded before the user loads `xcolor`, the user gets an option clash. I can not load `xcolor` at the beginning of the document. In that case more or less the whole package can only be loaded at the beginning of the document. How can/should this be solved?


title: Displaying two XML listings side by side.

text: I have two XML outputs from a program that I would like to include in a LaTeX document. I would like them to appear side-by-side each in its own box. So that a reader can compare the two outputs while reading the document. Can't seem to find a way to do this, without making images for each output and adding both as images/graphics. Could there be a better option?


title: Including HTML code side by side in Latex

text: I want to write HTML codes of two pages side by side in LaTeX like as follows:               <html>   <html>     <head>   <head>     </head>  </head>     <body>   <body>      ...      ...     </body>  </body>     </html>  </html>      I know how to include HTML code in LaTeX but I have no clue how will I achieve it. So if anyone please help me regarding this I will be grateful. Thank you. **EDIT:** I have tried it with the help of table as shown below, but it is giving errors.               \begin{table}[htb]     \parbox{.45\linewidth}{      \centering      \begin{tabular}{c}           \begin{lstlisting}[language=html]      <html>      <head>      </head>      <body>       ...      </body>     </html>      \end{lstlisting}     \end{tabular}        }     \hfill     \parbox{.45\linewidth}{     \centering     \begin{tabular}{c}          \begin{lstlisting}[language=html]     <html>     <head>     </head>     <body>     ...     </body>     </html>     \end{lstlisting}     \end{tabular}        }     \end{table}


title: Showing two listings in a table side-by-side

text: I wonder is there any possibility to show two different listings in one table side by side? Here is my code that only show one listening but how can I embed it in a table and another one? **EDIT: Even I have tried the mentioned links on below, I get a few errors while compiling the file. I also post my edited LaTeX code.**                   \documentclass[english,a4paper,12pt]{report}     \usepackage{mathpazo}     \usepackage{graphicx}     \renewcommand{\sfdefault}{lmss}     \usepackage{courier}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{listings}          \begin{document}     \begin{tabular}{|l|l|}          \begin{minipage}{.48\textwidth}     \begin{lstlisting}[     basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,     language={[AspectJ]Java},     numbersep=8pt,     numbers=left,     xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords ={class,run}     ]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }          class X ext ProxifiedObject {         PrintHelloThread thread              void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}     \end{minipage}          &          \begin{minipage}{.48\textwidth}     \begin{lstlisting}[     basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,     language={[AspectJ]Java},     numbersep=8pt,     numbers=left,     xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords ={class,run}     ]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }          class X ext ProxifiedObject {         PrintHelloThread thread              void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}     \end{minipage}     \\          \end{tabular}     \end{document}      What I would like to show is : ![enter image description here](http://i.stack.imgur.com/ypLGW.gif)


title: Latex: adding text inform of a graphic

text: > **Possible Duplicate:**   >  Displaying two XML listings side by side. I have two xml outputs from a program that I would like to include in a latex document. I would like them to appear side-by-side each in its own box. So that a reader can compare the two outputs while reading the document. Cant seem to find a way to do this, without making images for each outout and adding both as images/graphics. Could there be a better option?


title: How can this table be created in LaTeX

text: I'm new to LaTeX, and just want to ask how the following table may be created using LaTeX: ![enter image description here](http://i.stack.imgur.com/1FOqJ.png)


title: How can the following table be created in LaTeX

text: I have asked this question here, and asking it once again, as it was marked as `duplicate`, although it is _different_ from the links that were pointed to be the same as the question. So, how can I create a table that looks like the following using LaTex? ![enter image description here](http://i.stack.imgur.com/b9KuZ.png) Thanks.


title: Inserting text automatically with macros in Kile

text: In WinEdt you can insert text automatically with internal programmable macros. You can do this in Kile or other frontend editor? Can be direct in file.tex via shell or bash on Ubuntu. I need insert:               \documentclass[a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[brazil]{babel}     \usepackage{amssymb,amsfonts,indentfirst}     \usepackage[centertags]{amsmath}     \usepackage[normalem]{ulem}     \usepackage{enumerate,multicol,subfig}     \usepackage{tikz}       \usetikzlibrary{calc,positioning}     \everymath{\displaystyle}     \graphicspath{{figuras/}}          \begin{document}          \end{document}


title: Left-aligning equations

text: How do I left-align selective equation blocks, i.e. not centered ? I know how to do it for ALL equation blocks in the document setting               \usepackage[fleqn]{amsmath}     \setlength{\mathindent}{0pt}      in the preamble, but I only want to do this for some equation blocks.               \documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}     \usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}     \usepackage{babel}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[dvipsnames,table]{xcolor}     \usepackage{color}     \definecolor{vanillegeel}{RGB}{255,240,216}     \usepackage{empheq}          \begin{document}          De raaklijn aan $(x_{0},f(x_{0}))$ wordt algemeen bepaald met :     \begin{empheq}[box={\fboxsep=3pt\colorbox{vanillegeel}}]{align*}     \textnormal{$\begin{cases}z=f(x)\text{ is continu in }x_{0}\text{.}\\     f'(x_{0})=0\text{ : }z=f(x_{0})\text{ is de horizontale raaklijn.}\\     \lim_{x\to x_{0}} f'(x)=\pm\infty\text{ : }x=x_{0}\text{ is de verticale raaklijn.}\\     f'(x_{0})\in\mathbb{R}_{0}\text{ : }z-f(x_{0})=f'(x_{0})\cdot(x-x_{0})\text{ is de raaklijn.\hspace{-12pt}}\end{cases}$}\end{empheq}          \end{document}


title: Loading babel with the 'hungarian' (magyar) option breaks 'pygments' code highlighting

text: Given the following `TeX` file everything works as expected: the (Hungarian) text `Árvíztűrő Tükörfúrógép` typesetted as expected and the code snippet also formatted brilliantly.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{verbments}     \begin{document}     \section{Text}     Árvíztűrő Tükörfúrógép.          \section{Java}     \begin{pyglist}[language=java]     public static void main(String[] args) {       int sum = 0;       for (int i = 0; i < 0; i++)         sum += i;       System.out.format("Sum: %s.\n", sum);     }     \end{pyglist}     \end{document}      However if I specify that I want to use the Hungarian `babel` package with `\usepackage[magyar]{babel}`, I receive some cryptic errors (possibly related to the code generated by `Pygments`). (The log file containing the actual error message can be found here.) I use `verbments` in this sample, but the same thing applies to `minted`. Edit.: I forgot to mention, that loading _any_ `babel` package (like English, German, etc.) does _not_ results in errors. Second edit.: I forgot to phrase a question, so here I go: _what could be the problem,_ and _what could be the solution?_ I'm utterly confused.


title: Occasional counter too large error despite \MakePerPage

text: I am using the bigfoot package to generate two styles of footnotes, which I signal using either the normal `\footnote` or my new `\footnoteB`. FootnoteB uses alphabetical numbering but the count is reset each page (`\MakePerPage`); nowhere do I have even close to 26 of them on a single page. Here's what I've got in the preamble:               \usepackage{bigfoot}     \DeclareNewFootnote[para]{B}[alph]     \DeclareNewFootnote{default}          \usepackage{perpage}     \MakePerPage{footnoteB}     \renewcommand{\thefootnoteB}{\emph{\alph{footnoteB}}}      Most of the time it works fine. However, every so often when I'm compiling it will hit a footnoteB (not necessarily the same one every time) and come up with the 'counter too large' error, which shouldn't be possible for the reasons above. Sometimes I've been able to fix this by removing and then adding back in the perpage package, but the compiling seems a bit stuck this time around (after deleting aux files and trying again, etc.). Why is it having this issue (of _sometimes_ trying to number continuously) despite the `\MakePerPage` in the preamble, and how can I get it back on track?


title: Temporarily disable superscript in citation

text: I use superscripted citation style by using `\setcitestyle{super}` in LaTeX preamble, which done the job as I wanted. However, there are several region, in which I need to temporarily disable the superscript. For example the sentence > This figure is reproduced from reference [1] doesn't look right with [1] being superscripted. How to achieve that? Any idea? Thanks.


title: Is there a robust \renewcommand replacement?

text: Replacing `\newcommand` by `\DeclareRobustCommand` makes a new command robust. But what about `\renewcommand`? Is there a command to robustly renew a command? It would be possible to first use `\renewcommand` and then use `\MakeRobustCommand` of the makerobust package, but isn't there a "one- command-way"? (And does that one provide a starred form, same as `\DeclareRobustCommand*`?)


title: How to use apa6 man and have justified paragraphs

text: I want to be able to use the `apa6.cls` class `man` but paragraphs are flushed to the left, and I want it to be justified.


title: Is it possible to hide chapter numbering for non-chapter headers and TOC listings

text: I'm writing an edited collection of essays using a Scrivener-MMD-latex workflow (using the memoir class) and would like to hide chapter numbering for all items that aren't actually chapters. Here's a visual of what I'm trying to eliminate So, in the TOC I'd like to hide the numbering marked in red ![screenshot1](http://i.stack.imgur.com/A05C6.png) Similarly, in the text, I'd like to omit numbering as marked: ![enter image description here](http://i.stack.imgur.com/DHozT.png) I'm already using:               \setcounter{tocdepth}{1}     \setcounter{secnumdepth}{1}      to hide subsections and below from the TOC, but am wondering if there is a similarly simple way to do this within my header using the memoir class?