title: cannot create longtable

text: could you please help me with the following matter? I am trying to create a long table using the `longtable` environment. But I keep getting errors. Thank you. Here is my code:               \documentclass[11pt, draft, titlepage]{article}     \bibliographystyle{plainnat}     \setlength{\oddsidemargin}{0.05in}     \setlength{\evensidemargin}{0.04in} \setlength{\textwidth}{6.6 in}     \setlength{\textheight}{600pt} \setlength{\topmargin}{0 in}     \setlength{\headheight}{0 in}     \setlength{\parindent}{0.5 cm}     \newcommand {\st}{\setlength{\baselineskip}{24pt}}     \newcommand{\fn}{\footnote}     \usepackage[dvips]{graphicx}     \usepackage[dvips]{lscape}     \usepackage{tabularx}     \usepackage{rotating}     \usepackage{array}     \usepackage{booktabs, multicol, multirow, afterpage, bigstrut}     \usepackage{longtable}               \begin{document}          \begin{longtable}{l|l|l|l|l|l|l}     \caption{Results from OLS Estimation}     \begin{small}     \hline     \hline               & \multicolumn{3}{c}{Males} & \multicolumn{3}{c}{Females} \\     \hline               & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\               & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} \\          \hline     \endfirsthead          \hline \multicolumn{7}{|r|}{{\tablename} \thetable{} -- Continued} \\ \hline               & \multicolumn{3}{c}{Males} & \multicolumn{3}{c}{Females} \\     \hline               & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\               & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} \\          \hline     \endhead          \hline \multicolumn{7}{|r|}{{Continued on next page}} \\ \hline     \endfoot          \hline \hline     \endlastfoot              Log wage & \multicolumn{1}{c}{0.2754**} & \multicolumn{1}{c}{0.1301*} & \multicolumn{1}{c}{-0.1309**} & \multicolumn{1}{c}{0.3629**} & \multicolumn{1}{c}{0.2700**} & \multicolumn{1}{c}{-0.0815+} \\               & \multicolumn{1}{c}{(0.0814)} & \multicolumn{1}{c}{(0.0613)} & \multicolumn{1}{c}{(0.0494)} & \multicolumn{1}{c}{(0.0803)} & \multicolumn{1}{c}{(0.0625)} & \multicolumn{1}{c}{(0.0473)} \\         Age   & \multicolumn{1}{c}{0.0128} & \multicolumn{1}{c}{0.0589} & \multicolumn{1}{c}{0.0432} & \multicolumn{1}{c}{0.0879} & \multicolumn{1}{c}{0.0226} & \multicolumn{1}{c}{-0.0691} \\               & \multicolumn{1}{c}{(0.0880)} & \multicolumn{1}{c}{(0.0740)} & \multicolumn{1}{c}{(0.0473)} & \multicolumn{1}{c}{(0.0812)} & \multicolumn{1}{c}{(0.0600)} & \multicolumn{1}{c}{(0.0520)} \\         Age sq & \multicolumn{1}{c}{0.0001} & \multicolumn{1}{c}{-0.0004} & \multicolumn{1}{c}{-0.0005} & \multicolumn{1}{c}{-0.0007} & \multicolumn{1}{c}{-0.0002} & \multicolumn{1}{c}{0.0005} \\               & \multicolumn{1}{c}{(0.0008)} & \multicolumn{1}{c}{(0.0006)} & \multicolumn{1}{c}{(0.0004)} & \multicolumn{1}{c}{(0.0007)} & \multicolumn{1}{c}{(0.0005)} & \multicolumn{1}{c}{(0.0005)} \\         Educ  & \multicolumn{1}{c}{0.0174} & \multicolumn{1}{c}{-0.0721} & \multicolumn{1}{c}{-0.1064**} & \multicolumn{1}{c}{-0.1381} & \multicolumn{1}{c}{-0.2056*} & \multicolumn{1}{c}{-0.0770**} \\               & \multicolumn{1}{c}{(0.0609)} & \multicolumn{1}{c}{(0.0543)} & \multicolumn{1}{c}{(0.0245)} & \multicolumn{1}{c}{(0.0902)} & \multicolumn{1}{c}{(0.0848)} & \multicolumn{1}{c}{(0.0258)} \\         Educ sq & \multicolumn{1}{c}{0.0003} & \multicolumn{1}{c}{0.0051*} & \multicolumn{1}{c}{0.0055**} & \multicolumn{1}{c}{0.0051} & \multicolumn{1}{c}{0.0095**} & \multicolumn{1}{c}{0.0047**} \\               & \multicolumn{1}{c}{(0.0026)} & \multicolumn{1}{c}{(0.0022)} & \multicolumn{1}{c}{(0.0013)} & \multicolumn{1}{c}{(0.0036)} & \multicolumn{1}{c}{(0.0032)} & \multicolumn{1}{c}{(0.0013)} \\         Non-labor inc & \multicolumn{1}{c}{0.0027*} & \multicolumn{1}{c}{0.0024*} & \multicolumn{1}{c}{-0.0003} & \multicolumn{1}{c}{0.0010} & \multicolumn{1}{c}{0.0013+} & \multicolumn{1}{c}{0.0002} \\               & \multicolumn{1}{c}{(0.0012)} & \multicolumn{1}{c}{(0.0010)} & \multicolumn{1}{c}{(0.0005)} & \multicolumn{1}{c}{(0.0008)} & \multicolumn{1}{c}{(0.0007)} & \multicolumn{1}{c}{(0.0004)} \\         HH wealth & \multicolumn{1}{c}{0.0079} & \multicolumn{1}{c}{0.0160*} & \multicolumn{1}{c}{0.0077} & \multicolumn{1}{c}{0.0022} & \multicolumn{1}{c}{0.0004} & \multicolumn{1}{c}{-0.0012} \\               & \multicolumn{1}{c}{(0.0093)} & \multicolumn{1}{c}{(0.0068)} & \multicolumn{1}{c}{(0.0050)} & \multicolumn{1}{c}{(0.0043)} & \multicolumn{1}{c}{(0.0038)} & \multicolumn{1}{c}{(0.0019)} \\         Nwhite & \multicolumn{1}{c}{0.9998**} & \multicolumn{1}{c}{0.7522**} & \multicolumn{1}{c}{-0.2394**} & \multicolumn{1}{c}{0.6197**} & \multicolumn{1}{c}{0.4897**} & \multicolumn{1}{c}{-0.1332*} \\               & \multicolumn{1}{c}{(0.1271)} & \multicolumn{1}{c}{(0.1149)} & \multicolumn{1}{c}{(0.0470)} & \multicolumn{1}{c}{(0.1142)} & \multicolumn{1}{c}{(0.0968)} & \multicolumn{1}{c}{(0.0572)} \\         Hisp  & \multicolumn{1}{c}{0.6440**} & \multicolumn{1}{c}{0.4753**} & \multicolumn{1}{c}{-0.1572**} & \multicolumn{1}{c}{0.6450**} & \multicolumn{1}{c}{0.6302**} & \multicolumn{1}{c}{-0.0371} \\               & \multicolumn{1}{c}{(0.1728)} & \multicolumn{1}{c}{(0.1607)} & \multicolumn{1}{c}{(0.0559)} & \multicolumn{1}{c}{(0.1904)} & \multicolumn{1}{c}{(0.1719)} & \multicolumn{1}{c}{(0.0701)} \\         Married & \multicolumn{1}{c}{-0.3104*} & \multicolumn{1}{c}{-0.3796**} & \multicolumn{1}{c}{-0.0801} & \multicolumn{1}{c}{0.2232*} & \multicolumn{1}{c}{-0.0784} & \multicolumn{1}{c}{-0.3247**} \\               & \multicolumn{1}{c}{(0.1472)} & \multicolumn{1}{c}{(0.1296)} & \multicolumn{1}{c}{(0.0853)} & \multicolumn{1}{c}{(0.1107)} & \multicolumn{1}{c}{(0.0858)} & \multicolumn{1}{c}{(0.0662)} \\         Poor health & \multicolumn{1}{c}{-0.0069} & \multicolumn{1}{c}{0.0406} & \multicolumn{1}{c}{0.0520} & \multicolumn{1}{c}{-0.0710} & \multicolumn{1}{c}{0.0845} & \multicolumn{1}{c}{0.1645**} \\               & \multicolumn{1}{c}{(0.1004)} & \multicolumn{1}{c}{(0.0801)} & \multicolumn{1}{c}{(0.0576)} & \multicolumn{1}{c}{(0.1052)} & \multicolumn{1}{c}{(0.0844)} & \multicolumn{1}{c}{(0.0590)} \\         Children (0-5) & \multicolumn{1}{c}{-0.1143} & \multicolumn{1}{c}{-0.0376} & \multicolumn{1}{c}{0.0835} & \multicolumn{1}{c}{0.0154} & \multicolumn{1}{c}{-0.0310} & \multicolumn{1}{c}{-0.0397} \\               & \multicolumn{1}{c}{(0.1293)} & \multicolumn{1}{c}{(0.0927)} & \multicolumn{1}{c}{(0.0825)} & \multicolumn{1}{c}{(0.1083)} & \multicolumn{1}{c}{(0.0919)} & \multicolumn{1}{c}{(0.0561)} \\         Children (6-18) & \multicolumn{1}{c}{-0.1533*} & \multicolumn{1}{c}{-0.0320} & \multicolumn{1}{c}{0.1166**} & \multicolumn{1}{c}{-0.1228+} & \multicolumn{1}{c}{-0.0113} & \multicolumn{1}{c}{0.1015*} \\               & \multicolumn{1}{c}{(0.0675)} & \multicolumn{1}{c}{(0.0513)} & \multicolumn{1}{c}{(0.0400)} & \multicolumn{1}{c}{(0.0652)} & \multicolumn{1}{c}{(0.0487)} & \multicolumn{1}{c}{(0.0407)} \\         N of own sis & \multicolumn{1}{c}{-0.0388} & \multicolumn{1}{c}{-0.0311} & \multicolumn{1}{c}{0.0098} & \multicolumn{1}{c}{0.0632*} & \multicolumn{1}{c}{-0.0008} & \multicolumn{1}{c}{-0.0510**} \\               & \multicolumn{1}{c}{(0.0281)} & \multicolumn{1}{c}{(0.0221)} & \multicolumn{1}{c}{(0.0152)} & \multicolumn{1}{c}{(0.0250)} & \multicolumn{1}{c}{(0.0208)} & \multicolumn{1}{c}{(0.0121)} \\         N of own bro & \multicolumn{1}{c}{0.0514+} & \multicolumn{1}{c}{0.0228} & \multicolumn{1}{c}{-0.0270+} & \multicolumn{1}{c}{0.0099} & \multicolumn{1}{c}{-0.0128} & \multicolumn{1}{c}{-0.0206} \\               & \multicolumn{1}{c}{(0.0268)} & \multicolumn{1}{c}{(0.0223)} & \multicolumn{1}{c}{(0.0138)} & \multicolumn{1}{c}{(0.0271)} & \multicolumn{1}{c}{(0.0224)} & \multicolumn{1}{c}{(0.0138)} \\         N of spouse sis & \multicolumn{1}{c}{0.0115} & \multicolumn{1}{c}{-0.0176} & \multicolumn{1}{c}{-0.0275*} & \multicolumn{1}{c}{-0.0105} & \multicolumn{1}{c}{0.0042} & \multicolumn{1}{c}{0.0197} \\               & \multicolumn{1}{c}{(0.0270)} & \multicolumn{1}{c}{(0.0221)} & \multicolumn{1}{c}{(0.0136)} & \multicolumn{1}{c}{(0.0277)} & \multicolumn{1}{c}{(0.0226)} & \multicolumn{1}{c}{(0.0146)} \\         N of spouse bro & \multicolumn{1}{c}{0.0052} & \multicolumn{1}{c}{0.0026} & \multicolumn{1}{c}{0.0002} & \multicolumn{1}{c}{0.0247} & \multicolumn{1}{c}{0.0168} & \multicolumn{1}{c}{-0.0091} \\               & \multicolumn{1}{c}{(0.0311)} & \multicolumn{1}{c}{(0.0252)} & \multicolumn{1}{c}{(0.0159)} & \multicolumn{1}{c}{(0.0292)} & \multicolumn{1}{c}{(0.0246)} & \multicolumn{1}{c}{(0.0141)} \\         N of parents & \multicolumn{1}{c}{0.2854**} & \multicolumn{1}{c}{0.3605**} & \multicolumn{1}{c}{0.0725*} & \multicolumn{1}{c}{0.2085**} & \multicolumn{1}{c}{0.2918**} & \multicolumn{1}{c}{0.0849*} \\               & \multicolumn{1}{c}{(0.0621)} & \multicolumn{1}{c}{(0.0469)} & \multicolumn{1}{c}{(0.0367)} & \multicolumn{1}{c}{(0.0625)} & \multicolumn{1}{c}{(0.0466)} & \multicolumn{1}{c}{(0.0367)} \\         Mothers/parents & \multicolumn{1}{c}{0.2108+} & \multicolumn{1}{c}{0.2918**} & \multicolumn{1}{c}{0.0499} & \multicolumn{1}{c}{0.2833*} & \multicolumn{1}{c}{0.3428**} & \multicolumn{1}{c}{0.0369} \\               & \multicolumn{1}{c}{(0.1190)} & \multicolumn{1}{c}{(0.0862)} & \multicolumn{1}{c}{(0.0772)} & \multicolumn{1}{c}{(0.1119)} & \multicolumn{1}{c}{(0.0799)} & \multicolumn{1}{c}{(0.0753)} \\         Parents' age & \multicolumn{1}{c}{-0.0137*} & \multicolumn{1}{c}{-0.0052} & \multicolumn{1}{c}{0.0076*} & \multicolumn{1}{c}{-0.0088} & \multicolumn{1}{c}{0.0022} & \multicolumn{1}{c}{0.0096*} \\               & \multicolumn{1}{c}{(0.0067)} & \multicolumn{1}{c}{(0.0056)} & \multicolumn{1}{c}{(0.0036)} & \multicolumn{1}{c}{(0.0068)} & \multicolumn{1}{c}{(0.0055)} & \multicolumn{1}{c}{(0.0038)} \\         Parents' educ & \multicolumn{1}{c}{-0.0619**} & \multicolumn{1}{c}{-0.0140} & \multicolumn{1}{c}{0.0437**} & \multicolumn{1}{c}{-0.0506**} & \multicolumn{1}{c}{-0.0064} & \multicolumn{1}{c}{0.0444**} \\               & \multicolumn{1}{c}{(0.0168)} & \multicolumn{1}{c}{(0.0139)} & \multicolumn{1}{c}{(0.0080)} & \multicolumn{1}{c}{(0.0158)} & \multicolumn{1}{c}{(0.0128)} & \multicolumn{1}{c}{(0.0083)} \\         At least one parent &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{} &  \\         single & \multicolumn{1}{c}{0.2178*} & \multicolumn{1}{c}{0.3229**} & \multicolumn{1}{c}{0.1104+} & \multicolumn{1}{c}{0.1486+} & \multicolumn{1}{c}{0.2837**} & \multicolumn{1}{c}{0.1480**} \\               & \multicolumn{1}{c}{(0.0945)} & \multicolumn{1}{c}{(0.0706)} & \multicolumn{1}{c}{(0.0575)} & \multicolumn{1}{c}{(0.0873)} & \multicolumn{1}{c}{(0.0668)} & \multicolumn{1}{c}{(0.0524)} \\         needs care & \multicolumn{1}{c}{0.0447} & \multicolumn{1}{c}{-0.0174} & \multicolumn{1}{c}{-0.0586} & \multicolumn{1}{c}{0.0251} & \multicolumn{1}{c}{0.0068} & \multicolumn{1}{c}{-0.0297} \\               & \multicolumn{1}{c}{(0.0892)} & \multicolumn{1}{c}{(0.0735)} & \multicolumn{1}{c}{(0.0459)} & \multicolumn{1}{c}{(0.0857)} & \multicolumn{1}{c}{(0.0694)} & \multicolumn{1}{c}{(0.0466)} \\         cannot be & \multicolumn{1}{c}{0.0740} & \multicolumn{1}{c}{0.1054} & \multicolumn{1}{c}{0.0193} & \multicolumn{1}{c}{-0.0068} & \multicolumn{1}{c}{-0.0029} & \multicolumn{1}{c}{0.0188} \\         left alone & \multicolumn{1}{c}{(0.0981)} & \multicolumn{1}{c}{(0.0797)} & \multicolumn{1}{c}{(0.0511)} & \multicolumn{1}{c}{(0.0913)} & \multicolumn{1}{c}{(0.0733)} & \multicolumn{1}{c}{(0.0499)} \\         homeowner & \multicolumn{1}{c}{-0.0436} & \multicolumn{1}{c}{0.0117} & \multicolumn{1}{c}{0.0492} & \multicolumn{1}{c}{0.0185} & \multicolumn{1}{c}{0.0415} & \multicolumn{1}{c}{0.0276} \\               & \multicolumn{1}{c}{(0.0957)} & \multicolumn{1}{c}{(0.0814)} & \multicolumn{1}{c}{(0.0448)} & \multicolumn{1}{c}{(0.0897)} & \multicolumn{1}{c}{(0.0745)} & \multicolumn{1}{c}{(0.0461)} \\         poorer & \multicolumn{1}{c}{0.8224**} & \multicolumn{1}{c}{0.7197**} & \multicolumn{1}{c}{-0.1096*} & \multicolumn{1}{c}{0.8435**} & \multicolumn{1}{c}{0.6969**} & \multicolumn{1}{c}{-0.1552**} \\               & \multicolumn{1}{c}{(0.0828)} & \multicolumn{1}{c}{(0.0671)} & \multicolumn{1}{c}{(0.0434)} & \multicolumn{1}{c}{(0.0798)} & \multicolumn{1}{c}{(0.0668)} & \multicolumn{1}{c}{(0.0397)} \\         richer & \multicolumn{1}{c}{-0.9860**} & \multicolumn{1}{c}{-0.4509**} & \multicolumn{1}{c}{0.5021**} & \multicolumn{1}{c}{-1.0081**} & \multicolumn{1}{c}{-0.4896**} & \multicolumn{1}{c}{0.4862**} \\               & \multicolumn{1}{c}{(0.0851)} & \multicolumn{1}{c}{(0.0636)} & \multicolumn{1}{c}{(0.0525)} & \multicolumn{1}{c}{(0.0805)} & \multicolumn{1}{c}{(0.0590)} & \multicolumn{1}{c}{(0.0495)} \\     \hline         Observations & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{13,275} & \multicolumn{1}{c}{13,275} & \multicolumn{1}{c}{13,275} \\         R-squared & \multicolumn{1}{c}{0.0956} & \multicolumn{1}{c}{0.0875} & \multicolumn{1}{c}{0.0570} & \multicolumn{1}{c}{0.0929} & \multicolumn{1}{c}{0.0819} & \multicolumn{1}{c}{0.0555} \\     \hline     \hline     \end{small}     \label{tab:OLSresults}     \end{longtable}          \end{document}


