title: FR: Staplers corner

text: I like twocolumn documents, but sometimes people complain that stapeling pages together made it hard to read the top left text of the left column on all pages after the first page. OK, I could have a broader margin on the left, but what about something more fancy? I'd like to have a "staplers corner" starting on page 2. It should look like this: ![staplers corner](http://i.stack.imgur.com/vApvv.png) Basically, it's just a quarter of a circle every new page left blank, a kind of parshape. If possible, I'd appreciate a solution without tikz, pstricks or fp, because documents with these packages take such a long time to compile. Below I put the tex file and you can see how I arranged the "staplers corner", but this is a horrible kind of solution.               \documentclass[twocolumn, DIV=calc, parskip=half]{scrartcl}     \usepackage{blindtext, microtype}          \begin{document}     \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          %\blindtext{}     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam     lobortis facilisis sem. Nullam nec mi et neque pharetra     sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper, felis     non sodales commodo, lectus velit ultrices augue, a dignissim nibh     lectus placerat pede. Vivamus nunc nunc, molestie ut, ultricies vel,     semper in, velit. Ut porttitor.  Praesent in sapien. Lorem ipsum dolor     sit amet, consectetuer adipiscing elit. Duis fringilla tristique     neque. Sed interdum libero ut metus. Pellentesque placerat. Nam rutrum     augue a leo. Morbi sed elit sit amet ante lobortis     sollicitudin. Praesent blandit blandit mauris. Praesent lectus tellus,     aliquet aliquam, luctus a, egestas a, turpis. Mauris lacinia lorem sit     amet ipsum. Nunc quis urna dictum turpis accumsan semper. Lorem ipsum     dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis     sem. Nullam nec mi et neque pharetra sollicitudin.  Praesent imperdiet     mi nec ante. Donec ullamcorper, felis non sodales commodo, lectus     velit ultrices augue, a dignissim nibh lectus placerat pede. Vivamus     nunc nunc, molestie ut, ultricies vel, semper in,     velit. Ut\newpage{} \mbox{\hspace*{4em}} porttitor. Praesent in     sapien. Lorem ip-\mbox{\hspace*{3.8em}}sum dolor sit amet,     consectetuer adipiscing \mbox{\hspace*{3.1em}}elit. Duis fringilla     tristique neque. Sed inter-\mbox{\hspace*{2em}}dum libero ut     metus. Pellentesque placerat. Nam rutrum augue a leo. Morbi sed elit     sit amet ante lobortis sollicitudin.  Praesent blandit blandit     mauris. Praesent lectus tellus, alquet aliquam, luctus a, egestas a,     turpis. Mauris lacinia lorem sit amet ipsum. Nunc quis urna dictum     turpis accumsan semper.          \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}          \blindtext{}     \blindtext{}     \end{document}      If there is no way to have command like `\AtBeginningOfEveryNewPage{...}`, maybe the only solution were LuaTeX?


title: Turning working code into macro causes "Missing number, treated as zero --- \let"

