title: split equation in multiple lines

text: I am a new Latex user,I have loaded these two math equation in my Latex documents and i want to split an equation i have into multiple line               \usepackage{amssymb}     \usepackage{amsthm}      I am reading this topic for breaking the lines over multiple How to break a long equation? although what ever i do it does not allow me to compile **MWE**               \documentclass[authoryear,preprint,review,12pt]{elsarticle}          \usepackage{amssymb}     \usepackage{amsthm}          \begin{document}          \begin{equation}\label{xx}     \begin{split}     A&= 1 + 2 + \\     & 3 +4 +6     \end{split}     \end{equation}          \end{document}          \endinput      So               \begin{equation}     A = 1 + 2 + 3 +4 +6     \end{equation}      I want to place them/break the equation in two lines and retain the format of numbering and equal placing beneath. i tried               \begin{equation}     A = 1 + 2 + \\     3 +4 +6     \end{equation}      Although it does not work When i use `\begin{multline}`               \begin{multline}     A = 1 + 2 + \\     3 +4 +6     \end{multline}      and the following errors               ! LaTeX Error: Environment multline undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \begin{multline}      ! LaTeX Error: \begin{document} ended by \end{multline}.See the LaTeX manual or LaTeX Companion for explanation.Type H for immediate help.... \end{multline} Though i get the equation broken it is not numbered, or has a one line distance from my text as the `\begin{equation}` Also tried this example as kindly suggested               \begin{equation}\label{xx}     \begin{split}     A&= 1 + 2 + \\     & 3 +4 +6     \end{split}     \end{equation}      and obtaining these               ! LaTeX Error: Environment split undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \begin{split}     ! Misplaced alignment tab character &. A&     ! Misplaced alignment tab character &.<recently read> & &     ! LaTeX Error: \begin{equation} on input line 142 ended by \end{split}.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \end{split}      Have i missed anything?


title: Increasing margin of left side tag/number in amsmath align enviroment

text: I asked this on the lyx user list but haven't got an answer (http://marc.info/?l=lyx-users&m=137891444218650&w=2). I would like to include text lines in align environment using 'leqno' option of amsmath package. This inserts numbers in front of each line and aligns the lines giving an output like this:               |(1)                aligned text = line     |(2)                   something = other something     |(3)                         ab  = CD      The | represents the left margin (specified for text pages). How could I set the exact position of the number, for example to move it to the right, closer to the aligned lines (or increase the margin for the number)? I find the space between numbers and aligned text too big. Instead of the above I would like to get something like this: align environment 1:               |              (1)  A. aligned text = line     |              (2)        something = other something     |              (3)              ab  = CD      align environment 2:               |        (1)                       something = other something     |        (2)  B. this is longer aligned text = linedifferent      |        (3)                             ab  = CD      See that I have different align environments and the indentations have to be the same within the same align but should be different between different aligns, depending on the length of the aligned lines. I would prefer to set the distance between the number and the left edge of the aligned stuff (labels A. and B. above), and the indentation should be adjusted according to this. Is this possible? Thanks, bcsikos


title: Difference between unrestricted and internal vertical mode

text: At any point in the processing of a document, TeX can be in one of seven modes: no mode (only in `\write` and similar commands, I think), math mode (`$...$`), display math mode (`$$...$$`), restricted horizontal mode (`\hbox{...}`), unrestricted horizontal (paragraphs), internal vertical mode (`\vbox{...}`) or on the main vertical list. What are the differences between the two vertical modes? Obviously, there can be no page breaks within a `\vbox`, so I'll refine my question into: assuming that TeX is currently on the main vertical list, what are the differences between doing               \setbox0\vbox{... material ...}\unvbox0      and putting `... material ...` directly in the main vertical list?


title: How to use correctly latexdiff with figures?

text: I did change a source of some image between new and old version of `.tex` files, when I run `latexdiff` it marks such parts like this:               \DIFdelend %DIF > lamp     \DIFaddbegin \begin{figure*}[t]     \DIFaddendFL \begin{center}               \subfigure[] {\label{fig:result_lamp_img}\includegraphics[width=0.3\linewidth] {lamp_i\DIFdelbeginFL \DIFdelFL{mg1}\DIFdelendFL \DIFaddbeginFL \DIFaddFL{mg2}\DIFaddendFL .jpg}}     ....      How to force `latexdiff` not to change the source of image files?


title: What are some good graphing libraries/programs for embedding in LaTeX