title: How to not overlap over the footnote line?

text: The picture shows my problem. I don't want to overlap over the line of the footnote. Is there a way to avoid that ? thank you ![enter image description here](http://i.stack.imgur.com/PJ0Te.png) a portion of the code that generates that :               \begin{frame}     \frametitle{Ligne de partage des eaux\footnotemark}          La méthode des lignes de partage des eaux s'appuit sur la métaphore du comportement de l'eau dans un paysage.          \footnotetext[2]{Watershed}     \end{frame}


title: Customizing autocite with biblatex

text: I am getting some unexpected output with `biblatex`. In the following MWE I expect to get the same thing with `\footcites` and `\autocites`               \documentclass{article}     \usepackage[autocite=footnote]{biblatex}     \DeclareCiteCommand{\footcite}[\mkbibfootnote]{A}{B}{\multicitedelim}{}     \DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]{\footcite}{\multicitedelim}     \DeclareAutoCiteCommand{footnote}{\footcite}{\footcites}     \bibliography{biblatex-examples.bib}     \begin{document}     \footcite{aksin}     \autocite{aksin}     \footcites{aksin}{aksin}     \autocites{aksin}{aksin}     \end{document}      If I add `\letcs\autocites{blx@macite@footnote}` then `\footcites` and `\autocites` give me the same output. I feel like I am missing something about how `autocite` works. Further, if I change the `biblatex` package options to `autocite=myfootnote` and use `\DeclareAutoCiteCommand{myfootnote}{\footcite}{\footcites}` I get errors. What am I doing wrong?


title: parindent in TikZ node