text: Here's a minimal working example (MWE):               \documentclass{scrartcl}          \usepackage{listings}          \begin{document}          \noindent\minipage[t]{0.45\linewidth}     \lstlisting       foo     \endlstlisting     \endminipage \qquad \minipage[t]{0.45\linewidth}     \lstlisting       bar     \endlstlisting     \endminipage          \end{document}      Since I'm using this pattern a lot (code on left transforms into code on right), like a good programmer I encapsulate it in a macro:               \newcommand{\twocol}[2]{     \noindent\minipage[t]{0.45\linewidth}       #1     \endminipage \qquad \minipage[t]{0.45\linewidth}       #2     \endminipage     }      And try this in my document:               \twocol{     \lstlisting       foo     \endlstlisting     }{     \lstlisting       bar     \endlstlisting     } %% line 33, see below      At which point LaTeX is unhappy:               ! Missing number, treated as zero.     <to be read again>          \let      l.33 }      Line 33 is the closing bracket of the `twocol`. This is just a simple textual substitution (I copy-pasted the listings commands) so what's going wrong, and how do I fix it? Note: using the `\begin{} ... \end{}` forms everywhere doesn't help.


title: vertical position of sidecap figure w.r.t. top aligned caption

text: How to change the vertical position of a sidecap figure w.r.t. its top aligned caption? I want the caption to be right from the figure but align like in the attached mockup.               \documentclass{article}          \usepackage[demo]{graphicx}          \usepackage{sidecap}     \sidecaptionvpos{figure}{t}          \begin{document}          \begin{SCfigure}         \includegraphics{graphs/dataset17b.pdf}       \caption{Foo bar}     \end{SCfigure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Pn57p.png) `verbatimbox`'s `addvbuffer` fails for long captions: ![addvbuffer](http://i.stack.imgur.com/BaHx1.jpg)               \documentclass{article}     \usepackage{verbatimbox}     \usepackage[demo]{graphicx}          \usepackage{sidecap}     \sidecaptionvpos{figure}{t}          \begin{document}          \begin{SCfigure}         \includegraphics{graphs/dataset17b.pdf}         \caption{\addvbuffer[5ex 0ex]{Foo bar}}     \end{SCfigure}          \begin{SCfigure}         \includegraphics{graphs/dataset17b.pdf}         \caption{\addvbuffer[5ex 0ex]{Foo bar Foo bar Foo bar Foo bar Foo             bar Foo bar Foo bar Foo bar Foo bar}}     \end{SCfigure}          \end{document}


title: How to put subcaptions below subtables, and increase gap between subtables with 'subfigure'?

text: Using 'subfigure', how can I create subtables within a table, such that a) subcaptions are underneath each subtable, and b) there's a reasonable horizontal gap between the subtables? So far I've only be able to get the subcaptions on top, and no reasonable gap, e.g. with following code:               \documentclass{article}     \usepackage{subfigure}     \begin{document}     \begin{table}     \centering     \subtable[caption1]     {\begin{tabular}{c c c}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \subtable[caption2]     {\begin{tabular}{c c c}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \caption{caption for whole table}     \end{table}     \end{document}


title: Using thmtools: numbering with asterisk

text: I would like to repeat a theorem number with an added asterisk. That is, the original theorem is: **Theorem 1.** Lorem ipsum... And I would like the analogue theorem to be: **Theorem 1*.** Lorem ipsum...


title: Memoir: Subbottom over several pages?

text: In the Memoir class, I use the subbottom command to create subfigures, labeled, e.g., 1(a), 1(b), 1(c) etc. And this works very nicely. However, if I include more figures in subbottoms than what can be on one page, it does not put them on the next page - that is, it does not break the figure over several pages. I tried putting in a `\ContinuedFloat` at the beginning of the figure- environment, but then it is unable to compile. I could of course just break the figure, but since the figures in the subbottoms belong together, I prefer to have them in the same figure and then labeled with consecutive letters. Is there a way to obtain subbottoms that can be split over several pages when using the Memoir class? The code could be something like shown below, where for instance the fourth subbottom is included on the same page as the three before, even though it does not fit onto this page.               \documentclass[10pt,a4paper]{memoir}          \usepackage[pdftex]{graphicx}     \newsubfloat{figure}          \begin{document}     \begin{figure}[htb!]     \centering     \subbottom[Subcaption 1.]{\includegraphics[scale=0.27]{Picture1} \label{Fig:Subfig1.}}      \subbottom[Subcaption 2.]{\includegraphics[scale=0.27]{Picture2} \label{Fig:Subfig2.}}      \subbottom[Subcaption 3.]{\includegraphics[scale=0.27]{Picture3} \label{Fig:Subfig3.}}      \subbottom[Subcaption 4.]{\includegraphics[scale=0.27]{Picture4} \label{Fig:Subfig4.}}      \end{figure}          \end{document}


title: Why do line-broken glossary entries contaminate "marginpar"s with cross-referencability?

text: The following MWE shows the effect of a line-broken glossary entry on an adjacent marginpar, as opposed to a non-line-breaking glossary entry. Why does line-brokenness contaminate the marginpar?               \documentclass[a4paper]{memoir}     \usepackage[xetex]{hyperref}     \hypersetup{colorlinks=true}     \usepackage{glossaries}     \makeglossaries     \loadglsentries{glossary}          \begin{document}          Here\marginpar{Here is a margin paragraph.} is a reference to the glossary word \glsname{tst-a}, \\\          and here\marginpar{Here is another margin paragraph.} is a reference to the glossary word \glsname{tst-b},                \glsaddall     \printglossaries          \end{document}      My glossary entries are defined as follows:               \newglossaryentry{tst-a}{%     name={a-short-glsname},     description={Definition of tst}}          \newglossaryentry{tst-b}{%     name={a-very-long-glsname-likely-to-line-break},     description={Definition of tsp}}      ![Sample result](http://i.stack.imgur.com/hwgOx.png)


title: Using amsthm but still getting "Environment theorem undefined"

text: I'm trying to write up all my university theorems and I cant get the theorem environment to work. Here is a mini example of what I'm trying to do.               \documentclass[a4paper,12pt]{article}          \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{amssymb,amsmath,amsthm, amsfonts}          \newcommand{\vect}[1]{\vect{\underline{#1}}}     \newcommand{\bi}[1]{\textit{\textbf{#1}}}          \title{Theorems\\ Y3 S1}     \author{Hannahl}          \begin{document}     \maketitle          \section{Mathematical Methods}     \begin{theorem}{Placheral's Theorem}     ||F||^2_2 =2\pi ||u||^2_2      \end{theorem}     \end{document}      I get this error ! LaTeX Error: Environment theorem undefined. I am using windows 7 have MikTex 2.9 installed and am using TexMaker. From what I have read the theorem environment should be part of the amsthm package which I have. But it isn't working! Any help will be much appreciated.


title: How to split a latex document using parts and chapters

text: I'm trying to make a PDF document, using the book class, divided like this:   * Part: 1      * Chapter 1      * Chapter 2      * Etc.   * Part: 2      * Chapter 1     * Chapter 2      * Etc. How do I do this without the break in page numbers?


title: How to Convert PDF containing Math (made from LaTeX) to Word

text: I'm writing here following http://math.stackexchange.com/questions/402407/how- to-convert-pdf-containing-math-made-from-latex-to-word and http://meta.math.stackexchange.com/questions/9715/reopening-thread-that-i- dont-think-is-off-topic. **1.** My main goal is just to use MathType in Word and to edit with Word. Therefore, what is the best way to convert an Adobe PDF containing math (equations, symbols, tables, etc.) into a Word document? **2.** Is there another way to make the PDF appear in Word? I was thinking that maybe the PDF doesn't need to be converted. Instead, each page of the PDF could be convertered/terated as a picture which could then be pasted onto a Word document. This process takes too long to do for each page. What program or recourse is available? Thank you very much! Unfortunately, it would take too much time for me to retype the PDF, because it is essentially a free textbook containing maths on which I must annotate. Also, I do not have the LaTeX source file for the PDF, only the PDF itself. I've spent at least 3 hours trying to research and resolve this question, including reading http://www.physicsforums.com/showthread.php?t=507174 and http://forums.adobe.com/message/3906332. I've tried the following PDF to Word converters, but ALL of them deform, disfigure, and distort the math, the fonts, and the formatting: Zamzar.com, Wondershare PDF to Word Converter 4.0.1, Able2Doc PDF to Word Converter v7.0.34, and UniPDF.


title: Is it \limsup or \lim\sup?

text: Is the concept of limit superior in mathematics written as `$\limsup$` or `$\lim\sup$`?


title: Dependencies clash for pgf-umlsd

text: I am fairly new to latex and the way it compiles. I will try to explain my issue. I want to draw Sequence Diagrams using Tikz with the help of pgf-umlsd. When I try to compile my document, I get the following error:               (C:\Users\LocalUser\Documents\project\report\myfile.aux     ! Undefined control sequence.     l.42 \savepicturepage                          {pgfid1}{7}     ?       Which referes to the following line in the .aux file:               \savepicturepage{pgfid5}{7}      Here are the packages I declare to use in my document.               \usepackage[pdftex]{graphicx}     \usepackage{amssymb}     \usepackage{dsfont}     \usepackage[top=1.5cm, bottom=1.5cm, left=2cm, right=2cm]{geometry}     \usepackage{mathtools}          \usepackage{caption}     \usepackage{subcaption}          \usepackage{epstopdf}     \usepackage{eurosym}          % use math packages     \usepackage{amsmath,amsfonts,amsthm} % Math packages     \usepackage{algorithm}     \usepackage{algorithmic}          % TODOs package     \usepackage{todonotes}     \usepackage{lipsum}          % After matter packages     \usepackage{appendix}     \usepackage{natbib}          % Drawing diagrams     \usepackage{tikz}     \usepackage{pgf-umlsd}      Surprisingly the `\savepicturepage` cannot be found. From where are the commands executed in the .aux file? How should I go to troubleshoot this issue? How could I see if there are dependencies clashes between the various packages?


title: Can't get correct ps output using tikzmark

text: I was using tables-in-latex-with-diagonal-first-row as a guideline and everything was working fine as long as I kept using pdflatex in texmaker to get the pdf file. However, for submission I need a ps file and this is not generated, so I tried using Latex and dvips, but the table just didn't look right anymore. Next, I tried using pdflatex with dvi output followed by dvips, still the same problem. Any idea how to solve this? I add an example table code, correct output and messed up output below               \documentclass{article}     \usepackage{tikz,array}     \usetikzlibrary{calc}     \newcommand{\tikzmark}[1]{\tikz[remember picture,overlay]\coordinate (#1);}               \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}     \newcolumntype{T}[2]{@{\hspace{\tabcolsep}}C{#2}@{\hspace{\tabcolsep}\tikzmark{#1}}}          \begin{document}               \begin{table}          \setlength\extrarowheight{2pt}     \begin{tikzpicture}[remember picture]     \node[inner xsep=-\pgflinewidth,inner ysep=-\pgflinewidth] at (0,0) (mytable){%     \begin{tabular}{|T{a}{0.13\columnwidth}|T{b}{0.08\columnwidth}|T{c}{0.08\columnwidth}|T{d}{0.08\columnwidth}|T{e}{0.08\columnwidth}|T{f}{0.08\columnwidth}|c|}     \hline      t1                  & + &    & +   & ++ &    \\     t2                  &   &    & +   &    &    \\     t3  &   &    & +   &    &    \\     t4                  & + &    & +   &    &    \\     t5                  &   &    &     &    & ++ \\     t6      &   & ++ &     & +  &    \\     t7                  &   & ++ &     & +  &    \\     t8                  &   & +  &     & ++ &    \\     t9                  &   & +  &     & ++ &    \\     t10                 &   &    & +++ &    &    \\          \hline     \end{tabular}          };     \draw (mytable.north east) --++ (30:1.475cm);     \draw (mytable.north-|a) --++ (30:1.475cm);     \draw (mytable.north-|b) --++ (30:1.475cm);     \draw (mytable.north-|c) --++ (30:1.475cm);     \draw (mytable.north-|d) --++ (30:1.475cm);     \draw (mytable.north-|e) --++ (30:1.475cm);     \draw (mytable.north-|f) --++ (30:1.475cm);     \draw (mytable.north east) ++ (30:1.475cm) --([shift={(30:1.4cm)}]mytable.north-|a);     %     \node[rotate=30,anchor=west] at ($(mytable.north-|b)!0.5!(mytable.north-|a)$) {f1};     \node[rotate=30,anchor=west] at ($(mytable.north-|c)!0.5!(mytable.north-|b)$) {f2};     \node[rotate=30,anchor=west] at ($(mytable.north-|c)!0.5!(mytable.north-|d)$) {f3};     \node[rotate=30,anchor=west] at ($(mytable.north-|d)!0.5!(mytable.north-|e)$) {f4};     \node[rotate=30,anchor=west] at ($(mytable.north-|e)!0.5!(mytable.north-|f)$) {f5};     \end{tikzpicture}     \caption{Overview}     \label{tab:overview}     \end{table}                    \end{document}      This is what it should look like ![Good example](http://i.stack.imgur.com/bf1Zq.png) This is the output when using the route TEX->DVI->PS ![enter image description here](http://i.stack.imgur.com/BPwiC.png)


title: labels disappearing in pgfplot bar chart

text: Only the third label appears for this bar chart. If I put only one data row, the label shows up fine. If I put two data rows, both the labels are hidden. If I put three data rows (as below), only the third label shows up. Any ideas why this might be happening?               \documentclass{article}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \pgfplotstableread{     X   question                                                                interactionhigh InteractionLow  VisualHigh  VisualLow     1   {*I needed to learn a lot of material before I could get started with SIDNIE.}      6.50                6.18                6.22            5.96     2   {I felt very confident working with SIDNIE.}                                    5.60                5.55                6.11            6.04     3   {*I found the system very cumbersome for use.}                          6.50                6.64                6.44            5.62     }\datatable            \begin{axis}[xbar=0,        yticklabels from table={\datatable}{question},        y tick label style={text width=5cm, align=right},     height=18cm,     width=10cm,     inner sep=0mm,     xmin=0,     xmax=7,       ]          \addplot table[y=X,x={interactionhigh}] {\datatable};     \addplot table[y=X,x={InteractionLow}] {\datatable};     \addplot table[y=X,x={VisualHigh}] {\datatable};     \addplot table[y=X,x={VisualLow}] {\datatable};     \end{axis}     \end{tikzpicture}          \end{document}


title: How to underline the name of a journal in bibliography without modifying the .bib file

text: I'm trying to underline the name of the journals in my bibliography without modifying the `.bib` file. I'm using BibTeX. I'm not familiar with the packages and syntax that is used in the hacks I've seen posted around.


title: Page numbering in beamer

text: I use option `allowframebreak` for frame. It gives an error in frame numbering; all slide which generated in `allowframebreak` slide take the same number. I have two problem:   1. Numbering normal with frame in slide which have `allowframebreak` option.   2. Remove numbering in these slide (in case there is last slides) I used this code for frame numbering:               \defbeamertemplate*{footline}{shadow theme}{%     \leavevmode%     \hbox{\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fil,rightskip=.3cm]{author in head/foot}%         \usebeamerfont{author in head/foot}\hfill\insertshortauthor     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%         \usebeamerfont{title in head/foot}\insertshorttitle\hfill%     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{mycolor}     \hfill\insertframenumber\,/\,\inserttotalframenumber     \end{beamercolorbox}}%     \vskip0pt%     }      Here is my code:               \documentclass{beamer}     \usepackage{graphicx}     \usepackage[labelsep=quad,indention=10pt]{subfig}     \usepackage{tikz}     \usetikzlibrary{matrix,chains,positioning,decorations.pathreplacing,arrows,calc,}     \usetikzlibrary{decorations.markings}     \usepackage{booktabs}     \usepackage{array}     \usepackage{zref-savepos}     \usepackage{epstopdf}% for eps file     \usepackage{changepage}     \newcounter{restofframe}     \newsavebox{\restofframebox}     \newlength{\mylowermargin}     \setlength{\mylowermargin}{2pt}          \newenvironment{restofframe}{%         \par%\centering         \stepcounter{restofframe}%         \zsavepos{restofframe-\arabic{restofframe}-begin}%         \begin{lrbox}{\restofframebox}%     }{%         \end{lrbox}%         \setkeys{Gin}{keepaspectratio}%         \raisebox{\dimexpr-\height+\ht\strutbox\relax}[0pt][0pt]{%         \resizebox*{!}{\dimexpr\zposy{restofframe-\arabic{restofframe}-begin}sp-\zposy{restofframe-\arabic{restofframe}-end}sp-\mylowermargin\relax}%             {\usebox{\restofframebox}}%         }%         \vskip0pt plus 1filll\relax         \mbox{\zsavepos{restofframe-\arabic{restofframe}-end}}%         \par     }                    \usetheme{Warsaw}     %\usepackage{beamerthemeshadow}          \date{}     %\titlegraphic{\includegraphics[width=0.3\textwidth,height=.3\textheight]{logo_JVN}}          \setbeamercolor{mycolor}{fg=red,bg=olive}          \defbeamertemplate*{footline}{shadow theme}{%     \leavevmode%     \hbox{\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fil,rightskip=.3cm]{author in head/foot}%         \usebeamerfont{author in head/foot}\hfill\insertshortauthor     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%         \usebeamerfont{title in head/foot}\insertshorttitle\hfill%     \end{beamercolorbox}%     \begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{mycolor}     \hfill\insertframenumber\,/\,\inserttotalframenumber     \end{beamercolorbox}}%     \vskip0pt%     }     %\titlegraphic{\includegraphics[height=1cm]{logo_JVN}}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%% Previous frame     \makeatletter     \def\beamer@checkframetitle{%     \begingroup       \edef\temp{%         \endgroup         \noexpand\frametitle         [\unexpanded\expandafter{\beamer@savedshortframetitle}]%         {\unexpanded\expandafter{\beamer@savedframetitle}}%       }     \temp     \@ifnextchar\bgroup\beamer@inlineframetitle{}}          \long\def\beamer@@frametitle[#1]#2{%       \beamer@ifempty{#2}{}{%         \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle     continuation}\fi}}%       \gdef\beamer@frametitle{#2}%       \gdef\beamer@shortframetitle{#1}%       \global\let\beamer@savedshortframetitle\beamer@shortframetitle         \global\let\beamer@savedframetitle\beamer@frametitle     }%     }       \global\let\beamer@savedshortframetitle\@empty         \global\let\beamer@savedframetitle\@empty          \makeatother          %%% justify      \usepackage{ragged2e}          \usepackage{tabularx}          \newcommand{\backupbegin}{        \newcounter{framenumberappendix}        \setcounter{framenumberappendix}{\value{framenumber}}     }     \newcommand{\backupend}{        \addtocounter{framenumberappendix}{-\value{framenumber}}        \addtocounter{framenumber}{\value{framenumberappendix}}      }          \begin{document}     \begin{frame}         ABC\\         DEF\\     \end{frame}     \begin{frame}         ABC\\         DEF\\     \end{frame}          \begin{frame}[t,allowframebreaks,noframenumbering]     \frametitle{References}               \begin{thebibliography}{50}     \bibitem{luhasz2012} Luhasz.G; Tirea, M ; Negru, V(2012); \emph{Neural Network Predictions of Stock Price Fluctuations,Symbolic and Numeric Algorithms for Scientific Computing (SYNASC), 2012 14th International Symposium on, Page(s):505 - 512 }     \bibitem{chan2009} Tsong-Wuu Lin, Chan-Chien Yu(2009); \emph{Forecasting stock market with neural networks}, Available at SSRN: http://ssrn.com/abstract=1327544 or http://dx.doi.org/10.2139/ssrn.1327544.     \bibitem{yim2002}Juliana Yim (2002), \emph{A Comparison of Neural Networks with Time Series Models for Forecasting Returns on a Stock Market Index.},Developments in Applied Artificial Intelligence, pages: 25-35.     \bibitem{Ramik2008}Ramnik Arora (2008), \emph{Artificial Neural Networks for Forecasting Stock Price}     \bibitem{jasic2004} Jasic, T. and D. Wood (2004),\emph{ ‘The Profitability of Daily Stock Market Indices Trades Based on Neural Network Predictions: Case Study for the S \& P 500, the DAX, the TOPIX and the FTSE in the Period 1965–1999’}, Applied Financial Economics, 14(4): 285–97     \bibitem{tkacz2001} Tkacz, G. (2001), \emph{‘Neural Network Forecasting of Canadian GDP Growth’}, International Journal of Forecasting, 17(1): 57–69.     \bibitem{cao2005} Cao, Q., K.B. Leggio and M.J. Schniederjans (2005), \emph{‘A Comparison Between Fama and French’s Model and Artificial Neural Networks in Predicting the Chinese Stock Market’},Computers and Operations Research, 32: 2499–512.     \bibitem{huang2004}Huang, Z., H. Chen, C-J Hsu, W-H Chen and S. Wu (2004),\emph{ ‘Credit Rating Analysis with Support Vector Machines and Neural Networks: A Market Comparative Study’}, Decision Support Systems, 37(4): 543–58.          \bibitem{moller1993} M. F. M{\o}ller. \emph{A scaled conjugate gradient algorithm for fast supervised learning}, Neural Networks, Volume 6, Issue 4, 1993, Pages 525–533.                \bibitem{Wavetoolbox}Michel.M,Yves.M, Georges.O, Jean-Michel.P,\emph{Wavelet Toolbox For Use with MATLAB} ,User’s Guide Version 1, MathWorks, 1996          \bibitem{veitch2005}David Veitch(2005), \emph{Wavelet Neural Networks and their application in the study of dynamical systems}.     \bibitem{nygren2004}Karl Nygren, \emph{ Stock Prediction – A Neural Network Approach}, 2004                    \bibitem{martin1993}R. Martin and B. Heinrich. \emph{A direct adaptive method for faster back-propagation learning: the rprop algorithm}. Proceedings of the IEEE In-ternational Conference on Neural Networks 1993, pages 586-591.     \bibitem{minu2010} K. K. Minu, M. C. Lineesh and C. Jessy John,\emph{ Wavelet Neural Networks for Nonlinear Time Series},  Analysis, 2010.     \bibitem{marquadt1194}H. M. T and M. M. B. \emph{Training feedforward networks with the marquardt algorithm}. IEEE Transactions on Neural Networks, 5:989-993, 1994.          \bibitem{marquadt}Hao Yu, Bogdan M,Wilamowski, \emph{Levenberg–Marquardt Training}, in The Industrial Electronics Handbook, Vol. 5-Intelligent Systems, 2nd ed. (CRC Press, Boca Raton, 2011).          \end{thebibliography}     \end{frame}     \end{document}      and my problem is: ![enter image description here](http://i.stack.imgur.com/Eq2SH.png)


title: Changing the whitespace before the List of Schemes header

text: I'm using chemstyle to create a list of schemes and also tocloft. I noticed that the whitespace above the List of Schemes header is larger than the whitespace above the Table of Contents and List of Figures headers. Is there a way to customize the whitespace above the los header (or the toc and lof headers) so it's consistent? MWE:               \documentclass[oneside, 12pt, a4paper]{book}      \setlength\headheight{15pt}     \usepackage[varioref=false]{chemstyle}     \usepackage{caption} %required for chemstyle     \usepackage{psfrag}     \usepackage{tocloft}          \begin{document}          \frontmatter     \tableofcontents     \cleardoublepage     \listoffigures     \cleardoublepage     \listofschemes          \end{document}


title: same command with output X in main body and Y in footnote

text: In reference to this question, I would like to ask whether there could be a command that produces the output X when issued in the body of a text, but the output Y when issued in any sort of footnote. Example: `This is a nice sentence says Mister \funnycommand.\footnote{This is a nice footnote says Mister \funnycommand.}` Output: > This is a nice sentence says Mister X.*1 > > ============== > > *1 This is a nice footnote says Mister Y.


title: Drawing circuit diagrams (with logic gates) in LaTeX

text: I'm having some difficult drawing circuit diagrams with logic gates in LaTeX. I've tried with `circuitikz` and `pst-circ`.               \begin{pspicture}(-1,-1)(5,3)     \logicand[ninputs=2,invertinputa=true, invertinputb=true](0,0){Name}     \end{pspicture}      gives               Error: ! Undefined control sequence.     <recently read> \c@lor@to@ps           l.75 ...inputa=true, invertinputb=true](0,0){Name}          ?       And               \begin{circuitikz} \draw     (0,2) node[and port] (myand1) {}     (0,0) node[and port] (myand2) {}     (2,1) node[xnor port] (myxnor) {};     (myand1.out) | (myxnor.in 1)     (myand2.out) | (myxnor.in 2)     \end{circuitikz}      produces no error, but also no lines appear between logic gates. Please help me generate logic diagrams from LaTeX code. (I need AND, OR, NOT, NOR and NAND gates.)


title: Change bullet type for each level of Outline Environment

text: I love using the `outline` environment (`outlines` package) for taking notes in class. `\1` uses a standard bullet, `\2` uses a dash. I wanted to make `\3` a bullet and `\4` a dash as well. How would I go about doing this as I'm fairly new to LaTeX.


title: Automatic missing package download on the Mac

text: Is there a LaTeX distribution for the Mac which has or comes close to MiKTeX's ability to download missing packages automatically?


title: Figures on left pages, text on right ones with class book (cont.)

text: In addition to the very useful discussion Figures on left pages, text on right ones with class book, numbering only on right pages, I would like to handle 2 other features:   * the suppression of blank pages automatically inserted by book,   * the possibility to switch between figure and table captions. Regarding the first, 3 blank pages are added before a new chapter (probably also before a new part) where only 1 should be. I managed to remove one redefining `\chapter` as follows (removing the first line involving `\clearpage`) but not the other.               \renewcommand\chapter{                         \thispagestyle{plain}%                         \global\@topnum\z@                         \@afterindentfalse                         \secdef\@chapter\@schapter}      For the second, I defined a new command `\switchcaption` as follows which I call before and after a table respectively with "table" and "figure" as argument.               \newcommand\switchcaption[1]{\def\@captype{#1}}      By the way, I would be very interested in better understanding   * when it is useful to use directly `\def` instead of `\\(re)newcommand` (`\newcommand\@captype{figure}` seems to work just as well as `\def\@captype{figure}`),   * when it is needed to work within `\makeatletter` `\makeatother` (apparently `\newcommand` works differently in both cases: it "reads" the new command name with subsequent braces outside `\makeatletter` `\makeatother` and without braces otherwise),   * why `\addfig` definition needs two statements (one for `\@addfig` and another apparently for its argument). Thank you very much in advance for your help!


title: Listings: different counters for different listing environments

text: How do I create two lstlisting environments that each have its own counter? If I use for example               \lstnewenvironment{algorithm}[2]{         \renewcommand\lstlistingname{Algorithm}         \lstset{ ... }     } {}          \lstnewenvironment{program}[2]{         \renewcommand\lstlistingname{Program}         \lstset{ ... }     } {}      And then               \begin{algorithm}{Algorithm caption}{alg-label}     ...     \end{algorithm}          \begin{program}{Program caption}{prg-label}     ...     \end{program}      Then they will share the counter, i.e. it will result for example in               Algorithm 1.1         ...     Program 1.2         ...      I would like the counting to be independent for different listing environments. I also use the caption package to create a nice caption. I've already tried many things but none really successfuly. The only way that I found that indicates how to change the counter/file extension is via i.e. \DeclareCaptionType[fileext=alg]{algorithm} but the problem is that this command already defines a new environment so I don't know how to use it together with a new listings environment and the caption package. I'm using for example the following settings:               \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}     \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}


title: Bibliography style question

text: I'm trying to create a bibliography in LaTeX, and I have this example to look at: ![Bibliography example](http://i.stack.imgur.com/FoPcs.png) I'm wondering how they made this. The first source is a book, and the rest is websites. I don't know how to make different kind of sources under the same title or 'kind' (Like books, websites, articles and so on). Next, how do I make it show up like they do with websites? Something like [online] Available at.. and so on. :-)


title: How to connect the lines in the simplest way?

text: How do I connect the lines of the simplest form in the following code. Perhaps with chain or other option, so that the code is short.               \usetikzlibrary{chains,calc}     \newcommand{\xx}{10}     \newcommand{\yy}{9}     \newcounter{x}    %novo contador     \setcounter{x}{1} %valor inicial do contador     \begin{tikzpicture}[>=latex,start chain=dot placed {at=(\tikzchaincount*30:1.5)}]         %grade         \draw[very thin,color=lightgray,dashed] (0,0) grid (\xx+1,\yy+1);         %eixos         \draw[->] (-1,0) -- (\xx+1,0) node[below] {$n^\circ$};         \draw[->] (0,-1) -- (0,\yy+1) node[right] {altura $(m)$};         %cotas         \foreach \x in {1,...,\xx}             \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt)                 node[below]     {$\x$};         \foreach \y in {1,...,\yy}         \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt)             node[left] {$\y 0$};         \node[below left] at (0,0) {$0$};         %grafico         \foreach \y in {1,3,2,4,5,1,3,6,8,9}{             \fill[blue] (\thex,\y) circle (2pt);             \coordinate (p\thex) at (\thex,\y);             \draw (p\thex) -- (p\thex); %CONECT LINES HERE             \pgfmathsetcounter{x}{\thex+1} %soma 1 no contador             \setcounter{x}{\thex} %redefine o contador         }     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/wiF0n.png) I need this. ![enter image description here](http://i.stack.imgur.com/oKrwS.png) I solve with               \usetikzlibrary{calc}     \newcommand{\xx}{10}     \newcommand{\yy}{9}     \begin{tikzpicture}[>=latex]         %grade         \draw[very thin,color=lightgray,dashed] (0,0) grid (\xx+1,\yy+1);         %eixos         \draw[->] (-1,0) -- (\xx+1,0) node[below] {$n^\circ$};         \draw[->] (0,-1) -- (0,\yy+1) node[right] {altura $(m)$};         %cotas         \foreach \x in {1,...,\xx}             \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt)                 node[below]     {$\x$};         \foreach \y in {1,...,\yy}         \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt)             node[left] {$\y 0$};         \node[below left] at (0,0) {$0$};         %grafico         \coordinate (p1) at (1,1);         \coordinate (p2) at (2,3);         \coordinate (p3) at (3,2);         \coordinate (p4) at (4,4);         \coordinate (p5) at (5,5);         \coordinate (p6) at (6,1);         \coordinate (p7) at (7,3);         \coordinate (p8) at (8,6);         \coordinate (p9) at (9,8);         \coordinate (p10) at (10,9);              \draw plot[mark=*,mark options={blue}] coordinates{             (p1)(p2)(p3)             (p4)(p5)(p6)             (p7)(p8)(p9)             (p10)         };     \end{tikzpicture}


title: tikzpicture in Beamer: how to uncover nodes in foreach statement

text: How can I uncover the nodes in the following tikzpicture? I want to display all red nodes, followed by all green nodes, and then followed by all blue nodes.               \tikzstyle{level 1}=[sibling angle=120]     \tikzstyle{level 2}=[sibling angle=60]     \tikzstyle{level 3}=[sibling angle=30]     \tikzstyle{every node}=[fill,inner sep=0pt,minimum size=4pt]     \tikzstyle{edge from parent}=[segment length=1mm,                               segment angle=10,draw]      \begin{tikzpicture}[grow cyclic,shape=circle,very thick,level distance=13mm,                     cap=round,scale=0.5]     \node {} child [color=\A] foreach \A in {red,red,red}     {  node {} child [color=\A!50!\B] foreach \B in {green,green,green}          { node {} child [color=\A!50!\B!50!\C] foreach \C in {blue,blue,blue}              { node {} }         }     };     \end{tikzpicture}


title: uncover before pause in beamer later

text: I have split my frame in two columns. The first column has an algorithm (interleaved with pause statements). The second column has a figure. Currently the figure shows at last (after hitting keys as many times as there are pause statements). How can I uncover the figure before any pause statements. Attached below is the psuedo code.               \begin{columns}[c]     \column{2.00in}     \begin{algorithmic}[1]     \STATE stmt1     \pause     \STATE stmt2      \end{algorithmic}     \column{1.00in}     \begin{tikzpicture}     picture code     \end{tikzpicture}     \end{columns}     \end{frame}


title: Custom header, not using fancyhdr

text: I want to add the following header to my chapters: ![enter image description here](http://i.stack.imgur.com/odpFo.jpg) I do not want to use fancyhdr because when I use it, it moves all my previous page settings (principally the table of contents layout), I tried using /thispagestyle{fancy} but it does not work. My code looks as follows:               \documentclass[letterpaper,12pt,oneside,onecolumn,final,openany]{report}          \usepackage{alltt}     \usepackage{times}                        \usepackage{graphicx}     \usepackage{listings}     \usepackage{apalike}     \usepackage{verbatim}     \usepackage[spanish]{babel}     \usepackage[left=2.7cm,top=2.5cm,right=2.2cm]{geometry}     \usepackage{titlesec}     \usepackage{titletoc}     \usepackage{tocloft}          \AtBeginDocument{\renewcommand{\contentsname}{\hfill\rule{.7\textwidth}{3pt} \hspace*{.3\textwidth} \\ \hspace*{.3\textwidth} Contenido}}     \AtBeginDocument{\renewcommand{\listfigurename}{\hfill\rule{.7\textwidth}{3pt} \hspace*{.3\textwidth} \\ \hspace*{.3\textwidth} Lista de Figuras}}     \AtBeginDocument{\renewcommand{\listtablename}{\hfill\rule{.7\textwidth}{3pt} \hspace*{.3\textwidth} \\ \hspace*{.3\textwidth} Lista de Tablas}}          \pagestyle{myheadings}          \begin{document}          \pagenumbering{roman}     \tableofcontents     \clearpage     \listoffigures     \clearpage     \listoftables     \clearpage     \pagenumbering{arabic}          \thispagestyle{myheadings}          \chapter{Introduction}     \label{chap:intro}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam convallis accumsan tempor. Etiam adipiscing gravida sollicitudin. Suspendisse potenti. Donec risus lectus, ultricies at varius in, accumsan quis sapien. Duis at arcu turpis, lacinia dapibus orci. Etiam pharetra turpis et diam volutpat in dapibus lorem facilisis. Vestibulum adipiscing, metus quis scelerisque pulvinar, purus quam iaculis felis, ac porta nulla justo nec dui. Donec condimentum pulvinar augue, varius placerat quam pharetra in. Vestibulum velit ante, feugiat imperdiet scelerisque in, posuere eu purus.          \section{Lorem ipsum}     \label{sec:intro:lorem}          Pellentesque sit amet dui non nunc venenatis tempus vel id libero. Etiam consectetur metus fringilla nibh           \subsection{Ipsum}     \label{sec:intro:ipsum}          Etiam iaculis ante vitae diam egestas egestas. Nullam sed odio id mi consequat porttitor. Ut ut libero augue,           \chapter{Things 2}     \label{chap:intro2}          \subsection{Pallentesque}     \label{sec:intro:pallen}          Pellentesque sit amet dui non nunc venenatis tempus vel id libero. Etiam consectetur metus fringilla nibh           \end{document}      Currently it looks like this: ![enter image description here](http://i.stack.imgur.com/wdQDl.jpg) Any suggestions?


title: How to place inline figure

text: I am trying to create a resume with a picture. So i want the picture to be on the right hand side while the text is written on the left. With a bit of googling, I found wrapfigure package to insert the image. Now the problem is that after inserting using wrapfigure, the whole page is vertically divided into text and image sections, so I cant write any text below the text. Here is how it looks now: (Cross is the image) ![enter image description here](http://i.stack.imgur.com/2wfDs.png) This effect is seen in the following page also. Is there any alternative or a improvement to this method itself? A MWE is:               \documentclass{article}     \usepackage[a4paper,hmargin=2cm,vmargin=2cm]{geometry}     \usepackage[a4,frame,center]{crop}     \usepackage{graphicx}     \usepackage{wrapfig}               \begin{wrapfigure}{r}{0.15\textwidth}     \includegraphics[height=40mm,width=35mm]{foto.jpg}     \end{wrapfigure}          \begin{document}     \title{Curriculum Vitae}     \author{My Name}     \date{May, 2012}     \maketitle          \section*{\sl Personal Information}         Date of Birth   :   DD.MM.YY \\         Citizenship     :   Country \\         Visa Status     :   Status \\         Passport Number :   XYZ \\         Gender      :   Gender \\         Marital Status  :   Status \\         Languages known :   langs          You will understand more if u insert more text in this sentence. The more the text, the clear u can see the line break.          \end{document}


title: Where can I find on/off symbol?

text: Where do I find the on/off symbol of electronics?![enter image description here](http://i.stack.imgur.com/tqVyU.jpg)


title: Using lstinline in caption of lstlistings with multicol?

text: Consider this MWE:               \documentclass{article}     \usepackage{multicol}     \usepackage{listings}          \begin{document}          \def\extra{extra}          \begin{lstlisting}[       multicols=2,       caption={         [short] aaaa \extra, \lstinline{asf_sdf}       },     ]     LDPT_NULL = 0,     LDPT_API_VERSION,     LDPT_GOLD_VERSION,     LDPT_LINKER_OUTPUT,     \end{lstlisting}      It crashes with:               ! LaTeX Error: Something's wrong--perhaps a missing \item.      It will not crash if `multicols` is commented - or if `multicols` is left, and `\lstinline` is commented. EDIT - and also, `\protect\lstinline{asf_sdf}` does not help. How can I use all these commands together?


title: Labels on edges

text: For some reason, I can not have large labels on the edge. I get an overflow. Any idea? If I replace `$\\{a_1, a_2\\}$` with one character it works.               \begin{figure}[b]        \centering         \begin{tikzpicture}          \SetUpEdge[lw         = 1pt,                     color      = black,                     labelcolor = white]           \SetVertexNoLabel           \GraphInit[vstyle=Normal]            \SetGraphUnit{3}           \tikzset{VertexStyle/.append  style={fill}}           \Vertex{s}           \NO(s){a}  \EA(a){b} \SO(b){c}           \Edge[label=$\{a_1, a_2\}$](s)(a)           \Edge[label=$b$](a)(b)           \Edge[label=$c$](b)(c)         \end{tikzpicture}       \caption{Graph $g_1$ \label{fig:graph_1}}     \end{figure}      The error that I get is:               ! TeX capacity exceeded, sorry [input stack size=5000].     \curr@fontshape ->\f@encoding     /\f@family /\f@series /\f@shape     l.38 \Edge[label=$\{a_1, a_2\}$](s)(a)     If you really absolutely need more capacity,     you can ask a wizard to enlarge me.


title: Adding watermark

text: I have simple question of adding a watermark with predefined position. I need to put it with the setting given below. Here is my code:               \documentclass[a4paper,twoside,10pt]{report}          \usepackage{graphicx}     \usepackage{tikz}     \usepackage{eso-pic}     \usepackage{pdflscape}          \usepackage[a5paper]{geometry}% just for the example     \usepackage{background}     \usepackage{lipsum}          \backgroundsetup{%       scale=1,       %% change accordingly       angle=0,       %% change accordingly       opacity=.6,    %% change accordingly       color =black,  %% change accordingly       contents={\begin{tikzpicture}[remember picture,overlay]             \node at (current page.north east) {\includegraphics[width=5cm]{AA_Deutsche.png}};    ***How can I put my image to upper right corner of each image.***         \end{tikzpicture}}     }     \begin{document}          .     .     \newpage     \begin{landscape}     ...     \end{landscape}          \newpage     .     .     \end{document}      I'm attaching the image and desired setting . Currently I'm using Adobe to add the watermark with these setting (Attached please see setting image) ![enter image description here](http://i.stack.imgur.com/OL2Mj.jpg) ![enter image description here](http://i.stack.imgur.com/n7jVI.jpg)


title: Need help with JasaTeX Author-Year style not indenting references

text: I am really new to LaTeX and I am trying to use the JasaTeX template to format my paper. Everything looks okay, except my reference section. The references should indent the next lines after the first line for each citation, but it's not indenting as it's supposed to. It's just a block of references. I am not sure how to fix this. Any help is appreciated.


title: Increase the gap above table

text: I am aware that this might be a duplicate of: How to change the spacing between figures/tables and text? I've tried the methods described there but none of them increases the gap **before** the table for me. Please let me know if I need to post a MWE.


title: Unwanted space before flalign

text: Why is there so much vertical space between the subsection heading and the equation in the following example. How do I get rid of it?               \documentclass{article}     \usepackage{mathtools}     \begin{document}     \section{Title}     \subsection{Subtitle}     \begin{flalign*}     a+b=8 &&\\     c=2 &&     \end{flalign*}     \end{document}      ![Imad](http://i.stack.imgur.com/rpIw1.png) Secondly, why is it aligned at the equals sign, even without `&=`? I want both of the lines to be flushed to the left.


title: Caption below boxed algorithm2e when used as a figure?

text: My desired output is similar to the example given in this answer, in that I want the caption below the algorithm and outside the box, except I want the algorithm included as a figure (so I use `\usepackage[figure,boxed]{algorithm2e}`). Currently I have something like this: ![enter image description here](http://i.stack.imgur.com/mWAcT.png) The MWE:               \documentclass[a4paper]{article}          \usepackage{blindtext}     \usepackage[linesnumbered,boxed,figure]{algorithm2e}          \SetAlCapSkip{1em}          \SetKwInput{KwInput}{Input}     \SetKwInput{KwOutput}{Output}          \begin{document}            \begin{algorithm}[h]         \SetAlgoLined         \KwInput{Parameters...}              \KwOutput{$\emptyset$}              \If{Condition}         {           Do something \;         }         \caption{Algoritm test...}       \end{algorithm}               \end{document}


title: Reduce the space between a quotation and a title

text: When I use the quotation environment at the start of a section I get too much space between the title and the start of the quotation. How to modify spacing around quotation environment? has ways to set the spacing manually, which is 0, but I'd rather LaTeX handle the spacing for me, as I am not sure how much to put. So I started with this               \documentclass[12pt,letterpaper]{article}     \usepackage{setspace}           %Allows double spacing with the \doublespacing command          \begin{document}     \doublespacing          \section{Too much space}     \singlespacing      \begin{quotation}          \noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     \end{quotation}          \doublespacing     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."          \section{The right spacing}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \end{document}      And I really like the output, except for the giant space between the title and the quotation. I tried one of the answers from the last question, but it kills all the whitespace, so I put in \baselineskip instead of 0, but that doesn't seem to work.               \documentclass[12pt,letterpaper]{article}     \usepackage{setspace}           %Allows double spacing with the \doublespacing command          \makeatletter     \renewenvironment{quotation}                    {\list{}{\listparindent=0pt%whatever you need                             \itemindent    \listparindent                             \leftmargin=0pt%  whatever you need                             \rightmargin=10pt%whatever you need                             \topsep=\baselineskip%%%%%  whatever you need                             \parsep        \z@ \@plus\p@}%                     \item\relax}                    {\endlist}     \makeatother               \begin{document}     \doublespacing          \section{Too much space}     \singlespacing      \begin{quotation}          \noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     \end{quotation}          \doublespacing     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."          \section{The right spacing}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \end{document}      But as you can see if you compile that (I'm not sure how to put in images of the output) the spacing is the large at both the top and bottom of the environment. And yes, I know double spacing is horrible, but the essay must be double spaced so the TA can write in comments. Edit: I just found out that I should be using quote, not quotation, but it gives the same problem.


title: How to draw the recursive H-Layout tree using Tikz?

text: The following image shows a recursive H-Layout tree.   ![H-Layout](http://i.stack.imgur.com/JSnxb.jpg) It is called H-Layout because of its H unit consisting of 7 nodes.   My problem is: > How to draw such tree in a _recursive_ manner instead of drawing each node > explicitly?


title: compiling error runaway agrument embedding audio

text: \documentclass[11pt]{article}      \usepackage[utf8]{inputenc}      \usepackage{geometry}      \geometry{letterpaper}     \usepackage{graphicx}      \usepackage{media 9}     \usepackage[english]{babel}     \title{Brief Article}     \author{The Author}     \begin{document}     \maketitle     \section{First section}     Your text goes here.     \subsection{A subsection}     More text.          \includemedia[     addressource=eli.mp3,     flashvars={     source=eli.mp3     &autoPlay=true     },     transparent     ]{\color{blue}\framebox[0.4\linewidth][c]{Arq. Elizabeth}{APlayer.swf}          \end{document}


title: How can I change the item body in beamer LaTeX

text: In the following code, I want to show item 5 in place of item 1. How I can fix that, or is it possible to change the name of an item? For example, in this case, the item `point1` will be `point5` in slide 5. For example, I can change the color of the item `point1` in slide 5 (see the commented line).               \documentclass[compress,red]{beamer}     \usepackage{etex}     \mode<presentation>     \usetheme{Warsaw}     \usepackage[applemac]{inputenc}%les accents pour mac     \usepackage{subfigure}     \usepackage{multicol}     \usepackage{animate}     \usepackage{movie 15}     \usepackage{amsmath}     \usepackage{epsfig}     \usepackage{graphicx}     \usepackage[all,knot]{xy}     \xyoption{arc}     \usepackage{url}     \usepackage{array,ragged2e}     %\usepackage{multimedia}     %\usepackage{hyperref}     \usepackage{setspace}     \usepackage{multirow}      \begin{document}     \section{section1 }     \frame[shrink]{\frametitle{Titre de la fenetre}     \begin{itemize}     %\item<1-> \color<5>[rgb]{0,0.6,0} point1     \item<1-4> point1     \item<2-4> point2     \item<3-4> point3     \item<4> point4     \item<5> point5     \end{itemize}          }     \end{document}


title: latex R code with %*%

text: I'm using latex with `lstlisting` to format my R code. Some of my code uses matrix arithmetic, including `%*%`. Unfortunately this causes errors when compiling. There is an example of what I would like to do...               \begin{lstlisting}     solve(t(X) %*% X) %*% t(X) %*% y     \end{lstlisting}


title: Determining tikz drawing style, depending on the values of two nested loop iterators

text: So the question is a tikz one! Assume that you are drawing things inside two nested foreach loops in tikz, and the iterator variables are `\x` and `\y`. What I'd like to obtain is to be able to specify a list of `(x,y)` pairs, s.t when drawing inside my two nested loops, I can apply one predefined style "A" if `(\x,\y)` matches a pair in the list, otherwise applies style "B". Any ideas on how I can obtain this? Simple example could be the following code, which draws 16 lines on a sheet. I might want the condition that when `\x` is even, then it should use style "B" instead of style "A", but in all generality, I want to be able to specify the specific `(\x,\y)` pairs that will use style "B" rather than "A".               \documentclass{article}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}[             A/.style={draw,color=red},             B/.style={draw,color=blue}         ]         \foreach \x in {0,1,2,3} {             \foreach \y in {0,1,2,3} {                 \draw[A] (2*\x,4*\y) -- (4*\y,3*\x);             }         }         \end{tikzpicture}     \end{document}


title: Is there a vertical equivalent for \rlap?

text: I'm looking for some sort of vertical equivalent for `\rlap`, which can be used to typeset maybe one or more paragraphs (or minipages), but do not advance _vertically_ the content that would appear immediately following this command. Are there anywhere some implementations of `\tlap` and `\blap`?


title: Sphinx: Overriding the document class

text: I am using `Sphinx` to generate multi-output documents (Epub, HTML, LaTeX). How can I change the use documentclass? The following snippet should (in my opinion) override the used class but results in               % Generated by Sphinx.     \def\sphinxdocclass{scrbook}     \documentclass[,]{sphinxmanual}      Here's the code from my `conf.py`:               latex_elements = {          'papersize': '',          'fontpkg': '',          'fncychap': '',          'maketitle': '',          'pointsize': '',          'preamble': '',          'releasename': "",          'babel': '',          'printindex': '',          'fontenc': '',          'docclass':'scrbook',          'inputenc': '',          'classoptions': '',          'utf8extra': '',      }      The manual says, it should not be overridden, since other macros are responsible to set it. Is there a workaround?


title: Generate list of all installed (La)TeX files

text: I'm trying to write a script (Perl) for the general public which would need to have a list of all installed TeX files of a certain type, e.g. `.sty` and/or `.cls` files or only plainTeX files (`.tex`), depending on the used options. I know I can search for specific files using the `kpsewhich` program, but it seems to have no 'list all' mode (which is understandable). My second idea was to parse all `ls-R` files which should work, but would be more work. **Is there a way to get all TeX source files or only the`ls-R` files from `kpsewhich` or another tool?** At best this should work for both TeX Live and MikTeX on all supported operation systems. However, my main target is TeX Live under Linux. As fall- back solution I would hard code the default paths and allow the user to change these using a configuration file.


title: How can I force the pgfplots coordinate system and the tikz coordinate system to match and why do they not match by default?

text: I plot a function with `pgfplots` and want to combine it with some simple `\draw` commands from `tikz`. But to my suprise the coordinate systems seem not to match. The rectangle drawn ranges from x=-10 up to x=10 and from y=0 up to y=1 which as well are the min and max values of the function drawn BUT they do not fit. How can I force the pgfplots coordinate system and the tikz coordinate system to match and (if somebody knows) what is the problem here?               \documentclass[border=3mm]{standalone}     \usepackage{pgfplots}     \usepackage{tikz}     \begin{document}          \begin{tikzpicture}[domain=-10:10]              \begin{axis}[axis lines=none]             \addplot {exp(x)/(1+exp(x))};         \end{axis}         \draw[thick] (-10,0) rectangle (10,1);          \end{tikzpicture}          \end{document}      ![dings](http://i.stack.imgur.com/PcXJC.png)


title: First page bottom margin problems -- fancyhdr / geometry

text: Can anyone please help me understand why the bottom margin on the first page spills over if I only use the geometry definitions inside the square brackets of `\usepackage[]{geometry}`; however, placing the same geometry definitions inside the wavy brackets of `\newgeometry{}` works just fine? I feel like what I have done is a hack, instead of the way it is supposed to be.               \documentclass[12pt]{article}     \usepackage[head=122.5pt, headsep=-40pt, top=1.6in, bottom=.7in, left=1in, right=1in]{geometry}     %    \newgeometry{head=122.5pt, headsep=-40pt, top=1.6in, bottom=.7in, left=1in, right=1in}     \usepackage{fancyhdr} % This is a special package for headers / footers.     \usepackage{lastpage}          \usepackage{lipsum}               % HEADERS     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}          % first page header     \fancypagestyle{plain}{                 \fancyhead{} % print nothing on top-left and top-right of the first page.                 \fancyhead[C]{ Company \\ Street Address \\ City, State ~ Zip \\~\\ Tel. / Fax.: ~ (xxx) xxx-xxxx \\ noone@nowhere.com \\~\\ \today }                 \fancyfoot{} % print nothing on bottom-left and bottom-right of the first page.                 \fancyfoot[C]{} % first page center footer                           }          % second page header     \pagestyle{fancy}         \fancyhead{} % center of second page         \fancyhead[L] {Name of Recipient \\ \today \\ Page {\thepage\ of {\pageref{LastPage}}} \vspace*{.9in} }         \fancyhead[R]{} % right header \quad \thepage         \fancyfoot[C]{} % second page center footer          \thispagestyle{plain}     \vspace*{0.6in}          \begin{document}               \lipsum[1-15]          \end{document}


title: Producing centered asterisk to indicate new section

text: In a text (or a passage of a text) that is _not_ subdivided by headings -- say, an essay --, a common tool to indicate the start of a new section is a simple asterisk (or other symbol), usually centered, but not necessarily so.               \documentclass[pagesize,fontsize=12pt,paper=a5,DIV=9]{scrartcl}     \usepackage{blindtext}     \begin{document}     \blindtext\par     \noindent     \makebox[\textwidth][c]{*}\par     \noindent     \blindtext     \end{document}      Something like this is necessary or useful because a mere blank line might not be clear enough, e.g. when the preceding paragraph ends with a line that's almost full, and/or when the start of the new section coincides with the start of a new page. What I'd like to know is if there's an implementation of something like this somewhere in a *TeX package. Such an implementation would have to deal with a few things that make the whole thing a bit less simple than my example suggests:   * the asterisk must always stick to the last line of the section whose end it marks, i.e. it must not be split off onto a new page   * but: that last line might also be the last line of the page. In a one-sided document, it might be okay to `\enlargethispage`, if there's no footer that it might clash with. In a two-sided document this might be okay as well, but you might want to take into account readers who are sensitive enough to notice the difference in `\textheight` on a doube-page spread caused by the asterisk, and finding it awkward. Jan Tschichold, in his »Penguin Rules«, by the way, does not find it awkward.    * even if there's no footer, it might clash with footnotes. Such a clash might be even harder to anticipate. There's probably some more things that need to be addressed. These are the first that came to my mind, and some of them have kept me from writing a satisfactory implementation of this myself so far -- which is why I'd like to know if someone else has tried it. ## update As suggested by Ulrike, I tried `memoir's` `\fancybreak.` Here's an example that can be compared side-by-side to what Marc and egreg suggested.               \documentclass[11pt,a4paper,twoside=false]{memoir}     \usepackage{typearea}     \usepackage{kantlipsum}     \typearea{10}     %typearea etc. are just to create conditions identical to my scrartcl tests of Marc's egreg's solutions     \begin{document}     \kant[1-4]     \fancybreak{* * *}     \kant[1-4]     \end{document}      `\fancybreak` doesn't seem to tie the asterisks to the paragraph that they finish off.


title: General Affiliation after Author Blocks

text: I want to put a general 'authorblockA' for every author like this: > >              THIS IS A TITLE >   >      George Orwel     George Campbell >     orwel@mail.com   campbell@mail.com >   >         General Georges Asotiation. >      Artists and writters Asotiation. >   This is what I have so far:               \title{THIS IS A TITLE}     \author{         \IEEEauthorblockN{George Orwell}         \IEEEauthorblockA{orwell@mail.com}         \and         \IEEEauthorblockN{George Campbell}         \IEEEauthorblockA{campbell@mail.com} \\         \IEEEauthorblockA{General Georges Asotiation.}         \IEEEauthorblockA{Artists and writters Asotiation.}     }      Which produces this (with wrong indentation of the two last fields): ![compiled pdf](http://i.stack.imgur.com/Q7FuO.png)


title: how to get rid of first bullet in paralist-bibliography

text: In this question, I managed to get a single-paragraph-bibliography using `paralist`. Now I want to get rid of the first bullet. I got it working for a normal `paraenum` list, but it fails for the bibliography. How can I manage this? Here is an example: removing the bullet works, but not in the bibliography:               \documentclass{scrreprt}     \usepackage[utf8]{inputenc}     \usepackage{xcolor}     \usepackage[colorlinks=true,citecolor=blue,]{hyperref}     \usepackage{natbib}     \bibpunct{(}{)}{;}{a}{,}{,}     \setlength{\bibsep}{0.0cm}          % ========== DEFINE COUNTER DEPENDENT BULLET ============     \makeatletter     \newcommand{\mybullet}{%         \ifnum\value{enumi}=1         \else             \textbullet         \fi     }     \makeatother          \usepackage{paralist}          % ====== REDEFINE BIBLIOGRAPHY ===================     \renewenvironment{thebibliography}[1]{\let\par\relax%       \section*{\refname}\inparaenum}{\endinparaenum}     \let\oldbibitem\bibitem     \renewcommand{\bibitem}{\item[\mybullet] \oldbibitem}          \begin{document}          % ====== IT WORKS IN PARALIST =========     Test paralist without first bullet:     \begin{inparaenum}[\mybullet]     \item bullet-free first item     \item second item     \item third item     \end{inparaenum}          % ====== BUT NOT IN THE BIBLIOGRAPHY =========     Let us cite \citet{Author:1976} \citep[but also][]{Someone:2000}.          % ========== BIBLIOGRAPHY ============     \begin{thebibliography}{93}     \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi          \bibitem[{Author {et~al.}(1976)Author, Other, \&       Yetanother}]{Author:1976}     Author, F., Other, S., \& Yetanother, T. 1976, Obscure Journal, 25, 314          \bibitem[{Someone {et~al.}(2000)Someone, Someother, \& Thirdone}]{Someone:2000}     Someone, F., Someother, S., \& Thirdone, T. 2000, Otherjournal, 321, 42     \end{thebibliography}          \end{document}       Also if someone manages to fix hyperlinks from the citation to the bibliography (not necessarily to the specific item), that would be great!


title: Suppress the text "Figure X about here" in the endfloat package

text: The endfloat package is very useful to programmatically move all floats to the end of a manuscript without manually editing each floating environment. However, it introduces a placeholder tag with the text "Figure X about here". For my current use case, I would prefer it simply move the figures to the end silently, and not print this placeholder text. I can suppress the figure/table table-of-contents it creates by re-defining the commands:               \usepackage{endfloat} % Floats at end     \renewcommand{\listoffigures}{} % but suppress these lists     \renewcommand{\listoftables}{} % suppress these lists      But not sure what to do to remove the "[Figure X about here]" text. Any suggestions? Thanks!


title: classicthesis + pdfspacing --> problems with footnote in chapter title

text: I had the problem stated in this thread I now want to use `pdfspacing`, but this seems not to work with the way I defined footnotes in chapter titles. See this example. Without `pdfspacing`, it compiles, with it does not:               \documentclass[12pt,                    a4paper,                    footinclude=true,                    headinclude=true,                    titlepages,                    %draft                    ]{scrbook}          \usepackage[pdfspacing,                 linedheaders,                 eulermath,                 eulerchapternumbers,                 parts,                 floatperchapter]{classicthesis}                \begin{document}     \tableofcontents          \cleardoublepage\part{Introduction and Background}          \chapter[Chapter Title]         {Chapter Title\hspace{1.5pt}\protect\footnotemark}         \chaptermark{Chapter Title}         \label{ch:chaptertile}          \footnotetext{this chapter has been published as: XYZ}          \end{document}


title: Length parameter for vertical skip space in a math environment?

text: I learned here that I can use `\\\\[<len>]` to explicitly set the vertical skip space between lines, e.g., `<len>` set to `3ex`. I'd like to set `<len>` to, say, 2-times the normal length in this environment (e.g., `align` or `dcases`) but I don't know the length parameter that determines this. Another example: I'd like to change the explicit `3ex` below to some multiple of the vertical line-skip space in the `align` environment. Does anyone know what that is?               \documentclass{beamer}     \usepackage{amsmath}     \usepackage{mathtools}     \begin{document}       \begin{frame}         Some sample text         \begin{spreadlines}{3ex}           \begin{align*}             \pi(\mu \mid x) &= \frac{\pi(\mu)\,\mathcal{L}(x \mid \mu)}{p(x)} \\                             &= \begin{dcases*}                                  \frac{(1-w)\phi(x)}{p(x)} & for \(\mu=0\) \\                                  \frac{w\gamma(\mu)\phi(x-\mu)}{p(x)} & for \(\mu \neq 0\).                                \end{dcases*}           \end{align*}         \end{spreadlines}       \end{frame}     \end{document}


title: Is it possible to check if I am inside a float environment?

text: I have a class file that I am writing (it's my first one and I am new to LaTeX). I have a situation where I'd like to know if I am inside a float so that I can prevent attempting to create a nested one. I found How can I detect if I'm inside or outside of a float environment? but this didn't work. I tried this (from the answer to that question):               \makeatletter        \def\InFloat{\ifnum\@floatpenalty<0\relax in float \else outside float \fi}     \makeatother      But it always displays "in float" wherever I place "\InFloat" in my document. I have also found How to detect if in an exercise environment? and tried this:               \newcommand{\InFloat}{\ifinner inside-float\else outside-float\fi}      but that doesn't work either. I've been trying to find an answer but have been unsuccessful so far... Updates Thanks for the replies, I have tried this:               \makeatletter     \def\InFloat{\@ifundefined{\@captype}{OUTSITE}{INSIDE}}     \makeatother      but I got this in the output "Undefined control sequence. \@captype". I should add a bit of background about what I am trying to do, and why. I have a number of documents that are text based but marked up using some proprietary markings. I want to convert these so I can use LaTex going forwards. The mark- up is such that it is easily translated into LaTeX with a sed script (I am writing commands and environments in a class file make those marked up sections render as needed - the sed script substitutes the mark-up for the commands/environment begin/end that I have created). Two of the mark-ups are relevant to this question. One defines a box and I have implemented an environment using boxedminipage for that. The other defines an image (or actually potentially multiple images, a caption and some text). I have implemented an environment using figure for that one. They both work fine, except for the possibility that the image mark-up can fall inside the box mark-up. It is this case I want to detect and simply not create the inner figure in the case when the image mark-up appears inside a box mark-up. Hopefully that makes sense.


title: Sections present in pdfbookmarks

text: This question is a follow up of my previous question Hide section in table of contents but show it in pdfbookmark. When I compile my code in XeLaTeX it comes out perfectly in TeXworks. With only one set of pdfbookmarks. See the right hand part of the picture below. When I open that file in Preview or Adobe Reader, there is suddenly an extra set of bookmarks which is from the `\section{}` commands in my code. See the left hand side of the picture. ![Preview and TeXworks side by side](http://i.stack.imgur.com/pyDjV.png) When I remove the `\section{}` commands and play around with `\setcounter{section}{0}` my `\firsttitlemarks\thesubsection` header gets messed up. The 1: **1** -2:4 turns into 1: **2** -2:4 etc. Any ideas on how to remove these extra bookmarks without breaking my header's marks?               \documentclass[paper=a5,pagesize=pdftex]{scrbook}     \usepackage[top=2cm,bottom=1.5cm, left=1.5cm, right=1.5cm]{geometry}     \usepackage[pagestyles]{titlesec}     \usepackage{lettrine}     \usepackage{xltxtra}     \usepackage{tocloft}     \usepackage{etoolbox}     \usepackage[toc]{multitoc}     \usepackage{setspace}          \renewcommand{\thesection}{\arabic{section}}     \renewcommand{\thesubsection}{\arabic{subsection}}          \newcommand\Text{And every plant of the field before it was in the earth, and every herb of the field before it grew: for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground.}          \setcounter{tocdepth}{0}          \defaultfontfeatures{Mapping=tex-text}     \setmainfont{Cardo}          % definition of the page style with required headers     \newpagestyle{Biblestyle}{       \setheadrule{.02pt}       \sethead[\thepage][\chaptertitle][\firsttitlemarks\thesection:\ifthesubsection{\firsttitlemarks\thesubsection}{1}---\bottitlemarks\thesection:\bottitlemarks\thesubsection]{\firsttitlemarks\thesection:\ifthesubsection{\firsttitlemarks\thesubsection}{1}---\bottitlemarks\thesection:\bottitlemarks\thesubsection}{\chaptertitle}{\thepage}     }          % sets the marks to be used (section and subsection)     \setmarks{section}{subsection}          % sections and subsections formatting     \titleformat{\section}{}{\lettrine{\thesection}}{0em}{}[\vskip-1\baselineskip]     \titleformat{\subsection}[runin]     {\small\bfseries}{\thesubsection}{1em}{}     \titlespacing{\section}{1em}{-1pt}{0pt}     \titlespacing{\subsection}{0pt}{0pt}{1em}          \setlength{\parindent}{0pt}          \newlength\NumLen     \newlength\LinLen     % indents one line of text. Indentation= width of section number + 1em     \newcommand\IndOne{%       \settowidth\NumLen{\thesection}       \addtolength\NumLen{1em}       \setlength\LinLen{\dimexpr\textwidth-\NumLen}%\the\NumLen\the\LinLen       \parshape 2 \NumLen \LinLen 0pt \textwidth}     % indents two lines of text. Indentation= width of section number + 1em     \newcommand\IndTwo{%       \settowidth\NumLen{\thesection}       \addtolength\NumLen{1em}       \setlength\LinLen{\dimexpr\textwidth-\NumLen}%\the\NumLen\the\LinLen       \parshape 3 \NumLen \LinLen \NumLen \LinLen 0pt \textwidth}          \usepackage[none]{hyphenat}     \sloppy     \usepackage{hyperref}     \hypersetup{         bookmarksdepth=1,         unicode=true,         colorlinks=true,         citecolor={black},         linkcolor={black},         urlcolor={black},         pdffitwindow=true,     }          \addtokomafont{disposition}{\rmfamily\mdseries}          \renewcommand{\contentsname}{Table of Contents}     \renewcommand*\cfttoctitlefont{\huge\hfill}     \renewcommand*\cftaftertoctitle{\hfill}     \renewcommand{\cftchapdotsep}{\cftdot}     \renewcommand{\cftpartfont}{\hfill\bfseries}     \renewcommand{\cftchapfont}{\mdseries}     \renewcommand{\cftpartpagefont}{\hfill\footnotesize\bfseries}     \renewcommand{\cftchappagefont}{\mdseries}     \setlength{\cftbeforetoctitleskip}{-4em}     \setlength{\cftaftertoctitleskip}{3em}     \setlength{\cftbeforechapskip}{.3em}     \setlength{\cftbeforepartskip}{.3em}     \setlength{\columnsep}{2pc}     \setlength\columnseprule{.4pt}          \begin{document}     \frontmatter         % Titlepage             \pdfbookmark[0]{Titlepage}{title}         \title{}         \subject{             \vspace{3cm}             \textbf{\Large{THE}\\\vspace{-0.3cm}             \Huge{HOLY}\\\vspace{0.05cm}             \Huge{BIBLE}}\\\vspace{0.5cm}         \author{} \date{}         }         \maketitle          \cleardoublepage     \pdfbookmark[0]{\contentsname}{tofcontents}     \begin{spacing}{0.01}     \tableofcontents     \end{spacing}     \cleardoublepage          \mainmatter     \pagestyle{Biblestyle}     \newlength{\myIndent}     \begin{center}     \phantomsection     \addcontentsline{toc}{part}{Old Testament}\noindent     \phantomsection     \addcontentsline{toc}{chapter}{Genesis}\noindent     THE FIRST BOOK OF MOSES, CALLED\\     \vspace{0.15cm}\textbf{\Huge{GENESIS}}\vspace{0.00cm}\\          \end{center}     \renewcommand{\chaptertitle}{Genesis}     \setcounter{section}{0}     \pdfbookmark[1]{1}{01O1}     \section{}\settowidth{\myIndent}     {\IndOne \Text}     \ifdimless{\the\myIndent}     {.99\textwidth}     {\IndOne \Text \stepcounter{subsection} \subsection{} \IndOne \Text}     {\IndTwo \Text \stepcounter{subsection} \subsection{} \Text}     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text          \pdfbookmark[1]{2}{01O2}     \section{}\settowidth{\myIndent}     {\IndOne \Text}     \ifdimless{\the\myIndent}     {.99\textwidth}     {\IndOne \Text \stepcounter{subsection} \subsection{} \IndOne \Text}     {\IndTwo \Text \stepcounter{subsection} \subsection{} \Text}     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text          \begin{center}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Exodus}\noindent     THE SECOND BOOK OF MOSES, CALLED\\     \vspace{0.15cm}\textbf{\Huge{EXODUS}}\vspace{0.00cm}\\     \end{center}     \renewcommand{\chaptertitle}{Exodus}     \setcounter{section}{0}     \pdfbookmark[1]{1}{02O1}     \section{}\settowidth{\myIndent}     {\IndOne \Text}     \ifdimless{\the\myIndent}     {.99\textwidth}     {\IndOne \Text \stepcounter{subsection} \subsection{} \IndOne \Text}     {\IndTwo \Text \stepcounter{subsection} \subsection{} \Text}     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \subsection{} \Text     \end{document}


title: Index hyperlinks to open a PDF file

text: The usual practice is that the index entries link to a page in the text where the word occurs. I am trying to index a list of files and am indexing each word in the file name. In the MWE below, clicking on the link in the index takes me to the appropriate section in the doc, and then I can click on that to open the file. Since the body of this document has no real meaning in this case (I am _only_ interested in the index), I would like a way to modify this two step process to be just one step. So, I would like the links in the index to be links to the file (as they are now in the main body of the document). I am assuming that this should only require a change to the `\ProcessWord` macro. ## Notes:   * The `datatool` package was used here only since my real use case gets the file names via this package.    * For the output links to open the actual files you need to use a PDF reader that supports that (such as Acrobat). The PDF viewer with `TeXShop 2.43` does have support, but not the one with `TeXWorks 2.3`. ## References:   * How do I split a string? ## Code:               \documentclass{article}     \usepackage{datatool}% database     \usepackage{imakeidx}% indexing     \usepackage{hyperref}% For cross references     \makeindex          % ---------- Process Each Word:     %     % http://tex.stackexchange.com/questions/12810/how-do-i-split-a-string     \makeatletter     \def\ProcessEachWord#1{%         \begingroup%         \edef\@tempa{#1\space}%         \gdef\@tempb{#1}%         \expandafter\endgroup%         \expandafter\ReadWords\@tempa\relax%     }%     \def\ReadWords#1 #2\relax{%           \ProcessWord[\@tempb]{#1}%  #1 = substr, #2 = rest of string           \begingroup%           \ifx\relax#2\relax% is #2 empty?              \def\next{\endgroup\EndProcessWords}% your own end-macro if required           \else%              \def\next{\endgroup\ReadWords#2\relax}%           \fi%           \next%     }%     \makeatother     % ----------                \newcommand{\ProcessWord}[2][]{%         %\par\noindent\href{run:#1.pdf}{#1}% Moved Below         \index{#2!#1}%         %~#2%     }%     \newcommand{\EndProcessWords}{}          \begin{document}     \DTLnewdb{DB}%          \DTLnewrow{DB}%      \DTLnewdbentry{DB}{FileName}{Now good enough}%           \DTLnewrow{DB}%      \DTLnewdbentry{DB}{FileName}{Now good enough for you and me}%           \DTLforeach{DB}{\FileName=FileName}{%         \section{\FileName}%         \par\noindent\href{run:\FileName.pdf}{\FileName}%         \ProcessEachWord{\FileName}%     }%          \printindex     \end{document}


title: LyX Error: Could not find LaTeX command for character '' (code point 0x2009)

text: I have been trying to copy and paste some code into LyX (via the 'Program Listings' menu item), and when I compile the document I get the LyX error:               Could not find LaTeX command for character '' (code point 0x2009)         LyX also suggested I convert the document I am attempting to copy and paste to UTF-8. However, I ran a `file --mime <mycodefile.py>` and a `file --mime <mycodefile.py>` and both return `charset=us-ascii`. Correct if I'm wrong, but isn't ascii a subset of UTF-8? If so, where is this offending 0x2009 character coming from, and how to I fix this issue?    Thanks    Note: instead of copying and pasting, I tried using 'Insert> File > Plain Text ...', and I got the same error. So it's not like the text is being reencoded somehow in the clipboard. **EDIT** : for some reason, after restarting lyx i could compile (slaps forehead). when I copy/pasted originally, the encoding may have been unicode, but then I cntl-Z'd and switched it to UTF-8 using vim. This error somehow persisted until restart.


title: Cross-reference entire enumerate list

text: I would like to refer to all the items of an `enumerate` environment, by applying a label to the list. I tried this               \documentclass{article}[10pt]     \usepackage{amsmath, hyperref, enumerate}     \begin{document}     \setcounter{section}{1}     \begin{enumerate}\label{listref}     \item Mary     \item Had     \item A little     \item Lamb     \end{enumerate}     The poem \eqref{listref} is one of the best known childrens' rhymes.     \end{document}      but that did not produce the result required. I think labelling the first and the last items on the list is an option, but I was wondering if there is a smoother way of doing this.


title: Can I convert a string to catcode 11?

text: In the TeX FAQ there's a way to test if the `jobname` is equal to something (comparing the jobname). The difficulty of the naïve test is that the contents of the `\jobname` primitive are catcode 12 so to test if the `\jobname` is, say, `myfile` we need to create a macro containing the string `myfile` but with catcode 12 and use that to compare against `\jobname`. This is all very well if you control the test. But what if you don't? What if there's some test deep in some package that you want to pass the `\jobname` (or some part of it) to and this test is against a predefined word of catcodes 11. Is there some way, like `\meaning`, that can convert its contents to catcode 11? _Added in edit_ : An example of possible use has been called for.               \documentclass{beamer}     %\url{http://tex.stackexchange.com/q/117892/86}          \expandafter\includeonlylecture\expandafter{\jobname}          \begin{document}          \lecture{An Astonishing Result}{euclid}          \begin{frame}{Euclid's Astonishing Result}     \end{frame}          \lecture{A Boring Result}{pythagoras}          \begin{frame}{Pythagoras' Boring Result}     \end{frame}          \end{document}      The intention being that:               pdflatex -jobname euclide lectures.tex      and               pdflatex -jobname pythagoras lectures.tex      produce different lectures.


title: Problems with copy and paste from PDF using lstlisting

text: I'm using lstlisting to create course notes from which I am hoping that code can be copy&paste'd I've already implemented the suggestions in Phantom spaces in listings (pdf) to make sure that there are no spurious spaces, but now the problem is that minus signs (-) are copied as non-ascii, and so when I paste the code into Matlab (in this case) I get an error. I'm assuming that this will happen with other characters, but at this point I have only trouble with the minus sign. I doubt it matters, but I've been using:               \definecolor{dkgreen}{rgb}{0,0.6,0}     \definecolor{gray}{rgb}{0.5,0.5,0.5}     \definecolor{mauve}{rgb}{0.58,0,0.82}          \lstset{ %       language=Matlab,                % the language of the code       basicstyle=\footnotesize,           % the size of the fonts that are used for the code       numbers=left,                   % where to put the line-numbers       numberstyle=\footnotesize,          % the size of the fonts that are used for the line-numbers       stepnumber=2,                   % the step between two line-numbers. If it's 1, each line                                        % will be numbered       numbersep=5pt,                  % how far the line-numbers are from the code       backgroundcolor=\color{white},      % choose the background color. You must add \usepackage{color}       showspaces=false,               % show spaces adding particular underscores       showstringspaces=false,         % underline spaces within strings       showtabs=false,                 % show tabs within strings adding particular underscores       frame=single,                   % adds a frame around the code       tabsize=2,                      % sets default tabsize to 2 spaces       captionpos=b,                   % sets the caption-position to bottom       breaklines=true,                % sets automatic line breaking       breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace       title=\lstname,                   % show the filename of files included with \lstinputlisting;                                       % also try caption instead of title       numberstyle=\tiny\color{gray},        % line number style       keywordstyle=\color{blue},          % keyword style       commentstyle=\color{dkgreen},       % comment style       stringstyle=\color{mauve},         % string literal style       escapeinside={\%*}{*)},            % if you want to add a comment within your code       morekeywords={*,...}               % if you want to add more keywords to the set       basicstyle=\ttfamily,       columns=flexible     }          \begin{lstlisting}     % notice how after a % one can write comments which can be used to     % explain the code inline.      % it will actually not bother Matlab if you copy the comments     % together with the code     x=2; % This is our first guess     for k=1:30 % we will iterate 30 times          x=x-(tan(x)-x/3)/(sec(x)-1/3) %notice that we are not using k. That is OK.     end     \end{lstlisting}      I cannot manage to lift the example and drop it into Matlab with it complaining about the (-) signs. Any ideas?


title: Count number of figures, tables and citations in report class

text: I'm using report documentclass and trying to use `totcount` for counting figures, tables and references, but there are two problems:   1. Figures and tables counters are reset for each chapter, so `\total{figure}` and `\total{table}` is displaying 0. How to find the total count of figures and tables throughout the document?   2. A solution for counting references given in `totcount` documentation              \newtotcounter{citesnum}     \def\oldcite{} \let\oldcite=\cite     \def\cite{\stepcounter{citesnum}\oldcite}      isn't working for me since I have several `\cite{}` commands for single reverence. Is there a way to work around this one as well?


title: pgfplots: Adding additional lines to a graph

text: I did an ANOVA with 4 tests. Result graph is shown here, original code comes from: TikZ: Replacing the values (labels) on x-axis with names               \documentclass[12pt]{article}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}          \begin{document}     \begin{tikzpicture}         \begin{axis}             [             ,width=7cm             ,xlabel=Test             ,ylabel=Mean             ,xtick=data,            %,xtick={0,1,...,3}             ,xticklabels={Test A,Test B,Test C,Test D}             ]             \addplot+[sharp plot] coordinates             {(0,18.26) (1,21.47) (2,24.58) (3,24.95)};         \end{axis}     \end{tikzpicture}     \end{document}      Problem: I want to add additional lines which indicate the results of pairwise comparisions as displayed in the example below: ![Repeated measurement with pairwise comparisions](http://i.stack.imgur.com/8Dn3d.jpg)   1. I could manually arrange further lines - is there a more elegant way?   2. How do I add the `***` and `**` near the lines?   3. How do I get a dotted line with arrows as endings?


title: How to retrieve the caption of a table (longtable)

text: I want to repeat the caption of a `longtable` on different pages.   1. Is there any way (other than defining a new variable to save the caption) to get it.    2. How can I get rid of the extra line after the caption for the first time, i.e., the header of the `longtable` in the first page. MWC (you can replace images ):               \documentclass[preprint, 12pt]     \usepackage[table]{xcolor}   % colored rows     \usepackage{longtable}          \begin{document}     \begin{longtable}{|c|c|c|}     \caption{Step by step execution trace of Algorithm \ref{algo:CWM}}     \label{tab:example01Table}               % %\begin{tabular}{|c|c|c|}          %     \\       % <=====  I want to get rid of this line please      \rowcolor{gray}     \# & Heap & Tour \\      \hline\hline     \endfirsthead     %     \multicolumn{3}{c}%             {{(Cont.) Table \thetable: Step by step execution trace of Algorithm }} \\          \rowcolor{gray}     \# & Heap & Tour \\      \hline\hline     \endhead          %          0 &  Empty & \includegraphics[width=\mylength]{t00.pdf} \\\hline     1 & \includegraphics[width=\mylength]{h01.pdf} & \includegraphics[width=\mylength]{t01.pdf} \\ \hline     2 & \includegraphics[width=\mylength]{h02.pdf} & \includegraphics[width=\mylength]{t02.pdf} \\ \hline     3 & \includegraphics[width=\mylength]{h03.pdf} & \includegraphics[width=\mylength]{t03.pdf} \\ \hline     4 & \includegraphics[width=\mylength]{h04.pdf} & \includegraphics[width=\mylength]{t04.pdf} \\\hline     5 & \includegraphics[width=\mylength]{h05.pdf} & No Change \\ \hline     6 & \includegraphics[width=\mylength]{h06.pdf} & No Change \\ \hline     7 & \includegraphics[width=\mylength]{h07.pdf} & \includegraphics[width=\mylength]{t07.pdf} \\ \hline     8 & \includegraphics[width=\mylength]{h08.pdf} & No Change \\ \hline     9 & \includegraphics[width=\mylength]{h09.pdf} & \includegraphics[width=\mylength]{t09.pdf} \\\hline     10 & \includegraphics[width=\mylength]{h10.pdf} & \includegraphics[width=\mylength]{t10.pdf} \\ \hline     11 & \includegraphics[width=\mylength]{h11.pdf} & \includegraphics[width=\mylength]{t11.pdf} \\ \hline     - & - & \includegraphics[width=\mylength]{finalTour.pdf} \\ \hline          % %\end{tabular}          \end{longtable}     \end{document}


title: How to start new numeration of theorems with every chapter?

text: What I want? [that way of numbering]               1   How to do squats          Theorem 1. Put your barbell on your shoulders.     Theorem 2. Squat.          2   How to do bench press          Theorem 1. Lean on a bench.     Theorem 2. Push.      What I get ![enter image description here](http://i.stack.imgur.com/EzO7M.png) with this MWE:               \documentclass[10pt]{article}     \usepackage[russian]{babel}      \usepackage[utf8]{inputenc}     \usepackage{amsthm}     \newtheorem{theorem}{Theorem}     \begin{document}          \section{How to do squats}          \begin{theorem}\normalfont     Put your barbell on your shoulders.     \end{theorem}          \begin{theorem}\normalfont     Squat.     \end{theorem}          \section{How to do bench press}          \begin{theorem}\normalfont     Lean on a bench.     \end{theorem}          \begin{theorem}\normalfont     Push.     \end{theorem}          \end{document}


title: Problem with options in \DeclareSiUnit

text: I also wanted to know How to use siunitx to write 100 MBps?, so `\sisetup{per- mode=symbol,per-symbol = p}` solved my question and I decided to use it as option in `\DeclareSIUnit[per-mode=symbol,per- symbol=p]{\Bps}{\byte\per\second}`. This way I can fix the format of `\per` with every unit and get Km/s and MBps on the same text without to write the format in each `\SI` command. Maybe this mixture is not correct but this is not my question. But something is missing because when I write `\SI{10}{\Bps}` I get 10 Bps, but with `\SI{10}{\mega\Bps}` the result is 10 MB/s. So, what's wrong? Here you have a MWE and it's results:               \documentclass[a4paper,12pt]{article}     \usepackage[load-configurations={abbreviations,binary}]{siunitx}     \sisetup{per-mode=symbol}          \DeclareSIUnit[per-mode=symbol,per-symbol=p]{\Bps}{\byte\per\second}          \begin{document}          \SI[per-mode=symbol,per-symbol=p]{1}{\mega\byte\per\second}          \SI{2}{\Bps}           \SI{3}{\mega\Bps}          \SI[per-mode=symbol,per-symbol=p]{4}{\mega\Bps}          \end{document}      ![enter image description here](http://i.stack.imgur.com/ZeR4P.png)


title: pgfplots, plot options ignored when using "restrict expr to domain"

text: This is my first post here. I want to use pgfplots (wonderful piece of software/code) to display some data (A,B,C) from a experiment. In some diagrams I want to plot x=A and y=B but only for some points that are within a speficic C-range. This can be done useing               restrict expr to domain      In one case all the plot options are ingored if I use this feature. See the example (myData2.csv). When I use slightly different data (myData and myData3) it works. I really tried all that is in my power but I do not solve this mystery. In the example below I have three plots all with the same options. Bur only in two cases this options are considered correctly. Where is my mistake?               \documentclass{standalone}       \usepackage{pgfplots}      \pgfplotsset{compat=newest}             \usepackage{filecontents}            \begin{filecontents}{myData.csv}      A;B;C     0.02;20;2     0.03;20;2     0.00;20;3     0.03;20;3     \end{filecontents}            \begin{filecontents}{myData2.csv}     A;B;C      0.02;1;40     0.02;2;40     0.02;3;40     0.02;4;40     0.02;5;40     0.01;0;40     0.01;1;40     0.3;2;40     0.3;3;40     0.01;4;40     0.01;5;40     \end{filecontents}           \begin{filecontents}{myData3.csv}      A;B;C     0.02;2;20     0.03;2;20     0.1;3;20     0.2;3;20     \end{filecontents}           \begin{document}          \begin{tikzpicture}     \begin{axis}[     xlabel={xlabel},     ylabel={ylabel},     xmin=0,     xmax=0.3,     ymin=0,     ymax=100,     width =100mm,     height = 70mm,     ]     \addplot         [         % Optionen           mark=*,          draw=red,         line width=1.5pt             ]         table         [            x=A,         y=B,         col sep=semicolon,         row sep = newline,         restrict expr to domain={\thisrow{C}}{2.1:3.1},          ] {myData.csv};         \addlegendentry{C = 3, file myData}      \addplot         [         % Optionen           mark=*,          draw=red,         line width=1.5pt             ]         table         [            x=A,         y=C,         col sep=semicolon,         row sep = newline,         restrict expr to domain={\thisrow{B}}{2.1:3.1},          ] {myData3.csv};         \addlegendentry{B = 3, file myData3}             \addplot         [         % Optionen         mark=*,          draw=red,         line width=0.5pt         ]         table         [            x=A,         y=C,         col sep=semicolon,         row sep = newline,         restrict expr to domain={\thisrow{B}}{2.1:3.1},          ] {myData2.csv};         \addlegendentry{B = 3, file myData2}         \end{axis}       \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/lrDOQ.png) **Solution**               \documentclass{standalone}       \usepackage{pgfplots}      \pgfplotsset{compat=newest}             \usepackage{filecontents}            \begin{filecontents}{myData2.csv}     A;B;C      0.0;3;40     0.0;2;40     0.1;3;40     0.1;2;40     0.2;3;40     0.2;2;40     0.3;3;40     0.3;2;40     0.4;3;40     0.4;2;40     \end{filecontents}           \begin{document}          \begin{tikzpicture}     \begin{axis}[     xlabel={xlabel},     ylabel={ylabel},     xmin=0,     xmax=0.3,     ymin=0,     ymax=100,     width =100mm,     height = 70mm,     ]           \addplot         [         % Optionen         mark=*,          draw=blue,         line width=0.5pt         ]         table         [            x=A,         y=C,         col sep=semicolon,         row sep = newline,         restrict expr to domain={\thisrow{B}}{2.1:3.1},          unbounded coords=discard % <-- important         ] {myData2.csv};         \addlegendentry{correct (points connected, using \texttt{unbounded coords=discard})}     \addplot         [         % Optionen         mark=o,          draw=red,         line width=1.5pt         ]         table         [            x=A,         y=C,         col sep=semicolon,         row sep = newline,         restrict expr to domain={\thisrow{B}}{2.1:3.1},          %unbounded coords=discard % <-- important         ] {myData2.csv};         \addlegendentry{not correct (points not connected)}             \end{axis}       \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/NfNC5.png)