text: The de-facto plotting program for LaTeX is, AFAIA, gnuplot. Is there such a program for drawing graphs/diagrams? I am aware of graphviz and at first glance it appears very useful, but it is missing certain basic features such as specifying multiple rank orders (arrange left to right, top to bottom... see here) or subscripts/superscripts. It apparently allows for html formatting which in theory provides for subscripts/superscripts, but it does not seem to work. dot2tex attempts to make graphviz more LaTeX friendly, but the generated graphs are not as sharp, C style comments, which are valid in graphviz files, appear to conflict with LaTeX files, even when included as a `doc` file, and I, personally, can't figure out how to embed the graph as a figure as opposed to a dangling graph. Is there a way to address some of these shortcomings:   * no sub/superscripts   * no figures   * no comments If not, is there a way to output the file to a more LaTeX friendly format, much like gnuplot does with its latex format, such that I can use LaTeX's math mode? **EDIT** here are two pictures to better describe what I mean by graphs and/or diagrams ![Diagram 1](http://i.stack.imgur.com/dS0ZE.png) ![Diagram 2](http://i.stack.imgur.com/8HBss.png)


title: LaTeX's datatool package together with siunitx

text: I want to use the `datatool` package to read csv files and parse them to LaTeX tables. Furthermore I want to use `siunitx` to format the numbers from the csv file. Have a look at the following example:               \documentclass{article}          \usepackage{datatool}     \usepackage{siunitx}     \usepackage[table]{xcolor}     \usepackage{colortbl}          %% table data     \begin{filecontents*}{scientists.csv}     name,surname,age,IQ     Albert,Einstein,133,210.12     Marie,Curie,145,220.12     \end{filecontents*}          %%% table design     \colorlet{tableheadcolor}{black!60}     \newcommand\tableheadfont{       \sffamily\bfseries       \slshape       \color{white}     }     \begin{document}          \DTLloaddb{table}{scientists.csv}               \sisetup{round-mode=places,              table-number-alignment = center-decimal-marker              }     \rowcolors{1}{gray!15}{white!100}     \begin{table}     \begin{tabular}{l                     l                     S[table-format = 3.0  ,round-precision=0]                     S[table-format = 3.2  ,round-precision=2]                     @{}l}         \rowcolor{tableheadcolor}         \tableheadfont name & \tableheadfont surname & \tableheadfont age & \tableheadfont iq & \tabularnewline         \hline         \DTLforeach*{table}%         {\name=name, \surname=surname, \age=age, \iq=IQ}%         {\DTLiffirstrow{}{\tabularnewline}%          \name & \surname & \age & \iq &         }     \end{tabular}     \end{table}          \end{document}      The last column contains a numerical value which shall be formatted with `siunitx` (S-column). That's why I had to append an empty row (have a look at tabular, siunitx and input - `Extra }, or forgotten $.` for details). here is the result: ![enter image description here](http://i.stack.imgur.com/3DnXJ.png) There are two problems with this solution:   1. due to the colored header the last header cell isn't complete (the q is missing)   2. the "Albert" in the first data cell is shifted to the right. Does anybody know how I can solve these problems?


title: set minimum number of pages for TOC

text: I am looking for a method to set the _minimum_ number of pages for the TOC. For example, with the MWE, chapter 1 starts on the 3rd page in first run, and the 14th page on second run. Knowing this I would like to get the first run to also start chapter 1 on the 14th page by inserting a sufficient number of blank pages for the TOC. In the second run, there should be 0 pages inserted (at least in this case since I reserved the correct number of pages). ## Background: This bug is causing me quite a bit of grief: "pgf Error: No shape named i-0 is known", but only upon 2nd run. The problem seems to be related to the number of pages used by the TOC changing between runs. So was hoping that something like this can be used as a temporary fix until the bug in the `intersections` library is fixed. ## Code:               \def\NumberOfChapters{10}     \def\NumberOfSections{50}          \documentclass{book}     \usepackage{lipsum}     \usepackage{pgffor}          \begin{document}     \frontmatter     \pagenumbering{roman}     \tableofcontents     \pagenumbering{arabic}     \clearpage          \mainmatter     \foreach \x in {1,...,\NumberOfChapters}{         \chapter{Chapter \x}         \foreach \y in {1,...,\NumberOfSections}{             \section{Section \y}             \lipsum[1-7]         }     }     \end{document}


title: Short cut method to draw multiple dots with label on a curve

text: Let us consider the following example:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[scale=.6pt]     \draw (1,0)--(20,0);      \foreach \x in {1,...,20}{     \draw[fill] (\x,0) circle (1.5pt);     }        \foreach \x/\a in {1/1,2/2,3/3,4/4,5/5,6/6,7/7,8/8,9/9,10/10,11/11,12/12,13 /13,14/14,15/15,16/16,17/17,18/18,19/19,20/20}{     \node[below] at (\x,0) {\a};     }     \end{tikzpicture}     \end{document}      This produces ![output](http://i.stack.imgur.com/U9EiS.png) Whenever I have used the following short cut technique gives errors.               \foreach \x/\a in {1/1,...,20/20}{       \node[below] at (\x,0) {\a};      }      How can I do this by short cut method?


title: How to nest xymatrix in Xy-pic

text: This is a bit of a long post, so apologies in advance. I would like to nest xymatrices in `Xy-pic` so that entire xymatrices would be treated as single entries in another xymatrix. I tried the obvious method of putting an xymatrix as an entry in another, which didn't work. I then did some search and read a few manuals, and found one method which only deals with two matrices side by side, with the starting point of the arrows not at the centers of the two matrices, as in the code below:               \[     \xymatrix{     & R_1 \ar[r] \ar[d] & P \\     R_2 \ar[r] \ar[d] & B & \\     Q &&      } \qquad\rightarrow\qquad      \xymatrix{a}     \]      I then found on a thread on the Xy official site someone asking the same question as me; and he was told to use xygraph, and that there is an xymovie about this type of construction. I couldn't find the movie; and couldn't find much information on how to use xygraph either ( the section in Xy-pic RM didn't include many examples). Eventually I tried this:               \xy     \xygraph{!M          \xymatrix{     & R_1 \ar[r] \ar[d] & P \\     R_2 \ar[r] \ar[d] & B & \\     Q &&      } ([u]X : ?, [l]Y : ?)          }     \endxy      which still didn't do what I wanted. So is there a way to nest xymatrices? Or maybe I need to use some other graphics packages? Thank you very much for you help! (And your time for reading this.)


title: How to cite chapter in book?

text: Is there any source where I can find the required fields in my bibliography file to refer to a chapter within a book? I found @inbook, but I cannot find the fields (author=, chapter=... ). In general it would be nice to know what are all the possible fields for each type of reference i.e. @article, @book, @unpublished and so forth.


title: Formatting list of custom floats in classic thesis

text: I am writing a document using `classicthesis` package, where I have some algorithms written with the `clrscode` package. I used package `float` to create a new float named "algorithm". However when I print the list of algorithms using `\listof{algorithm}{List of algorithms}` I either get a wrongly formatted list (i.e. with the long series of dots ..........., which is different from the other ones in `classicthesis`), or a correctly formatted one, but where algorithms are called "figure". I trimmed down my document so that I got this minimal working example:               \documentclass[english]{scrreprt}          \usepackage{scrhack}          \usepackage{float}          \floatstyle{ruled}     \newfloat{algorithm}{thp}{loa}[chapter]     \floatname{algorithm}{Algorithm}          \usepackage[pdfspacing,floatperchapter]{classicthesis}          \begin{document}          \begingroup         \let\clearpage\relax         \let\cleardoublepage\relax              \tableofcontents         \listoffigures         \listoftables         \listof{algorithm}{List of algorithms}     \endgroup          \chapter{Test chapter}\label{ch:algotest}          \section{Some tests}          Algorithm \ref{alg:first} shows a plain algorithm. Figures \ref{fig:first} and \ref{fig:second} show a couple figures, and a table is shown in table \ref{tab:first}.          \begin{algorithm}       \caption{A plain algorithm\label{alg:first}}       \begin{verbatim}         while not finished:           do stuff       \end{verbatim}     \end{algorithm}          \begin{figure}       \caption{First figure\label{fig:first}}       This one is a figure.     \end{figure}          \begin{figure}       \caption{Second figure\label{fig:second}}       This one is a figure too.     \end{figure}          \begin{table}       \caption{Table figure\label{tab:first}}       This one is a table.     \end{table}          \end{document}      If the line `\usepackage{scrhack}` is used I got the "figure" name instead of "algorithm", whereas if it is commented out I got the wrongly formatted list. From what I found on the web it seems that `scrreprt` and `float` packages are incompatible, thus the need for `scrhack`package, but I could not find anything related to `classicthesis`. Is there a way to properly format a list of custom floats?


title: Package files not downloading on an account without privileges

text: I'm on a uni campus pc which is pretty locked down without admin privileges so when my document requires a particular e.g. `\usepackage{enumitem}` file it never downloads it. Do I have to manually search the net, find it and put it into the directory where I'm creating my LaTex file? I have many such directories, do I need copies in each?


title: Copy and paste disabled in LyX 2.0

text: I try to copy and paste in a LyX document I am editing and it says that the command (paste) is disabled. This happens with anything, be it normal text, figures or formulae. I am working on a 64 bit PC with Windows 7 and using Lyx 2.0. I checked the document settings in short cuts and they are set. This is so frustrating. Can anyone help me please?


title: packages times(-itsc), txfonts, newtxtext/newtxmath, and mathptmx: relation and interactions

text: I am always using the packages `times` (actually: `times-itsc` from here in order to get italic small-caps) and `txfonts`. I use `txfonts` for the `\coloneqq` (:=) symbol. My loading order has traditionally and habitually been `times-itsc` -> `amsmath` -> `textcomp` -> `upgreek` -> `txfonts`. (I'm mentioning the middle three here just in case it matters for the answer; of course I'm loading many more packages around and in between.)   1. I recently heard about the `newtxtext`/`newtxmath` package. Is the idea that I, simplifying somewhat, just replace `txfonts` with it, and that's it?   2. Just now I notice that `newtxtext` is for text and that `txfonts` was already for much more than just some extra symbols (I originally included this in my package repertoire simply for the `\coloneqq` symbol). Should I in my current setup or with `newtxtext` and/or `newtxmath` in place of `txfonts` get rid of any packages? How do `times`(`-itsc`) and `txfonts`/`newtx...` interact or overlap? For example, do `times` and `txfonts` partially override each other? What is the precise effect of me loading first `times-itsc` and then `txfonts`?   3. And how does `mathptmx` compare to the above?   4. Any caveats regarding package loading order, especially with respect to `amsmath`? _(This question is quite general, so general answers will be fine.)_ **UPDATE:** New insights:   * `mathptmx` supersedes `times`.      * The superscript numbers are larger than those of `times` and too large for my taste, though this is probably a feature by design.   * `newtxtext`/`newtxmath` supersede (in combination) `txfonts`. With `newtxtext`/`newtxmath`, I get:      * larger subscript numbers     * smaller, thicker, and lower-placed footnote numbers   * Italic small caps were previously only offered by `times-itsc`; now `newtxtext` offers them too. (Thanks, Michael Sharpe!)


title: Local package inside other local package

text: Why doesn't work this?: Folder content:                Main folder/      |- main.tex      |- mylocal/         |- headers.sty         |- tikz-qtree/            |- tikz-qtree.sty/.tex            |- pgftree.sty/.tex            |- pgfsubpic.sty/.tex      Files:               % Main.tex     \documentclass{article}          \usepackage{./mylocal/localpackage}          % ./mylocal/headers.sty     \usepackage{./mylocal/tikz-qtree/tikz-qtree}      Context: I have a group of documents, all ones with the same header (a group of related documents with the same format, settings and packages). For this reason, I have in main.tex (an example of one of these documents) the line _\usepackage{./mylocal/localpackage}_. In _localpackage.sty_ I have all my includes, custom commands, environments and settings. Now, I need other additional packages not included in the Ubuntu's repositories (for example). I don't want formally install in my system this additional packages because my documents are free and I want other people can download my documents and compile them easily. I don't want force users install manually packages (either absent in well-known repositories or in general uncommons packages) for compiling these documents. Thus, I put this additional packages (for example, _otherlocalpackage.sty_ ) in my local folder ( _./mylocal/_ ), and then I add the line _\usepackage{./mylocal/thisnewpackage}_ in my "universal" header _localpackage.sty_. The problem arises reading this "additional package", because this package is indeed a group of files calling each other (with local and not complete paths). LaTeX said me that it can't found this additional packages. For example, _tikz-qtree.sty_ has the line _\RequirePackage{pdftree}_ and LaTeX said me:               ! LaTeX Error: `pgftree.sty' not found.      How can I force LaTeX deal with my local folder as a "standard" folder, in order to "local paths" inside other packages works? I guess renaming each RequirePackage/input/usepackage lines inside my additional package for longer paths (path since my makefile up the file/package in question) that must work, but I try always avoid manual works in order to make code more flexible and to avoid potential risks.


title: Bibliography in chapter*

text: How can I customize the bibliography commands, so that the bibliography header would be `\chapter*{Bibliography}`? The document class is `report`, and I am using BibTeX with a plain style. The current commands are               \bibliographystyle{plain}     \bibliography{mybibfile}      I prefer not to use a method that will force me to inline the entire bibliography environment inside the document - It is rather lengthy.


title: Decrease length of underline in math

text: In math I often find that single underlined letters have too long of a line. Here is an example: `$\beta\in[\underline{\beta},\bar{\beta}]$` ![enter image description here](http://i.stack.imgur.com/7wegi.png) Or perhaps worse: ![enter image description here](http://i.stack.imgur.com/VJmL1.png) I can solve the too narrow bar loading some accents from the `mathxm` font of package `mathabx`, but I have not found a good way to decrease the width of e.g. `\underline{U}`. I would appreciate a hint. * * * Here is a summary of different functions. I have added the nunder-function, which is kind of fun. However, it desperately needs an additional optional argument to set the division factor `\mkern\the\numexpr#1/2mu\relax` (hard- coded to two). Two see why compare the following examples of KP-fonts (left) and CM|nunder div by 2 (middle) and CM|nunder div. by 10 (right). On the right image `nunder` is perhaps as nice as `bunderline`. ![Kp-font](http://i.stack.imgur.com/GMqcl.png) ![CM1](http://i.stack.imgur.com/67CFs.png) ![CM2](http://i.stack.imgur.com/RfJLl.png) `nunder` works very well KP-fonts, but performs poorly with CM with the hard- coded value of 2. I will have two look further into two optional arguments, but my first attempt was not a success (using the blah example of TeX Faq).               \documentclass{article}     \usepackage{etex}     \usepackage{amsmath}     \usepackage{mathtools}          \newcommand{\bunderline}[2][4]{\underline{#2\mkern-#1mu}\mkern#1mu}     \newcommand{\boverline}[2][4]{\overline{#2\mkern-#1mu}\mkern#1mu}     \newcommand{\nunder}[2][5]{\mathrlap{\mkern\the\numexpr#1/2mu\relax\underline{\phantom{\mathrm{#2}\mkern-#1mu}}}#2}     \newcommand{\nunderline}[2][4]{%       \ensuremath{\mathrlap{\mkern#1mu\underline{\phantom{\mathrm{#2}\mkern-#1mu}}}}#2}     \begin{document}          \begin{align}       \label{eq:4}       \nunderline[3]{U}\nunderline[3]{\beta}\\       \nunderline[6]{U}\nunderline[6]{\beta}\\       \bunderline[6]{U}\bunderline[2]{\beta}\\       \nunder[6]{U}\nunder[2]{\beta}\\       \nunder[3]{U}\nunder[2]{\beta}     \end{align}          \end{document}


title: How to set width of longtable

text: I have a `longtable` defined like this               \documentclass[a4paper,12pt]{report}          \usepackage{longtable}           \begin{document}     \setlength\LTleft{0pt}      \begin{longtable}[l]{ lllllllllllllllll }     00000576 & 576 & 577 & 578 & 579 & 580 & 581 & 582 & 583 & 584 & 585 & 586 & 587 & 588 & 589 & 590 & 591 \\      00000592 & 592 & 593 & 594 & 595 & 596 & 597 & 598 & 599 & 600 & 601 & 602 & 603 & 604 & 605 & 606 & 607 \\      00000608 & 608 & 609 & 610 & 611 & 612 & 613 & 614 & 615 & 616 & 617 & 618 & 619 & 620 & 621 & 622 & 623 \\      00000624 & 624 & 625 & 626 & 627 & 628 & 629 & 630 & 631 & 632 & 633 & 634 & 635 & 636 & 637 & 638 & 639 \\      00000640 & 640 & 641 & 642 & 643 & 644 & 645 & 646 & 647 & 648 & 649 & 650 & 651 & 652 & 653 & 654 & 655 \\      00000656 & 656 & 657 & 658 & 659 & 660 & 661 & 662 & 663 & 664 & 665 & 666 & 667 & 668 & 669 & 670 & 671 \\      00000672 & 672 & 673 & 674 & 675 & 676 & 677 & 678 & 679 & 680 & 681 & 682 & 683 & 684 & 685 & 686 & 687 \\      00000688 & 688 & 689 & 690 & 691 & 692 & 693 & 694 & 695 & 696 & 697 & 698 & 699 & 700 & 701 & 702 & 703 \\      00000704 & 704 & 705 & 706 & 707 & 708 & 709 & 710 & 711 & 712 & 713 & 714 & 715 & 716 & 717 & 718 & 719 \\      00000720 & 720 & 721 & 722 & 723 & 724 & 725 & 726 & 727 & 728 & 729 & 730 & 731 & 732 & 733 & 734 & 735 \\      00000736 & 736 & 737 & 738 & 739 & 740 & 741 & 742 & 743 & 744 & 745 & 746 & 747 & 748 & 749 & 750 & 751 \\      00000752 & 752 & 753 & 754 & 755 & 756 & 757 & 758 & 759 & 760 & 761 & 762 & 763 & 764 & 765 & 766 & 767 \\      00000768 & 768 & 769 & 770 & 771 & 772 & 773 & 774 & 775 & 776 & 777 & 778 & 779 & 780 & 781 & 782 & 783 \\      00000784 & 784 & 785 & 786 & 787 & 788 & 789 & 790 & 791 & 792 & 793 & 794 & 795 & 796 & 797 & 798 & 799 \\      00000800 & 800 & 801 & 802 & 803 & 804 & 805 & 806 & 807 & 808 & 809 & 810 & 811 & 812 & 813 & 814 & 815 \\      00000816 & 816 & 817 & 818 & 819 & 820 & 821 & 822 & 823 & 824 & 825 & 826 & 827 & 828 & 829 & 830 & 831 \\      00000832 & 832 & 833 & 834 & 835 & 836 & 837 & 838 & 839 & 840 & 841 & 842 & 843 & 844 & 845 & 846 & 847 \\      00000848 & 848 & 849 & 850 & 851 & 852 & 853 & 854 & 855 & 856 & 857 & 858 & 859 & 860 & 861 & 862 & 863 \\      00000864 & 864 & 865 & 866 & 867 & 868 & 869 & 870 & 871 & 872 & 873 & 874 & 875 & 876 & 877 & 878 & 879 \\      00000880 & 880 & 881 & 882 & 883 & 884 & 885 & 886 & 887 & 888 & 889 & 890 & 891 & 892 & 893 & 894 & 895 \\      00000896 & 896 & 897 & 898 & 899 & 900 & 901 & 902 & 903 & 904 & 905 & 906 & 907 & 908 & 909 & 910 & 911 \\      00000912 & 912 & 913 & 914 & 915 & 916 & 917 & 918 & 919 & 920 & 921 & 922 & 923 & 924 & 925 & 926 & 927 \\      00000928 & 928 & 929 & 930 & 931 & 932 & 933 & 934 & 935 & 936 & 937 & 938 & 939 & 940 & 941 & 942 & 943 \\      00000944 & 944 & 945 & 946 & 947 & 948 & 949 & 950 & 951 & 952 & 953 & 954 & 955 & 956 & 957 & 958 & 959 \\      00000960 & 960 & 961 & 962 & 963 & 964 & 965 & 966 & 967 & 968 & 969 & 970 & 971 & 972 & 973 & 974 & 975 \\      00000976 & 976 & 977 & 978 & 979 & 980 & 981 & 982 & 983 & 984 & 985 & 986 & 987 & 988 & 989 & 990 & 991 \\     \end{longtable}          \end{document}      This table extends very close to the end of the right side of the page. How can I set the width of such a table?


title: tocloft and width of the table of contents

text: In the `ClassicThesis` class, the table of contents is set up through the `tocloft` package and I cannot find a way to line up the page numbers (on the right) as shown below with the thick red line. I'd like the blue numbers to be lined up to the right with the upper line. ![enter image description here](http://i.stack.imgur.com/DSiI7.png)


title: Beamer columns with multiple same slides

text: In beamer, I come across a little problem with the columns environment. In one slide, I always put picture on the left and text on the right. The problem is, when this slide is shown at first, the picture shows twice, i.e. two same slide. Then the text is shown fine. I understand this is not a big issue, but I am wondering is there any solution to get rid of the first one? In other words, when the slide is shown, left column appears and then right column..., not left column appears TWICE. Apologies for my bad English. Here is a MWE:               %% Test columns     \begin{frame}\frametitle{Test frame}         \begin{columns}         \column{.5\textwidth}             A figure         \column{.5\textwidth}             \begin{itemize}                 \item Item 1                 \item Item 2             \end{itemize}           \end{columns}     \end{frame}


title: Mathsymbol in the documentclass memoir

text: I write a thesis with `\documentclass{memoir}` and included the ams packages by               usepackage{amsmath,amssymb,amsfonts,mathrsfs,datetime}      However there is the difference in using bolt math sign. Here is the way I would like to have it               \documentclass{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{amsmath,amssymb,amsfonts,mathrsfs}     \begin{document}      Here are some words          \begin{equation}     \mathbb{S}     \end{equation}     \end{document}      ![enter image description here](http://i.stack.imgur.com/NK8U4.jpg) and here is some code how it is displayed in the memoir class                 \documentclass[11pt,a4paper,titlepage]{memoir}     \usepackage[OT1]{fontenc}         \usepackage[english]{babel}         \usepackage[utf8]{inputenc}         \usepackage[sc]{mathpazo}         \usepackage{amsmath,amssymb,amsfonts,mathrsfs}            \begin{document}         Here are some words         \begin{equation}         \mathbb{S}         \end{equation}         \end{document}      and here is the output ![enter image description here](http://i.stack.imgur.com/XTBac.jpg) How can I get the same mathbb symbol in the second code as in the first one?


title: Color part of text and captions

text: is it possible to color in red **part** of a text and/or of a caption (let's say, just some words)? I tried to create the environment:               \newenvironment{redtext}{\color{red}}{\ignorespacesafterend}      following this reference. However, it cannot be used for captions. Thank you.


title: Vertical bar in text mode

text: How do I create a vertical bar in text mode, which is a bit thicker and taller than the `|` character? I used to know how to do this with boxes, but googling no longer turns up any useful resources. I'm specifically using xelatex.


title: Notes after bibliography entry with Biber and biblatex

text: I'm using `biblatex` with Biber as a backend. I need to add a one-sentence note, in bold, after a few of my references in the bibliography. These notes are not contained in my `.bib` file; they are specific to the paper I am currently working on. It has been suggested to me that I can just edit the `.bbl` file to include the note, but I'm not sure how to do this. Is this a viable solution? If so, how do I do it? If not, how can I achieve this in another way? I'm using the nature citation style, if that makes a difference.


title: Why does doing \\ in LaTeX causes Undefined control sequence error

text: I have a weird LaTeX error here. It seems as if the newline (`\\\`) command is the culprit of a compilation error. The error shows up at the ending line of the .tex document: the `\end{document}` line, stating that _this_ line has the undefined control sequence. This code, though, is actually what causes the error. This will compile (formatted incorrectly):               \defn{Method of Moments Estimator (MOME)}{a}      Properties of MOME:      But this won't compile (formatted correctly):               \defn{Method of Moments Estimator (MOME)}{a} \\     Properties of MOME:      The only difference is the `\\\` at the end of the line. I have no idea why this should not work. For reference, this is the `\defn` command that I made:               \newcommand{\defn}[2]{     \tab     \textit{\textbf{Definition }}     \textbf{#1}     \textbf{:}     \text{#2}     }      And the `\tab` command:               \newcommand{\tab}{\text{    } \text{    } \text{    }}      I would greatly appreciate any help on this matter. Thank you to all who contribute.


title: Regarding the leftbar environment

text: Does anyone know how to control the width and color of the left bar in the `leftbar` environment?


title: Reducing space after a result of a command

text: I've got a command defined like this:               \newcommand{\abc}[1]{      \ifthenelse{\equal{#1}{a}}{abca}{}      \ifthenelse{\equal{#1}{b}}{abcb}{}     }      And later in my document I use it like this:               \abc{a}, following text      How can I reduce the space after the result of that command:               abca , following text      Thanks in advance for any piece of advice.


title: TikZ: How to connect nodes and specify line direction?

text: When drawing a line between two nodes in TikZ, you can specify the anchors on the beginning and end nodes in order to control how the line is drawn. I would like to specify the anchor on the beginning node, and the angle at which the line is drawn, and let TikZ figure out where it will intercept the end node. The usual use case is when I'm connecting to a "big node" and I would like the lines to be vertical. I can cheat by placing a coordinate behind the big node, drawing a line to the coordinate instead, and then drawing the big node so that it covers things up. However this won't work if I need to put an arrow on the end. I could try to calculate the intercept coordinate on the edge of the big node manually, but that seems against the TikZ spirit. `|-` doesn't work in this case.               \documentclass[10pt]{minimal}     \usepackage[active,tightpage,pdftex]{preview}     \usepackage{tikz}          \begin{document}     \begin{preview}          \tikzstyle{RectObject}=[rectangle,fill=white,draw,line width=0.5mm]     \tikzstyle{line}=[draw]     \tikzstyle{arrow}=[draw, -latex]           \begin{tikzpicture}       %%%%%%%%%%%%%%%%%%%%%%%%       %%  LEFT SIDE       %%%%%%%%%%%%%%%%%%%%%%%%       \draw (1,0) node[RectObject] (Small1A) {A};       \draw (3,0) node[RectObject] (Small1B) {B};       \coordinate (Cheat1A) at (1,2);       \coordinate (Cheat1B) at (3,2);       \path [line] (Small1A.north) -- (Cheat1A);       \path [line] (Small1B.north) -- (Cheat1B);            % need to draw Big Node last to cover up our cheating       \draw (2,2) node[RectObject, inner xsep=1cm] (Big1) {Big Node};            \draw (2,4) node[text width=4cm] (text1) {L: Cheating to control line orientation. Arrows would be hard.};            %%%%%%%%%%%%%%%%%%%%%%%%       %%  RIGHT SIDE       %%%%%%%%%%%%%%%%%%%%%%%%       \draw (7,2) node[RectObject, inner xsep=1cm] (Big2) {Big Node};       \draw (6,0) node[RectObject] (Small2A) {A};       \draw (8,0) node[RectObject] (Small2B) {B};       \path [arrow] (Small2A) -- (Big2);       \path [arrow] (Small2B) -- (Big2);            \draw (7,4) node[text width=4cm] (text2) {R: No cheating. Arrows easy. Can't control line orientation.};     \end{tikzpicture}     \end{preview}     \end{document}      Here's a side-by-side example of "cheating", which shows what I want to be able to do, and "not cheating", which does not do what I want. ![side-by-side example of "cheating", which shows what I want to be able to do, and "not cheating", which does not do what I want](http://i.stack.imgur.com/VA0xT.png) The left side of this example shows what I want to be able to do, except I want to do it without cheating, and I'd like to put arrows on the end of the lines.


title: Problem of superimpose and how to change legend symbol

text: Given the plot as follows ![enter image description here](http://i.stack.imgur.com/ORCk5.png) I have two problems:   1. a and b are superimposed on each other, how should I make this clear on the graph?   2. How could I change legend c to other icons like star? (It looks a bit similar to a) The code is shown below:               \documentclass[tikz]{standalone}     \usepackage{pgf}     \usepackage{graphicx}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{arrows,automata,positioning}     \begin{document}      \begin{tikzpicture}[font=\sffamily]     \begin{semilogyaxis}[title=Random Dataset,     legend pos=outer north east,     legend style={draw=none},     xtick={1,2,...,9},      scaled ticks=false,     log ticks with fixed point={1000 sep=},     axis x line=bottom,     axis y line=left,     axis line style=-,     minor tick style={draw=none},     enlargelimits,     ylabel = Solving Time (ms),     xlabel = Number of Constraints,     every axis legend/.append style={xshift=-10pt}     ]     \addplot plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};     \addplot plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};     \addplot plot coordinates{(1,78)(2,62)(3,41)(4,44)(5,120)(6,96)(7,133)(8,133)(9,91)};     \legend{a,b,c}     \end{semilogyaxis}     \end{tikzpicture}     \end{document}


title: How to align long labels in a list to the left margin?

text: I would like to create a list in LaTeX in which:   1. the longest label is aligned to the left margin,   2. the labels can be composite and look like "(1)(a)",   3. the labels, which can be of varying widths (e.g. one item is numbered "(1)(a)", the next one "(b)") are flush right,   4. the items are justified and are not indented. Because nothing can beat a picture, here is the effect I would like to achieve:![example of a list](http://i.stack.imgur.com/3nv4n.png)   Well, as you can see, I have managed to make such a list :) The thing is, the solution I used involved a lot of manual setting, e.g. specyfing `leftmargin` in points (I used the `enumitem` package), which is not the most elegant way of doing things. I was wondering if it is possible to create such a list "automatically". Since it's always good to give some code to work on, I can offer that:               \documentclass{article}     \usepackage{enumitem}     \newcounter{ex}     \newcounter{ex_alph}     \begin{document}     \section{Lorem ipsum}     \Large     \begin{enumerate}     \item[\refstepcounter{ex}(\theex)\stepcounter{ex_alph}(\alph{ex_alph})]Lorem ipsum\ldots     \item[\stepcounter{ex_alph}(\alph{ex_alph})]Lorem ipsum\ldots     \setcounter{ex_alph}{0}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\ldots     \end{enumerate}     \begin{enumerate}     \item[\refstepcounter{ex}(\theex)]Lorem ipsum\ldots     \end{enumerate}     \end{document}


title: Why does using Greek break em-dashes?

text: I know the conversion of --- to an em-dash is an on-going problem with lualatex. But I don't understand why using Greek in one font should (afterwards) break conversion of 3 hyphens to an em-dash in another. Here is my code:               %!TEX encoding = UTF-8 Unicode     \documentclass{article}          \usepackage{fontspec}     \usepackage{ednotes}     \setmainfont[Ligatures=TeX]{Linux Libertine O}     \setsansfont[Ligatures=TeX,Scale=MatchLowercase]{TeX Gyre Heros}     \setmonofont[Scale=MatchLowercase]{Inconsolata}     \newfontfamily\myGk[Script=Greek,Scale=MatchUppercase,Ligatures=TeX]{Cambria}     %\newfontfamily\myGk[Script=Greek,Scale=MatchUppercase,Ligatures=TeX]{Linux Libertine O}          \newcommand\textgreek[1]{\myGk\emph{#1}}          \begin{document}     \fontsize{11.5}{13}\selectfont               This is a test---to see if dashes are being converted to emdashes.          \textgreek{Ἐν ἀρχῇ ἦν ὁ λόγος}          This is a test---to see if dashes are being converted to emdashes.          \end{document}      For me, if I run the above code as is, the second "This is a test..." comes out with dashes instead of an em-dash. If I use the Linux Libertine O font for the Greek, I don't have the problem. Can anyone tell me how I can use the Cambria Greek (which I prefer) without breaking em-dashes in the main font? I am using TeXLive 2012 with Mac TeXShop.


title: Ghostscript Error when doing multiple slices with pst-solides3d

text: I'm trying to represent a polytope, but it seems that GhostScript doesn't let me slice a cube more than once. In particular, I tried the following:               \psset{unit=0.6cm,labelsep=20pt}     \psset{viewpoint=150 -110 10 rtp2xyz,Decran=120}      \begin{pspicture*}(-5,-1)(15,20)        \psset{solidmemory}       \psSolid[object=cube,action=none,a=10,plansepare={[1 1 1 -3]},name=A](5,5,5)       \psSolid[object=load,load=A0,plansepare{[1 1 0 -2]},action=none,name=B]       \psSolid[object=load,load=B,action=draw**]       \composeSolid       \axesIIID[axisnames={A,B,C}](0,0,0)(11,11,11)      \end{pspicture*}      The above code compiles but of course shows only the result from the first cut. If I replace the last `\psSolid` line with                 \psSolid[object=load,load=B0,action=draw**]      then GhostScript fails and gives me the following error:               Output written on dual_example.dvi (1 page, 36936 bytes).     SyncTeX written on dual_example.synctex.gz.     Transcript written on dual_example.log.     ### /usr/texbin/dvips -R -Poutline  -o /tmp/altpdflatex.14198-1361245018/dual_example.ps dual_example.dvi     This is dvips(k) 5.992 Copyright 2012 Radical Eye Software (www.radicaleye.com)     ' TeX output 2013.02.18:1936' -> /tmp/altpdflatex.14198-1361245018/dual_example.ps     </usr/local/texlive/2012/texmf/dvips/base/tex.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pstricks/pstricks.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pstricks/pst-algparser.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pstricks/pst-tools.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pstricks/pst-dots.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pst-node/pst-node.pro>     </usr/local/texlive/2012/texmf-dist/dvips/pst-solides3d/pst-solides3d.pro>     </usr/local/texlive/2012/texmf/dvips/base/texps.pro>     </usr/local/texlive/2012/texmf/dvips/base/special.pro>     </usr/local/texlive/2012/texmf/dvips/base/color.pro>.      </usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb>     </usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi12.pfb>     </usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb>     [1]      ### ps2pdf13 /tmp/altpdflatex.14198-1361245018/dual_example.ps /tmp/altpdflatex.14198-1361245018/dual_example.pdf     Error: /undefined in B0     Operand stack:          Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--     Dictionary stack:        --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:113/200(L)--   --dict:751/1012(L)--   --dict:182/300(L)--   --dict:38/200(L)--   --dict:203/300(L)--   --dict:751/1012(L)--     Current allocation mode is local     Last OS error: 2     Current file position is 419337     GPL Ghostscript 9.05: Unrecoverable error, exit code 1     ### FAILED to generate /tmp/altpdflatex.14198-1361245018/dual_example.pdf ()      Can anyone please tell me what I'm doing wrong?


title: Is using \addfontfeatures (much?) less efficient than defining a \newfontface?

text: Consider the following file:               \documentclass{article}          \usepackage{fontspec}          \setmainfont[Numbers={Lining,Proportional},Ligatures=Common]{EB Garamond}     \newfontface\garamondoldstylenumbers[Numbers={OldStyle,Proportional},Ligatures=Common]{EB Garamond}          \begin{document}          EB Garamond 123          \typeout{1st use of \addfontfeatures}     {\addfontfeatures{Numbers={OldStyle,Proportional}}EB Garamond 123\par}     \typeout{2nd use of \addfontfeatures}     {\addfontfeatures{Numbers={OldStyle,Proportional}}EB Garamond 123\par}          \typeout{1st use of \garamondoldstylenumbers}     {\garamondoldstylenumbers EB Garamond 123\par}     \typeout{2nd use of \garamondoldstylenumbers}     {\garamondoldstylenumbers EB Garamond 123\par}          \end{document}      If this is compiled under either XeLaTeX or LuaLaTeX, examining the log file shows messages along the lines of               .................................................     . Font family 'EBGaramond(2)' created for font 'EB Garamond' with options     . [Numbers={Lining,Proportional},Ligatures=Common,Numbers={OldStyle,Proportional}].     .      . This font family consists of the following shapes:     .       etc. after _both_ uses of `\addfontfeatures`, but not after using `\garamondoldstylenumbers`. (Naturally, similar messages occurs in when `\setmainfont` and `\newfontface` are processed in the preamble.) There will be some performance hit from parsing the options to `\addfontfeatures`. But is there a performance hit beyond this, because `fontspec` seems to be defining the font anew each time? The only relevant thing I can find in the fontspec manual says "For cases when a specific font with a specific feature set is going to be re-used many times in a document, it is inefficient to keep calling `\fontspec` for every use. While the `\fontspec` command does not define a new font instance after the first call, the feature options must still be parsed and processed." I would assume that `\addfontfeatures` uses the `\fontspec` command, but I don't know the details of the implementation. (I will be typesetting a long document that will require frequent use of both the italic and swashed italic of a commercial font: I have used old style numbers and EB Garamond in the example because it is freely available. Naturally, I would normally define a macro for `\addfontfeatures{...}`.)


title: How can I stop TeX from bleating about an underfull \hbox?

text: I have a paragraph that contains an underfull `\hbox`. (It's loaded with huge proper nouns that don't hyphenate easily.) It's not going to be fixed (badness is only 1330), but I'd like to get TeX to stop bleating about it, so that I can get closer to a clean run. I tried setting `\tolerance=1600` but evidently that's not the right incantation. How can I explain to TeX that an underfull `\hbox` with badness 1330 is OK?


title: How to label text with equation number?

text: I'm trying to put equation numbers next to text as if said text was an equation. If I use `\text{}` in an `align*` environment, it typesets the text right-aligned and the whole environment centered, but that's not what I want. I would like the text to look like in an `itemize` or `enumerate` environment (for example, indented), but still with an equation number behind it. And that equation number should come from the regular equation number "pool". Ideally, it would look like this:               We have to make sure that:       A is very b,             (1)       A is not c.              (2)      How can I write this in LaTeX?


title: Stop LaTeX compile with a command?

text: Is there a way to stop the compile process through the use of a command? Something like:                \exception{This is a user-set exception.  Compile halted.}      So when performing the compile process, the specified text string is displayed to the console, and the compile process aborts? The reason I want to do something like this is I want to have a conditional statement that checks a user-defined parameter. If the parameter is outside a desired range, I want the user to be informed that they made a bad choice and should change it. Thanks in advance.


title: Recreate position of subfigures in a table above figure caption

text: I need to recreate a particular style of captioning a "figure". Main characteristics of this style are:   * No subcaptions included in the subfigures.   * The position of the subfigures is recreated in a table (using tabular is an option?) above the caption of the figure. I hope the MWE and the picture help to get the idea Note that the position of the subfigures may follow any type of positioning e.g. in the figure is a 2-2 alignment. Other type of alignment might be 2-2-1, 1-2-2, and so on. A MWE follows with my work so far. The table can be (obvioulsy) improved. In addition, the table must still be included in the Figure caption starting directly above the letter "F" of "Figure".               \documentclass{article}     \usepackage{graphicx}     \usepackage{subcaption}     \usepackage{booktabs}     \usepackage{array}          \newcolumntype{M}{>{\centering\arraybackslash}p{.3cm}}     \renewcommand\arraystretch{1.5}          \usepackage{tikz}     \usepackage[framemethod=default]{mdframed}          \newcommand{\mybox}[1]{     \begin{tikzpicture}     \node[draw,rectangle,line width =0.5pt,text width=0.4cm,     minimum width=0.4cm,minimum height=0.4cm]{#1};     \end{tikzpicture}     }          \begin{document}     \begin{figure}     \centering              \begin{subfigure}[b]{0.4\textwidth}                             \includegraphics[width=\textwidth]{example-image-a}         \end{subfigure} \quad         \begin{subfigure}[b]{0.4\textwidth}                 \centering                 \includegraphics[width=\textwidth]{example-image-b}         \end{subfigure}              \begin{subfigure}[b]{0.4\textwidth}                 \centering                 \includegraphics[width=\textwidth]{example-image-c}         \end{subfigure}              \mybox{a} \mybox{b} \\         \mybox{c}              \caption{TOF depth cameras a) Letter A, b) Letter B and c) Letter C}\label{fig:TOF}          \end{figure}          \end{document}      Any help will be greatly appreciated. You can find an example of such figure in: ![Desired captioning](http://www.tsc.uc3m.es/imagine/Curso_ProcesadoMorfologico/imagenes/morfologia2.jpg)


title: How can I highlight a keywordsprefix in listings?

text: Ok, so here's my problem which I'm repeatedly gnawing on, whenever I try to typset source code. To this day, I have not found someone on the internet asking for the same problem. I want to add a `keywordsprefix` so that everything starting with a `&` is highlighted as a keyword. Here's a MWE illustrating my problem               \documentclass{article}     \usepackage{listings, xcolor}          \begin{document}          \definecolor{lispgreen}{RGB}{154, 228, 151}     \definecolor{lightgray}{gray}{0.97}     \definecolor{violet}{rgb}{0.8, 0, 0.7}          \lstset{language=Lisp,             basicstyle=\ttfamily\small,             numbers=left,             numberstyle=\tiny,             keywordsprefix=&,             keywordstyle=\color{lispgreen!70!black},             stringstyle=\color{violet},             showstringspaces=false,             backgroundcolor=\color{lightgray},             frame=single}          \begin{lstlisting}     (defmacro simple-incf (var &optional (amount 1))          (list setq var (list + var amount)))     \end{lstlisting}          \end{document}      Now, a in a statement like `&optional`, everything _except_ the ampersand is highlighted, which looks profoundly weird to me. Maybe other people use other editors or settings, but by default, my vim will highlight also the keyword prefix itself so this is what I see daily. My question now is, can I somehow tell `listings` to either extend the highlighting to include also the prefixes or, alternatively, just brutely make that one character `&` highlighted everywhere (which in this case would also solve the problem)?


title: How to set language in Biber (1.6)?

text: I am using `biber` to manage my bibliography. I am using MikTeX with all updates installed. After updating to 1.6 however, my language settings don't work. Despite setting `German` as prime language, the bibliography gets outputed in English. What changed? Or what did I do wrong. Here is the MWE:               % test.tex          % !TEX TS-program = xelatex     % !TEX encoding =UTF-8 Unicode          \documentclass[a4paper,12pt,headings=small]{scrreprt}          \usepackage{polyglossia}     \setmainlanguage{german}               \usepackage[     backend=biber,     style=authoryear-icomp,     ]{biblatex}     \bibliography{bibliographie.bib}          \begin{document}     \chapter{Einleitung}     Ich möchte \textcite{bannas2012} zitieren und bin gespannt auf das Ergebnis.          \printbibliography     \end{document}      With `bibliography.bib`:               % Encoding: UTF8          @ARTICLE{bannas2012,       author = {Bannas, Günter},       title = {Angela Merkel in Indonesien},       year = {2012},       month = jul,       url = {http://www.faz.net},       urldate = {2013-03-21},     }      Maybe, language related `biber`s log helps:               INFO - Decoding LaTeX character macros into UTF-8     INFO - Found BibTeX data source 'bibliographie.bib'     INFO - Overriding locale 'de_DE.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable'     INFO - Sorting 'entry' list 'nyt' keys     INFO - No sort tailoring available for locale 'de_DE.UTF-8'     INFO - Writing 'einstellungen.bbl' with encoding 'UTF-8'


title: Adding the word "Chap" before the chapters numbers in the TOC

text: I'm using the book class and I need to add the word "Chap" before the chapters numbers in the TOC. Please keep in mind that the "Chap" should only appear before my chapters numbers, not before starred chapters titles, the Index, appendices or anything similar in the TOC.   By the way, I prefer to use the book class codes rather than to use packages.   Can anybode help me accomplish this?   Here is a minimal example:                \documentclass{book}     \usepackage[nottoc]{tocbibind}     \begin{document}     \tableofcontents     \chapter{One}     \chapter{Two}     \section{Bla}     \chapter*{Bla bla}     \addcontentsline{toc}{chapter}{bla bla}     \appendix     \chapter{App one}     \begin{thebibliography}{99}     \bibitem{bla}     bla     \end{thebibliography}                  \end{document}


title: Problem with defining parenthesis command in Texmaker

text: I am new to LaTeX and have been trying to redefine the `\left(` command to become `\\(`. for some reason TeXmaker won't let me do this, it keeps telling me that `\\(` is already defined but then when I type `\\(` in math mode it has a fit. What should I do? Here is my preamble:                \documentclass[12pt]{article}       \setlength\parindent{0pt}           \usepackage[T1]{fontenc}      \usepackage[utf8]{inputenc} % input encoding UTF-8           \usepackage{amsmath,amssymb,amsthm}           \usepackage{color}           \usepackage[margin=3.0cm]{geometry}      \usepackage{graphicx}      \usepackage{float}      \usepackage{array}      \usepackage{url}      %      %      \newcommand{\D}{\partial} %partial operator


title: Justification error in report format

text: I am writing my thesis using Kile. I encountered a mis-justification problem when creating table of contents, please see the uploaded picture. My institute insists to fix this. Can anybody help me on this? ![enter image description here](http://i.stack.imgur.com/Z0HD2.png) Here is my MWE:               \documentclass[12pt,a4paper]{report}     \usepackage{OkanFBEStyle}     \usepackage[pdftex]{graphicx}     \usepackage{subfigure}     \usepackage{boxedminipage}     \usepackage{enumerate}     \usepackage[nosort]{cite}     \usepackage{wrapfig}     \pdfminorversion=5      \makeatletter       \renewcommand{\thesubfigure}{\alph{subfigure}.\hskip-0.5\subfiglabelskip}     \renewcommand{\@@thesubfigure}{\thefigure.\alph{subfigure}}       \makeatother     \usepackage{float}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{array}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amsxtra}     \usepackage{cases}     \usepackage{xfrac}     \setcounter{tocdepth}{3}     \usepackage{epstopdf}     \usepackage{pifont}     \usepackage{url}     \usepackage{hyperref}     \usepackage{color}     \usepackage{ctable}     \usepackage{tabularx}     \usepackage{soul}     \usepackage{lineno}     \usepackage{tikz}     \usetikzlibrary {calc}     \newcolumntype{x}[1]{     >{\raggedleft\hspace{0pt}}p{#1}}     \newcolumntype{+}{>{\global\let\currentrowstyle\relax}}     \newcolumntype{^}{>{\currentrowstyle}}       \newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%       #1\ignorespaces       }     \newcommand{\otoprule}{\midrule[\heavyrulewidth]}     \newcolumntype{Z}{>{\centering\arraybackslash}X}          \begin{document}     \tableofcontents     \chapter{INTRODUCTION}     \section{Intramedullary Nailing}          \chapter{METHODS}     \section{Study 1: In modeling a distraction process, how should the tissue load be correctly represented in order to obtain a better understanding of the mechanical response of IM nails during limb lengthening?}     \subsection{Finite Element Model Considerations}     \end{document}


title: arara: fallback directive if no directives specified

text: ## Question Is it possible to tell `arara` to use a default directive when no directive is specified in the file, e.g. to run `pdflatex` twice? ## Background I often get LaTeX-files from other people, and every time I need to add some `arara`-rules before I can typeset them. It would be very nice if this process could be automated.


title: Subcolumns with multicol and the exam class

text: I'm using the `multicol` package with the exam class to create 2 sub-columns within a `multicols` environment for checkbox answers when the answers are short and one word. There is a significant amount of whitespace between answers in the sub-columns, however, and `\setlength\columnsep{Xpt}` doesn't seem to bring them closer together. In the example below, the space between the two columns in the second question needs to be compacted:               \documentclass[10pt]{exam}     \usepackage{multicol}     \setlength\columnsep{40pt}     \begin{document}     \begin{multicols}{2}[\section{My Form}]     \begin{questions}     \question Is this a question\hfill     \mbox{         \begin{oneparcheckboxes}             \choice Yes             \choice No         \end{oneparcheckboxes}     }     \question These columns are too far apart     \begin{multicols}{2}         \begin{checkboxes}             \choice Apple             \choice Banana             \choice Cucumber             \choice Eggplant             \choice Fruit             \choice Grapes         \end{checkboxes}     \end{multicols}     \question Comments:\ \hrulefill     \end{questions}     \end{multicols}     \end{document}


title: Increase the space between operator in subscript/superscript

text: I need to increase the space globally between operators in subscripts/superscripts. Example: `\sum_{x=4}` I need a little more space before and after the `=` symbol in the subscript. It is required globally in every operator in subscripts/superscripts.


title: qed symbol not correctly aligned when ending a proof with a diagram

text: I know there is a myriad of questions about the alignment of the tombstone symbol, but I couldn't see any one that addresses this little issue. Say you end your proof with a diagram such as the following: `\\[\xymatrix{A & B \\\ C & D} \\]` Then the little tombstone symbol will be way one line further down from where it should be. If I add `\qedhere` just after the diagram, then the tombstone is aligned with the B in the diagram, which is just wrong. How do I get it right? MWE:               \documentclass{article}     \usepackage{amsmath,amsthm}     \usepackage[all,cmtip,2cell]{xy}     \newtheorem{theorem}{Theorem}          \begin{document}     \begin{theorem} A theorem.     \begin{proof}     \[\xymatrix{A & B \\ C & D} \]     \end{proof}     \end{theorem}          \begin{theorem} A theorem.     \begin{proof}     \[\xymatrix{A & B \\ C & D} \qedhere \]     \end{proof}     \end{theorem}               \end{document}


title: A workaround for visualization depends on and ybar stacked

text: Are there any workarounds for the bug? > The "visualization depends on" function causes an error with stacked plots. > > With "ybar stacked", the minimal example generates the error message > > ! Undefined control sequence. \pgfplots@current@point@meta > ->{0Y0.0e0]},\test I need numbers over stacked bars. These numbers must be calculated from another column. MWE:               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[     ybar stacked, %this doesn't work     % ybar, % this works     % stack plots=y, % this doesn't work     visualization depends on=0.5*y \as \test     ]          \addplot [nodes near coords=\test] table {     0 0     1 10     2 8     };     \end{axis}     \end{tikzpicture}          \end{document}


title: Longtable new column widths on each page

text: Let's assume that I have a longtable of two pages. On the first page there are only short cells but on the second page there are some longer ones. Here's an example:               \begin{longtable}{|l|l|l|l|}     \caption{A simple longtable example}\\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\     \hline     \endfirsthead     \multicolumn{4}{c}%     {\tablename\ \thetable\ -- \textit{Continued from previous page}} \\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\     \hline     \endhead     \hline \multicolumn{4}{r}{\textit{Continued on next page}} \\     \endfoot     \hline     \endlastfoot     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1222222222222222222 22222222222222 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     \end{longtable}      ![](http://i.stack.imgur.com/zd48p.png) So now the column widths are the same on both pages. However on the first page, the first column could be less wide. How can I set a column autowidth for each page?


title: Check if counter exists

text: I've written a package that introduces a new environment:               \newfloat{foo}{htb}{bar}[chapter]      The package however can be used for articles, books, ... Since not all of these environments have the concept of `chapter`, on gets a `No counter 'chapter' defined.` exception. How can I check if the chapter counter is defined?


title: Automatic versewidth

text: `verse` package has `\settowidth` command to center a poetry. Example:               \settowidth{\versewidth}{There was an old party of Lyme}     \begin{verse}[\versewidth]     There was an old party of Lyme \\     Who married three wives at one time. \\     \vin When asked: ‘Why the third?’ \\     \vin He replied: ‘One’s absurd, \\     And bigamy, sir, is a crime.’     \end{verse}      I have a lot of poetries, and it's impossible to do this for everyone. Is there a method to do the same thing without the specification of `\versewidth`? Like, for example, this:               \begin{verse}     \start{unknown_command}     There was an old party of Lyme \\     Who married three wives at one time. \\     \vin When asked: ‘Why the third?’ \\     \vin He replied: ‘One’s absurd, \\     And bigamy, sir, is a crime.’     \end{unknown_command}     \end{verse}


title: How to number atoms using chemfig?

text: I need to number atoms using `chemfig`. I thought I could use `\chembelow` and `\chemabove` to place numbers above and below but adding these commands changes the look of the drawing and does not simply only add the number.               \documentclass{minimal}     \usepackage{chemfig}     \begin{document}          \chemfig{*6(\chembelow{}{1}=\chembelow{}{5}-\chembelow{}{9}(*6(-=-=-=-=))--=\chemabove{}{2}-)}          \end{document}      ![Chemfig example](http://i.stack.imgur.com/8e1fp.png) The lines are broken where the numbers are added. How can I add numbers without breaking the lines? Also, the numbers are placed very close -- could that be related?


title: align* and wrapping command

text: For school we have to deliver all math with double lines under the result. I have made a command that makes this easy. It looks like this:               \newcommand*{\uul}[1]{     \underline{\underline{#1}}     }      It works great, except when I use it with the align* environment. If there is a `&=` inside, like so:               \uul{x &= 14}      it throw up all kinds of errors. If I remove the `&` it works just fine. I am guessing there is some problems arising from passing the content around, but is there any way to solve this?


title: \thispagestyle{empty} with longtable

text: I have a `longtable` and `landscape` table that spans 3 pages. I don't want a page number to be displayed on any of these 3 pages. However, setting `\thispagestyle{empty}` just _preceding_ the commencement of the table will only cause the first of the 3 page numbers to be removed. _**QUESTION_** : How do I make it such that all 3 page numbers are removed, while at the same time preserving all my other page numbers? * * * I haven't been able to construct a MWE due to inexperience with `lipsum`. Here's my attempt:               \documentclass[a4paper,12pt]{article}               \usepackage{longtable}     \usepackage{lipsum}     \usepackage{lscape}               \begin{document}          \begin{landscape}     \thispagestyle{empty}     \begin{longtable}     \lipsum[500]     \end{longtable}     \end{landscape}               \end{document}


title: Suppress abbreviated citation in list of references when using nocite

text: Dear TeX Exchange users, I'm converting a MS Word document to LaTeX and am using `\nocite{*}` to include a bibliography of references that are not cited within the .tex document using `\cite`, rather are just plain text. However, I'd like to suppress the appearance of the abbreviated citation before each reference in the list (i.e. if I use the 'plain' bibliography style, there is a [1] before the first reference etc..). I can provide a MWE if my explanation is unclear, thanks in advance for any help offered.


title: Change "Theorem" to "Věta" in beamer

text: I tried to use `\uselanguage{Czech}\languagepath{Czech}` as suggested in Babel (French) does not translate the theorem environment in Beamer class, but I still get "Theorem" instead of "Věta" for my theorem. How can I teach beamer the Czech words? And can I submit the language mutations to CTAN somehow to make the widely available? MWE:               \documentclass{beamer}     \usepackage[czech]{babel}     \uselanguage{Czech}     \languagepath{Czech}     \usepackage[utf8]{inputenc}     \usetheme{Copenhagen}     \begin{document}     \begin{frame}     \begin{proof}         Some text     \end{proof}     \begin{theorem}         Some text     \end{theorem}     \end{frame}     \end{document}


title: Anchor index for clickable index words?

text: `makeidx` package will list the words and references to the pages they appeared. Is it possible to mix the page numbers with `\hyperref` package to make the page numbers clickable with `\hyperlink{page.x}{indexed term}`? Going to the page provided in the index upon clicking on page number.


title: Using multiple system fonts

text: I'd like to use 3-4 different specific system fonts (e.g., Georgia, HelveticaNeui Light, and Lucida Sans) with certain font sizes for different sections of a page. How would I do this? Edit: Thanks for the responses. I saw the `fontspec` package but the examples I found defined in the preamble `\setmainfont{}`, `\setsansfont{}`, etc. I couldn't figure out how to define a fontfamily and then reference it for a particular section. Here's an example:               \documentclass[12pt]{article}          \usepackage{fontspec}          \begin{document}          \section{Georgia}%here define font          This text shows in Georgia.          \section{Lucida Sans}%          This text shows in Lucida Sans          \section{HelveticaNeue Light}%here define font          This text shows in Helvetica Neue Light          \end{document}


title: Convert numpy array into tabular

text: I am doing some data analysis in python, putting the results in form of a matrix stored into a numpy array. I would like to put this results into a report and the best way would be to put a table with a tabular inside containing the data. Is anyone aware of a quick way to output latex code from python, or any other way I could use to quickly format an array into a tabular code latex can handle ? Thanks.


title: Chapter Design in Latex

text: I am writing a mathematics book for grade six . I need a special style for the title of the chapters. Does any one have an idea. Any help is highly appreciated.   I plan to add pictures to the title. examples of what I am working :               \documentclass{report}     \usepackage[T1]{fontenc}     \usepackage{titlesec, blindtext, color}     \definecolor{gray75}{gray}{0.75}     \newcommand{\hsp}{\hspace{20pt}}     \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}     \begin{document}     \tableofcontents     \chapter{Greatest common divisor}     \blindtext     \end{document}      Example of what I see on google is the following: ![enter image description here](http://i.stack.imgur.com/yfXho.png)


title: Code for reading Metafont definitions

text: I need some C code to generate Bezier curves from Metafont source code. Ideally, I'd like to have a C/C++ function with the following specifications: Input: an array of text strings (the lines in the MetaFont program) Output: an array of Bezier curves representing the centerlines of the "pen" strokes (plus some information about the pen used for each stroke). So, internally, this code would parse the MetFont source, solve little systems of linear equations, and calculate the control points of the Bezier curves. Code like this must exist in both MetaFont and MetaPost, but I'm having trouble finding it. Which files/functions should I look at first ? Thanks. Adding edits here, as instructed: Remaining questions are: (1) Are mplib.c and mplib.h the best starting points ? (2) If they are, where can I find them ? (3) If not, where else should I look ? I think I have the answers, but I couldn't figure out how to answer my own question: I think mplib.c and mplib.h probably are the best starting points. They are not part of the source distributions. You have to generate them by applying ctangle to mp.w (which is huge).


title: How to remove a line under number chapter in classicthesis?

text: I've been working on a thesis with TeXShop for three years now and I'm finalizing my writing. I'm trying to change my `classicthesis` template a litte bit. I would like to remove the line under the number chapter. Indeed, I put a `minitoc` in front of each chapter and therefore, there are three lines in the beginning of the page. Can someone tell me how to remove that line? This is the code of my preamble :               % book example for classicthesis.sty     \documentclass[11pt,a4paper,footinclude=true,headinclude=true]{scrbook} % KOMA-Script book     \usepackage[T1]{fontenc}          \usepackage[applemac]{inputenc}         \usepackage[frenchb]{babel}     \usepackage{setspace}      \usepackage{hyperref}      \usepackage[tight,french]{minitoc}     \usepackage{apacite}     \usepackage{lipsum}     \usepackage[parts,pdfspacing,dottedtoc,eulerchapternumbers]{../classicthesis} % ,manychapters     %\usepackage[osf]{libertine}     \usepackage[left=3.5cm,right=3.5cm,top=3cm,bottom=3cm]{geometry}     \FrenchFootnotes     \usepackage{amsthm}     \usepackage{lineno}     \setcounter{tocdepth}{3}     \setcounter{secnumdepth}{3}     \AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}     \frontmatter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \def\ptctitle{Table}     \def\mtctitle{Table}     \def\stctitle{Table}     \setlength{\mtcindent}{0pt}     \renewcommand{\mtifont}{\normalsize\scshape\lsstyle}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%%%%modifie la taille des numéros de chapitres%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \ifthenelse{\boolean{@eulerchapternumbers}}% font for the chapter numbers         {\newcommand\mychapterNumber{\fontencoding{U}\fontfamily{eur}\fontseries{b}\fontsize{28}{29}\selectfont}}%         {\newcommand\mychapterNumber{\fontencoding{T1}\fontfamily{pplj}\fontsize{25}{26}\selectfont}}          \ifthenelse{\boolean{@linedheaders}}%         {%         \titleformat{\chapter}[block]%             {\relax}{\titlerule\vspace*{.9\baselineskip}\\\raggedleft{\color{halfgray}\mychapterNumber\thechapter}}{1.2em}%             {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%         }{%         \titleformat{\chapter}[block]%             {\relax}{{\color{halfgray}\mychapterNumber\thechapter}}{1.2em}%             {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%         }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               \begin{document}     %   \pagestyle{scrheadings}     %   \manualmark     %   \markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}                         \dominitoc     \tableofcontents                    \pagestyle{scrheadings}          \end{document}      For the moment, I have a line under the title of my chapter. Here is a part of a screenshot of a chapter: ![enter image description here](http://i.stack.imgur.com/7m8fn.jpg) And I would like to remove that line : ![enter image description here](http://i.stack.imgur.com/04uaT.jpg) Thanks for your help ! Your suggestions work : ![enter image description here](http://i.stack.imgur.com/JluQN.jpg)


title: Prevent page break within footnote in ConTeXt

text: I have the following example of footenotes:               \definepapersize[MyBook][A5]     \setuppapersize[MyBook][A5]          \usetypescript[times]     \setupbodyfont[times,11pt]     \setupbodyfontenvironment   [default][em=italic] % use italic as em, not slanted          \setuplayout[location=middle,       topspace=1cm,       bottomspace=1.5cm,       width=middle,       cutspace=1.4cm,       backspace=2.5cm,       height=fit,       footer=1.2cm,       grid=yes]          \starttext          \section{Geist}          In den vorausgegangenen Diskussionen haben wir festgestellt, dass der Mensch aus zwei Dimensionen besteht, einer materiellen und einer spirituellen Dimension. Die verschiedenen Ansichten über den Geist werden allgemein in vier Gruppen unterteilt:          \startitemize[n,fit][start=1,stopper={.\space},margin=1em]     \item Einige streiten die Existenz des Geistes gänzlich ab, akzeptieren die Existenz immateriellen Seins nicht und begegnen behaupteten spirituellen Phänomenen mit materiellen Erklärungen.\footnote{Typische Vertreter: Demokrit, Zenon von Elea, Thomas Hobbes, die Behavioristen, Jalaf, As-Ari, Baqillani, Abu Bark Assam}     \item Einer anderen Ansicht zufolge gibt es zwar spirituelle Phänomene, erkennt jedoch keine Begründung für den Geist als eigenes Wesen. Deren Vertreter unterscheiden zwischen spirituellen und materiellen Angelegenheiten, betrachten die spirituellen Angelegenheiten jedoch als materiellen und physiologischen Vorgängen entsprungen.\footnote{Typische Vertreter: Thomas Henry Huxley}     \item Eine dritte Sichtweise erkennt Geist und Körper als zwei voneinander unabhängige Elemente an, die jedoch einen materiellen Ursprung teilen.\footnote{Typische Vertreter: William James, Betrand Russel}     \item Eine weitere Auffassung zufolge beeinflussen sich Geist und Körper wechselseitig und außer an eine körperliche, materielle Dimension wird auch eine eigene spirituelle Dimension akzeptiert, der alle spirituellen Phänomene zuzuteilen sind.\footnote{Die meisten muslimischen Philosophen und Wissenschaftler vertreten diese Auffassung.}     \stopitemize     \blank[line]          \stoptext      The Problem is: The last footnote conflicts in the text and the footer - so that ConTeXt makes a page breaking footenote, lacking of a good rule to handle this situation. I do not know, what to do best to fix this. Are there any possibilities without changing the footnotes and the text itself?


title: To-do-notes in separate TeX File, but without \listoftodo in main doc

text: I am using the `todonotes` package and have three requirements, the first two which the MWE already does:   1. Obtain a list of `todo` notes in a separate auxiliary file. This can easily be obtained via the `\listoftodos` as per the similarly named question referenced below.   2. Have the `\todo` appear in the document -- also works.   3. What does _not_ yet work: I do _not_ want the list of `todo` to appear in the header of this document. The MWE below generates (after two runs): ![enter image description here](http://i.stack.imgur.com/5vPYU.png) The correct result should be only the two `todo` notes in yellow and pink, and the `.tdo` file needs to be newer than the .tex file ## Notes:   * Did not automate the testing of the case where the MWE is run as is, and then upon second run the `\listoftodos` is commented out -- This will seem to produce the desired result, as an older `.tdo` file exists. However, I would prefer a solution that yields the correct result upon first compile. ## Background:   * I have numerous small files and having a list of todo in each file is not that helpful. My plan is to post process all the individual `todo` auxillary files to obtain a single document that has all the `todo` notes along with links to the files that created them.  ## References:   * To-do-notes in a separated TeX file ## Code:               \documentclass{article}     \usepackage[colorinlistoftodos]{todonotes}%          \begin{document}     \listoftodos% Want the temporary file generated          \bigskip               \todo[inline,color=yellow,caption={Fix me}]{There should be no text above this line (as if listoftodos was commented).}               \IfFileExists{\jobname.tdo}{%         %  Yeah, we have the temporary file         \todo[inline,color=red!20]{Temporary .todo file exist.            But need to ensure that it was not left over from a previous run...}     }{%         \todo[inline,color=red]{Failed: No .todo file...}     }     \end{document}


title: How do I put a note after an image into an itemized environment?

text: Following the question How do I insert a full screen picture inside an itemized environment?, I was able to insert an image into an itemized environment. Now I would like to put comments on my slides with `\note` option, and to have it added right after the image inserted with `tikzpicture` environment (see below). Is it possible?               \documentclass[10pt]{beamer}     \usetheme{Szeged}     \usecolortheme{dolphin}          \usepackage{fontspec}     \usepackage{pgf}     \usepackage{tikz}          \setbeamercovered{transparent=25}   %Uncover text transparently     \setbeameroption{show notes}          \begin{document}              \begin{frame}             \begin{itemize}                 \item<1> first item                     \note<1>{some comments on first item}                 \item<3> second item                     \note<3>{some comments on second item}                 \item<4> third item                     \note<4>{some comments on third item}             \end{itemize}              \only<2>{                 \begin{tikzpicture}[remember picture,overlay]                  \fill [black] (current page.south west) rectangle (current page.north east);                  \node at (current page.center) {\includegraphics[scale=0.5]{testPicture}};                 \end{tikzpicture}              }              %\note<2>{some notes on picture 1}    this does not have the expected result...                    \end{frame}     \end{document}


title: arrows crossing over nodes in tikz

text: I have drawn a tree by tikz package, but the arrows are crossing over nodes. is there any switch to prevent this?               \documentclass[tikz,border=10pt]{standalone}     \usetikzlibrary{graphdrawing}     \usetikzlibrary{graphs}     \usegdlibrary{trees}          \begin{document}          \begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum size=0.75cm}]     \graph [tree layout, grow=down, fresh nodes, level distance=2cm, sibling distance=0.5cm]        {              0x01  -> {                        0x10  -> { 0x01 },                         0x19  -> { 0x01 },                        0x1a  -> {  0x01 , 0x11 ,  0x18 ,  0x1a ,  0x1b  },                        0x1b  -> {  0x01 , 0x11 ,  0x18 ,  0x1a ,  0x1b  },                        0x85  -> { 0x01 },                        0x87  -> { 0x01 },                        0x8d  -> { 0x01 },                        0x8f  -> { 0x01 },                        0xa3  -> { 0x01 },                        0xaf  -> { 0x01 }                     }     };     \end{tikzpicture}     \end{document}


title: Designing a book entry cell using tabular

text: I am trying to squeeze in a lot of book entries (#, title, author) into one page for printing. I am not sure if I am nesting `\tabular` correctly, but here is what I came up with:               \documentclass[10pt,a4paper]{article}     \usepackage[margin=0.2in]{geometry}          \usepackage{array}     \usepackage{color}     \usepackage[usenames,dvipsnames]{xcolor}          % define command for book entry     \newcommand{\bookentry}[3]{       \begin{tabular}{cp{1.25in}}         \textcolor{gray}{\textbf{#1}} &                {\tiny \textsc{#2}} \newline                {\tiny \textbf{#3}}        \end{tabular}     }          \begin{document}          \begin{tabular}{cc}            \begin{tabular}{|l|l|}          \hline         \bookentry{1}{Siddhartha}{Herman Hesse} &          \bookentry{2}{Old Man And The Sea}{Ernest Hemingway} \\ \hline         \bookentry{3}{Catch 22}{Joseph Heller} &          \bookentry{4}{The Elements of Style}{Strunk \& White} \\ \hline       \end{tabular} &            \begin{tabular}{|l|l|}         \hline         \bookentry{1}{The Latex Companion}{Mittelbach \& Goossens} &          \bookentry{2}{The Elements of Typographic Style}{Robert Bringhurst} \\ \hline         \bookentry{3}{Feynman Lectures On Computation}{Richard P. Feynman \& Anthony Hey} &         \bookentry{4}{The TeXbook}{Donald Knuth} \\ \hline       \end{tabular}          \end{tabular}          \end{document}      Here is the output: ![book entries](http://i.stack.imgur.com/gzVBs.png)   1. How can I change the line spacing between the title and author? I think it's using the 10pt spacing, but I am using `\tiny` for the text.   2. How can I format the numbers so that they fill the height of the cell, and are centered vertically and horizontally?


title: How could I remove the blank page before the title page?

text: I'm using latexian to edit my manuscript. However, the first page is blank. The following is my latex code. How could I deal with this problem?               \documentclass{article}     \usepackage{authblk}     \usepackage{geometry}     \usepackage{cite}     \begin{document}     \title{paper}     \author[1*]{author A}     \author[1]{ author B}     \author[2]{author C}     \affil[1] {Department of A, University of ABC}.\\     \affil[2]{Department of B, University of CBA}.\\     \affil[*]{Corresponding author: abc@email.abc.edu}     \date{}     \maketitle     \begin{abstract}     content     \end{abstract}     \section{Introduction}     content     \end{document}


title: Appearance issues with \bar{} and \underline{}

text: The following code               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \begin{document}     \[     \left[\underline{x},\bar{x}\right]     \]     \[     \left[\underline{t},\bar{t}\right]     \]     \end{document}      produces the following result: ![enter image description here](http://i.stack.imgur.com/bOs8b.png) I'd like to 'fix' the `\underline{x}` length, which is bigger than `\bar{x}`, and the `\bar{t}` which (almost!) overlaps with part of `\right]` compared to `\underline{t}` which appears nice with the `\left[`. Using `pdfLaTeX`.


title: Using shortcut with argument in tcolorbox

text: I want to do something like this:               \documentclass{article}         \usepackage[ngerman]{isodate} %for printing the date     \usepackage[dvipsnames]{xcolor} %for color names     \usepackage{tcolorbox}     \usepackage{lipsum}          \newcommand{\MyArgument}{Datum: \printdate{#1}}          \newtcolorbox{MyBox1}[1]{colback=red!5!white, colframe=red!75!black, title=\MyArgument }          %some more "\newtcolorbox{...}" with different colors, but all with title=\MyArgument          \begin{document}           \begin{MyBox}{2014-02-11}       \lipsum      \end{MyBox}          \end{document}      The output should be a box with the title "Datum: 11. Februar 2014" (German date format) The purpose is that I want to be able to change the title of all boxes at the same time. How can I do that?


title: Putting circle into a right triangle

text: I need help with MetaPost in putting circle into the bottom left corner of a right triangle. Here is my work:                beginfig(1)           pair A,B,C,D,E,F,O,G,H,I,J,AA, BB, CC, HB, HF, DD, EE,FF,h;                O=origin;           A=(-1cm,0);           B=(4cm,0);           C=(-1cm,-1cm);           D=(2.5cm,5cm);           E=(4cm,-1cm);           F=(0.5cm,5cm);              AA= 1/2[G,H];         BB= 1/2[I,G];         CC= 1/2[H,I];              DD=1/2[H,D];         EE=1/2[H,F];         FF=1/2[D,F];              G= whatever [A,B];         G= whatever [C,D];              H= whatever [C,D];         H= whatever [E,F];              I= whatever [E,F];         I= whatever  [A,B];              (J-C)= whatever *(           (C-A) rotated 1/2( angle(I-C) - angle(A-C)) );         (J-I) = whatever * ((I-C)rotated 1/2(angle(A-I) - angle (C-I)));         J-h = whatever * (I-C) rotated 90;         h= whatever [I,A];                     draw fullcircle scaled 2 abs(J-h) shifted J;                draw A--B;           draw C--D;           draw E--F;               draw G withpen pencircle scaled 4bp;          draw H withpen pencircle scaled 4bp;          draw I withpen pencircle scaled 4bp;              draw AA..BB..CC..cycle;         draw DD..EE..FF..cycle;               endfig;


title: Equal spacing between equations on a page

text: I am writing a short quiz for my students in LaTeX, however I am having trouble with the spacing. The two equations I have are:                $\int sin^3(x)cos^{\frac{3}{2}}(x)dx$      \vspace{20pc}           $\int \frac{3x^2+2x+4}{(x-1)^2(x+1)} dx$      I use `\vspace{20pc}` to give a gap between both equations to give room for the students to solve it by hand. However, I want to have an equal amount of room on an entire page for both problems. I used `\vfill` thinking that would work but it simply puts both equations to the top of the page. Is there a way that LaTeX will automatically generate an equal spacing for both problems on a page?


title: Annoying paragraph spacing issue with memoir

text: I have a spacing issue while using the `memoir` class. The main problem is that after the first paragraph there is a line skip and an indentation and afterwards, all the paragraphs are indented properly and there is no line skip. Here is a MWE:               \documentclass[11pt,twoside,openright]{memoir}     \usepackage[size=pocket,trim,bleed]{createspace}     %\usepackage[paperwidth=4.25in, paperheight=6.875in,bindingoffset=.75in]{geometry}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{tgtermes}          \usepackage{mathpazo}     \usepackage[protrusion=true,expansion=true]{microtype}     \usepackage{lipsum}     %\usepackage{type1cm}     %\usepackage{lettrine}          %\checkandfixthelayout          % See the ``Memoir customise'' template for some common customisations     % Don't forget to read the Memoir manual: memman.pdf          %\title{TITLE OF BOOK}     %\author{NAME OF AUTHOR}     %\date{} % Delete this line to display the current date          %% BEGIN TITLE          \makeatletter     \def\maketitle{%       \null       \thispagestyle{empty}%       \vfill       \begin{center}\leavevmode         \normalfont         {\LARGE\raggedleft \@author\par}%         \hrulefill\par         {\huge\raggedright \@title\par}%         \vskip 1cm     %    {\Large \@date\par}%       \end{center}%       \vfill       \null       \cleardoublepage       }     \makeatother     \author{AUTHOR}     %\author{NAME OF AUTHOR}     \title{TITLE}     %\date{}                                                       %%% BEGIN DOCUMENT          \begin{document}     \pdftitle{TITLE}     \pdfauthor{AUTHOR}     \pdfsubject{SUBJECT}     \chapterstyle{bianchi}          \let\cleardoublepage\clearpage               \maketitle                                   \frontmatter          \null\vfill          \begin{flushleft}          Copyright \copyright       %\textit{TITLE}          All rights reserved.          ISBN:           ISBN--13:      \bigskip                              \end{flushleft}     \let\cleardoublepage\clearpage     \clearpage     \tableofcontents              \chapter{Introduction}         \lipsum[1]              \lipsum[2]              \lipsum[3]          \mainmatter     \sloppy     %Input all of the chapter here               \backmatter               \end{document}      I also get an underfull `\vbox` which is something I do not know how to fix. Maybe the two are related? EDIT: I changed the document to fit createspace's guidelines but now the `\vbox` is back. I have attempted to use `\vfil` option but that is not working. What could be the issue?               \documentclass[11pt,twoside,openright]{memoir}     \usepackage{geometry}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{lipsum}          \geometry{         paperheight=8.00in,         top=.75in,         bottom=.75in,          paperwidth=5.25in,         inner=.38in,         outer=.75in,         bindingoffset=.75in,     }          \begin{document}     \chapterstyle{bianchi}          \tableofcontents*          \let\cleardoublepage\clearpage     \clearpage          \pagenumbering{roman}         \chapter{Introduction Chapter}         \vfil            \lipsum[1-10]          \mainmatter     \sloppy          %Input all of the chapter hermane     \pagenumbering{arabic}         \chapter{Awesome chapter}         \vfil         \lipsum[1-20]        \end{document}      **UPDATE** I used `\raggedbottom` in the preamble as suggested before and that seems to have rid me of all of `\vbox` errors. I will look through the entire file and update again. **UPDATE 2** `\raggedbottom` fixed 99.99% of the issues except I get 1 overfull `\vbox`. The exact error is: > Overfull \vbox (13.59999pt too high) has occurred while \output is active []


title: Beamer background image centered

text: I'm trying to use an image as a background for Beamer presentation according to this post. However, I do not want the image spanning the entire background. Thus, I'm doing something like:               \usebackgroundtemplate{% \centering     \hspace{4.5cm}     \includegraphics[width=1.5in]{image.jpeg}     }      The `\hspace` command works, but `\vspace` does not work. Basically, I'm trying to get the image to be at the center of the page. Any ideas on how this can be done?


title: how do i get header like

text: Name                                                                           Chapter name     roll No.     ___________________________________________________________________________________________               content               ___________________________________________________________________________________________     University name                                                                    page No.


title: Multiline formula with each column left-aligned

text: I am using LyX and I want a multiline and multicolumn display formula with each column aligned to the left. But when I add a formula and add columns, some are aligned to the right and some are aligned to the left. How do I control it and make all columns aligned to the left?


title: How to setup node distance in tikzpicture without the arrows to change directions?

text: I want to know why when I change the distance to 2.5cm the arrow connecting to the ouput node is in the opposite direction as shown in the second diagram. How can I fix this in order for the length of the arrows to be like in the second diagram? Sample code for the first diagram:               \documentclass[10pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}          \tikzstyle{block1} = [draw, fill=white!20, rectangle,minimum height=3em, minimum width=10em]     \tikzstyle{input} = [coordinate]     \tikzstyle{output} = [coordinate]     \begin{center}     \begin{tikzpicture}[auto, node distance=2.15cm,>=latex']         \node [input, name=input] {};         \node [block1, right of=input] (h_k) {$h(k)=h_1(k)*h_2(k)$};         \node [output, right of=h_k] (output) {};            \draw [->] (input) -- (h_k);         \draw [->] (h2_k) -- (output);     \end{tikzpicture}     \end{center}     \end{document}      ![enter image description here](http://i.stack.imgur.com/5vUE5.png) Sample code for the second diagram:               \documentclass[10pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}          \tikzstyle{block1} = [draw, fill=white!20, rectangle,minimum height=3em, minimum width=10em]     \tikzstyle{input} = [coordinate]     \tikzstyle{output} = [coordinate]     \begin{center}     \begin{tikzpicture}[auto, node distance=2.5cm,>=latex']         \node [input, name=input] {};         \node [block1, right of=input] (h_k) {$h(k)=h_1(k)*h_2(k)$};         \node [output, right of=h_k] (output) {};            \draw [->] (input) -- (h_k);         \draw [->] (h2_k) -- (output);     \end{tikzpicture}     \end{center}     \end{document}      ![enter image description here](http://i.stack.imgur.com/CqCNx.png)


title: Figure numbering in \chapter*

text: I am writing my thesis using the amsbook class, when I just discovered that the Figure numbering does not reset after introducing \chapter*. In particular, I have the following skeleton:               \documentclass{amsbook}          \begin{document}          \chapter*{Introduction}     \chapter{1}     \chapter{2}     \chapter{3}     \chapter*{Conclusion}          \end{document}      I have a figure environment in my Introduction, which currently is labelled Figure 0.1. I didn't mind this, but when I included a figure in the conclusion, it was labelled Figure 3.7, a continuation of the figure numbering from the previous chapter, which stopped at Figure 3.6. I saw some ways to redefine the numbering or to rename the figure name, e.g., using Fig instead of Figure. However, I cannot seem to find a way to relabel the figure count to using letters instead. I figured (no pun intended), that since I am using only one Figure in my introduction and another one in my conclusion, then just set (even manually) the figure label in my introduction as 'Figure A' and the figure in my conclusion as 'Figure B', and the rest of the figures in the main chapters as they are, i.e. Figure X.Y (X is the chapter and Y is the chronological count of the figure). Is there a way to do this? Thanks a lot!