title: cleveref, autonum and labeling only referenced equations

text: User MMM recommended that I use the new `autonum` package in reply to my query. However, I am having some difficulty getting the package to work. Here is a minimal working example that compiles with "undefined references":               \documentclass{article}     \usepackage{amsmath, cleveref}     \usepackage{autonum}          \begin{document}     \begin{align}\label{eq:eq1}     a = b+c     \end{align}     Refer to equation \cref{eq:eq1}.     \end{document}      I assume I am not using the package right, but I am not sure what exactly I am doing wrong. Also, here is the file list for the LaTeX=>PDF compile.                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)      amsmath.sty    2000/07/18 v2.13 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names     cleveref.sty    2011/01/19 v0.17.8 Intelligent cross-referencing      autonum.sty    2012/06/21 v0.2 autonum LaTeX package     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)      textpos.sty    2012/06/01 v1.7h     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)      ***********      And the .log file:               This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (preloaded format=pdflatex 2012.7.8)  8 JUL 2012 05:05     entering extended mode     **E:/programming/latex/minimal-examples/autonum.tex     (E:/programming/latex/minimal-examples/autonum.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, loaded.     (E:\programfiles\MiKTeX2.8\tex\latex\base\article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (E:\programfiles\MiKTeX2.8\tex\latex\base\size10.clo     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@section=\count80     \c@subsection=\count81     \c@subsubsection=\count82     \c@paragraph=\count83     \c@subparagraph=\count84     \c@figure=\count85     \c@table=\count86     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     (E:\programfiles\MiKTeX2.8\tex\latex\ams\math\amsmath.sty     Package: amsmath 2000/07/18 v2.13 AMS math features     \@mathmargin=\skip43          For additional information on amsmath, use the `?' option.     (E:\programfiles\MiKTeX2.8\tex\latex\ams\math\amstext.sty     Package: amstext 2000/06/29 v2.01          (E:\programfiles\MiKTeX2.8\tex\latex\ams\math\amsgen.sty     File: amsgen.sty 1999/11/30 v2.0     \@emptytoks=\toks14     \ex@=\dimen103     ))     (E:\programfiles\MiKTeX2.8\tex\latex\ams\math\amsbsy.sty     Package: amsbsy 1999/11/29 v1.2d     \pmbraise@=\dimen104     )     (E:\programfiles\MiKTeX2.8\tex\latex\ams\math\amsopn.sty     Package: amsopn 1999/12/14 v2.01 operator names     )     \inf@bad=\count87     LaTeX Info: Redefining \frac on input line 211.     \uproot@=\count88     \leftroot@=\count89     LaTeX Info: Redefining \overline on input line 307.     \classnum@=\count90     \DOTSCASE@=\count91     LaTeX Info: Redefining \ldots on input line 379.     LaTeX Info: Redefining \dots on input line 382.     LaTeX Info: Redefining \cdots on input line 467.     \Mathstrutbox@=\box26     \strutbox@=\box27     \big@size=\dimen105     LaTeX Font Info:    Redeclaring font encoding OML on input line 567.     LaTeX Font Info:    Redeclaring font encoding OMS on input line 568.     \macc@depth=\count92     \c@MaxMatrixCols=\count93     \dotsspace@=\muskip10     \c@parentequation=\count94     \dspbrk@lvl=\count95     \tag@help=\toks15     \row@=\count96     \column@=\count97     \maxfields@=\count98     \andhelp@=\toks16     \eqnshift@=\dimen106     \alignsep@=\dimen107     \tagshift@=\dimen108     \tagwidth@=\dimen109     \totwidth@=\dimen110     \lineht@=\dimen111     \@envbody=\toks17     \multlinegap=\skip44     \multlinetaggap=\skip45     \mathdisplay@stack=\toks18     LaTeX Info: Redefining \[ on input line 2666.     LaTeX Info: Redefining \] on input line 2667.     )     (C:\Users\<User>\AppData\Roaming\MiKTeX\2.8\tex\latex\cleveref\cleveref.sty     Package: cleveref 2011/01/19 v0.17.8 Intelligent cross-referencing     Package cleveref Info: loaded `english' language definitions on input line 5263     .     )     (C:\Users\<User>\AppData\Roaming\MiKTeX\2.8\tex\latex\autonum\autonum.sty     Package: autonum 2012/06/21 v0.2 autonum LaTeX package          (C:\Users\<User>\AppData\Roaming\MiKTeX\2.8\tex\latex\etoolbox\etoolbox.sty     Package: etoolbox 2011/01/03 v2.1 e-TeX tools for LaTeX          (E:\programfiles\MiKTeX2.8\tex\latex\misc\etex.sty     Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)     \et@xins=\count99     )     \etb@tempcnta=\count100     )     (C:\Users\<User>\AppData\Roaming\MiKTeX\2.8\tex\latex\textpos\textpos.sty     Package: textpos 2012/06/01 v1.7h          Package: textpos 2012/06/01 1.7h, absolute positioning of text on the page     (C:\Users\<User>\AppData\Roaming\MiKTeX\2.8\tex\latex\ms\everyshi.sty     Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)     )     \TP@textbox=\box28     \TP@holdbox=\box29     \TPHorizModule=\dimen112     \TPVertModule=\dimen113     \TP@margin=\dimen114     \TP@absmargin=\dimen115          Grid set 16 x 16 = 38.39343pt x 49.68562pt     \TPboxrulesize=\dimen116     \TP@ox=\dimen117     \TP@oy=\dimen118     \TP@tbargs=\toks19     \TP@prevdepth=\dimen119     TextBlockOrigin set to 0pt x 0pt     )     \c@autonum@counter=\count101     ) (E:\programming\latex\minimal-examples\autonum.aux)     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.     LaTeX Font Info:    ... okay on input line 5.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.     LaTeX Font Info:    ... okay on input line 5.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.     LaTeX Font Info:    ... okay on input line 5.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.     LaTeX Font Info:    ... okay on input line 5.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.     LaTeX Font Info:    ... okay on input line 5.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.     LaTeX Font Info:    ... okay on input line 5.          ABD: EveryShipout initializing macros     Underfull \hbox (badness 10000) detected at line 5      []$[]    $       []               LaTeX Warning: Reference `eq:eq1' on page 1 undefined on input line 10.          [1          {C:/Users/<User>/AppData/Local/MiKTeX/2.8/pdftex/config/pdftex.map}]     (E:\programming\latex\minimal-examples\autonum.aux)           *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)      amsmath.sty    2000/07/18 v2.13 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names     cleveref.sty    2011/01/19 v0.17.8 Intelligent cross-referencing      autonum.sty    2012/06/21 v0.2 autonum LaTeX package     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)      textpos.sty    2012/06/01 v1.7h     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)      ***********               LaTeX Warning: There were undefined references.           )      Here is how much of TeX's memory you used:      2606 strings out of 495285      44952 string characters out of 3180519      139985 words of memory out of 3000000      5849 multiletter control sequences out of 15000+200000      4402 words of font info for 17 fonts, out of 3000000 for 9000      14 hyphenation exceptions out of 8191      30i,9n,31p,841b,210s stack positions out of 5000i,500n,10000p,200000b,50000s     <E:/programfiles/MiKTeX2.8/fonts/type1/public/amsfonts/cm/cmbx10.pfb><E:/prog     ramfiles/MiKTeX2.8/fonts/type1/public/amsfonts/cm/cmmi10.pfb><E:/programfiles/M     iKTeX2.8/fonts/type1/public/amsfonts/cm/cmr10.pfb>     Output written on autonum.pdf (1 page, 30636 bytes).     PDF statistics:      18 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: Where do I place floats in the source?

text: I realize that this is an embarrassing simple question. Shall I put the floats, e.g.               \begin{figure}     .     .     \end{figure}      **in the source** immediately after first reference? or wait until the end of the paragraph, or section with the main/first reference. (My plan is to keep the `memoir` standard placements `[htbp]` unless they give me problems in the final document)


title: How to show only first author for one bibtex entry

text: How to show only first author for one particular bibtex entry? I am using scrbook if that info is of any value for this.


title: PGFPLOTS coordinate filtering as a style?

text: I am using pgfplots to make plots for my thesis, and I have many scatter plots that I want to have consistent formatting. I am controlling the shape and color of the scatter plot marks with two columns (from external files loaded through `\pgfplotstableread`) that have consistent names across the many input files. So far, my solution is to use one as to define `scatter/classes` and to use the other to filter. This has worked fine, but I would like to have the filter parameters specified as a style, rather than needing to repeat the filter code on every `\addplot` command. What is working:               \documentclass{article}                         \usepackage{pgfplots,pgfplotstable,tikz}     \usepackage{filecontents}          \begin{filecontents}{data.dat}     x y color shape     1 3 a 0     2 6 b 0     3 5 a 1     4 4 b 1     5 9 a 0     6 1 b 1     \end{filecontents}     \begin{document}          \pgfplotstableread{data.dat}\datafile          \begin{tikzpicture}     \begin{axis}     \addplot[x filter/.code={     \pgfplotstablegetelem{\coordindex}{shape}\of{\datafile}         \ifnum\pgfplotsretval=0         \else         \def\pgfmathresult{}         \fi},only marks, scatter, scatter src=explicit symbolic,  scatter/classes={     a={blue},%     b={red}%     },mark=o] table[x=x,y=y, meta=color] {\datafile};     \addplot[x filter/.code={     \pgfplotstablegetelem{\coordindex}{shape}\of{\datafile}         \ifnum\pgfplotsretval=1         \else         \def\pgfmathresult{}         \fi},only marks, scatter, scatter src=explicit symbolic, scatter/classes={     a={blue},%     b={red}%     },mark=square] table[x=x,y=y, meta=color] {\datafile};     \end{axis}     \end{tikzpicture}          \end{document}      I can't just plug the `x filter` code as it is into a style, since it uses the name of the table (which changes). I've tried the discard if not style, but it doesn't work with `\pgfplotstableread` Can I put the filtering code in a style and modify it so it automatically gets the correct table (being used for everything else in the plot)? I'm aware that I could approach the entire problem differently by using `\pgfplotstableset` to create a new column in the table that has (somehow) concatenated the color and shape, and then have (2x2 in the example) 4 different scatter classes.


title: Why is my PDF file so much different than my preview version?

text: I am using TeXShell and MiKTeX to compile with. Once I have written my code, I compile and preview and at first there was some problems with floats and stuff, but now, everything is perfect and exactly where it should be. However, when I then do               \usepackage[pdftex]{graphicx}      And click on the "pdflatex" button to put it into a PDF, all my pictures and graphs go all over the place and aren't like they are in the preview bit. Why is this? It didn't happen before? I double checked with my preview by compiling and previewing it again and again, my pictures and stuff were perfect, but when doing a PDF, it was all messed up. My pictures are all in both .eps and .jpg format. These are my margins that I have set at the beginning of the documents:               \flushbottom     \parindent 0.25in     \oddsidemargin -0.25in     \evensidemargin -0.25in     \topmargin=-.5in     \headheight=0.1in     \headsep= 0.2in     \footskip=0.3in     %\footheight=0.3in     \textheight = 9.5in     \textwidth 6.5in      Could this have anything to do with it? Because the text is fine until I get further down and get to my graphs. I was thinking about making them smaller, but they work fine on my preview so I assumed they would be fine on my PDF.


title: \let a control sequence to a redefined primitive