text: I'm playing around with the new `ocgx` package. It uses `TikZ` nodes to place text. Unfortunately, `parindent` does not work in the nodes. Is there a way to make it work? **Edit (source code)**               \documentclass{scrartcl}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{lipsum}     \usepackage{tikz}     \usepackage{amsmath}     \usetikzlibrary{calc,shadows,ocgx}     \AtBeginDocument{\edef\normalparindent{\the\parindent}}     \begin{document}     \tikzset{       checkbox/.style={         draw,circle,line width=.5pt,%         minimum size=.7em,top color=white,bottom color=cyan,         fill opacity=1,         inner sep=0,         drop shadow={fill=black,shadow xshift=.5mm,shadow yshift=-.5mm},       },       mytext/.style={         text width=\textwidth,align=justify,         every node={\setlength\parindent{\normalparindent}},         inner xsep=0pt,       },       mycomment/.style={         text width=\textwidth-2cm,align=justify,         fill=yellow!20,         inner xsep=.5cm,         inner ysep=.5cm,         outer xsep=.5cm,         draw=gray,       }     }          \lipsum[1]          \bigskip     \noindent%     \begin{tikzpicture}           \begin{scope}[ocg={name=mytext,ref=mytext}]         \node[mytext]{\setlength\parindent{\normalparindent}%           In elementary algebra, the \textbf{binomial theorem} describes the algebraic expansion of powers of a binomial. According to the theorem, it is possible to expand the power $(x + y)^n$ into a sum involving terms of the form $ax^{b}y^{c}$, where the exponents $b$ and $c$ are nonnegative integers with $b + c = n$, and the coefficient $a$ of each term is a specific positive integer depending on $n$ and $b$. When an exponent is zero, the corresponding power is usually omitted from the term.                This formula and the triangular arrangement of the binomial coefficients are often attributed to Blaise Pascal, who described them in the 17th century, but they were known to many mathematicians who preceded him. The 4th century B.C. Greek mathematician Euclid mentioned the special case of the binomial theorem for exponent 2 as did the 3rd century B.C. Indian mathematician Pingala to higher orders. A more general binomial theorem and the so-called "Pascal's triangle" were known in the 10th-century A.D. to Indian mathematician Halayudha and Persian mathematician Al-Karaji, in the 11th century to Persian poet and mathematician Omar Khayyam, and in the 13th century to Chinese mathematician Yang Hui, who all derived similar results. Al-Karaji also provided a mathematical proof of both the binomial theorem and Pascal's triangle, using mathematical induction.\par         };%       \end{scope}       \begin{scope}[ocg={name=mycomment,status=invisible,ref=mycomment}]         \node[mycomment]{binomial theorem:           \begin{align}             (a+b)^{2} & = a^{2}+2ab+b^{2}\\             (a-b)^{2} & = a^{2}-2ab+b^{2}\\             (a+b)(a-b) & = a^{2}-b^{2}           \end{align}         };%       \end{scope}     \end{tikzpicture}     \par     \begin{center}     \begin{tikzpicture}       \node[checkbox,switch ocg with mark on={mycomment}{mytext,mycomment}]{};     \end{tikzpicture} show formulas      \end{center}          \bigskip     \lipsum[2]          \end{document}        * Layer 1 ![enter image description here](http://i.stack.imgur.com/ofnzx.png)   * Layer 2 ![enter image description here](http://i.stack.imgur.com/iXA61.png)   * Layer 2 (new after Edit) ![enter image description here](http://i.stack.imgur.com/WJGny.png)


title: Why does the \marginpar not appear on the left page?

text: I am working on a book right now and the margin notes are not appearing on the left-side pages. I tried using mparhack but it made no difference. Is my geometry, fancy style or another package messing up the normal layout? I am using pdflatex to render. Here is a minimal test case:               \documentclass[twoside,10pt]{book}     \usepackage[margin=9mm,paperwidth=107.95mm,paperheight=174.63mm,bottom=18mm]{geometry}     %\usepackage[cam,a4,center,pdftex]{crop}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage{fancyhdr}     \usepackage{lipsum}     \pagestyle{fancy}     \fancyhead{}     \fancyfoot[C]{\thepage}     \renewcommand{\headrulewidth}{0pt}     \fontsize{10.5}{13}\selectfont     \usepackage[sc,medium]{titlesec}     \usepackage{tocloft}     \addtocontents{toc}{%                 \protect\renewcommand{\protect\cftchapleader}{%-- switch it on here                         \protect\cftdotfill{\protect\cftdotsep}}}     \addtocontents{toc}{\protect\thispagestyle{empty}}     \renewcommand{\cfttoctitlefont}{\hfill\scshape}     \renewcommand\cftaftertoctitle{\hfill\null\\\null\hfill\scshape{Page}}     \renewcommand{\cftchapfont}{\normalsize\scshape}     \renewcommand{\cftchappagefont}{\normalsize\scshape}     \setlength{\emergencystretch}{3em}     \title{Heroic Real Estate Otter of the 21st Century}     \date{}     \begin{document}     \frenchspacing     \chapter*{Thread 0}     \addcontentsline{toc}{chapter}{Thread 0}     \pagestyle{fancy}     \hspace{0pt}\marginpar[$\omega$]{$\omega$}\lipsum[4-6]          NEXT\hspace{0pt}\marginpar[$\psi$]{$\psi$}\lipsum[10]          \end{document}


title: How to use pgfplotstable's iflessthan key

text: `pgfplotstable` offers the `iflessthan` key to define a custom comparison function: `/pgfplots/iflessthan/.code args={##1##2##3##4}{<...>}` I just don't know how to use it, there's no example in the manual. What I'd like to do is to sort a table by a column that contains integers, but they are too big for `sort cmp={int <}` to handle. Here is a small examples that generates the table I want, but without the desired sorting:               \documentclass[a4paper,10pt]{scrartcl}          \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{pgfplotstable}     \usepackage{etoolbox}          \begin{document}       \pagestyle{empty}       \pgfplotstableread[trim cells=true,col sep=semicolon,header=false]{     % column 3: index, column 6: value     ;;;20730691;;;500     ;;;20730690;;;450     ;;;44569;;;400     ;;;;;;345     ;;;6366132;;;300     ;;;6366133;;;300     ;;;6366134;;;NER     }{\privateTable}       \pgfplotstablesort[sort,sort key={[index]3},sort cmp={string <},sort ]{\publicTable}{\privateTable}       \pgfplotstabletypeset[columns={3,6},                             columns/3/.style={column name=index,string type},                             columns/6/.style={column name=value,                               assign cell content/.code={% convert NER to ner                                 \ifstrequal{##1}{NER}{%                                   \pgfkeyssetvalue{/pgfplots/table/@cell content}{ner}                                 }{%                                   \pgfkeyssetvalue{/pgfplots/table/@cell content}{\pgfmathprintnumber{##1}}                                 }%                               }                             },                             row predicate/.code={% skip rows with empty index                               \pgfplotstablegetelem{#1}{3}\of{\publicTable}                               \ifnum\pdfstrcmp{\pgfplotsretval}{}=0                                 \pgfplotstableuserowfalse                               \fi                             },                             ]\publicTable     \end{document}      When I change `sort cmp` from `int <` to `string <`, I get three `missing number, treated as zero` errors. This is why I'd like to define a comparison function based on `\ifnumless` (from the `etoolbox` package). How can I do that? * * * When I just copy the `string <` style definition from `pgfplotsutil.code.tex`, I get numerous               !Parameters must be numbered consecutively.       <to be read again>;                          ##      errors:               \pgfplotstablesort[sort,       sort key={index},       iflessthan/.code args={##1##2##3##4}{%         \t@pgfplots@toka=\expandafter{##1}%         \t@pgfplots@tokb=\expandafter{##2}%         \edef\pgfplots@loc@TMPa{{\the\t@pgfplots@toka}{\the\t@pgfplots@tokb}}%         \expandafter\pgfplotsutilstrcmp\pgfplots@loc@TMPa         \if1\pgfplotsretval ##3\else ##4\fi       }       ]{\publicTable}{\privateTable}


title: How to edit eps images in TPX

text: I am making some plots in `Matlab` and then I save my plots as `eps` file as I want to get very hight quality images in `latex` docuement. But I need to edit my plots sometimes to put some comments etc on the plots. I am using `TPX` drawing tool to edit my other images. How Can i edit my eps images in TPX? I tried to import eps file in TPX but it gives error `psToedit file not created`


How do I use IEEE and AIP bibliography styles in biblatex? Is there a resource somewhere that has `bbx` and `cbx` style files? For AIP, I have seen REVTeX, but it only uses the basic BibTeX `bst`, not the BibLaTeX `bbx` and `cbx`. Also, I do not know how to use just the bibliography style without having to use the REVTeX document class.


title: How can I produce such a graph of my piecewise function?