text: pdfTeX version 1.40.0 introduced the primitive `\pdfprimitive` which the manual describes as follows. > This command executes the primitive meaning of the following control > sequence, if it has been redeﬁned or made undeﬁned. If the following control > sequence is undeﬁned and never was a primitive, nothing happens and no error > is raised. If the control sequence was initially expandable, `\pdfprimitive` > expands either. Otherwise `\pdfprimitive` doesn’t expand. (I think "either" should be "too.") **Is there a way to`\let` a control sequence to the primitive version?** Something like               \let\input\relax     \pdfletprimitive\input\input      The idea being that `\input` could be restored to its original meaning (at least locally). Obviously               \let\input\pdfprimitive\input      is not going to work just as               \expandafter\let\expandafter\input\pdfprimitive\input      is not going to work.


title: what TeX package(s) should I use for a Church Bulletin

text: I create Sunday Bulletins (aka service leaflets) for an Episcopal Church each week. Currently, I use the MS Publisher (PITA) I also do some web design using Ruby. While a physics undergrad, I learned just enough LaTeX to be dangerous, and to fall in love with well set text. Bulletins are very regular, and I would like to use TeX along with some Ruby on Rails front end to produce the bulletin each week instead. I have tried to set this up using my limited LaTeX knowledge, but it feels like I am working against the grain and the code is a mess. **My Questions** :   1. Given the following should I start with raw Tex, continue to use LaTeX or use some other macro package?   2. Where should I go to learn TeX as a programming language rather then just a mark-up tool so I can automate some of these items? **Bulletin Design Requirements** :   * The design of the bulleting is set, its design being part of the congregation's culture. I have updated it a little for modern typography, but I need to follow the basic pattern (i.e. I cannot easily adapt to something else already out there).   * Most of the document consists of a heading line that describes the part of the service (e.g. First Reading, Gospel Hymn, Closing Prayer) followed by a block of text or music. The heading quite often has some detail on the right margin. (e.g. Mark 2:1-14, Hymnal 342)   * The bulleting is printed directly form the computer on 8.5 X 14" (legal) paper in a 2-up booklet format. It then gets folded in half, collated and stapled in the center. size can range from 1 to 7 sheets but is usually 3 or 4.   * Some music is printed directly into the bulletin in the form of tiff images. These images occasionally need to be split across multiple pages. (In publisher I insert the image twice and crop the bottom off one and the top off the other). I already use LilyPond, and would like to use it more frequently if I could embed music notation directly in the text, but re-typesetting music is slow and error prone so some images will stay for the foreseeable future.   * Each page has a 7/8" gutter left of the main text that has short instructions in it (e.g _All stand_ , _Celebrant_ , _All_ ). This text is aligned either with a heading, or the start of a paragraph.   * A **Lot** of the text is "poetic," that is, line breaks and indentation are significant. I have this text with tabs and and Line Feeds already, but it took me hours to reset it in LaTeX and there are 1000's of lines that have to be reset. This is what ended up making my last attempt fail.   * I need a lot of control over where line breaks occur. Unlike a book, this form can tolerate quite a bit of difference in the size of the bottom margin, but there are certain places where text simply cannot break. If there is a chance to manually adjust page breaks all the better.


title: Inserted figure appears centered in the page

text: The following is a paragraph in my document, but the figure appears centered in the page. Please help me.               Góc này cũng chính là góc giữa hai bán kính đi qua giao điểm của hai đường tròn.\\     Trường hợp đặc biệt, khi góc giữa hai \dtr là góc vuông, lúc này ta gọi hai \dtr là \textbf{trực giao.}     Khi hai \dtr trực giao, thì tiếp tuyến của đường tròn này tại điểm chung lại đi qua tâm \dtr kia.     \begin{figure}[!ht]     \begin{center}     \includegraphics[scale = 1]{h_4}     \caption{}     \end{center}


title: MikTex 2.9 Portable. Cannot update and install packages

text: I have a company laptop running windows 7 enterprise edition 32bit without admin rights (resp. almost no rights to anything at all). I put the current version of MiKTex 2.9.4757 and Texmaker onto my user drive and installed ghostscript portable etc. according to the guideline of Jim Stitzel (using Asympote and no external pdf reader). But instead of putting it on a stick (which I tried too with similar problems) I saved it as I said in a separate folder at "My documents". I've tried a lot and read through forums, but I just cannot get it to run. (Sorry for the mess here, but I am not allowed to post any images that provide a better overview to make that would make live easier for everyone):   1. I get the error message "Invalid control sequence" or "Permission denied" when I want to     * _**install packages with MiKTeX "Package Manager"_**                          MiKTeX Problem Report   Message: Invalid control sequence.         Data: Source: Libraries\MiKTeX\Core\config.cpp         Line: 1690  MiKTeX: 2.9     OS: Microsoft Windows 7 Enterprise Edition, 32-bit Service Pack 1 (build 7601)         Invokers: explorer  SystemAdmin: no     PowerUser: no         Root0: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserInstall: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserConfig: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserData: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonInstall: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonConfig: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonData: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex              * _**update Formats via the MikTex "Option" Panel_**                          MiKTeX Problem Report   Message: Invalid control sequence.         Data:  Source: Libraries\MiKTeX\Core\config.cpp         Line: 1690  MiKTeX: 2.9 OS: Microsoft Windows 7 Enterprise Edition, 32-bit Service Pack 1 (build 7601)         Invokers: explorer  SystemAdmin: no     PowerUser: no         Root0: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserInstall: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserConfig: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         UserData: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonInstall: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonConfig: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex         CommonData: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex              * _**update packages with MiKTex "Update" Panel_** The Operation could not be completed for the following reason:                  Permission denied: \\HE100172e002\a19736526$\Home\Data\09_SIBE_Studium\09MixTexPortable\MikTex/data/le\mpm.fndb      It is no internet connection issue, proxy is set, repositories load properly   2. Not sure if this has anything to do with the whole issue, but when I started MiKTeX for the first time via `miktex-portable.cmd` it put all the files in the Windows programms menu instead of the system tray which is normally does when you boot from usb. The icon links did not work at the beginning but I managed to relink all of them except the "Update" Panel. There I get the error message "Windows API error 3: The system cannot find the path specified". Anyone got any idea how to fix this please? I'm grateful for any hint or links to related threads that I might not have found yet.


title: How to stop wallpaper package hiding fancyhdr page numbers