text: I am writing my thesis in behavioural economics and have to draw individual discount functions, I did the following graph with stata, but would love to have it with tikz. ![enter image description here](http://i.stack.imgur.com/7HUrq.png) I played around in tikz and got this so far:               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}         \begin{axis}[domain=-1:5,samples=400]             \addplot+[mark=none] {1-(1-0.7*0.8)*(x+1)};             \addplot+[mark=none] {0.7*0.8^(x+1)};         \end{axis}     \end{tikzpicture}     \end{document}      which leads to this output: ![enter image description here](http://i.stack.imgur.com/39KUQ.png) Sadly my deadline is very soon. Could anyone help me with following fixes?   1. the range of the y-axis should be from 0 to 1   2. the range of the x-axis should be from 0 to 5, AND the x-value showed should be the true value of the function +1   3. the functions shouldn't cross, just touch i.e.              \addplot+[mark=none] {1-(1-0.7*0.8)*(x+1)};      from x=-1 to 0 (showed values: 0 to 1)               \addplot+[mark=none] {0.7*0.8^(x+1)};      from x=0 to 4 (showed values: 1 to 5)   4. Both functions should have the same colour (black) ![enter image description here][1]


title: Work diagram help

text: I am trying to create this sort of diagram (or graph). The X axis is time, Y axis are projects/tasks and lines through them are people (employees) working on certain task in given time period. I've found similar diagram, which is enclosed below. It is a star wars plot/story diagram from http://xkcd.com/657/. More or less sums up my needs. I know I could draw it by hand in eg. LibreOffice Draw or such a program, but first I'd like to know if there's any possibility of having this directly in tex. BTW: if any of you know the exact name of this diagram/graph, please let me know. Thank you all in advance ![enter image description here](http://i.stack.imgur.com/yeZLu.png)


title: How to redefine the caption command with optional arguments

text: I'm writing a thesis that has double spacing on by default throughout the document. However, captions on figures need to be singlepaced. I can do that like this               \normalsize \singlespace \caption{ bla bla bla}      where singlespace is defined as:               \newcommand{\singlespace}{\renewcommand{\baselinestretch}{1.0}}      * * * This gets old, so I want to redefine caption, which I did like this:               \let\savedCaption=\caption     \renewcommand{\caption}[1]{\normalsize\singlespace\savedCaption{#1}}      This works fine, but sometimes I want to specify the optional tablename for my list of tables. So I do this,               \renewcommand{\caption}[2][]{\normalsize\singlespace\savedCaption[#2]{#1}}      Unfortunately, this will default the table name to be empty. The behavior I really want is this:               \renewcommand{\caption}[2][#1]{\normalsize\singlespace\savedCaption[#2]{#1}}      ...but latex complains about that. Can anyone help me get caption redefined properly?


title: Setting \pagestyle{fancy} seems into create an error

text: Calling `fancy` page style is somehow apparently causing the following condition to test true.               \documentclass{article}     \usepackage{fancyhdr}     \pagestyle{fancy}     \ifcsname chapter\endcsname%         \renewcommand{\chapter}{}     \fi     \pagestyle{empty}     \begin{document}     testing     \end{document}      If I place `\pagestyle{fancy}` after the conditional, `\ifcsname chapter....\fi`, everything works. This is an `article` class, so this conditional should be false. If I call `\pagestyle{plain}`, it doesn't matter where I place it. Why does this order matter?


title: dotted arrow with pb-diagram

text: Moreover, it is possible to get two parallel maps (one pointing to the left, the other to the right and **shaft option being dotted or dashed arrow** ) between two nodes using pb-diagram? This question is related to: double arrow with pb-diagram .Thank you!


title: correct pronunciation of TeX

text: Yes Yes I know it has been asked (several times), but I still feel confused. In the TeXbook, Donald Knuth wrote: > _Insiders pronounce the χ of TeX as a Greek chi, not as an ‘x’_ (I hope that I didn't misunderstand what this phrase means). But I did try to listen the Greek pronunciation of the letter `χ`, and it sounds like the word `he` in English. For example: http://www.bbc.co.uk/languages/greek/guide/alphabet.shtml or http://www.ilearngreek.com/lessons/alphabet.L1.asp But if so, the pronunciation is weird (at least for me). Did I misunderstand what Donald Knuth wrote above? It would be nice to have your sound in a mp3. A text description is too hard to understand the pronunciation.


title: Adding node to last coordinate

text: I have a loglog plot and would like to highlight the last coordinate. For example               \begin{tikzpicture}     \begin{loglogaxis}[]     \addplot+[] coordinates{(0,0) (2,20) (3,100) (4,4000)};     \end{loglogaxis}     \end{tikzpicture}      I want a node **only** on the last coordinate showing a value of 4000. The option `nodes near coords` does not what I want since it displays all coordinates and only their log values.


title: How to insert an un-aligned equation inside an aligned equation block?

text: Here is a block of LaTeX that contains an un-aligned equation between 2 aligned equation blocks.               \begin{gather*}         \begin{align*}             a &= b (c + d)&\\               &= bc + bd&         \end{align*}\\         [ \text{as } bc = zx \text{, and } bd = zy \text{, (this may be a long description occupying one line)} ]\\         \begin{align*}               &= zx + zy&\\               &= z(x + y)&         \end{align*}\\     \end{gather*}      The output looks like :                          a = b(c + d)                  = bc + bd     [as bc = zx, and bd = zy, (this may be a long description occupying one line)]         = zx + zy         = z(x + y)      You should notice that the "equal" sign in the second aligned block is not placed in the same position as the first aligned block. I want to know that is there a way to align the "equal" sign in the second aligned block so that it is placed at the same position as the first aligned block. i.e. It should look like :                          a = b(c + d)                  = bc + bd     [as bc = zx, and bd = zy, (this may be a long description occupying one line)]                  = zx + zy                  = z(x + y)      Thanks for any suggestion.


title: Defining a macro with combine many options to one bracket

text: I am beginner in writing macros with multi options. What I want to do, is to combine many options to one pair of brackets.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \makeatletter     \def\DLineS{%     \@ifnextchar[%      {\DLineS@i}      {\DLineS@i[1.25]}%     }     \def\DLineS@i[#1]{%     \@ifnextchar[%      {\DLineS@ii{#1}}      {\DLineS@ii{#1}[-0.25]}%     }     \def\DLineS@ii#1[#2]#3#4{%     \draw[latex-latex] ($(#3)!#2!(#4)$) -- ($(#3)!#1!(#4)$)      }     \makeatother     \begin{document}     \begin{tikzpicture}     \coordinate[label=below:{\small $A$}] (A) at (0,0);     \coordinate[label=below:{\small $B$}] (B) at (1,1);     \filldraw (A) circle (1.5pt);     \filldraw (B) circle (1.5pt);     \DLineS[1.5][-0.75]{A}{B};     % I want this line is \DLineS[1.5,-0.75]{A}{B};     \end{tikzpicture}     \end{document}


title: Underfull vbox and typearea warnings with Koma-Script and a5paper

text: I have this in the preamble:               \documentclass[a5paper]{scrbook}     \usepackage[utf8x]{inputenc}     \usepackage[spanish]{babel}     \usepackage{graphicx}     \usepackage[T1]{fontenc}     \usepackage[light,oldstylenums,largesmallcaps]{kpfonts}     \usepackage{lettrine}     \renewcommand*{\chapterpagestyle}{empty}      I'm getting this warning:               Maybe no optimal type area settings!     (typearea)                The maximum limit of line width is about 18%     (typearea)                larger than the heuristically detected line width.     (typearea)                You may e.g. increase DIV, decrease fontsize     (typearea)                or change the papersize.      and               underfull vbox (badness 10000)      If I set the paper size to a4, the warnings disappear. But the point is I want to use a5 paper size! Thank you for your help.


title: How can I draw a line in a figure environment?

text: I have put together a figure in Inkscape, however, for the last four lines I wanted to add, the program has for some reason not allowed it. I'm putting this figure into a LaTeX document in the following way               \begin{figure}[ht]     \centering     \includegraphics[width=13cm]{Amplitudes2.eps} %Amplitudes2 is my figure.     \setlength{\unitlength}{0.1\textwidth}     \begin{picture}(0,0)     \put(-3.83,0.26){\footnotesize{$1000$}}     \end{picture}     \parbox{5.4in}{\vspace{0.6cm}\caption{Caption goes here.}}     \end{figure}      Here is the figure as shown in the document: ![enter image description here](http://i.stack.imgur.com/kseax.png) This is what I would like to have: ![enter image description here](http://i.stack.imgur.com/NSMDa.png) I just want to add some simple dotted lines (that I couldn't add in Inkscape). I normally add figure labels etc. using the `\put` command as shown in the MWE for the text "1000". Can I use something similar thing for this dotted line?


title: Making cards for Magic: The Gathering and similar card games

text: I'm creating cards for a card game. They will be similar to cards in _Magic: The Gathering_ (left-hand image below). What I have is in the right-hand image below. ![fireball](http://i.stack.imgur.com/5KFtq.jpg) ![fury](http://i.stack.imgur.com/IroRg.png) The problem is that the code doesn't generate the image in a modifiable/maintainable way, in the following respect. The image essentially consists of four juxtaposed blocks of varying shapes ('Fury', the white square, 'Persistent' and the final text square). There is then a red border (as it happens, with a drop shadow) drawn around these blocks and along the boundaries between them. At the moment I am manually specifying the path of the border. Now, I want to be able to change the number and position of the various blocks (for different types of cards) and have the border automatically adapt. It seems that it might be possible to do this by taking the union of the blocks, and 'expanding' it a little to form a red object which sits behind the blocks. So something like a drop shadow operation, but more complex. (Then that red object would itself need a drop shadow.) Is this feasible? NB. Any other visual improvements would be gratefully received! Edit: I've realised that drawing the 4 boxes with thick red lines at the borders might have the desired effect. Or more exactly, I need the following in order:   1. the drop shadows (thickened lines, black, translated) and (thickened lines, white, translated)    2. the border (thickened lines, red)   3. the original material.  A key problem is that applying 1,2,3 for the first block, then the second, etc. will fail -- all step 1s need to happen before all step 2s, and so on. Is it possible to make a style that does this? Code:               \documentclass[a4paper,11pt]{article}     \usepackage[T1]{fontenc}     \usepackage[margin=2mm]{geometry}     \usepackage{tikz,nopageno}     \usepackage{wasysym}     \usepackage{expl3}     \usepackage{ifthen}     \usepackage{etoolbox}     \usepackage{color}     \usepackage{blindtext}     %\usepackage{contour}          \usepackage{libertine}     \usepackage{multicol}               \ExplSyntaxOn     \cs_new_eq:NN \Repeat \prg_replicate:nn     \ExplSyntaxOff          %\renewcommand\Repeat[2]{#2}          \setlength\parskip{0mm}     \setlength\parindent{0mm}          \usetikzlibrary{shadows}          \newcommand{\rounding}{3mm}     \newcommand{\cardheight}{88mm}     \newcommand{\cardwidth}{63mm}     \newcommand{\backgroundthickness}{5mm}     \newcommand{\framethickness}{0.6mm}     \newcommand{\attbartop}{42mm}     \newcommand{\attbarbottom}{35mm}     \newcommand{\topbarbottom}{76mm}          \begin{document}          \newcommand{\highlight}[2]{%     \begin{tikzpicture}[baseline = (text.base)]       \node[inner sep=0pt] (text) {#2};       \begin{pgfinterruptboundingbox}         \begin{pgfonlayer}{background}         \node[fit=(text), rounded corners, fill=#1, draw=none] {};         \end{pgfonlayer}       \end{pgfinterruptboundingbox}     \end{tikzpicture}%     }          \tikzset{path image/.style={     path picture={     \node at (path picture bounding box.center) {     \includegraphics[height=90mm]{#1}     };}}}          \tikzset{double shadow/.style={     drop shadow={shadow xshift=-0.5mm,shadow yshift=-0.5mm,black},     preaction={drop shadow={shadow xshift=0.3mm,shadow yshift=0.3mm,white!70!black}}     }}          \newcommand{\card}[7]{%     \begin{tikzpicture}         \fill[black,rounded corners=\rounding] (0,0) rectangle (\cardwidth,\cardheight);               %\draw[path image=texture_#1.png,rounded corners=1mm] (\rounding,\rounding) rectangle (\cardwidth-\rounding,\cardheight-\rounding);              \fill[#1!75!black, %Draw red frame               double shadow]            (\backgroundthickness,\backgroundthickness)               -- (\backgroundthickness,\attbarbottom)               to[bend left] (\backgroundthickness,\attbartop)               -- (\backgroundthickness,\topbarbottom)               to[bend left] (\backgroundthickness,\cardheight-\backgroundthickness)               -- (\cardwidth-\backgroundthickness,\cardheight-\backgroundthickness)               to[bend left] (\cardwidth-\backgroundthickness,\topbarbottom)               -- (\cardwidth-\backgroundthickness,\attbartop)               to[bend left] (\cardwidth-\backgroundthickness,\attbarbottom)               -- (\cardwidth-\backgroundthickness,\backgroundthickness)               -- cycle;              \fill[#1!10,drop shadow={shadow xshift=-0.2mm,shadow yshift=0.3mm,black}] %Draw text box             (\backgroundthickness+\framethickness,\backgroundthickness+\framethickness) rectangle              (\cardwidth-\backgroundthickness-\framethickness,\attbarbottom);              \draw[black,thick,fill=#1!40] %Draw center bar              (\backgroundthickness+\framethickness,\attbarbottom+\framethickness)               to[bend left] (\backgroundthickness+\framethickness,\attbartop-\framethickness)               -- (\cardwidth-\backgroundthickness-\framethickness,\attbartop-\framethickness)               to[bend left] (\cardwidth-\backgroundthickness-\framethickness,\attbarbottom+\framethickness)               -- cycle;              \draw[black,thick,fill=white] %Draw Image placeholder             (\backgroundthickness+\framethickness,\attbartop) rectangle              (\cardwidth-\backgroundthickness-\framethickness,\topbarbottom);              \draw[black,thick,fill=#1!40] %Draw top bar              (\backgroundthickness+\framethickness,\topbarbottom+\framethickness)               to[bend left] (\backgroundthickness+\framethickness,\cardheight-\backgroundthickness-\framethickness)               -- (\cardwidth-\backgroundthickness-\framethickness,\cardheight-\backgroundthickness-\framethickness)               to[bend left] (\cardwidth-\backgroundthickness-\framethickness,\topbarbottom+\framethickness)               -- cycle;              \node[anchor=south west] at (\backgroundthickness,\topbarbottom+1mm) {\raisebox{0pt}[\height][0pt]{\bf #2}};         \node[anchor=east] at (\cardwidth-\backgroundthickness-\framethickness+0.5mm,\topbarbottom+3.5mm) {\raisebox{0pt}[\height][0pt]{\bf #3}};         \node[anchor=south west] at (\backgroundthickness,\attbarbottom+1mm) {\raisebox{0pt}[\height][0pt]{#5}};                  \node[anchor=north west,text width=\cardwidth-2*\backgroundthickness-2*\framethickness-2mm,font=\footnotesize] at (\backgroundthickness+\framethickness,\attbarbottom-0.5mm) {#6};              \node[anchor=south east,font=\tiny] at (\cardwidth-\backgroundthickness-\framethickness,\backgroundthickness+\framethickness) {\raisebox{0pt}[\height][0pt]{\bf Tier #7}};          \end{tikzpicture}}          \newcommand{\cost}[2]{%     \begin{tikzpicture}         \node[fill=#1!75!black,shape=circle,inner sep=0.3mm,draw=black,text=white,text width={}] (TEXT) {\raisebox{0pt}[\height][0pt]{\bf #2}};     \end{tikzpicture}}          \newcommand{\inlinecost}[2]{%     \begin{tikzpicture}[baseline={(TEXT.base)}]         \node[fill=#1!75!black,shape=circle,inner sep=0.3mm,draw=black,text=white,text width={}] (TEXT) {\raisebox{0pt}[\height][0pt]{\bf #2}};     \end{tikzpicture}}          \card{red}{Fury}{\cost{red}{1}}{}{Persistent}{You gain a \textbf{Bonus} of 1 to all melee attack rolls.\\\  \\Effect ends when a double is rolled on a melee attack.\\\  \\\textit{Bonuses do not stack.}}{1}          \end{document}      (I've commented out a line that uses a red texture, but just in case: it's here and must be renamed to `texture_red.png`.)


title: setspace kill the \flushbottom, how to make the sep between footnote item equal that in normal text

text: I want double spacing, but then sep between footnote item is strange. I use `setspace` package, but it kill the `\flushbottom` mechanism. Is there a method after I set \linespread{2}, the footnote text area have no other difference with normal text area, just like a `\footnotesize` declaration insert into? Anyway, here is my code:               \documentclass{article}     \linespread{2}     \usepackage{lipsum}     \begin{document}     \lipsum[1]     abc\footnote{murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur} def\footnote{murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur murmur}     \lipsum[2]     \end{document}      See here. I am not satisfied with the sep between the two footnotes. I want they could be this. If I use `setspace`, the bottom of page is ragged. It's too ugly. There are the samples (please compare the output, especially bottom of page 1)               \documentclass{article}     \usepackage{lipsum}     \usepackage[width=5in,height=8in]{geometry}     \usepackage{amsmath}     \usepackage{setspace}     \doublespacing     %\linespread{1.667}     \usepackage{footmisc}     \setlength{\parskip}{0pt}     \flushbottom     \newcommand{\MY}{\dfrac{1+\dfrac{\sum}{\sum}}{\dfrac{\sum}{\sum}+1}}     \begin{document}     \setlength{\abovedisplayskip}{1pt plus0.1pt minus0.1pt}     \setlength{\belowdisplayskip}{1pt plus0.1pt minus0.1pt}     \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]     \end{document}                    \documentclass{article}     \usepackage{lipsum}     \usepackage[width=5in,height=8in]{geometry}     \usepackage{amsmath}     %\usepackage{setspace}     %\doublespacing     \linespread{1.667}     \usepackage{footmisc}     \setlength{\parskip}{0pt}     \flushbottom     \newcommand{\MY}{\dfrac{1+\dfrac{\sum}{\sum}}{\dfrac{\sum}{\sum}+1}}     \begin{document}     \setlength{\abovedisplayskip}{1pt plus0.1pt minus0.1pt}     \setlength{\belowdisplayskip}{1pt plus0.1pt minus0.1pt}     \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]          \lipsum[2]     \[\MY\]     \end{document}


title: Apply a second decoration to a tikz path

text: I'm trying to decorate a snake path, but I don't get any output using a postaction. Here's the example code.               \begin{tikzpicture}       \draw [snake=expanding waves, segment amplitude = 1.5cm, segment length = 0.3 cm, postaction={decorate, decoration={random steps,segment length=3pt,amplitude=5pt}}] (0,0) -- (-2,0);     \end{tikzpicture}      Any help would be greatly appreciated.


title: Use of math mode with SIstyle

text: When using the `SIstyle` package, I noticed that numbers inside `\SI{}{}` and `\num{}` appear in a slightly different style than inside `$$`.   * Do the `\SI{}{}` and `\num{}` commands come with math mode already?   * Should I place math mode around this? E.g. `$\SI{}{}$` and `$\num{}$`.


title: How would I create verb conjugation charts?

text: As a student learning a second language, I often create a study guide of the vocabulary that goes along with the particular upcoming exam. For conjugations of verbs, it is extremely helpful to present them as 2 by 3 charts. As a very amateur LaTeX user, I have no clue how to program these charts into a document. How would I go about producing a chart with two columns and three rows? Also, it would be of great help if I could get a title bar above each chart to state what the verb is (i.e. to put its infinitive there) and what tense it is. This website's layout would be a very good example: http://www.spanishdict.com/conjugate/beber What I'm looking for is simply a chart for the present tense conjugations with almost identical format. The only difference being that at the top of the chart, there is the infinitive (and its meaning in English).


title: Emitting LaTeX a “token” at a time, handling superscripts

text: I am outputting LaTeX from another source language, but one that only gives me things a source-token at a time. Thus, I may get a token corresponding to “begin superscript” and then I will later get one corresponding to “end superscript”. I used to have               \newcommand{\mybeginsup}{\begin{math}{}\sp\bgroup\tt}     \newcommand{\myendsup}{\egroup\end{math}}      (The `\tt` is the way I want my superscripts to style, and I hope it’s irrelevant.) The problem with this is that it doesn’t handle nested superscripts. My guess it that this causes a nesting of `\begin{math}` commands, and that it is this that causes the “Bad math environment delimiter.” error messages. So, how should I do this? I did try:               \usepackage{ifthen}     \newcounter{embeddedmaths}     \renewcommand{\mybeginsup}{%     \ifthenelse{\value{embeddedmaths} = 0}%     {\addtocounter{embeddedmaths}{1}\begin{math}}{}\sp\bgroup\tt}     \renewcommand{\myendsup}{%     \egroup\addtocounter{embeddedmaths}{-1}%     \ifthenelse{\value{embeddedmaths} = 0}{\end{math}}{}}      to try to count the number of times I had entered math mode, but this gives               ! Missing } inserted.     <inserted text>       So now I’m stuck.


title: What is \box255?

text: I'm just reading the everyshi manual, and it says: > This package provides the hooks `\EveryShipout` and `\AtNextShipout` whose > arguments are executed after the output routine has constructed `\box255`, > and before `\shipout` is called. This seems to imply this `\box255` is somehow special; but I tried looking it up on the net and could find terribly much about it. So, can anyone explain why would `\box255` be special, and possibly point to a quick reading or tutorial involving it?


title: Correctly typesetting words surrounded by double underscores?

text: Forgive me if the answer to this is obvious, I've just begun working with LaTex and I've had no luck with Google. I'm working on learning LaTeX, and as part of my practice I'm rewriting a guide on special methods in Python in LaTeX. As you might know, Python's special methods take on the form `__methodname__`. This causes problems when I try to generate a PDF from my .tex source file using pdflatex. How can I make LaTeX ignore the double underscores, or otherwise make my output correct? In case it might help, here's a sample of what I'm trying to typeset:                e.g. \texttt{__init__} or \texttt{__lt__}      Which I want to look like "e.g. `__init__` or `__lt__`".


title: Difference between \paragraph and \subparagraph in scrreprt?

text: I'm using `scrreprt` for writing and (at least for me without any typographic education) I don't see any difference between a section typed as `\paragraph` or `\subparagraph`. My **questions** : Is there a difference between the two, and if "no", why not? What about the spacing before `\paragraph`s in this class? I know that KOMA-Script is very carefully designed (and maybe some of my settings have modified something which they shouldn't), but in my PhD thesis document it seems to me that the spaces before `\(sub)paragraph` are relatively large. I built a quite lengthy example, as the `blindtext` package does not seem to use `\subparagraph`.               \documentclass[11pt, a4paper,  halfparskip]{scrreprt}          \usepackage[ngerman]{babel}     \usepackage{blindtext}     %\usepackage[spanish]{babel}     %\setlength{\parskip}{10ex plus 0.5ex minus 0.2ex}          \raggedbottom          \begin{document}          \chapter{Chapter one}     \section{Section one in chapter one}     \subsection{Subsection one of section one in chapter one}          Another paragraph, is it? lorem lorem lorem lorem lorem lorem lorem     lorem lorem lorem lorem lorem lorem lorem lorem.          \paragraph{Paragraph1} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.          \subparagraph{Subparagraph1} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.          \paragraph{Par2} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.           \paragraph{Par3} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.      \subparagraph{SubPar1} Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.      \subparagraph{SubPar1} At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.           \paragraph{Par3} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.           At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.           \minisec{minisec1} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.           At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.           \blinddocument          \end{document}


title: Merging bib files from within LaTeX

text: I have two `.bib` files that I want to use in my bibliography. Entries do not overlap. I have found quite a few forum topics on that, but none of them really satisfied me. So my idea is to merge the two to one `.bib` file which I will use in the `.tex`. Most conveniently, this would be done from within LaTeX (so I do not use `bibtool`, or reference software). So, I made a macro to merge two files:               \newwrite\bibwrite     \newcommand{\concatbib}[2]{%       \begingroup       \IfFileExists{#1}%         {\CatchFileDef{\bibone}{#1}{}}          {\let\bibone\empty}       \IfFileExists{#2}%         {\CatchFileDef{\bibtwo}{#2}{}}         {\let\bibtwo\empty}%       \immediate\openout\bibwrite=MyBib.bib\relax       \immediate\write\bibwrite{\bibone \bibtwo}%       \immediate\closeout\bibwrite       \endgroup     }      which is basically taken from another question (How can I open a file in "append" mode?). Now the problem is that Latex wants to interpret the file contents, and things like `\noexpand`, `\detokenize`did not work as desired. So I have to read it in verbatim, which I tried according to Martin Scharrer's answer here: Control command arguments.               \def\alltext{       \begingroup       \let\do\@makeother % define \do to change the category code of its argument to 'other'       \dospecials % makro that is a string of every special character preceeded with \do -> all catcodes are changed       \all@text     }     \def\all@text#1{       \endgroup       #1     }      and I would use this within the other macro. Testing it alone, though, I get the error that Use of `\all` does not match its definition `\alltext`, and I think that I am missing a big point here.   * I think that I put the definition of `\all@text` after `\alltext` so I can close the group, which to my understanding I need to define the region where the catcodes are altered. But I do not see why `\all@text` should be known already in the definition of `\alltext`?   * up to now I understood that `\@...` commands are primitive commands, but I thought it was only a notation. Is there more to it?   * is there a way to make that code work?


title: Including both chapter name and name of section in header using memoir

text: I'm writing a thesis using `memoir` as my class. I would like a header **similar to`fancyhdr`**, but this is not emulated in `memoir`. I know how to make my own pagestyle, however when I try to refer to the chapter name it only prints the chapter number. On verso pages, I want the chapter name to be left ragged and the section name to be right ragged, and vice versa on recto pages. My code looks like this:                   \makepagestyle{dtu}         \makeevenhead{dtu}{\sffamily \thechapter}{}{\sffamily \thesection}         \makeoddhead{dtu}{\sffamily \thesection}{}{\sffamily \thechapter}         \makeevenfoot{dtu}{\sffamily \thepage}{}{}         \makeoddfoot{dtu}{}{}{\sffamily\thepage}         \makeheadrule{dtu}{\textwidth}{1pt}         \pagestyle{dtu}      But it only prints the numbers, not the number + name of the chapter/section! **How can I include the number+name of each chapter and section in the header?**


title: How to use visualcounters in latex?

text: I want to use `Progressbar` in my LaTeX document. I found some idea from the visualcounter module by Aditya Mahajan, but I don't know how to utilize that one. Because I am new to LaTeX, any one help me to solve this issue.


title: TexMaker Quick Build / View PDF saving

text: I'll admit I don't really use LaTeX all that much, but is there a way to turn off the automatic saving that seems to be happening when I either press "quick build" or "view PDF". It throws me off as I'm used to saving everything manually.


title: How to quote right *.txt or *.c in LaTex

text: I just don`t know how to make Latex do that *.c (or whatever for a file) without any spaces for a quote from a bash-script. Google etc cant help... Thanks for your help.               \documentclass[a4paper]{article}          \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage[colorinlistoftodos]{todonotes}     \usepackage{color}     \usepackage{xcolor}     \usepackage{listings}     \usepackage{caption}     \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}     \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}          \title{Grundlagen der Theoretischen Informatik}          \author{ }          \date{\today}          \begin{document}     \lstset{language=bash}      \maketitle          \section{}          \begin{lstlisting}[label=bash,caption=bash-code]     cp *.txt     \end{lstlisting}     ...


title: Double stroke fonts with unicode-math to match with Linux Libertine

text: After reading this question, Double stroke fonts with unicode-math like dsfont, I remembered that the font which comes with OpenOffice (Linux Libertine G) has a beautiful (but I don't know if useful) double stroke alphabet. How could we use Linux Libertine OpenType with XeTeX and take the double stroke alphabet from that font. You can see how is the double stroke alphabet in this document, at the bottom of the second page.


title: Insert a figure such that there is text to the right of it

text: Right now I'm using the following at the top of my document:               \begin{flushright}     \textbf{\large My name}     \vspace{3pt}     \hrule     \vspace{3pt}     Street 1a\\     Postal code + city\\     Phone number\\     Email@test.com     \end{flushright}     \begin{figure}[ht!]     \includegraphics{picture.jpg}     \end{figure}      This displays the jpg left aligned but below the line containing my email address. Is there a way to move the picture "up" so that its top is below the `\hrule`, exactly as the line containing the street?


title: Wrong frame size in animation

text: Consider the following code (more or less this):               \documentclass{article}          \usepackage{lmodern}     \usepackage[       hmargin=2.4cm,       vmargin=3cm     ]{geometry}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{animate}               \def\rS{0.3}                             % The Sun's radius.     \def\Earthangle{30}                      % Angle with respect to horizontal.     \def\rE{0.1}                             % The Earth's radius.                                              % Major radius of the Earth's elliptical orbit = 1.     \def\eE{0.25}                            % Excentricity of the Earth's elliptical orbit.     \pgfmathsetmacro\bE{sqrt(1 - \eE^2)}     % Minor radius of the Earth's elliptical orbit.     \def\Moonangle{-45}                      % Angle with respect to horizontal.     \pgfmathsetmacro\rM{0.5*\rE}             % The Moon's radius.     \pgfmathsetmacro\aM{2.5*\rE}             % Major radius of the Moon's elliptical orbit.     \def\eM{0.4}                             % Excentricity of the Earth's elliptical orbit.     \pgfmathsetmacro\bM{\aM*sqrt(1 - \eM^2)} % Minor radius of the Moon's elliptical orbit.     \def\offsetM{30}                         % Angle offset between the major axes of the Earth's and the Moon's orbits.          % This function computes the direction in which light hits the Earth.     \pgfmathdeclarefunction{f}{1}{%       \pgfmathparse{%         (-\eE + cos(#1) <  0) * (180 + atan(\bE*sin(#1)/(-\eE + cos(#1))))         +         (-\eE + cos(#1) >= 0) * atan(\bE*sin(#1)/(-\eE + cos(#1)))       }     }          % This function computes the distance between the Earth and the Sun,     % which is used to calculate the varying radiation intensity on the Earth.     \pgfmathdeclarefunction{d}{1}{%       \pgfmathparse{sqrt((-\eE + cos(#1))^2 + (\bE*sin(#1))^2)}     }          \def\animation#1{%     \begin{tikzpicture}[scale=5]        % Changing parameters for animation.        \pgfmathsetmacro{\Earthangle}{\iA}         \pgfmathsetmacro{\Moonangle}{12*\iA}             % Draw the elliptical path of the Earth.       \draw[thin, color=gray] (0, 0) ellipse (1 and \bE);            % Draw the Sun at the right-hand-side focus.       \shade[%         inner color=yellow!70,%         outer color=orange!70,%       ]({sqrt(1 - \bE^2)}, 0) circle (\rS);            % Draw the Earth at \Earthangle.       \pgfmathsetmacro{\radiation}{100*(1 - \eE)/d(\Earthangle)^2}       \colorlet{Earthlight}{yellow!\radiation!blue}       \shade[%         top color=Earthlight,%         bottom color=blue!75!black,%         shading angle={90 + f(\Earthangle)},%       ]({cos(\Earthangle)}, {\bE*sin(\Earthangle)}) circle (\rE);       %\draw ({cos(\Earthangle)}, {\bE*sin(\Earthangle) - \rE}) node[below] {Earth};            % Draw the Moon's (circular) orbit and the Moon at \Moonangle.       \draw[%         thin,%         color=gray,%         rotate around={{\offsetM}:({cos(\Earthangle)}, {\bE*sin(\Earthangle)})}%       ]({cos(\Earthangle)}, {\bE*sin(\Earthangle)}) ellipse ({\aM} and {\bM});            % Makes a path (Moon)-(Sun), e.g., the vector pointing from the Sun to the Moon.       \path ($({cos(\Earthangle) + \aM*cos(\Moonangle)*cos(\offsetM)                 - \bM*sin(\Moonangle)*sin(\offsetM)},%                {\bE*sin(\Earthangle) + \aM*cos(\Moonangle)*sin(\offsetM)                 + \bM*sin(\Moonangle)*cos(\offsetM)}) - ({sqrt(1 - \bE^2)}, 0)$);       % Get the components of that vector.       \pgfgetlastxy{\myx}{\myy}       % Computing the inclination angle.       \pgfmathsetmacro{\moonshadinangleangle}{-90 + atan2(\myx, \myy)}            \shade[%         top color=black!90,%         bottom color=black!10,%         shading angle=\moonshadinangleangle,%       ]({cos(\Earthangle) + \aM*cos(\Moonangle)*cos(\offsetM)          - \bM*sin(\Moonangle)*sin(\offsetM)},%         {\bE*sin(\Earthangle) + \aM*cos(\Moonangle)*sin(\offsetM)          + \bM*sin(\Moonangle)*cos(\offsetM)}) circle (\rM);     \end{tikzpicture}     }          \pagestyle{empty}          \begin{document}          \begin{figure}[htbp]     \centering      \begin{animateinline}[        poster=first,        controls,        loop      ]{10}       \multiframe{360}{iA=1+1}{\animation{\iA}}      \end{animateinline}     \end{figure}          \end{document}      ![output](http://i.stack.imgur.com/xLDTQ.jpg) When I run the animation, the Earth's orbit around the Sun is not constant. How do I solve this? **Update** Here is what I ended up with:               \documentclass{article}          \usepackage{lmodern}     \usepackage[       hmargin=2.4cm,       vmargin=3cm     ]{geometry}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{animate}               \def\rS{0.3}                             % The Sun's radius.     \def\Earthangle{30}                      % Angle with respect to horizontal.     \def\rE{0.1}                             % The Earth's radius.                                              % Major radius of the Earth's elliptical orbit = 1.     \def\eE{0.25}                            % Excentricity of the Earth's elliptical orbit.     \pgfmathsetmacro\bE{sqrt(1 - \eE^2)}     % Minor radius of the Earth's elliptical orbit.     \def\Moonangle{-45}                      % Angle with respect to horizontal.     \pgfmathsetmacro\rM{0.5*\rE}             % The Moon's radius.     \pgfmathsetmacro\aM{2.5*\rE}             % Major radius of the Moon's elliptical orbit.     \def\eM{0.4}                             % Excentricity of the Earth's elliptical orbit.     \pgfmathsetmacro\bM{\aM*sqrt(1 - \eM^2)} % Minor radius of the Moon's elliptical orbit.     \def\offsetM{30}                         % Angle offset between the major axes of the Earth's and the Moon's orbits.          % This function computes the direction in which light hits the Earth.     \pgfmathdeclarefunction{f}{1}{%       \pgfmathparse{%         (-\eE + cos(#1) <  0) * (180 + atan(\bE*sin(#1)/(-\eE + cos(#1))))         +         (-\eE + cos(#1) >= 0) * atan(\bE*sin(#1)/(-\eE + cos(#1)))       }     }          % This function computes the distance between the Earth and the Sun,     % which is used to calculate the varying radiation intensity on the Earth.     \pgfmathdeclarefunction{d}{1}{%       \pgfmathparse{sqrt((-\eE + cos(#1))^2 + (\bE*sin(#1))^2)}     }          \def\animation#1{%     \begin{tikzpicture}[scale=5]      \useasboundingbox (-1.28,-1.24) rectangle (1.30,1.28);        % Changing parameters for animation.        \pgfmathsetmacro{\Earthangle}{#1}         \pgfmathsetmacro{\Moonangle}{12*#1}             % Draw the elliptical path of the Earth.       \draw[thin, color=gray] (0, 0) ellipse (1 and \bE);            % Draw the Sun at the right-hand-side focus.       \shade[%         inner color=yellow!70,         outer color=orange!70       ]({sqrt(1 - \bE^2)}, 0) circle (\rS);            % Draw the Earth at \Earthangle.       \pgfmathsetmacro{\radiation}{100*(1 - \eE)/d(\Earthangle)^2}       \colorlet{Earthlight}{yellow!\radiation!blue}       \shade[%         top color=Earthlight,%         bottom color=blue!75!black,%         shading angle={90 + f(\Earthangle)},%       ]({cos(\Earthangle)}, {\bE*sin(\Earthangle)}) circle (\rE);       %\draw ({cos(\Earthangle)}, {\bE*sin(\Earthangle) - \rE}) node[below] {Earth};            % Draw the Moon's (circular) orbit and the Moon at \Moonangle.       \draw[%         thin,%         color=gray,%         rotate around={{\offsetM}:({cos(\Earthangle)}, {\bE*sin(\Earthangle)})}%       ]({cos(\Earthangle)}, {\bE*sin(\Earthangle)}) ellipse ({\aM} and {\bM});            % Makes a path (Moon)-(Sun), e.g., the vector pointing from the Sun to the Moon.       \path ($({cos(\Earthangle) + \aM*cos(\Moonangle)*cos(\offsetM)                 - \bM*sin(\Moonangle)*sin(\offsetM)},%                {\bE*sin(\Earthangle) + \aM*cos(\Moonangle)*sin(\offsetM)                 + \bM*sin(\Moonangle)*cos(\offsetM)}) - ({sqrt(1 - \bE^2)}, 0)$);       % Get the components of that vector.       \pgfgetlastxy{\myx}{\myy}       % Computing the inclination angle.       \pgfmathsetmacro{\moonshadinangleangle}{-90 + atan2(\myx, \myy)}            \shade[%         top color=black!90,%         bottom color=black!10,%         shading angle=\moonshadinangleangle,%       ]({cos(\Earthangle) + \aM*cos(\Moonangle)*cos(\offsetM)          - \bM*sin(\Moonangle)*sin(\offsetM)},%         {\bE*sin(\Earthangle) + \aM*cos(\Moonangle)*sin(\offsetM)          + \bM*sin(\Moonangle)*cos(\offsetM)}) circle (\rM);     \end{tikzpicture}     }          \pagestyle{empty}          \begin{document}          \begin{figure}[htbp]     \centering      \begin{animateinline}[poster=first,controls,loop]{10}       \multiframe{360}{iA=1+1}{\animation{\iA}}      \end{animateinline}     \end{figure}          \end{document}


title: How to build two different .tex files from same .tex file

text: When I prepare an exercise list for my students I use to also include there my own solutions. I prepare these documents with some macros based on `mdframed` and with `comment` help I easily obtain two pdfs, one with exercises and another one with exercises and solutions. I encourage my students to try to write their solutions with `LaTeX` so I give them the `.pdf` file with exercises and a source `.tex` file without answers. This way, they only have to worry about writing their solutions because the format is already provided. The problem is that I need to have two source files one with problems+solutions and another one only with problems. What I would like would be to have only one `.tex` file with problems and solutions and, from it be able to extract another `.tex` file without solutions. As a possible frame work suppose a main `.tex` file like:               % This is main.tex file     \documentclass{article}     \begin{document}     \begin{exercise}      This is the first exercise     \begin{solution}     This is my solution     \end{solution}     \end{exercise}     \end{document}      from which I want to easily obtain a similar one with empty solutions:               % This is student.tex file     \documentclass{article}     \begin{document}     \begin{exercise}      This is the first exercise     \begin{solution}     \end{solution}     \end{exercise}     \end{document}      I suppose I'm looking for something like a `.dtx` file but I've never used it and may be there are better solutions. I'm working on windows so `grep` commands won't work.


title: Background image from tikzpicture does not fit the whole page

text: For a poster, I would like to have an image fill the whole page. This image is supposed to be drawn within a tikz environment as my other content. However, graphicx seems to fail at rescaling when the image aspect ratio is much different fom the paper aspect ratio. My code reads:               \documentclass[]{extarticle}     \usepackage[a0paper,margin=0cm]{geometry}     \usepackage{tikz}     \pagestyle{empty}     \setlength{\parindent}{0pt}          \begin{document}     \begin{tikzpicture}     % draw generic background     \draw[white,line width=0pt] (-.5\textwidth, -.5\textheight) rectangle (.5\textwidth, .5\textheight);     % draw image     \pgftext[center,at={\pgfpoint{0}{0}}]{\includegraphics[width=\textwidth,height=\textheight]{test.jpg}}     \end{tikzpicture}     \end{document}      I use the background to fill the whole page with a tikz environment so that (0,0) is at the center of the page and I can position other tikz objects as needed. As long as I use images which closely fit the page or if I use the command `includegraphics[width=\textwidth,height=\textheight,keepaspectratio]`, the image gets scaled correctly. Otherwise, I get a blank first page and my content is on the second page. In other words, the image does not fit the page size, it is too large! How can I prevent this error from happening? Or is there even a better way to draw the image from within the tikz environment?


title: How to redirect associations in the tikz-uml package?

text: I am using the tikz-uml package to model a class diagram. The code snippet is placed in the `examples` sub-directory of the downloaded tikz-uml package. Here is the code:               \documentclass[a4paper,11pt, svgnames]{article}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[french]{babel}     \usepackage{listings}          \usepackage{../tikz-uml}          \textwidth 18.5cm     \textheight 25.5cm     \hoffset=-2.9cm     \voffset=-2.9cm          \sloppy     \hyphenpenalty 10000000          \date{}     \title{}     \author{}          \begin{document}          \begin{tikzpicture}         \begin{umlpackage}{First}             \begin{umlpackage}{Second}                 \umlemptyclass[type=abstract]{F}                 \umlemptyclass[y=-3, type=abstract]{M}                 \umlimpl{M}{F}                      \umlemptyclass[y=-3, x = 6]{P}                 \umlemptyclass[y=-6, x = 6]{H}                 \umlimpl{P}{M}                 \umlunicompo[pos1=1.9, pos2=0.2]{P}{M}                 \umlinherit{H}{P}             \end{umlpackage}         \end{umlpackage}     \end{tikzpicture}          \end{document}      and it results with the following diagram: ![Composition and implementation](http://i.stack.imgur.com/7oJke.png) The association lines between **P** and _M_ are overlapping. I would like to redirect the composition line (black diamond) between **P** and _M_ , so that the line is parallel to the implementation line (empty arrow), only placed above it. I tried reading the documentation, but whatever I do fails. Any help?


title: Converted EPS not found with TeX Live 2012 and Windows 8

text: I use TeX Live 2012 on Windows 8 and would like to use an EPS image. I usually use PNG, but in this case PNG is too pixelated. I found that `epstopdf` is the preferred solution and that TeX Live (starting in 2010) converts on the fly. TeX Live thinks it converted the file, but can't find it because it doesn't exist (log file below). I tried using absolute file references and turning off all other graphics packages, but the symptoms don't change. This is a little deeper than I've gotten in TeX and would appreciate any help.               (c:/texlive/2012/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg     File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv     e     ))     (./payout_content.tex     Package epstopdf Info: Source file: <../figures/gz_figure_1.eps>     (epstopdf)                    date: 2013-03-08 09:16:48     (epstopdf)                    size: 80137 bytes     (epstopdf)             Output file: <../figures/gz_figure_1-eps-converted-to.pd     f>     (epstopdf)             Command: <repstopdf --outfile=../figures/gz_figure_1-eps     -converted-to.pdf ../figures/gz_figure_1.eps>     (epstopdf)             \includegraphics on input line 6.     runsystem(repstopdf --outfile=../figures/gz_figure_1-eps-converted-to.pdf ../fi     gures/gz_figure_1.eps)...executed safely (allowed).          Package epstopdf Info: Result file: <../figures/gz_figure_1-eps-converted-to.pd     f>.               ! Package pdftex.def Error: File `../figures/gz_figure_1-eps-converted-to.pdf'      not found.          See the pdftex.def package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.6 ...   \includegraphics{../figures/gz_figure_1}          Using draft setting for this image.     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.


title: How to adjust the y-axis of pgfplots

text: In the right pgfplots, I hope that it could have `(0, 10000,20000,30000,40000,50000)[in normal scale]`, rather than `(1000,10000) [in log scale]` now, how should I do that? ![enter image description here](http://i.stack.imgur.com/FCR2V.png) This the the code               \begin{minipage}{0.5\linewidth}     \centering     \scriptsize      \begin{tikzpicture}[font=\sffamily]     \begin{semilogyaxis}[title=Random Dataset,                     legend pos=outer north east,                     legend style={draw=none},                     xtick={1,2,...,9}, % new bit                     scaled ticks=false,                     log ticks with fixed point={1000 sep=},                     axis x line=bottom,                     axis y line=left,                     axis line style=-,                     minor tick style={draw=none},                     enlargelimits,                     ylabel = Solving Time (ms),                     xlabel = Number of Constraints,                     every axis legend/.append style={xshift=-10pt}                     ]     \addplot+[mark=triangle] plot coordinates{(1,7112)(2,11330)(3,4574)(4,5036)(5,14003)(6,11445)(7,7478)(8,8973)(9,10895)};     \addplot plot coordinates{(1,4499)(2,4816)(3,3201)(4,2903)(5,5912)(6,4896)(7,7536)(8,6998)(9,4786)};     \addplot+[draw opacity=0.5, thick, mark=square] plot coordinates{(1,78)(2,62)(3,41)(4,44)(5,120)(6,96)(7,133)(8,133)(9,91)};     %\addplot plot coordinates{(1,81)(2,62)(3,48)(4,47)(5,101)(6,90)(7,129)(8,159)(9,168)};     %\legend{$\exact$,$\kmeansskyline$,$\DROO$,$\DROSkyline$}     \legend{$\exact$,$\kmeans$,$\DROO$}     \end{semilogyaxis}     \end{tikzpicture}     \end{minipage}% new bit     \begin{minipage}{0.5\linewidth}     \centering     \scriptsize      \begin{tikzpicture}[font=\sffamily]     \begin{semilogyaxis}[title=Random Dataset,                     legend pos=outer north east,                     legend style={draw=none},                     xtick={500,1500,...,5000}, % new bit                     scaled ticks=false,                     log ticks with fixed point={1000 sep=},                     axis x line=bottom,                     axis y line=left,                     axis line style=-,                     minor tick style={draw=none},                     enlargelimits,                     ylabel = Solving Time (ms),                     xlabel = Service Class Size,                     every axis legend/.append style={xshift=-10pt}                     ]     \addplot+[mark=triangle] plot coordinates{(500,1518)(1000,1431)(1500,1459)(2000,1346)(2500,1381)(3000,1474)(3500,1425)(4000,1508)(4500,1460)(5000,1389)};     \addplot plot coordinates{(500,37318)(1000,42496)(1500,38965)(2000,38415)(2500,34268)(3000,32102)(3500,30805)(4000,29453)(4500,33075)(5000,46871)};     \addplot+[draw opacity=0.5, thick, mark=square] plot coordinates{(500,8798)(1000,9953)(1500,13899)(2000,10810)(2500,11588)(3000,10397)(3500,9437)(4000,8202)(4500,6698)(5000,5635)};     %\addplot plot coordinates{(500,61)(1000,105)(1500,89)(2000,107)(2500,86)(3000,64)(3500,102)(4000,80)(4500,85)(5000,128)};     %\legend{$\exact$,$\kmeansskyline$,$\DRONP$,$\DROSkyline$}     \legend{$\exact$,$\kmeans$,$\DRO$}     \end{semilogyaxis}     \end{tikzpicture}     \end{minipage}


title: Drawing PQ-trees

text: I need to draw PQ-trees in LaTeX which look like these: ![http://i.imgur.com/D4cIk0x.png](http://i.stack.imgur.com/t1NxH.png) I tried trees in tikz but I had two problems:   * partially shade rectangles   * use vertical pointers from children to the parent, if the parent is a rectangle I'm wondering whether tikz-trees is the easiest way to go or whether you would recommend using something else?


title: Passing an if-else option to a custom sty file

text: I have a custom `.sty` file loading needed packages and defining some commands and environments. Is there an easy way to either:   * define an if-else option   * define option's default value I am using the `babel` package and want to specify it's options:               \usepackage[english, czech]{babel}      But sometimes, I need the opposite:               \usepackage[czech, english]{babel}      Is there a way to use it like this?               \usepackage{myPackage} % loads "english, czech"     \usepackage[en]{myPackage} % loads "czech, english"


How can I plot 3d graphs of functions defined implicitly (quadratic forms, for Linear Algebra course notes -- I'd like to include _lots_ of examples)? As far as I can see it is not possible with pgfplots and not through gnuplot either. Is there any package that will help with that? For example, parabolic and hyperbolic cylinders, hyperboloids, ellipsoids, etc. Concrete examples: `2xy + 2xz = 1` (hyperbolic cylinder) `(x^2)/(2^2) + (y^2)/(3^2) + (z^2)/(2^2) = 1` (ellipsoid) I also see that Maxima can do this:               (%11) hc:2*x*y+2*x*z=2;     (%i2) draw3d(enhanced3d=true,implicit(hc,x,-5,5,y,-5,5,z,-5,5));      This will work fine (the hyperbolic cylinder is correctly plotted on the screen), but I don't know what backend Maxima uses for this, and I'd like to use a plain LaTeX method, or something that could be called from LaTeX, as I may have to send the document for others to compile themselves on different environments.


title: Problem with Lyx PDFPages - no page numbers on inserted PDFs

text: I have a problem with inserting PDFs into my lyx document. I (perhaps stupidly) have made my figures all into one page each (created using powerpoint, then PDFing them), then inserted them using PDFPages into my Lyx document. I had tried inserting them using floats, but it seems to struggle with full-page figures (maybe I am doing something wrong there?). I can't use Lyx's figure-maker option really as I have a lot of landscape figures and it has already taken me ages to get each figure to fit on one page and look nice (and I have spent ages positioning the figure legend in the PDF so that it looks pretty). The problem I have is that there is no page numbering on these inserted figures. Lyx counts them as pages (i.e. if the page before is 6, then the page after my figure is 8), so it obviously does recognise that there is a page there. But I need kinda my figures to have page numbers. I guess that I could do it manually (ugh go back to the powerpoint, put numbers in, then re-insert all 60+ figures). But if I have corrections for my thesis I'll have to do that all over again :'( This probably stems from my foolishness of trying to avoid the lyx figure system, but any help at all would be much, much appreciated. (additional info, I don't know if this is useful? Document class=`article`, :               \bibliographystyle{unsrt}     \usepackage{url}       \pagenumbering{roman}     \let\myTOC\tableofcontents     \renewcommand\tableofcontents{%     \myTOC     \clearpage     \pagenumbering{arabic}     }      [I used this lovely site to get round the arabic numbering problem for the table of contents]


title: Spaces within a set of tuples

text: I want to have a set of tuples spaced with ":". I tried the following:               $\{1:1, 1:0, 0:1, 2:1, 1:2, 2:2\}$      but in the output, there is a space between the number and the colon. How can I get rid of that?


title: MathTime Professional II Lite Font Weight

text: I have a doubt about the font "MathTime Professional II Lite". I've installed it, however the math seems to be bold. I'm not sure why this is happening, but I'm trying to find a way to make it lighter. Anyone knows how to deal with this issue?


title: \StrLeft has no effect on \citetitle

text: `\footfullcite` uses too much space so I decided to define a own command. I called it `\footshortcite`. It only display a pre- and a post-Option and the Author with Year. However, I don't like that most citations in the footnote by my new command only use 1/4 or 1/3 of the line length, so I had the idea to put the title of the citation on top and cut it after X characters so that the footnote-citation is round about one complete line length. I tried it with `xstring` but it seems that `\citetitle` is not fully expandable, so that `\StrLeft` has no effect on it. Did I something wrong or am I right and its not possible?               \RequirePackage{filecontents}     \begin{filecontents*}{Literatur.bib}          @BOOK{denz2005,     author = {Denz, Hermann},     title = {Grundlagen einer empirischen Soziologie: Der Beitrag des quantitativen     Ansatzes},     publisher = {Lit},     location = {M\"unster},     year = {2005}     }          \end{filecontents*}          \documentclass{scrartcl}                          \usepackage[style=authoryear]{biblatex}     \bibliography{Literatur}     \usepackage{optparams}     \usepackage{xstring}          \def\footshortciteintern[#1][#2]#3{%     \ifx#1\empty      % Nur Autor     \footnote{\citeauthor{#3}, \citeyear{#3}.}     \else     \ifx#2\empty     % Autor und Seite     \footnote{\citeauthor{#3}, \citeyear{#3}, #1.}     \else     % Autor, Seite und vgl.     \expandafter       \footnote{#1 \citeauthor{#3}, \StrLeft{\citetitle{#3}}{10}, \citeyear{#3}, #2.}     \fi     \fi     }     \newcommand*\footshortcite{%     \optparams{\footshortciteintern}{[\empty][\empty]}     }          \begin{document}          Hallo \footshortcite[vgl.][S.111]{denz2005}     %\footshortcite[S.111]{denz2005}     %\footshortcite{denz2005}          \end{document}


title: How to install third-party modules for ConTeXt (MacTex distribution)?

text: I install MacTeX basic package and then install context by tlmgr. How do I install third-party modules?


title: How to get correct rendering for \dh \TH (ð þ Þ)?

text: I have some references containing \dh and \TH. When using these symbols in either the LaTeX source or the .bib file I only get a black box. Neither \dh nor ð works. According to the documentation, T1 only is needed which is what I already use. .tex and .bib files use utf8 without BOM as encoding. Here's a short example:               \documentclass[11pt,a4paper,german]{scrreprt}     \usepackage{scrhack}%ignore Warning float@addtolist     \usepackage{ae}     \usepackage{aecompl}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     %\usepackage{autofe}%(not working) bugfix: \dh und \TH     %\PrerenderUnicode{\dh\TH}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{latexsym}     \usepackage{babel}     \usepackage{courier}     \usepackage{caption}     \usepackage{booktabs}     \usepackage{tabularx}     \usepackage{relsize}          \begin{document}     \dh \TH Þ ð þ     \end{document}      What is needed to render these Letters correctly?


title: pgfplots: how make axes go through origin?

text: For `pgfplots`, in all the 2D examples I've seen, and in the manual, the location of axes seems to be specified in terms of location within the plot box, i.e.,relative to top, bottom. How does one specify that x- and y-axes intersect at the origin? And how does that they go through some other user- specified coordinate pair?


title: toc numbering help with rearranged sections and previous solution

text: I recently asked for help removing the numbers to the left of the Table of Contents and section headers. The thread with the answer to this is here: However, I have had to rearrange my sections to match my university guidelines and now I have a problem with the subsection numbering I kept. I was able to reset the page counter, but not the keen-eyed table of contents, which is labeling my first part's subsections as the third section (which it is now, after the acknowledgments and preface) however I would obviously like it to remain labeling these subsections in accordance with the sections as I had them before, i.e. 1.1,1.2,etc. A picture of what I have right now is below. ![table of contents with wrong section numbers](http://i.stack.imgur.com/jCiNl.png) Does anyone know a way to reset the section counter for the table of contents and remedy this problem? Any help would be appreciated.


title: Why are bent arrows with arrow tips not symmetric in TikZ?

text: They say a picture says more than a thousand words. ![enter image description here](http://i.stack.imgur.com/Vr3yL.png) Is there a good reason why TikZ draws the arrows as skewed as in the left image? Is there any easy way to get good-looking, symmetric arrows as in the right picture without manually positioning the arrow tips? **Note:** The line overlaps the fine tip of the arrows in the right image. This is not intentional, but adding `shorten >=2pt` also messes with the bend of the line. Here's the code that produces the image above (without the captions).               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[>=latex]         \node[draw,circle] at (0,0) (A) {A};         \node[draw,circle] at (1,0) (B) {B};         \draw[->] (A) to[out=45, in=135] (B);         \draw[->] (B) to[out=-135, in=-45] (A);         \draw[help lines] (0.5,0.5) -- (0.5,-0.5);     \end{tikzpicture}     \begin{tikzpicture}[>=latex]         \node[draw,circle] at (0,0) (A) {A};         \node[draw,circle] at (1,0) (B) {B};              \draw (A) to[out=45, in=135] (B);    % Draw nice line         \draw[<-] (B.135) -- ++(-0.1,0.066); % Add arrow tip              \draw (A) to[out=-45, in=-135] (B);  % Draw nice line         \draw[<-] (A.-45) -- ++(0.1,-0.066); % Add arrow tip              \draw[help lines] (0.5,0.5) -- (0.5,-0.5);     \end{tikzpicture}          \end{document}


title: LaTeX new command with no argument

text: I write some presentation with beamer. In the middle between each section I create some frame for outline content. But because presentation too long, I used `\includeonlyframes{current}` command to shorten compilation time, so some part of that frame will be visible and other not visible. For simplicity, I set `\newcommand{}` to that frame (outline frame). Now, how to set some of that frame available after compilation and other not visible. I mean how to call command with no argument. For example I create command               \newcommand{\current}[1]{\begin{frame}     [label=#1]     \frametitle{Outline}     \tableofcontents[currentsection , hideothersubsections ]     \end{frame}}      And I will call that command with no argument like `\current` for section that beyond my current editing, becasued I need some of that frame will not visible. I just need to show frame that related with my current editing (current section).