text: When I use the `wallpaper` package to put a background behind a slide or document, and then use `fancyhdr` to try and paginate the document the page numbers dont show up. Am I doing something wrong, or is there a process for bringing the page numbers back? Thanks               \documentclass[landscape]{article}     \usepackage[top=0.75in, bottom=0.75in, left=0.7in, right=2in]{geometry}      \usepackage{microtype,lipsum}     \geometry{letterpaper}     \usepackage{wallpaper}      \ULCornerWallPaper{1.0}{pillar.pdf} \topmargin=0.25in \headheight=1in \headsep=0.1in      \usepackage{fancyhdr}     \fancyhf{}     \renewcommand{\headrulewidth}{0pt}     \rfoot{\thepage}     \pagestyle{fancy}          \begin{document}          \lipsum[1-5]          \end{document}      Image for background of MWE attached below... ![pillar.pdf](http://i.stack.imgur.com/hA4vJ.png)


title: How to get a Reference section and a Bibliography

text: I am currently using a custom class (`mqthesis.cls`) to author my thesis. It works very well but it only gives a references section and I want to have a references section (with only the actually cited entries) as well as a bibliography (with all background reading listed). I know I can use `\nocite{*}`to make it so that the reference section actually includes my full bibliography but this only gives me a hybrid single section that contains my bibliography and citation links. I need two sections. I can include the \bibliography action twice but that just gets me two duplicate sections (both called 'references' as the `.cls` file stipulates). How do I get two distinct sections? Is it by editing the `.cls,` the `.tex` or both? Edit: I am using `natbib` package currently.


title: Numbering a reworded theorem

text: When using LaTeX for numbered theorems (or other numbered environments for that matter), if you have a theorem, and then you want to give a reformulation of the theorem, is there anyway to get LaTeX to number your first theorem, say Theorem 5, and your reformulation as say Theorem 5'? To obtain numbered theorems, I am not using any package, just using the command               \newtheorem{theorem}{Theorem}      in my preamble.


title: Placing several pictures in one line, but with linebreak

text: I am trying to plot several pictures in one line, but only two per line and then the next two in the next line. And I want it all to be in one Figure so that I have only one caption. I can place several pictures in a row, but without linebreak.               \begin{figure}[H]       \begin{center}         \mbox{           \subfigure[title1]{\scalebox{0.3}{\includegraphics{..path...}}}\qquad            \subfigure[title2]{\scalebox{0.3}{\includegraphics{...path2...}}} \linebreak           \subfigure[title3]{\scalebox{0.3}{\includegraphics{...path3...}}}\qquad            \subfigure[title3]{\scalebox{0.3}{\includegraphics{...path4...}}}           }         \caption{my caption}         \label{fig:myfigures}       \end{center}     \end{figure}      The `\linebreak` above does not work. How can I do this?


title: svmono and footnote inside boxedminipage

text: Using the svmono class (downloaded from http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0 ), I get a latex error "Command \itshape invalid in math mode" with the following code:               \documentclass{svmono}     \usepackage{boxedminipage}     \begin{document}          \begin{boxedminipage}[t]{4.5in}     Text\footnote{Text}     \end{boxedminipage}          \end{document}      I have no idea what itshape has to do with anything here. If anyone has any idea how I can fix this, I'd be grateful! Edit: I think the issue _might_ be that inside a boxedminipage, the footnotes are numbered 'a,b,c' instead of '1,2,3' -- so latex is trying to type set a superscript italic 'a', etc.. I still have no idea how to fix this...


title: Making citep behave like cite

text: I need to modify a very long document so that it no longer uses natbib (in order to conform to publisher requirements). I tried redefining \citep to be identical to \cite, but it doesn't seem to be working. The command I used was               \newcommand{\citep}[1]{\cite{#1}}      Could anyone tell me if this is correct? (Thanks!)


title: \autoref should call sections within the appendix "appendix" not "section"

text: I make use of autoref thoughout my now rather long document. I have an appendix with sections, though currently a small number, so changes could be made here. I want references in my document to sections within the appendix to say something like appendix A.1 instead of section A.1 but still refer to sections not in the appendix by section. I had an idea along the lines of creating some alias to section which had their own autorefname and using these instead of section. I tried and failed to use aliascnt for this. I don't know if it was because I was doing it wrongly or because it can't do what I wanted. Any help would be appreciated!


title: LaTeX, quoting same author without numbering

text: I am finishing a thesis and my bibstyle troubles me. I could not find an answer to following the question: How can I remove the automatic numbering (a, b, c, d...) of the same author quoted several times? My search for an answer brought me so far: I guess it has to do with the `FUNCTION{forward.pass}`, probably with the `FUNCTION{reverse.pass}`. Because if I remove these functions (which works) the numbering is not shown any more, **BUT** (this is my problem now!) a comma and the space-sign stay. (which is annoying. because it looks like this: Author; Title, ;URL; note. (the comma and the space after it should vanish.) The way I found to solve this problem temporarily is the following: Just edit the .bbl file - deleting what should not be there and compile once. (This works, but is a very _un-LaTeX-y_ way...) * * *               \documentclass[12pt,oneside,]    {report}                                 \begin{document}          Test text with citation 1: \cite{ZeusFocusonPEEK.2006}. And further citations here \cite{Saib.1993,CAMPUSdaten.2012}.          \bibliographystyle{BibstyleDAAK}     \bibliography{literatur2}          \end{document}      and the literature2.bib               ï»¿@electronic{CAMPUSdaten.2012,     author = {Anonymus},     title = {{C}{A}{M}{P}{U}{S} {D}atenbank},     url = {http://www.campusplastics.com/d},     urldate = {31.10.2012}     }          @article{Saib.1993,     author = {Saib, K. S. and Evans, W. J. and Isaac, D. H.},     year = {1993},     title = {{T}he role of microstructure during fatigue crack growth in poly(aryl ether ether ketone) ({P}{E}{E}{K})},     pages = {3198--3203},     volume = {34},     number = {15},     journal = {Polymer}     }          @electronic{ZeusFocusonPEEK.2006,     author = {Anonymus},     title = {{Z}eus {F}ocus on {P}{E}{E}{K}},     url = {http://www.zeusinc.com/},     urldate = {31.10.2012}     }      and the BibstyleDAAK has approximately 1700 lines. I generated it with the docstrip utility.


title: Depth of the \times symbol

text: I just noticed an annoying discrepancy involving the `\times` symbol's depth. Read the below code and then try to guess what it should look like:               \documentclass{article}     \begin{document}     \fbox{$A$} \fbox{$B$}          \fbox{$A \times A$} \fbox{$B$} \hrule     \end{document}      If you typeset this, you will see that the top line is perfectly level, while the `\hrule` is noticeably below the second _B_ and the box around `$A \times A$` is noticeably deep. Yet, I would consider both `$A$` and `$A \times A$` to be text-height and zero-depth expressions. Now replace `\times` by `\smash\times` and you will see the problem go away; unfortunately, you will also see the spacing break since `\smash` ruins the math-operatorness of `\times`. Am I right? `\times` has a nearly invisible depth and this distorts the center of expressions, otherwise having no depth, in which it is written. How should I work around this?


title: Report class: Suppressing page number in table of contents

text: I'm a newbie to LaTeX and am using Texmaker. I'm preparing a formal **report** and am having some problems with the table of contents. The table of contents page has a page number – how can I remove it?               \documentclass[a4paper,11pt]{report}     %\usepackage[T1]{fontenc}     %\usepackage[utf8]{inputenc}     %\usepackage{lmodern}     \usepackage{pdfpages}     \usepackage[notlot,notlof,nottoc]{tocbibind}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{mathabx}     \usepackage{textcomp}     \usepackage[toc,page,titletoc]{appendix}          \begin{document}     \begin{center}     ....     \thispagestyle{empty}     \tableofcontents     \thispagestyle{empty}     \listoffigures     \thispagestyle{empty}     \listoftables     \thispagestyle{empty}     ...      The first thispagestyle is used for another page preceeding this one. _Edit:_ I have two pages as toc. The second page does not have the page number, thankfully. Please help?


title: Is there a difference between the `displaymath` and `equation*` environments?

text: The `amsmath` documentation says > Basic LaTeX doesn’t provide an `equation*` environment, but rather a > functionally equivalent environment named `displaymath`. Are they _really_ the same or is there a catch? Maybe in interaction with some other packages?


title: IncludePDF with Landscape - No new page

text: I have a problem with `\includepdf` combined with landscape and now new page break I found some solutions to my problem but they didn't work. I came close with the following but it is still not what I need or want               \section{ABC}     \includepdf[landscape=true,pagecommand=\subsection{ABCD}, scale=0.8]{ABC.pdf}      The Result is like this Page 1 > ABC Page 2 > ABCD > > PDF What I want is Page 1 > ABC > > ABCD > > PDF


title: Showcase of translations to Asymptote from TikZ/PSTricks

text: So you already know TikZ and/or PSTricks, but you would like to expand your knowledge by learning Asymptote as well? Here's your chance. **The task/question:** Find an example of an impressive diagram drawn with TikZ or PSTricks (ideally but not necessarily one you created yourself), and redraw it using Asymptote. Your redrawn version should be at least as good as the original, except that 3d Asymptote pictures are allowed to be high- resolution rasterized images even if the original was a vector drawing. You should include, at a minimum, a link to the original; ideally, you should include (if allowed by copyright) the source code for the original and a picture of it. My hope is that ultimately, the answers to this question will become a useful resource for TikZ and PSTricks users seeking to learn Asymptote. To sweeten the deal, I will be awarding a bounty of **500 reputation points** to the most impressive answer. "Most impressive" will be determined by votes at the time the bounty ends, although I reserve the right to disqualify answers that I believe violate the letter or the spirit of original question. Additional, semi-selfish motive: Please let me know if you find my Asymptote tutorial useful. Other potentially useful resources include the official documentation and this tutorial in French for 3d stuff. * * * If you would like to answer this question but would like more specific examples, try translating answers from this question on drawing an egg or this question on drawing a Christmas tree.


title: Strange default exponent positioning?

text: Why is this red exponent so far away from the right parenthesis? To my eye it is too far away.               \documentclass{article}     \usepackage{xcolor}     \begin{document}     \[ax^2+bx+c=a\left(x+\frac{b}{2a}\right)^{\color{red}2}-\frac{b^2}{4a}+c\]     \end{document}      ![enter image description here](http://i.stack.imgur.com/t1sH3.png)


title: moderncv - modify size of blank spaces

text: I'm trying to find a way to modify the `moderncv` LaTeX "library" (dk if library is the right word). As shown on the picture below, I want the space 1 & 2 to be reduced by half. I'm new in LaTeX, it's awesome btw, sorry if this is a stupid question. ![enter image description here](http://i.stack.imgur.com/Qfbqw.png)


title: IEEE paper submission subfig missing

text: I use IEEEtran `bare_jrnl.tex` and my .tex file builds on my machine without any problem. I use `subfig` package. (`subfigure` doesn't work) When I try to submit my manuscript IEEE page says `subfig is missing`.![enter image description here](http://i.stack.imgur.com/cc2zd.png) I tried to change my `.tex` file and disable `subfig` package. However, I couldn't. I use `subfloat` several times. And since `subfloat` works on my machine perfectly, I don't want to change my `.tex` file. So, what is the best solution to submit my paper? PS: I downloaded the style file from: http://drucmwebproxy.ieee.org/documents/IEEEtran.zip and using bare_jrnl.tex.


title: Where to put GitInfo hooks on Mac

text: Where and how does one put the `post-checkout` and `post-commit` hooks for using the `gitinfo` package with latex on a Mac? Example working directory:`/Volumes/Boxcryptor Classic/Git/randomproject` On Windows there is a hidden folder `.git` within the working directory. On my Mac I cannot find it, I already tried `defaults write com.apple.Finder AppleShowAllFiles TRUE ; killall Finder`.


title: Creating a new environment containing a tikz environment

text: I would like to create a new environment in order to ease the process of making plots. It should be able to something like this:               \begin{graph}     \addplot [domain=-10:10, samples=1000]{x)};     \end{graph}      Thus the axis is predefined, and all I have to is add the plot that I want. So far i have tried the following without any succes               \newenvironment{graph}[3]{\begin{tikzpicture}\begin{axis}[     width=8cm,  xlabel={  $ #1 $ },ylabel={$ #2 $},axis x line=left, axis y line=left,      title={$#3 $}, xmin = 0,xmax = 10,ymin = 0,ymax = 10, xtick=\empty, ytick=\empty]      {\end{axis}\end{tikzpicture}}


title: create elegant display of digits and symbols

text: I want to create a display of the duodecimal digits of `\pi` for printing on a T shirt. I've made some progress with help from SE: Fonts larger than \Huge?, How to increase the size of first character in a chapter (Drop-Caps). Here's my MWE               \documentclass[extrafontsizes,48pt]{memoir}          \usepackage{lettrine}          \newcommand{\sirdot}{\smash{\raisebox{.2ex}{$\odot$}}}     \newcommand{\apple}{\smash{$\Delta$}}          \begin{document}          %3:184809493B918664573A6211BB151551A05729290A7809          \noindent     3.184809493\apple 918664573\sirdot 6211\apple\apple 151551\sirdot     05729290\sirdot 7809          \vspace{1in}          \begin{minipage}{4.5in}     \noindent     \lettrine{3.}     1 8 4 8 0 9 4 9 3 \apple{} 9 1 8 6 6 4 5 7 3 \sirdot{}     6 2 1 1 \apple{} \apple{}     1 5 1 5 5 1 \sirdot{}     0 5 7 2 9 2 9 0 \sirdot{} 7 8 0 9 \ldots     \end{minipage}          \end{document}      ![enter image description here](http://i.stack.imgur.com/eYM5O.png) I'm asking here for answers to questions about the aesthetics.   * Font suggestions?   * Change the interword spacing? (see How to change the interword spacing?)   * Arrange the display in a circle, or running around a circle, perhaps with the 3. in the center?   * Make the dropped cap 3. an image, perhaps with a circle in the background? (For information about _why_ I want to do this, see duodecimal page number.) **Edit:** I've accepted @Gonzalo Medina's lovely answer below, with the circular display and font `\usepackage[fulloldstylenums]{kpfonts}` (and a somewhat smaller central 3.). But ambition knows no bounds. The `\sirdot` character does not look as if it belongs in the font. Can I have a new character with that essential shape that fits better? Perhaps the `0` with a dot in the center? And, for good measure - the `\Delta` does seem to belong (the thick and thin elements match nicely). But the top of the character ought to look more like the top of the 4, and the horizontal should probably be thick rather than thin. Something like this (hacked with images and paint): ![character revisions](http://i.stack.imgur.com/mhZmc.png) **Edit:** @Gonzalo Medina answered this new question for `\sirdot`and suggested importing from another font for the `\Delta`m. The one from the default font in my MWE may be better than the one in the accepted answer. How do I grab that? The answer at Importing a Single Symbol From a Different Font should do the job.


title: Tikz flowchart: center text + math in node

text: I'm trying to draw a flowchart with TikZ. In one of the decision "diamonds", I have both text and a bit of math between `$`.               \node [decision, below of=buildbid, node distance=1.8cm, aspect=8, minimum size=20mm] (evalTotImpact) {$\delta_b\left(b_{\text{cur}},b_{\text{last}}\right)\geq$max?};      Unfortunately, despite using `centered` in the tikzstyle definitions, the text position seems to be fixed and ends up outside of the block, as can be seen on this picture. ![image](http://i.imgur.com/dxaNL.png) It does not happen for other blocks in the flowchart with math... Here is the smallest example I could make:               \documentclass[journal]{IEEEtran}     \usepackage[cmex10]{amsmath}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \begin{document}          \usetikzlibrary{calc}     \tikzstyle{decision} = [diamond, draw, fill=white, text width=4em, text centered, node distance=3cm, inner sep=0pt, font=\footnotesize]     \tikzstyle{block} = [rectangle, draw, fill=white, text width=6em, text centered, rounded corners, minimum height=6pt, font=\footnotesize]     \tikzstyle{line} = [draw, -latex', font=\footnotesize]          \begin{figure}     \centering     \begin{tikzpicture}[node distance = 1.7cm, auto]     \footnotesize     \tikzset{block/.append style={text width=10em, minimum height=2em}}     \node [decision, aspect=8, minimum size=20mm] (evalTotImpact) {$\delta_b\left(b_{\text{cur}},b_{\text{last}}\right)\geq$max?};     \end{tikzpicture}     \end{figure}          \end{document}


title: Create separator lines for algorithm captions in algorithm2e

text: How I can generate separator lines for captions as follows in algorithm2e? * * * Algorithm 1: Generate Separator Line * * *


title: Tikz foreach inside matrix

text: Apparently this question has been asked a hundred times already. But I couldn't get it to work with any of the answers provided. I want to have nested for loops inside a Tikz matrix. Something like:               \begin{tikzpicture}[>=latex]       \tikzstyle{every node}=[minimum size=3mm]       \tikzset{pre/.style={draw,fill=black}}       \matrix[matrix of math nodes,%           left delimiter = (,%           right delimiter = )] {%         \foreach \i in {0,..,10} {%           \foreach \j in {0,1} {%             \node[pre](pre\i\j){}; &           }           \\         }       }     \end{tikzpicture}      Thanks to this and a couple of other posts I know that this cannot work. So, I tried to translate it accordingly. But I cannot even get it to work with a simple non-nested loop:               \begin{tikzpicture}[>=latex]       \tikzstyle{every node}=[minimum size=3mm]       \tikzset{pre/.style={draw,fill=black}}       \let\mymatrixcontent\empty       \foreach \i in {0,1,2,3,4} {%         \expandafter\gappto\expandafter\mymatrixcontent\expandafter{\i \&}%       }       \expandafter\gappto\expandafter\mymatrixcontent\expandafter{\\}%            \matrix[matrix of math nodes,%           nodes = {pre},%           left delimiter = (,%           right delimiter = ),           ampersand replacement=\&] {%         \mymatrixcontent       };     \end{tikzpicture}      Latex fails with the extremely helpful message               ! Missing } inserted.     <inserted text>                      }     l.345 \end{tikzpicture}      What am I doing wrong? Is there an easier way to accomplish this? Cheers!


title: KOMA landscape/portrait

text: Got an problem regarding landscape pages in a portrait report. The first sheet is according to the koma manual and works fine. The second with the same code won't. Example:               \documentclass[ 12pt,                                        paper=a4,                                    pagesize,                                    DIV=calc,                                    liststotocnumbered,                          headsepline,                                 footsepline]                                 {scrreprt}          \usepackage[left=1.5cm,right=1.5cm,top=1cm,bottom=1cm,includeheadfoot]{geometry}          %langue settings     %header and footer settings          \begin{document}          First page in portrait\\          \storeareas\myvalues     \KOMAoptions{pagesize, paper=landscape, DIV=20}      Second page in landscape\\     \clearpage     \myvalues          Third page in portrait again\\          \KOMAoptions{pagesize, paper=landscape, DIV=20}      Fourth page NOT in landscape!!!!\\     \clearpage          \end{document}      Some ideas? best regards


title: Generating dozens of graphs

text: I am revising old lecture notes on microeconomics and they contain a lot of graphs. As I am rewriting it in LaTeX, I would like to recreate the old graphs, but I need to select the right tool for the job. The graphs generally involve a lot of lines, hyperbolas, tangents, intersections, shaded regions, space-limited labeling, ... Individual objects can, in most cases, be easily described as mathematical functions, so interpretation of formulae is key. I could just draw "good enough" graphs in GeoGebra, but I am looking for a more flexible solution for mass edits, e.g. changing all fonts in all graphs, colors, or thickness. It would be ideal if I'd just edit a few lines of code and rerender everything. Mass editing with "non-coded" graphs would probably be a pain. I am not that familiar with TikZ/PGF, so I am not sure if it fits. It would also help me greatly if I had a tool where I could fine tune my graphs. With TikZ/PGF, I can think of only creating a `minimal` LaTeX document and automatic rendering on save. It does not have to be integrated into a LaTeX workflow, it can be a (command line) script that generates all graphs as `eps` or `pdf`.


title: Last part of longtable after next float

text: I'm having the following problem with a document I'm making. I have a table which is split over five pages. This is done with longtable and it works fine. In the next section I have another (simple) table. This second table is placed before the last part of the longtable. This gives the ugly result that the caption for table 6.8 is placed after the caption of table 6.9. I can solve this by specifying that the second table should be placed at the bottom of the page and not the top, but ideally I would like the last part of the longtable to be placed at the top of the page and the second table immediately below that (and not the other way around as is now the case). Has anybody got a clue how this can be achieved? Below is a 'small' example that illustrates the problem.               \documentclass[11pt]{article}          \usepackage{longtable}     \usepackage{booktabs}          \begin{document}     \section{First}          \begin{longtable}{crrrrrrrr}     \caption{Head}\\     \toprule     & \multicolumn{1}{c}{1} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{4} & \multicolumn{1}{c}{4} & \multicolumn{1}{c}{5}\\      & & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \\     \midrule     \endfirsthead     \caption[]{(Continued)}\\     \midrule     & \multicolumn{1}{c}{1} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{4} & \multicolumn{1}{c}{4} & \multicolumn{1}{c}{5}\\      & & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \multicolumn{1}{c}{s} & \multicolumn{1}{c}{n} & \\     \midrule     \endhead     \midrule  \multicolumn{9}{r}{{Continued on next page}} \\      \endfoot     \bottomrule     \endlastfoot     0 & 5 & N/A & 11 & N/A & N/A & N/A & N/A & N/A \\      1 &  & 14 & 25 & 10 & 16 & N/A & N/A & N/A \\      2 &  & 28 & 43 & 19 & 27 & 12 & 15 & N/A \\      3 &  & 46 & 65 & 30 & 40 & 18 & 21 & N/A \\      4 &  & 68 & 91 & 43 & 55 & 24 & 27 & N/A \\      5 &  & 94 & 121 & 58 & 72 & 30 & 33 & 16 \\      6 &  & 124 & 155 & 75 & 91 & 36 & 39 & 19 \\      7 &  & 158 & 193 & 94 & 112 & 42 & 45 & 22 \\      8 &  & 196 & 235 & 115 & 135 & 48 & 51 & 27 \\      9 &  & 238 & 281 & 138 & 160 & 54 & 57 & 30 \\      10 &  & 284 & 331 & 163 & 187 & 60 & 63 & 35 \\      11 &  & 334 & 385 & 190 & 216 & 66 & 69 & 38 \\      12 &  & 388 & 443 & 219 & 247 & 72 & 75 & 43 \\      13 &  & 446 & 505 & 250 & 280 & 78 & 81 & 46 \\      14 &  & 508 & 571 & 283 & 315 & 84 & 87 & 51 \\      15 &  & 574 & 641 & 318 & 352 & 90 & 93 & 54 \\      16 &  & 644 & 715 & 355 & 391 & 96 & 99 & 59 \\      17 &  & 718 & 793 & 394 & 432 & 102 & 105 & 62 \\      18 &  & 796 & 875 & 435 & 475 & 108 & 111 & 67 \\      19 &  & 878 & 961 & 478 & 520 & 114 & 117 & 70 \\      20 &  & 964 & 1051 & 523 & 567 & 120 & 123 & 75 \\      21 &  & 1054 & 1145 & 570 & 616 & 126 & 129 & 78 \\      22 &  & 1148 & 1243 & 619 & 667 & 132 & 135 & 83 \\      23 &  & 1246 & 1345 & 670 & 720 & 138 & 141 & 86 \\      24 &  & 1348 & 1451 & 723 & 775 & 144 & 147 & 91 \\      25 &  & 1454 & 1561 & 778 & 832 & 150 & 153 & 94 \\      26 &  & 1564 & 1675 & 835 & 891 & 156 & 159 & 99 \\      27 &  & 1678 & 1793 & 894 & 952 & 162 & 165 & 102 \\      28 &  & 1796 & 1915 & 955 & 1015 & 168 & 171 & 107 \\      29 &  & 1918 & 2041 & 1018 & 1080 & 174 & 177 & 110 \\      30 &  & 2044 & 2171 & 1083 & 1147 & 180 & 183 & 115 \\      31 &  & 2174 & 2305 & 1150 & 1216 & 186 & 189 & 118 \\      32 &  & 2308 & 2443 & 1219 & 1287 & 192 & 195 & 123 \\      33 &  & 2446 & 2585 & 1290 & 1360 & 198 & 201 & 126 \\      34 &  & 2588 & 2731 & 1363 & 1435 & 204 & 207 & 131 \\      35 &  & 2734 & 2881 & 1438 & 1512 & 210 & 213 & 134 \\      36 &  & 2884 & 3035 & 1515 & 1591 & 216 & 219 & 139 \\      37 &  & 3038 & 3193 & 1594 & 1672 & 222 & 225 & 142 \\      38 &  & 3196 & 3355 & 1675 & 1755 & 228 & 231 & 147 \\      39 &  & 3358 & 3521 & 1758 & 1840 & 234 & 237 & 150 \\      40 &  & 3524 & 3691 & 1843 & 1927 & 240 & 243 & 155 \\      \end{longtable}          \section{Second}          \begin{table}     \begin{center}     \begin{tabular}{cc}     \toprule     $p$ & Upper bound\\     \midrule     0 & $h\leq \frac{b^2+12}{48}$\\\addlinespace[0.75em]     1 & $h\leq \frac{b^2-25}{40}$\\\addlinespace[0.75em]     2 & $h\leq \frac{b^2-64}{32}$\\\addlinespace[0.75em]     3 & $h\leq \frac{b^2-81}{24}$\\\addlinespace[0.75em]     4 & $h\leq \frac{b^2-100}{16}$\\\addlinespace[0.75em]     5 & $h\leq \frac{b^2-113}{8}$\\     \bottomrule     \end{tabular}     \caption{The second table.}     \end{center}     \end{table}          \end{document}


title: How to Draw Intervals

text: I am writing up some exercises for students who are using College Algebra as their textbook. I need to know how to TeX pictures of intervals like those on page 3 and page 5 of the linked book. Thanks. ![enter image description here](http://i.stack.imgur.com/qrWEZ.png)


title: Too many contour labels in contour plots

text: I am trying to create a contour plot with labels in the contour lines. The data is imported from Octave, and stored in a file called `data.dat`. It contains many contour lines, so that manual modification of the file is not practical. The following code reproduces the problem:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}       \begin{tikzpicture}         \begin{axis}         \addplot[contour prepared]           table {           0 2.875 5           3 2.875 5                0 2.825 4           3 2.825 4                0 2.75 3           3 2.75 3                0 2.5 2           3 2.5 2                0 1 1           3 1 1           };         \end{axis}       \end{tikzpicture}     \end{document}      The result has some contour lines too close to each other and therefore their labels overimpose. I would like to automatically limit the number of labels that are added to the contour lines in two ways:   1. Those labels with greater value than certain number will not appear. In my example, for example, show only labels in contour lines with value lower than 3.    2. Show labels only for selected contour lines. For example, remove the label that equals to 4.  Any hints about what options to play with are welcome, as I could not find a proper way to do this in the documentation.


title: Kile shows a message repeatedly

text: I am using **kile** on the system **Ubuntu11.04**. Whenever I am compiling **tex** file with **kile** , it shows a message below : ![enter image description here](http://i.stack.imgur.com/Op80O.png) I don,t konw why **kile** shows this message. Hope someone will give a solution of my problem.


title: Cannot draw commutative diagram

text: > **Possible Duplicate:**   >  Cannot draw diagram My code is:               \xymatrix{& C \ar@/_/[ld]_f \ar[d]_{(f,g)} \ar@/^/[rd]^g\\               & A\times B \ar[ld]_p \ar[rd]^q\\               A && B}      and the error I got:               ! Xy-pic error: in entry "1,2": No [rd] (is "2,3") from here.


title: Simple pre-parser to separate TeX and comments?

text: I want to write a mathematical paper both with formulas and with program snippets, side by side. However I do not want the programs displayed or documented by TeX, just be able to extract them into a file if desired. Note that my intention has nothing to do with literal programming but perhaps I can (mis-) use some of these tools for my purpose? For example assuming a special token %# for the pre-parser such a file could look like:               \documentclass[]{article}     \begin{document}     The factorial is an important function:     \begin{equation}         n! = \prod_{k=1}^n k     \end{equation}     %#  n := 1;     %#  for k from 1 to n      %#      n := n * k;     \end{document}      My question: Are there tools (or editors) which can preparse a TeX document and split it into two (or more) different files intended for further processing by different tools? Or any other ideas using TeX features? EDIT: In extension to the excellent answer of jfbu: Assuming that the code snippet is immediate after a numbered equation, could the number of the equation also we written out to the code file? This would amount to a cross- referencing between the two outputs. (If this is not possible, how can the internal snippet counter introduced in the 'elaborated answer' of jfbu be written out (with a prepended comment sign like # or // ?).


title: How do I center entire content of a page vertically?

text: I am using MacTex distribution of Tex, and using xetex for extended font support. My document class is 'article', and I am typesetting a booklet. I can't seem to find solution on how to center a preface (consisting of multiple paragraphs on its own page) vertically within its page. I have defined an environment to reuse preface formatting:               \newenvironment{preface}{\thispagestyle{empty}\topskip0pt\vspace*{\fill}\small}{\vspace*{\fill}}      As you can see, my prefaces (i am planning multiple booklets with same style) use smaller text, 'empty' page style and attempt to center vertically. I have to say the above does attempt to center the content, but it is more top heavy than it should be. I want equal amount of space above the content and below it. How do I accomplish that, in the most straightforward way (if possible avoiding complex tex macros)? ### Minimal working example:               \documentclass[a5paper]{article}     \newenvironment{preface}{\thispagestyle{empty}\topskip0pt\vspace*{\fill}\small}{\vspace*{\fill}}     \begin{preface}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rhoncus eros et eros varius adipiscing.           In fringilla, enim quis sagittis fringilla, lorem nulla aliquet purus, id malesuada elit mauris vitae nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer ut fermentum sem. Maecenas dapibus elit sit amet laoreet pellentesque.          Integer nec euismod lectus, eget rutrum lacus. Suspendisse imperdiet auctor turpis. Integer congue condimentum nisl, eu ultrices felis facilisis ac. In hac habitasse platea dictumst. Nam at cursus eros, at posuere tellus. Vivamus ipsum nibh, pellentesque non lacinia nec, porta sed sapien. Suspendisse egestas velit ante, ut iaculis augue sollicitudin eget.      \end{preface}     \end{document}


title: Using pstool with LuaLaTeX

text: I am trying to use psfrag in conjunction with pstool an LuaLaTeX to replace a tag in an .eps plot generated with gnuplot. I'm not sure if pstool is generally working with LuaLaTeX, however, the processing of the .eps results in an compilation error because pstool seems to call pdfLaTeX instead:               An error occured processing graphic:     `./fig.eps'     Check the log file for compilation errors: `./fig-pstool.log'      And in the fig-pstool.log:               Fatal fontspec error: "cannot-use-pdftex"      MWE:               \documentclass{scrbook}          \usepackage{polyglossia}     \usepackage{fontspec}     \usepackage{graphicx}     \usepackage{epstopdf}          \usepackage{psfrag}     \usepackage{pstool}          \begin{document}          \begin{figure}         \psfragfig*{fig}{\psfrag{SL2}[Br]{$\int_{-1}^1 \rho dh$}}     \end{figure}          \end{document}      Compiling with pdfLaTeX or omitting fontspec works fine.


title: Align equation left

text: Here is my split equation:               \documentclass{article}     \usepackage{asmath}     \begin{document}     \begin{equation}     \begin{split}     a_{ijk} =& \frac {Pr(M_{I} =2  \&  M_J=1 \& M_K =1 | I=i , J=j , K=k)}{Pr (M_I =1 \& M_J =1 \& M_K=1 | I=i , J=j)} \\                 =& \frac {\mu_{ijk211}}{\mu_{ijk111}}\\     \end{split}     \end{equation}     \end{document}      I want to align this equation to the left. Is this possible in an `equation` environment?


title: Using \ExecuteBibliographyOptions causes bibliography not to appear

text: I'm writing my thesis and trying to get separate reference indexing for each chapter. Working off a friend's template, it seems I'm looking for the `\ExecuteBibliographyOptions` options. However, when I add that line, no bibliography is produced. The warning I get is:               biblatex Warning: Please (re)run BibTeX on the file(s):     (biblatex)                debuggingbib1-blx     (biblatex)                and rerun LaTeX afterwards.      Tried a BUNCH of things. Switching to biber did not work, probably because I'm using texworks and did not implement the arara hack. Note again, it works fine (sans my options) if I comment out the executebibliographyoptions line. Thoughts?               \documentclass[12pt,letterpaper,oneside]{memoir}          \usepackage[backend=bibtex,style=nature]{biblatex}     \ExecuteBibliographyOptions{url=false,refsection=chapter,maxnames=99}          \usepackage{filecontents}     \begin{filecontents}{biblib.bib}      @article{Novick1957,     author = {Novick, A and Weiner, M},     file = {:C$\backslash$:/Users/Administrator/Desktop/Dropbox/Papers Mendeley/Novick, Weiner - 1957 - Enzyme induction as an all-or-none phenomenon.pdf:pdf},     journal = {Proceedings of the National Academy of \ldots},     pages = {553--566},     title = {{Enzyme induction as an all-or-none phenomenon}},     url = {http://www.ncbi.nlm.nih.gov/pmc/articles/PMC528498/},     year = {1957}     }     \end{filecontents}           \addbibresource{biblib.bib}          \begin{document}          \chapter{Introduction}\label{chap:introduction}          \section{A brief history of non-genetic variability}     Although observations of cell-to-cell expression variability are relatively new, with one prescient exception \cite{Novick1957},          \section{bibliography}     \printbibliography[heading=none]               \end{document}


title: Table of contents only on right-hand side pages

text: I need to have a table of contents only on right-hand sided (even) pages, a goal similar to what was described here: Table of content only on right-side pages. However, I have a table of contents spanning at least 3 pages, and while               \documentclass[11pt,twoside,a4paper]{report}     \usepackage{afterpage}     \AtBeginDocument{%         \addtocontents{toc}{\protect\afterpage\protect\cleardoublepage}%     }     \begin{document}     \tableofcontents     \chapter{}     \end{document}      does add one blank page after the first toc page, the following pages appear as well in the left side. Is there a way to have all pages of this kind of front matter (particularly the TOC) only right-sided while using the report document class?


title: biblatex: cite without affecting sorting order

text: I want citations in numerical style sorted in order of appeareance, using biblatex. BUT: I want to have citations before the mainmatter, e.g., in nomenclature or on the title back page, without affecting the sort order (meaning my titleback citation should not necessarily be [1]). All citations will appear again in the mainmatter. Can I achieve that with biblatex? For example, with a command that ...   * allows to cite but is invisible to "order of appearance", or   * a command to reset the list of citations before the mainmatter? MWE: (citations in the "mainmatter" should be [1] ... [4])               \documentclass{article}     \usepackage[      style=numeric,      sorting=none     ]{biblatex}          \addbibresource{biblatex-examples.bib}          \begin{document}      The title picture shows the original cover of      Aristotles' poetics \cite{aristotle:poetics}. \\           Nomenclature: four --- said by Augustine \cite{augustine}. \\              Mainmatter: \\      Aksin~\cite{aksin} says one in his article.      Aristotle~\cite{aristotle:poetics} says two in his book.      Angenendt~\cite{angenendt} says three in his article.      And Augustine \cite{augustine} says four in his book.      \printbibliography     \end{document}      * * * edit: found an ugly hack, but does not really count as solution:   I inserted               \makeatletter     \immediate\write\@mainaux{\@percentchar mainmatterstartshere}     \makeatother      where the mainmatter starts, and used an external script to kill all `\citation{...}` commands from the aux file in front of that before running bibtex (except the `\citation{biblatex-control}` which does not seem like a good idea).


title: Public storage of TeX templates

text: It exists a public storage of TeX templates? I mean that people could search a template that is standardized or just nicely formated eg. Dr thesis, official papers, books, articles and so ... It would be great to have a database of all papers. i have found this howtotex it hase screenshots an description, but just few templates available :(


title: How to place the figures in LaTeX document?

text: Although I am putting the figures after some subsection, they do not appear in which I am putting in them.


title: Problems with Terminal output garbled when using ConTeXt

text: when using texexec to compile my documents my terminal is sometimes garbled, so I can't read any error messages anymore :( But since this only happened a very few times, I couldn't be really bothered until now. But lately I've started to use tmux on one working computer i just ssh into, but now whenever I run texec terminal output is garbled. I can reset the terminal, but still if an error is happening I have no chance to see the error message :( I copied a small part of my output, so you can hopefully see what I'm talking about:               systems         : end file ENotes at line 3     system          : command \x is already defined     (./notes.tuo) (./notes.tuo) (./notes.tuo) (./notes.tuo) (./notes.tuo)     (./notes.tuo) (./notes.tuo) (./notes.tuo) (./notes.tuo) (./notes.tuo)     (./notes.tuo)     publications    : loading database from notes.bbl     (./notes.bbl) (./notes.tuo)     systems         : begin file notes at line 23     (./msf_intro.tex     subject         : - Master Stability Function     ) (./msf_delgap.tex     subject         : - Master Stability Function + Gap Junction + Delays          Overfull \hbox (4.03052pt too wide) detected at line 41     \*12ptmmmirm*: J\*12ptmmsyrm*: f[] \*12ptmmmirm*: G[]H\*12ptmmmrrm*: ([][]\*12p     tmmmirm*: ; [][][][]\*12ptmmmrrm*: )\*12ptmmsyrm*: g \*12ptmmmrrm*: = \*12ptmmm     irm*: J[]\*12ptmmsyrm*: f[] \*12ptmmmirm*: G[]H\*12ptmmmrrm*: ([][]\*12ptmmmirm     *: ; [][][][]\*12ptmmmrrm*: )\*12ptmmsyrm*: g\*12ptmmmirm*: [] \*12⎻├└└└⎼⎼└*:      → \*12⎻├└└└☃⎼└*: J[]\*12⎻├└└⎽≤⎼└*: °[] \*12⎻├└└└☃⎼└*: G[]H\*12⎻├└└└⎼⎼└*: ([][]\     *12⎻├└└└☃⎼└*: ; [][][][]\*12⎻├└└└⎼⎼└*: )\*12⎻├└└⎽≤⎼└*: ±     °⎺┼├⎽           : ⎼e⎽e├├☃┼± └▒⎻ °☃┌e ┌☃⎽├     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ⎺⎼☃±☃┼▒┌↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ┌└↑└▒├▒     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ┌└↑⎼└     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ├e│┼▒┼⎽☃↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ec↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ─│↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ├5↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: 8⎼↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ⎺⎼☃±☃┼▒┌↑▒└⎽↑b▒⎽e     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ⎺⎼☃±☃┼▒┌↑▒└⎽↑e┤┌e⎼     °⎺┼├⎽           : ┤⎽☃┼± └▒⎻ °☃┌e: ⎺⎼☃±☃┼▒┌↑⎻┤b┌☃c↑┌└     (/A⎻⎻┌☃c▒├☃⎺┼⎽/C⎺┼TeX├/├e│/├e│└°↑c⎺┼├e│├/├e│/c⎺┼├e│├/b▒⎽e/⎽⎺⎼├↑de°↓└┐☃☃)      and so on... thanks!


title: Extra vertical space between aligned equations in ConTeXt?

text: In LaTeX, I can use `\\\\[3mm]` for example, to put extra vertical space, if I think it will improve the readability of displayed, aligned equations. And in fact I find I do this quite a bit. But what is the ConTeXt equivalent to this?


title: Automated age calculation

text: How can I calculate my age at compile-time in LaTeX? Something like:               I'm \myage{day}{month}{year} years old.      would be most awesome.


title: Using \InsertChunk on examdesign class to create testbank

text: I've using the `examdesign` class to create exams and it can do almost everything I want. But I find that I've been repeating myself as I reuse old exams as practice exams and quiz problems. I'd like to create a bank of test problems and it seems that this can almost be accomplished using the `\InsertChunk` function provided by the `examdesign` class, but there seems to be a small bug. I can almost accomplish my goal if I put the following in the main LaTeX file:               \documentclass{examdesign}          \IncludeFromFile{foo.tex}          \begin{examtop}         Exam Instructions     \end{examtop}          \begin{document}          \begin{multiplechoice}            \begin{question}         Question text goes here.         \choice[!]{0.31}       \end{question}            \InsertChunk{chunk name}          \end{multiplechoice}          \end{document}      And the following in a file named `foo.tex`:               \begin{chunk}{chunk name}       \begin{question}         Question 2 text goes here.         \choice[!]{0.31}       \end{question}     \end{chunk}      However, this setup breaks if I remove the first question. I was wondering if anybody knew enough about the `examdesign` class to propose a modification or a workaround so that I could keep all my questions in `foo.tex`.


title: How to put the url centered under the caption of a figure?

text: I would like to put a source under the caption of my figure. The only thing that is not working is when I put the URL, the caption and the URL don't stay in the middle. Also `\url{...}` didn't work by itself:               \begin{figure}[!h]     \centering     \includegraphics[width=70mm]{figure3}     \linespread{1}\caption{TITLE OF IMAGE     \\ \small{source by:\protect\url{www.aly-abbara.com/livre_gyn_obs/images/testosterone_DHT.html}}}     \label{figure3}     \end{figure}


title: How can I make the crossed-"O" ($\oslash$) bold?

text: I'd like to bolden the crossed-o but               \textbf{$\oslash$}      does nothing!


title: Forcing a figure to appear on the next page

text: I have a figure which takes up an entire page of space. When I use `\includegraphics` to put it in my document, instead of appearing on the next page, it appears at the end of the section. However, I want the full-page figure to appear on the following page. In other words, in the below MWE, I want: (page 1) all of `TEXT A`, followed by the amount of `TEXT B` necessary to fill the rest of the page (page 2) the full-page figure (page 3) the remainder of `TEXT B`               \documentclass{article}     \usepackage{graphicx} % for \includegraphics     \usepackage{lipsum}   % for filler text     \begin{document}     \section{First Section}     \lipsum[1-4] % TEXT A     \includegraphics{full_page_image}     \lipsum[1-4] % TEXT B     \section{Second Section}     \end{document}


title: tikzposter 4 logos title (2 at each side)

text: I am trying to place 4 logos two at each side of the title for a poster in tikzposter. Is there any way to overlap the title with the figures? Maybe placing the `\titlegraphic` in a different layer using `\settitle`?               \documentclass[25pt, a0paper, portrait, margin=0mm, innermargin=15mm, blockverticalspace=15mm, colspace=15mm, subcolspace=8mm,draft]{tikzposter}          \usepackage{xcolor}     \usepackage{filecontents}% http://ctan.org/pkg/filecontents     \usepackage{lipsum}% http://ctan.org/pkg/lipsum     \usepackage{tikz}     \usepackage{multicol}     \usepackage{adjustbox}          \setlength{\columnsep}{2cm}          \title{\parbox{0.5\linewidth}{\centering My  really  really  really  really  really  really  really  really  long poster TITLE.}}     \author{Name}     \titlegraphic{     \includegraphics[width=10cm,height=5cm]{./myImage.jpg}      \hfill      \includegraphics[width=10cm,height=5cm]{./myImage.jpg}     \\% \vspace{5pt} \\     \includegraphics[width=10cm,height=5cm]{./myImage.jpg}      \hfill      \includegraphics[width=10cm,height=5cm]{./myImage.jpg}     }          \usetheme{Autumn}\usecolorstyle[colorPalette=BrownBlueOrange]{Germany}          \begin{document}          \maketitle          \block{My LIPSUM block}{       \lipsum[1]     }          \end{document}      ![enter image description here](http://i.stack.imgur.com/h3vvV.png)


title: Citing inside theorem header

text: How do I create something like this without getting any errors?               \begin{thm}[\cite[page 10]{ABC2011}]     ...     \end{thm}      I tried putting various things into {...} brackets, but not eliminating any errors. I probably have misunderstood something about how LaTeX works in the background and the AMS packet:               \usepackage[amsmath,thmmarks]{ntheorem}


title: How to convert dots to commas in mathmode?

text: For my study of physics I have to do various lab reports. Normally I just process all my data using `python`, `gnuplot` or Mathematica and copy it from there to my TeX document. Unfortunately all these applications use the `.` (dot) as a decimal seperator. Because I study in Germany the german standard says that I have to use `,` (comma) as the decimal seperator. In most cases the supervisors of the lab are forgiving, but one of them told me to redo my whole lab report because of this. Now I don't want to search all the 15 pages to replace all dots with commas. I could have used a regular expression but this still implied editing the whole file.


title: Avoiding a line break at the beginning of an enumerate

text: How can I avoid the line break at the begin of an `enumerate` environment? I've noticed that theorem-style environments succeed in doing so. I'm using the `enumitem` package and my concrete example is:               \textbf{Example:} % don't want a line break here!     \begin{enumerate}       \item test1       \item test2     \end{enumerate}      I tried wrapping the `enumerate` in a `vbox` but that just shifted the entire list up...


title: Footcite that changes format on second citation

text: I'm writing a report for the university. They're being very specific about specifying formatting for citation. Although I suspect the mentor won't be very strict, I'm still interested in having as close output from LaTeX as possible. I'm an utter newbie with LaTeX, so I'm learning as I go. Having picked up a template from another Croatian university that has a very similar format, I've began writing my text and customizing the template as I go. The issue I ran into is with citations. Here are the (translated) instructions on citing: > Citing: On every page, place reference into a footnote. See appendix for > information on format. Literature: At the end; list authors alphabetically. And: > Note: For second and other citations of the same bibliographical unit, you > should list the following: First and last name of the author, in parenthesis > a numerical identifier of the footnote where it's first listed, number of > page where it's first listed. So far, I switched from `bibtex` to `biblatex` and `biber` in order to make use of `\footcite`. I've played with some defaults (`style=numeric`, …), but I feel that as a newbie it'd take me a long, long time to figure out how to get this exact behavior. **How would I go about** forcing full bibliography entry to appear in the first reference to an entry in a `\footcite`, then having subsequent entries display author name, first footnote's ID and first footnote's page number, while at the same time having full entry appear in the Literature section?


title: need help creating a dynamic columned table

text: \NewDocumentCommand\foo{>{\SplitList{;}}m}     {         \begin{table}         \begin{tabular}{ \ProcessList{#1} c}             \ProcessList{#1}{\additem}         \end{tabular}         \end{table}}     }            \newcommand\additem[1]{#1 &}         Im trying to make a dynamic table that will take in as many args in the list and out put to the table with each item being a column.. having an issue with the number of columns and the number of & being inserted. any help would be greatly appreciated. my issue is with predicting the number of columns in the table. and preventing the `! Package array Error: Illegal pream-token (\ProcessList):`c' used.` or if i remove the processlist i get `! Extra alignment tab has been changed to \cr.`


title: Label only from first author

text: With the following example, I tried to get a label only made of from the first author using `maxcitenames`. But unfortunately it seems not to work. Do I miss something?               \RequirePackage{filecontents}     \begin{filecontents*}{\jobname.bib}     @book{smith1,     author={John Smith and Mike Someone},     title={The book with a very very very very very long title},     year={2005},     location={New York},     publisher={Publisher},     }     \end{filecontents*}     \documentclass[12pt]{article}     \usepackage[style=alphabetic,%                 backend=biber,                 maxbibnames=99,                 maxcitenames=1,                 backref=true                 ]{biblatex}         \addbibresource{\jobname}         \renewcommand*{\labelalphaothers}{}         \renewcommand*{\intitlepunct}{}         \DefineBibliographyStrings{german}{in={}}         \DefineBibliographyStrings{english}{in={}}         \DeclareNameAlias{sortname}{last-first}         \DeclareNameAlias{default}{last-first}          \begin{document}     \cite{smith1}     \printbibliography     \end{document}


title: Suppress fontaxes warnings

text: I'm using MyriadPro. When compiling, I'm getting a lot of fontaxes warnings: > Package fontaxes Warning: I don't know how to decode (fontaxes) family `cmr' > on input line 632. I would like to suppress these. A previous question about natbib was similar, but I'm unsure how to extend that answer to this specific case. I've found this [7.1206-7.1227 of `typeface.sty`], which appears to do what I'm after, but inserting the below fragment doesn't work:                  \ifdef{\fa@warn@undecodable}{          \renewcommand*\fa@warn@undecodable[1]{}          \TF@PackageInfoNoLine{Silenced fontaxes command %             \string\fa@warn@undecodable}        }{}        \ifdef{\fontaxes@warn@undecodable}{          \renewcommand*\fontaxes@warn@undecodable[1]{}          \TF@PackageInfoNoLine{Silenced fontaxes command %          \string\fontaxes@warn@undecodable}        }{}      This still produces the errors. **How can I disable the fontaxes warnings?**


title: mdframed: option thmmarks of ntheorem affects vertical skip after theorem

text: I define a framed theorem environment with the mdframed package. I experience the following problem: There is no vertical skip between the bottom of the frame and the text of the following paragraph if the framed theorem is split across pages. Here is a MWE:               \documentclass{article}     \usepackage{lipsum}     \usepackage{mathtools}     \usepackage[amsmath,thmmarks]{ntheorem}%     \usepackage[framemethod=TikZ]{mdframed}          \mdfdefinestyle{mdfStyle}{%        innerleftmargin=0.5\parindent,%        innerrightmargin=0pt,%        innertopmargin=0.5\parindent,%        innerbottommargin=0.5\parindent,        topline=true,%        rightline=false,%        bottomline=true,%        leftline=true,%        roundcorner=3pt,%        linewidth=1pt,        linecolor=black,        ntheorem=true}          \newmdtheoremenv[style=mdfStyle]{theorem}{Theorem}          \begin{document}     \lipsum[1]     \begin{theorem}     \lipsum[2]     \end{theorem}     \begin{theorem}     \lipsum[3]     \end{theorem}     \lipsum[4]     \begin{theorem}     \lipsum[5]     \end{theorem}     \lipsum[6]     \end{document}      An uninspired workaround is to replace               \mdfdefinestyle{mdfStyle}{%        innerleftmargin=0.5\parindent,%        innerrightmargin=0pt,%        innertopmargin=0.5\parindent,%        innerbottommargin=0.5\parindent,        topline=true,%        rightline=false,%        bottomline=true,%        leftline=true,%        roundcorner=3pt,%        linewidth=1pt,        linecolor=black,        ntheorem=true}      with               \mdfdefinestyle{mdfStyle}{%        innerleftmargin=0.5\parindent,%        innerrightmargin=0pt,%        innertopmargin=0.5\parindent,%        innerbottommargin=0.5\parindent,        topline=true,%        rightline=false,%        bottomline=true,%        leftline=true,%        roundcorner=3pt,%        linewidth=1pt,        linecolor=black,        ntheorem=true,%        afterlastframe={\vspace{\topsep}}}      Question 1: Is this a bug? Question 2: Is there a better workaround that adds vertical space only if "needed"? Note: The problem does not arise without the option thmmarks to ntheorem.


title: How to align equations in the equation environment?

text: I have been looking on how to align equations and I have seen numerous examples with `\align` and `\flalign`, however whenever I try to use these in the `equation` environment, I get an error. I would like to be able to align the equations at the middle equal signs. Here is an image of the current output: ![current output](http://i.stack.imgur.com/8PMiV.jpg)               \begin{proof}     Let   \begin{math} \varepsilon > 0 \end{math} be given and let \begin{math} \delta = \varepsilon \end{math}. It follows that for  \begin{math} I:(X,d^*) \to (R,d) \end{math}          \begin{equation*}     \text{if}\quad\d^*(f,g) = \int_a^b \bigg  |f(t) - g(t)\, \mathrm{d}t \  \bigg  | < \delta      \end{equation*}           \begin{equation*}     \text{then}\quad{\bigg  | \int_a^b f(t) - g(t)\, \mathrm{d}t  \bigg  |  =  \bigg  | \lim_{n \to \infty} \sum_{i=1}^{n}{M_i(t_i-t_{i-1})} \bigg  |\leq     \end{equation*}      \begin{equation*}     \lim_{n \to \infty} \sum_{i=1}^{n}  \bigg  | {M_i(t_i-t_{i-1})} \bigg  |= \int_a^b \bigg  |f(t) - g(t)\, \mathrm{d}t \  \bigg  | < \delta = \varepsilon     \end{equation*} \          \end{proof}      I am now using `aligned` instead of the `equation` environment. Here is the code and the error I'm getting: CODE:               \documentclass{article}     \usepackage{mathtools}     \usepackage{amsthm}     \begin{document}     \theoremstyle{definition}     \newtheorem{Prb1}{Problem}          \begin{Prb1}      Since the the integral is nothing more that an infinite sum it obeys the triangle inequality. Hence, we may use this property to prove that \begin{math}I:(X,d^*) \to (R,d) \end{math} is continuous. Where \begin{math} d^*(f,g) = \int_a^b f(t) - g(t)\, \mathrm{d}t\end{math} for continuous functions \begin{math}f,g,\end{math} and \begin{math}I(f) = \int_a^b f(t) \, \mathrm{d}t \end{math} \hfill     \end{Prb1}          \begin{proof}          Let   \begin{math} \varepsilon > 0 \end{math} be given and let \begin{math} \delta = \varepsilon \end{math}. It follows that for  \begin{math} I:(X,d^*) \to (R,d) \end{math}          \begin{align*}     \text{if}\quad\d^*(f,g) &= \int_a^b \bigg  |f(t) - g(t)\, \mathrm{d}t \  \bigg  | < \delta \\     \text{then}\quad{\bigg  | \int_a^b f(t) - g(t)\, \mathrm{d}t  \bigg  |  &=  \bigg  | \lim_{n \to \infty} \sum_{i=1}^{n}{M_i(t_i-t_{i-1})} \bigg  |\leq \\     \lim_{n \to \infty} \sum_{i=1}^{n}  \bigg  | {M_i(t_i-t_{i-1})} \bigg  |&= \int_a^b \bigg  |f(t) - g(t)\, \mathrm{d}t \  \bigg  | < \delta = \varepsilon  \end{align*}      \begin{equation*}     \text{if}\quad\ d^*(f,g) = \int_a^b \bigg  |f(t) - g(t)\, \mathrm{d}t \  \bigg  | < \delta \end{equation*}           \end{proof}     \end{document}      ERROR:               ))))     Runaway argument?      \text {if}\quad \d ^*(f,g) &= \int _a^b \bigg |f(t) - g(t)\, \mathrm \ETC.     ! Paragraph ended before \align* was complete.     <to be read again>                         \par      l.25           ?


title: \if and \fi inside different \def macros

text: Recently I failed to solve specific task in LaTeX. I wanted to make document with several sections, each divided on several subsections. Each section I had placed to separate files, and used `\input` for them in the main file. So my `main.tex` file was rather short. Then I tried to use set of following constructions:               \def\removesubsectionstext{\let\printsubsectionstext\iffalse\let\finalizeprinttext\fi}     \def\insertsubsectionstext{\let\printsubsectionstext\iftrue\let\finalizeprinttext\fi}     \makeatletter     \renewcommand{\section}{\finalizeprinttext%     \@startsection{section}{1}%     {0pt}{1.5ex plus .5ex minus .1ex}{0.8ex plus .1ex}%     {\normalfont\large\bfseries}%     \printsubsectionstext}     \renewcommand{\subsection}{\finalizeprinttext%     \@startsection{subsection}{2}%     {0pt}{1.5ex plus .5ex minus .1ex}{0.8ex plus .1ex}     {\normalfont\bfseries}%     \printsubsectionstext}     \makeatother      By using this definitions and redefinitions I was hoping to hide texts inside some of the chapters, with contents elements remaining visible. I thought it was possible by this code:               \documentclass[12pt,a4paper,]{article}     \usepackage{amsmath, amssymb,latexsym}     \usepackage{array,tabularx,caption2}     \usepackage{color}     \usepackage{pstricks,pst-all,pst-3dplot,pst-optic}     \usepackage{graphicx}     \begin{document}     \insertsubsectionstext     \printsubsectionstext     \tableofcontents     \break     \input{chapter1}     \break     \removesubsectionstext     \input{chapter2}     \finalizeprinttext     \end{document}      Here I had expected to hide text from chapter2 and to see text from chapter1. But this is not working. I suspect it is impossible to use `\if` in one `\def` macro, and to close it with `\fi` in another. Is there workaround that will solve my problem? I know, that I can manually insert in my text `\finalizeprinttext` and `\printsubsectionstext` near every `\section` and \subsection command, and that solved my problem partially. It is against automatic errors control. There is always opportunity to forget to insert `\finalizeprinttext` and `\printsubsectionstext` near new sections and subsections.


title: How to draw an Euler angle rotation sequence with TikZ?

text: For some lecture notes I want to illustrate successive unit axis rotations using Euler angles. I am quite happy with what I came up with so far: ![Euler angle unit axis rotations](http://i.stack.imgur.com/uaT1k.png) However, I am failing at drawing the angles in between the successive roations. For example, I would like to have `theta_1` between `x_I` and `x'` etc. Like so: ![Example of desired output](http://i.stack.imgur.com/yCkng.png) where the lines should (ideally...) be arcs, and be labelled. I achieve the last one of the pictures above with the following code using the `tikz-3dplot` package.               \begin{tikzpicture}[scale=2.5,tdplot_main_coords]          % Set origin of main (body) coordinate system     \coordinate (O) at (0,0,0);          % Draw main coordinate system     \draw[red, ,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x_{\mathcal{I}}$};     \draw[red, ,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y_{\mathcal{I}}$};     \draw[red, ,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z_{\mathcal{I}}$};           % Intermediate frame 1     \tdplotsetrotatedcoords{\zRot}{0}{0}     \draw[tdplot_rotated_coords,->, blue] (0,0,0) -- (1,0,0) node[anchor=north east]{$x'$};     \draw[tdplot_rotated_coords,->, blue] (0,0,0) -- (0,1,0) node[anchor=west]{$y'$};     \draw[tdplot_rotated_coords,->, blue] (0,0,0) -- (0,0,1) node[anchor=west]{$z'$};          % Intermediate frame 2     \tdplotsetrotatedcoords{\zRot}{\yRot}{0}     \draw[,tdplot_rotated_coords,->, green] (0,0,0) -- (1,0,0) node[anchor=     north]{};     \draw[,tdplot_rotated_coords,->, green] (0,0,0) -- (0,1,0)     node[anchor=west]{$y''$};     \draw[,tdplot_rotated_coords,->, green] (0,0,0) -- (0,0,1)     node[anchor=south]{$z''$};          % Rotate to final frame     \tdplotsetrotatedcoords{\zRot}{\yRot}{\xRot}     \draw[thick,tdplot_rotated_coords,->, cyan] (0,0,0) -- (1,0,0)     node[anchor=west]{$x_{\mathcal{B}}$, \textcolor{green}{$x''$}};     \draw[thick,tdplot_rotated_coords,->, cyan] (0,0,0) -- (0,1,0) node[anchor=west]{$y_{\mathcal{B}}$};     \draw[thick,tdplot_rotated_coords,->, cyan] (0,0,0) -- (0,0,1) node[anchor=south]{$z_{\mathcal{B}}$};          \end{tikzpicture}      The full code is pasted here, not to crowd this up too much:   http://pastebin.com/pYW6iyEP **Long story short: How can I draw arcs in between the individual coordinate systems?**


title: Difference between bibliography management styles

text: There are two ways that I've seen people including their bibliographies. The first is without including any package:               % Document:     \bibliographystyle{ieeetr}     \bibliography{<file>}      And the second includes `biblatex`:               % Preamble:     \usepackage[backend=bibtex,style=numeric]{biblatex}     \addbibresource{<file>.bib}     % Document:     \printbibliography      What exactly is the difference between these, and which is preferred in what situation?


title: Why is LaTeX3 taking so long to come out?

text: I feel as though I have been hearing about the LaTeX3 project for a very long time. Why is it taking so long for it to come into fruition? Are there major technical difficulties, or is it purely a lack of developers that is causing a bottleneck?


title: How to set the page layout both the left and the right the same width?

text: Here is my code.Thank you.               \documentclass[a4paper,twocolumn]{exam}     \usepackage{xeCJK}     \usepackage{amsmath}     \usepackage{multicol}          \setCJKmainfont{SimSun}          \begin{document}          \begin{center}       \fbox{\fbox{\parbox{5.5in}{\centering             谢谢各位朋友 \qquad 谢谢各位朋友}}}     \end{center}          \vspace{0.1in}          \makebox[\textwidth]{Name and s好人:\enspace \hrulefill}          \vspace{0.2in}          \makebox[\textwidth]{Instructor's name:\enspace \hrulefill}          \begin{multicols*}{2}     \begin{questions}     \question          (本题满分14分 衡水十月模拟)\\已知函数$f(x)=a^x+x^2-x\ln a \, (a >0,a \neq 1)$.\\     (1)求函数$f(x)$在点$(0,f(x))$处的切线方程；\\     (2)求函数$f(x)$的单调递增区间；\\     (3)若存在$x_1,x_2 \in [-1,1]$,使得$|f(x_1)-f(x_2)|\ge e-1$\,($e$是自然对数的底数),求实数$a$的取值范围.                    \question          (本题满分14分 衡水十月模拟)\\已知函数$f(x)=a^x+x^2-x\ln a \, (a >0,a \neq 1)$.\\     (1)求函数$f(x)$在点$(0,f(x))$处的切线方程；\\     (2)求函数$f(x)$的单调递增区间；\\     (3)若存在$x_1,x_2 \in [-1,1]$,使得$|f(x_1)-f(x_2)|\ge e-1$\,($e$是自然对数的底数),求实数$a$的取值范围.     \end{questions}          \end{multicols*}     \end{document}


title: Text in included PDF diagram is not shown, only lines

text: I want to include a PDF in LaTeX with:               \begin{figure}       \includegraphics[width=\textwidth]{image.pdf}     \end{figure}      The `image.pdf` contains graphical elements like boxes or lines and text in these boxes. My problem is: the boxes and lines are included in the final document but the text does not appear. I tried `\includepdf` but it's not working.


title: parameter passing to \verb|| environment

text: I happen to write the following code over and over again.               {\color{blue}\verb|>|} {\footnotesize\verb|HI|}       So, I came up with the following code to make it a command.               \newcommand{\result}[2]{%     {\color{#1}\verb|>|} {\footnotesize\verb|#2|}      }      The problem is that the result is not what I expected, there are '|' characters attached. What might be wrong? I need to have the verbatim environment kept as the result can contain some characters something like $, \ ...               \documentclass{article}          \newcommand{\result}[2]{%     {\color{#1}$>$} {\footnotesize \verb|#2|}      }          \usepackage{color}          \begin{document}     {\color{blue}\verb|>|} {\footnotesize\verb|HI|}           \result{red}{HI}          \end{document}      ![](http://i.stack.imgur.com/7pVZ7.png) ## ADDED   * For the original source, `\verb|>|` should have been `$>$`. I updated the source example.    * Following Willie's answer, I modified the command \newcommand{\result}[2]{{\color{#1}$>$} {\footnotesize\texttt{#2}}} It seems fine, but with **multicols** environment, the footnotesize font, gives some blank spaces before its printing of characters. I attach the screen capture and source code. ![](http://i.stack.imgur.com/PAQWM.png) It seems that line break causes this problem, by adding \mbox inside the \texttt, I could remove the blank.               \newcommand{\result}[2]{{\color{#1}$>$} {\footnotesize\texttt{\mbox{#2}}}}      ![](http://a.imageshack.us/img408/9236/screenshot20100803at933.png)               \documentclass{article}     \usepackage{multicol}     \usepackage{tikz}          \newcommand{\result}[2]{{\color{#1}$>$} {\footnotesize\texttt{\mbox{#2}}}}     \newcommand{\resultp}[2]{{\color{#1}$>$} {\small\texttt{\mbox{#2}}}}     \usepackage{color}          \begin{document}          \begin{multicols*}{2}     \noindent\result{green}{Welcome to my project! These are your args: (a b c)}\\     \result{green}{hello}\\     \result{green}{HI my\string_name}     \vskip 2ex     \noindent\resultp{green}{Welcome to my project! These are your args: (a b c)}\\     \resultp{green}{hello}\\     \resultp{green}{HI}          \end{multicols*}     \end{document}


title: \footnotemark and \footnotetext in minipage

text: The Tufte handout class give a neat layout that shows the footnote at the right hand side not bottom line. But, when I use the minipage with tufte-handout, and if the minipage has the footnote, the footnote is broken as the class modifies the footnote setup. So, I used the \footnotemark and \footnotetext, but the number is shown in alphabetical form at the bottom, whereas the arabic in the text area. And even, it gives me the error message -               l.29 The caller\footnotemark{\value{footnote}}                                                   \footnotetext[2]{hello} uses `...      ![](http://i.stack.imgur.com/hwoFM.png) What's wrong with my code? And how to get the correct footnote number?               \documentclass{tufte-handout}     \usepackage{tikz}     \newcommand{\clj}{\textcolor{blue}{\textsc{clojure}}}          \title{Week 31, August$^{1st}$ 2010}     \newlength{\RoundedBoxWidth}     \newsavebox{\GrayRoundedBox}     \newenvironment{GrayBox}[1][\dimexpr\textwidth-4.5ex]%        {\setlength{\RoundedBoxWidth}{\dimexpr#1}         \begin{lrbox}{\GrayRoundedBox}            \begin{minipage}{\RoundedBoxWidth}}%        {   \end{minipage}         \end{lrbox}         \begin{center}         \begin{tikzpicture}%            \draw node[draw=black,fill=black!10,rounded corners,%                  inner sep=2ex,text width=\RoundedBoxWidth]%                  {\usebox{\GrayRoundedBox}};         \end{tikzpicture}         \end{center}}          \begin{document}     hello\footnote{experiment}     %\newcounter{\myfootnote}     %\setcounter{\myfootnote}{\value{footnote}}     \vskip2ex     \begin{GrayBox}[1.2\textwidth]     {\LARGE How to use external \clj\ code}     \vskip0.3em\hrule\vskip1em          The caller uses `use' to use \verb|CLASSPATH/hello.clj|. Now, it's OK to call     the (hi).\footnotemark[\thefootnote]{}\footnotetext[\thefootnote]{Hello}          \end{GrayBox}     hello\footnote{experiment again}     \end{document}


title: the 'proper' way to cite the earliest publication date in brackets, followed by the publication date of the recent version used – ASA style

text: **See update on 2013-11-12 10:26:36Z below regarding my final solution** In the American Sociological Association Style Guide. 3rd ed. (p. 2 [PDF link!]) it is explained and demonstrated how to cite a work that is reprinted from a version published earlier. It should, according to the ASA guide, look like this, ![enter image description here](http://i.stack.imgur.com/ZdSHO.png) I'm curious to learn if there is an official or 'proper' way of doing this using `biblatex`? I have produced the above example with the code below,               \documentclass[11pt]{article}          \usepackage[backend=bibtex,     style=authoryear, natbib=true,              ]{biblatex}          \usepackage{hyperref}          \begin{filecontents}{bibfile.bib}          @book{Veblen2005:1899,         Author = {Veblen, Thorstein},         Isbn = {9788187879299},         Language = {en},         Month = jan,         Publisher = {Aakar Books},         Title = {{The Theory of the Leisure Class; An Economic Study of Institutions}},         Year = {[1899] 2005}}          \end{filecontents}          \addbibresource{bibfile.bib}          \begin{document}          \noindent     \ldots \citep{Veblen2005:1899} stated that \ldots\\          \printbibliography          \end{document}      ## Update on 2013-11-12 10:26:36Z Switching backend from `bibtex` to `biber`, as suggested in moewe's answer below, proved to be a bit more challenging than expected as I couldn't use `biber` directly from `TeXShop` (Ver. 3.26 on OSX 10.8.5). However, I managed, with the help of this answer by Harish Kumar, to use arara. Thus solution did require me to add some _arara-lines_ to the .tex file just before the `\documentclass{}` and to compile my .tex file from the terminal, I've pasted my code and a screenshot below.               \documentclass{article}     \usepackage[backend=biber, style=authoryear, natbib=true]{biblatex}     \usepackage{hyperref}     \usepackage{filecontents}          \begin{filecontents*}{\jobname.bib}     @book{Veblen2005:1899,         author = {Veblen, Thorstein},         Isbn = {978-81-87879-29-9},         publisher = {Aakar Books},         title = {The Theory of the Leisure Class},         subtitle = {An Economic Study of Institutions},         date = {2005-01},         origyear = {1899}}          @book{Weber2013,         Author = {Weber, Max},         Isbn = {9781135973988},         Keywords = {Reference / General, Religion / General},         Language = {en},         Month = jul,         Publisher = {Routledge},         Title = {{The Protestant Ethic and the Spirit of Capitalism}},         Year = {2013},            origdate = {1905}}         \end{filecontents*}          \addbibresource{\jobname.bib}          \renewbibmacro*{date+extrayear}{%           \iffieldundef{\thefield{datelabelsource}year}             {}             {\printtext[parens]{%                \iffieldundef{origyear}% this is new ...                  {}                  {\printtext[brackets]{\printorigdate}                   \setunit{\addspace}}% ... till here                \iffieldsequal{year}{\thefield{datelabelsource}year}                  {\printdateextralabel}%                  {\printfield{labelyear}%                   \printfield{extrayear}}}}}%         \renewbibmacro*{date}{}%         \renewbibmacro*{issue+date}{%           \iffieldundef{issue}             {}             {\printtext[parens]{\printfield{issue}}}%           \newunit}              \renewbibmacro*{cite:labelyear+extrayear}{%           \iffieldundef{labelyear}             {}             {\printtext[bibhyperref]{%moved this               \iffieldundef{origyear}% this is new                 {}                 {\printtext[brackets]{\printorigdate}                  \setunit{\addspace}}% everything beyond this point is old               \printfield{labelyear}%               \printfield{extrayear}}}}          \usepackage{hyperref}                 \hypersetup{               pdfborderstyle={/S/U/W 1}, % thanks, http://tex.stackexchange.com/a/26085/22939              }          % arara: pdflatex      % arara: biber     % arara: pdflatex      \begin{document}     \ldots \citep{Veblen2005:1899} stated that \ldots\\          However \citet{Weber2013} demonstrates that \ldots          \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/Dbd4D.png) I'll update this answer when I learn bore about the _backend_ and _TeXShop_. Please feel free to comment if you know of a better solution. Thanks.


title: overriding a preselected bibliography style, and suppressing unwanted bibtex fields

text: I have to use a style file for a journal paper, that uses `plainnat` as its bibliography style. I want to use `abbrvnat` style, but other than directly changing the journal style file I don't know any way to select a different bibliography style. Is there a neater way to do that? I've already things like               \usepackage{jmlr2e} %This is the journal style that uses plainnat     \bibliographystyle{abbrvnat}      without success. Also what is the most convenient way to suppress some unwanted BibTeX fields like URL, ISBN, etc, without resorting to `biblatex`?


title: Align math explanation

text: Any possibility to align the fractions (units in general) too?               Wobei:     \begin{flalign*}     \noindent \tab \rho _{KOH} & = 2.04 \frac{g}{cm^3} &\\     M_{KOH} & = 56.10 \frac{g}{mol} &\\     c_{KOH} & = 0.05 \frac{mol}{L} &\\     \end{flalign*}      If I add another & they end up completely at the right.


title: Need help creating a custom aux file read/write routine to suit my needs

text: I require two new commands, `\createreference` and `\citereference`, to work with. They should work as shown in the following examples: `\createreference{john}{John Q. Citizen}` should write the text “John Q. Citizen” into the file `myreferences.aux`. The text should be somehow associated with the corresponding entry `john`. `\citereference{john}` should print out “??” if no `john` entry can be found in `myreferences.aux` (or if the file doesn’t exist). However, it should print out the corresponding text (in this case “John Q. Citizen”) if the entry is found. This should work even if `\createreference` appears after `\citereference` in the code. I don’t have enough low-level expertise to be able to do this. Does someone else?


title: Table of Contents breaks file running

text: I have a file, which works fine, if there is no table of contents, however, while trying to compile this file with added `\tableofcontents` command, compiler tells me: > myfile.toc 2 LaTeX Error: Something's wrong--perhaps a missing \item. What's the solution? edited: I've just found that `\tableofcontents` are not in good relations with section's renewing:               \makeatletter     \renewcommand{\section}{         \@startsection             {section}{1}{0mm}         {\baselineskip}%         {\baselineskip}          {\fontsize{14}{14}\centering\bfseries\MakeUppercase}                }%        \makeatother       If I remove this renewing, `\tableofcontents` makes no problem. So this probably makes the problem clear?


title: Using LaTeX3 syntax in document commands

text: I have already read much about LaTeX3 on TeX.SE, in TeX Live’s documentation and in TUGBoat, but there is something I do not yet understand: is the expl3 syntax meant to be used in document-level commands? I would be truly delighted if it was possible to include the caracthers `:` and `_` in command names defined with `\newcommand` or an equivalent LaTeX3 definition construct. That would bring “namespaces in the document”, so to speak, and generally make commands more readable (in my opinion). Since I always have to work with XML and HTML in my professional life, I would like to make my LaTeX markup more similar to XML’s elements and attributes, _at least superficially_. Going further down this line of thinking, a side question is: is it somehow possible to use non-ASCII letters in LaTeX3 command names? P.S.: Yes, I do pursue the foolish dream of _semantic markup in LaTeX_ :-).