title: Colorbox not working with longtable

text: I have some tables that I want to entirely color in light grey, but the same command lines that work for the tabular environment (see second table example) do not work for the longtable environment (see first table example). How can I color the longtable in the same manner as the tabular table? Thank your for any help!               % PREAMBLE     \documentclass[12pt,a4paper]{article}     \usepackage{longtable}     \setlength{\LTpre}{0pt}     \setlength{\LTpost}{-6pt}     \usepackage{array}     \usepackage[UKenglish]{babel}     \usepackage{geometry}     \usepackage{booktabs}     \usepackage{array}     \usepackage{lscape}     \usepackage{siunitx}     \usepackage{parskip}     \usepackage{xcolor}     \definecolor{lightgray}{gray}{0.8}     \usepackage[skip=2pt,font=scriptsize]{caption}     \newcommand{\oneS}{\ensuremath{{}^{\textstyle *}}}     \newcommand{\twoS}{\ensuremath{{}^{\textstyle **}}}     \begin{document}          % LONGTABLE WHERE COLORBOX IS NOT WORKING     \newgeometry{left=1.5cm,right=1.5cm,top=1.8cm,bottom=1.8cm}     \begin{landscape}     \scriptsize     \thispagestyle{empty}     \scriptsize     %\begingroup\setlength{\fboxsep}{0pt} >>> colorbox commands that return error: Missing \endgroup inserted     %\colorbox{lightgray}{     \begin{longtable}{       l S[table-format=-1.4] S[table-format=-1.4] S[table-format=-3.2] S[table-format=-5.2] S[table-format= 7.2] S[table-format=-3.2] S[table-format=-3.2] S[table-format=-3.2] S[table-format=-3.2]  @{\hspace{0.8cm}} r r r r }      \caption{Summary statistics} \label{fig:sumstat} \\     \toprule     {Future i.e. underlying asset}  & \multicolumn{5}{l}{Daily returns on long-only positions} &  \multicolumn{4}{l}{Ljung-Box } & \multicolumn{2}{l}{Avg. vol. (\$ mil.)} &     \multicolumn{2}{l}{Avg. open interest} \\     \cmidrule(r){2-6} \cmidrule(r){7-10} \cmidrule(r){11-12} \cmidrule(r){13-14}     &  {Mean (\%)} & {Std. (\%)} & {Skew. (\%)}  & {Kurt. (\%)} & {Jarque-Bera} & {(5)} & {(20)} & {(60)} & {(120)} & {2000} & {2014} & {2000} & {2014} \\      \midrule     \endfirsthead     \toprule     {Future i.e. underlying asset}  & \multicolumn{5}{l}{Daily returns on long-only positions} &  \multicolumn{4}{l}{Ljung-Box } & \multicolumn{2}{l}{Avg. vol. (\$ mil.)} &     \multicolumn{2}{l}{Avg. open interest} \\      \cmidrule(r){2-6} \cmidrule(r){7-10} \cmidrule(r){11-12} \cmidrule(r){13-14}     &  {Mean (\%)} & {Std. (\%)} & {Skew. (\%)}  & {Kurt. (\%)} & {Jarque-Bera} & {(5)} & {(20)} & {(60)} & {(120)} & {2000} & {2014} & {2000} & {2014} \\      \midrule     \endhead     \bottomrule \multicolumn{14}{r}{\emph{Continued on next page}}     \endfoot     \bottomrule     \endlastfoot     Frozen Concentrated Orange Juice    &   -0.0184 &   1.8845  &   -8.68       &   764.51 \twoS    &   3170.82 \twoS   &   20.61   \twoS   &   43.77   \twoS   &   98.60   \twoS   &   150.82  \oneS   &   43  &   37  &   25727   &   16991   \\     \end{longtable}     % }\endgroup >>> colorbox commands that return error: Missing \endgroup inserted     \thispagestyle{empty}     \end{landscape}     \restoregeometry               % TABULAR WHERE COLORBOX IS WORKING     \newgeometry{left=5cm, top=5.3cm,bottom=5.3cm}     \thispagestyle{empty}     \begin{landscape}     \begin{table}[ht]     \scriptsize     \caption{Interest rate term structures }\label{fig:termstruct}     \centering     \begingroup\setlength{\fboxsep}{0pt}     \colorbox{lightgray}{ % >>> same colorbox commands as above working here with tabular environment     \begin{tabular}{ lllccccc }     \toprule     {Country} & {Currency} & {Rates description} & \multicolumn{5}{l}{Availability} \\     \cmidrule(r){3-3} \cmidrule(r){4-8}      & & {Overnight / Further out} & {O/N} & {1W} & {1M} & {2M} & {3M} \\     \midrule     India   &   INR &   India National Stock Exchange Interbank Offer Rate / INR Swap Onshore OIS   &   x   &   o   &   x   &   x   &   x   \\     \bottomrule     \end{tabular}     }\endgroup % >>> same colorbox commands as above but working here with tabular environment     \end{table}     \end{landscape}     \restoregeometry     \end{document}      Here is a picture of the working (tabular) table colored in grey: ![enter image description here](http://i.stack.imgur.com/OsOsd.png) **UPDATE** (after Christian's solution using tcolorbox) This seems to be quite tricky.. The coloring now works over multiple pages, but if I adjust the settings such that the caption is not colored the coloring on the second page starts below the top (the same amount I took away on the first page in order not to color the caption -> see pictures). Also the bottomrules are somewhat behind the colors (this is also the case if I choose a very very light grey). Adjusted line of Christian's solution code: `\begin{tcolorbox}[left=2pt,top=-9pt,boxrule=0pt,boxsep=0pt,arc=0mm,auto outer arc, breakable]` Page one: almost perfect except for the missing bottomrule ![enter image description here](http://i.stack.imgur.com/f58cD.png) Page two: now the color starts below the top ![enter image description here](http://i.stack.imgur.com/Qndld.png) **UPDATE** (after trying the rowcolor macro) Unfortunately this still leaves white space around the cmidrules (see picture). ![enter image description here](http://i.stack.imgur.com/RlwfO.png) **UPDATE** (after putting the caption outside the table) Unfortunately this does not work too. The caption is now excluded (and thus not grey), but the coloring still starts somewhat above the toprule and hence if I move it down the coloring on the second page will start below the toprule. ![enter image description here](http://i.stack.imgur.com/MaJf4.png) **UPDATE** (after properly trying the rowcolor macro with cline instead of cmidrule) The cmidrule whitespace is gone now, but there are still some things I am not happy about: There is white space where I inserted space between two rows; The continued on next page is also colored in grey; And some significance stars are cut off by the coloring. (This is probably my fault because the table is such a mess and I am sorry for it, but I only started using Latex a very short while ago and I am still a bloody noob). After the picture I will post the whole code of the table as I use it and hopefully you guys find a solution. And btw thanks for all the inputs so far - I really learned a lot from your answers!! ![enter image description here](http://i.stack.imgur.com/0QA5u.png) **CODE FOR THE TABLE AS OF NOW** (after trying rowcolor macro)               \documentclass[12pt,a4paper]{article}     \usepackage{mathpazo}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{latexsym}     \usepackage{graphicx}     \graphicspath{{./eps/}}     \usepackage{longtable}     \setlength{\LTpre}{0pt}     \setlength{\LTpost}{-6pt}     \usepackage{natbib}     \usepackage{array}     \usepackage[applemac]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[UKenglish]{babel}     \usepackage[UKenglish]{isodate}     \usepackage{geometry}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{tabularx}     \usepackage{array}     \usepackage{lscape}     \usepackage{siunitx}     \usepackage{appendix}     \usepackage{parskip}     \usepackage[table]{xcolor}     \definecolor{lightgray}{gray}{0.9}     \usepackage[skip=2pt,font=scriptsize]{caption}     \newcommand{\oneS}{\ensuremath{{}^{\textstyle *}}}     \newcommand{\twoS}{\ensuremath{{}^{\textstyle **}}}     \begin{document}          % Table 2: Descriptive statistics     \newgeometry{left=1.5cm,right=1.5cm,top=1.8cm,bottom=1.8cm}     \begin{landscape}     \scriptsize     \thispagestyle{empty}     \scriptsize     \def\arraystretch{1.5}     \rowcolors{3}{lightgray}{lightgray}%%%% start with line 3     \begin{longtable}{     l S[table-format=-1.4] S[table-format=-1.4] S[table-format=-3.2] S[table-format=-5.2] S[table-format= 7.2] S[table-format=-3.2] S[table-format=-3.2] S[table-format=-3.2] S[table-format=-3.2] @{\hspace{0.8cm}} r r r r }      \caption{Summary statistics} \label{fig:sumstat} \\ \hline     {Future i.e. underlying asset}  & \multicolumn{5}{l}{Daily returns on long-only positions} &  \multicolumn{4}{l}{Ljung-Box } & \multicolumn{2}{l}{Avg. vol. (\$ mil.)} &     \multicolumn{2}{l}{Avg. open interest} \\     \cline{2-6} \cline{7-10} \cline{11-12} \cline{13-14}     &  {Mean (\%)} & {Std. (\%)} & {Skew. (\%)}  & {Kurt. (\%)} & {Jarque-Bera} & {(5)} & {(20)} & {(60)} & {(120)} & {2000} & {2014} & {2000} & {2014} \\      \hline     \endfirsthead     \hline     {Future i.e. underlying asset}  & \multicolumn{5}{l}{Daily returns on long-only positions} &  \multicolumn{4}{l}{Ljung-Box } & \multicolumn{2}{l}{Avg. vol. (\$ mil.)} &     \multicolumn{2}{l}{Avg. open interest} \\     \cline{2-6} \cline{7-10} \cline{11-12} \cline{13-14}     &  {Mean (\%)} & {Std. (\%)} & {Skew. (\%)}  & {Kurt. (\%)} & {Jarque-Bera} & {(5)} & {(20)} & {(60)} & {(120)} & {2000} & {2014} & {2000} & {2014} \\      \hline     \endhead     \hline \multicolumn{14}{r}{\emph{Continued on next page}}     \endfoot     \hline     \endlastfoot     Azuki Red Beans &   -0.0506 &   1.2311  &   -8.48       &   498.31  \twoS   &   581.33 \twoS    &   9.02        &   22.62       &   82.93   \oneS   &   148.58  \oneS   &   256 &   8   &   24081   &   1195    \\     Canola  &   -0.0040 &   1.2639  &   -34.98      &   782.19  \twoS   &   3483.86 \twoS   &   18.63   \twoS   &   78.35   \twoS   &   126.33  \twoS   &   219.49  \twoS   &   35  &   137 &   57000   &   148689  \\     Cocoa   &   0.0152  &   1.9748  &   -22.63      &   526.62  \twoS   &   783.74  \twoS   &   5.05        &   22.98       &   73.80       &   151.80  \oneS   &   58  &   568 &   112073  &   166484  \\     Coffee  &   -0.0628 &   2.0621  &   10.13       &   694.97  \twoS   &   2295.38 \twoS   &   13.29   \oneS   &   38.74   \twoS   &   87.90   \oneS   &   135.62      &   219 &   1'288   &   44670   &   142144  \\     Corn    &   -0.0181 &   1.7912  &   6.17        &   498.40  \twoS   &   579.88  \twoS   &   6.36        &   44.37   \twoS   &   97.27   \twoS   &   168.05  \twoS   &   736 &   5'987   &   428941  &   1033440 \\     Cotton  &   -0.0355 &   1.7950  &   -5.54       &   405.78  \oneS   &   166.01  \twoS   &   17.92   \twoS   &   44.70   \twoS   &   105.17  \twoS   &   187.02  \twoS   &   389 &   961 &   59894   &   171613  \\     Frozen Concentrated Orange Juice    &   -0.0184 &   1.8845  &   -8.68       &   764.51  \twoS   &   3170.82 \twoS   &   20.61   \twoS   &   43.77   \twoS   &   98.60   \twoS   &   150.82  \oneS   &   43  &   37  &   25727   &   16991   \\     Lean Hogs   &   -0.0450 &   1.4720  &   -11.03      &   383.29      &   108.94  \twoS   &   0.15        &   24.79       &   98.73   \twoS   &   177.33  \twoS   &   205 &   1'383   &   49182   &   222955  \\     Live Cattle &   -0.0076 &   0.8947  &   -21.20      &   524.61  \twoS   &   766.75  \twoS   &   11.41   \oneS   &   61.44   \twoS   &   114.85  \twoS   &   219.51  \twoS   &   106 &   2'404   &   35788   &   271159  \\     Lumber  &   -0.0735 &   1.8705  &   14.40       &   290.86      &   13.40   \twoS   &   28.93   \twoS   &   41.23   \twoS   &   91.75   \twoS   &   167.33  \twoS   &   26  &   37  &   3479    &   6036    \\     Milk    &   0.0228  &   0.9491  &   11.11       &   755.16  \twoS   &   3047.50 \twoS   &   38.97   \twoS   &   119.47  \twoS   &   214.46  \twoS   &   277.08  \twoS   &   4   &   60  &   7370    &   17752   \\     Oats    &   0.0215  &   1.9433  &   -15.61      &   548.80  \twoS   &   922.74  \twoS   &   40.62   \twoS   &   65.32   \twoS   &   119.86  \twoS   &   177.37  \twoS   &   9   &   16  &   15592   &   9548    \\     Rapeseed    &   0.0296  &   0.9648  &   -32.82      &   614.05  \twoS   &   1510.62 \twoS   &   42.49   \twoS   &   102.01  \twoS   &   146.87  \twoS   &   196.53  \twoS   &   4   &   135 &   11006   &   52218   \\     Rough Rice  &   -0.0350 &   1.5563  &   2.24        &   438.54  \twoS   &   281.95  \twoS   &   36.49   \twoS   &   52.26   \twoS   &   106.70  \twoS   &   188.64  \twoS   &   8   &   34  &   6573    &   10987   \\     Rubber  &   0.0031  &   2.0663  &   -40.18      &   548.06  \twoS   &   997.78  \twoS   &   4.25        &   49.33   \twoS   &   149.77  \twoS   &   212.53  \twoS   &   1   &   1   &   160418  &   14016   \\     Soybean Meal    &   0.0675  &   1.7365  &   -13.68      &   467.56  \twoS   &   423.02  \twoS   &   4.50        &   33.19   \oneS   &   71.00       &   149.34  \oneS   &   421 &   5'876   &   113168  &   227463  \\     Soybean Oil &   0.0040  &   1.5492  &   10.94       &   502.91  \twoS   &   611.23  \twoS   &   0.77        &   14.75       &   57.70       &   148.56  \oneS   &   208 &   2'311   &   136633  &   272694  \\     Soybean &   0.0384  &   1.5740  &   -20.22      &   490.62  \twoS   &   557.26  \twoS   &   4.41        &   33.68   \oneS   &   88.55   \twoS   &   178.72  \twoS   &   1'266   &   10'905  &   164866  &   456361  \\     Sugar \#11 International    &   0.0143  &   2.0998  &   -31.41      &   494.08  \twoS   &   610.66  \twoS   &   12.69   \oneS   &   28.95       &   108.76  \twoS   &   205.47  \twoS   &   171 &   1'943   &   170865  &   652621  \\     Wheat   &   -0.0375 &   1.9741  &   5.60        &   495.17  \twoS   &   560.82  \twoS   &   0.83        &   26.73       &   91.33   \twoS   &   158.60  \oneS   &   336 &   3'308   &   135389  &   369247  \\     Ultra U.S. Treasury Bond    &   0.0207  &   0.6554  &   -15.76      &   448.51  \twoS   &   338.23  \twoS   &   3.98        &   24.19       &   58.73       &   159.24  \twoS   &   24'011  &   52'455  &   467187  &   630200  \\     Australian Gov't Bond 10Y   &   0.0013  &   0.0686  &   -9.82       &   466.84  \twoS   &   414.14  \twoS   &   12.90   \oneS   &   24.76       &   83.09   \oneS   &   173.44  \twoS   &   1'455   &   5'216   &   165420  &   476535  \\     Australian Gov't Bond 3Y    &   0.0019  &   0.0705  &   10.65       &   558.89  \twoS   &   990.22  \twoS   &   1.45        &   20.53       &   89.57   \twoS   &   162.75  \twoS   &   3'719   &   10'517  &   358211  &   572109  \\     Canadian Gov't Bond 10Y &   0.0153  &   0.3614  &   -14.13      &   466.70  \twoS   &   419.55  \twoS   &   7.15        &   18.00       &   62.10       &   143.37      &   537 &   4'783   &   47155   &   282932  \\     Eurobobl    &   0.0110  &   0.2225  &   -19.45      &   475.48  \twoS   &   474.07  \twoS   &   10.59       &   23.58       &   74.05       &   143.69      &   33'461  &   55'611  &   346668  &   910191  \\     Eurobund    &   0.0154  &   0.3513  &   -9.35       &   451.08  \twoS   &   340.08  \twoS   &   14.25   \oneS   &   26.77       &   74.06       &   130.28      &   82'510  &   93'541  &   642232  &   952275  \\     Euroschatz  &   0.0041  &   0.0885  &   -21.56      &   786.79  \twoS   &   3504.74 \twoS   &   16.06   \twoS   &   41.86   \twoS   &   107.02  \twoS   &   199.08  \twoS   &   22'679  &   36'028  &   305729  &   864832  \\     Japanese Gov't Bond 10Y &   0.0090  &   0.2179  &   -42.09      &   863.28  \twoS   &   4760.13 \twoS   &   8.71        &   29.58       &   91.84   \twoS   &   166.36  \twoS   &   49'603  &   43'313  &   137348  &   91986   \\     Long Gilt   &   0.0104  &   0.3826  &   -1.62       &   509.27  \twoS   &   642.83  \twoS   &   13.67   \oneS   &   30.27       &   79.71   \oneS   &   156.02  \oneS   &   3'535   &   27'988  &   69257   &   355250  \\     Long Swiss Confederation    &   0.0111  &   0.2748  &   -6.38       &   545.83  \twoS   &   889.23  \twoS   &   53.59   \twoS   &   80.77   \twoS   &   126.89  \twoS   &   194.76  \twoS   &   235 &   39  &   14044   &   5847    \\     U.S. Treasury Note 10Y  &   0.0196  &   0.4106  &   -3.10       &   619.08  \twoS   &   1494.68 \twoS   &   8.70        &   35.05   \oneS   &   65.91       &   162.87  \twoS   &   17'967  &   162'889 &   582852  &   2163999 \\     U.S. Treasury Note 2Y   &   0.0068  &   0.1087  &   7.20        &   1168.10 \twoS   &   11061.84    \twoS   &   12.15   \oneS   &   62.03   \twoS   &   112.94  \twoS   &   203.96  \twoS   &   1'166   &   50'400  &   51123   &   915589  \\     U.S. Treasury Note 5Y   &   0.0148  &   0.2694  &   -6.74       &   653.82  \twoS   &   1839.84 \twoS   &   11.64   \oneS   &   41.60   \twoS   &   80.85   \oneS   &   176.22  \twoS   &   9'089   &   83'868  &   400775  &   1719007 \\     Light Sweet Crude Oil (WTI) &   0.0153  &   2.2460  &   -32.40      &   626.96  \twoS   &   1630.41 \twoS   &   11.22   \oneS   &   34.71   \oneS   &   94.42   \twoS   &   160.52  \twoS   &   4'398   &   37'065  &   456534  &   699002  \\     Gasoil  &   0.0516  &   2.0066  &   -19.57      &   554.39  \twoS   &   972.18  \twoS   &   5.35        &   21.43       &   53.77       &   139.47      &   695 &   19'906  &   111039  &   418798  \\     RBOB Gasoline   &   0.0625  &   2.3566  &   -24.29      &   508.62  \twoS   &   673.32  \twoS   &   8.31        &   35.67   \oneS   &   92.23   \twoS   &   163.61  \twoS   &   127 &   1'788   &   88433   &   194846  \\     Heating Oil &   0.0360  &   2.1785  &   -14.55      &   501.86  \twoS   &   610.42  \twoS   &   6.11        &   25.38       &   78.77       &   146.84  \oneS   &   133 &   1'291   &   137530  &   203354  \\     Henry Hub Natural Gas   &   -0.1232 &   3.1845  &   5.43        &   528.06  \twoS   &   764.99  \twoS   &   22.23   \twoS   &   38.98   \twoS   &   85.67   \oneS   &   136.13      &   3'028   &   10'306  &   325705  &   743292  \\     Aluminum    &   -0.0156 &   1.4244  &   -26.87      &   532.39  \twoS   &   834.93  \twoS   &   7.32        &   28.77       &   79.11   \oneS   &   141.59      &   N/A &   6'159   &   7079    &   318966  \\     Copper  &   0.0344  &   1.8510  &   -19.03      &   702.81  \twoS   &   2402.34 \twoS   &   22.34   \twoS   &   67.49   \twoS   &   167.83  \twoS   &   255.37  \twoS   &   231 &   5'112   &   71885   &   128024  \\     Lead    &   0.0394  &   2.1804  &   -22.49      &   615.78  \twoS   &   1493.00 \twoS   &   14.26   \oneS   &   38.81   \twoS   &   87.45       &   189.45  \twoS   &   N/A &   999 &   883 &   40201   \\     Tin &   -0.0011 &   1.9655  &   -15.04      &   571.40  \twoS   &   1094.17 \twoS   &   13.67   \oneS   &   24.79       &   72.21       &   165.87  \twoS   &   N/A &   485 &   1760    &   115101  \\     Nickel  &   0.0235  &   2.4578  &   -12.07      &   644.24  \twoS   &   1747.51 \twoS   &   4.37        &   13.91       &   62.01       &   109.32      &   N/A &   2'184   &   946 &   49631   \\     Zinc    &   -0.0057 &   1.9730  &   -17.62      &   573.15  \twoS   &   1113.17 \twoS   &   14.15   \oneS   &   29.69       &   75.20       &   162.30  \twoS   &   N/A &   2'423   &   1760    &   115101  \\     Gold    &   0.0305  &   1.1971  &   -28.16      &   853.30  \twoS   &   4539.09 \twoS   &   0.62        &   34.75   \oneS   &   87.88   \oneS   &   174.93  \twoS   &   784 &   25'989  &   138832  &   329134  \\     Palladium   &   0.0102  &   2.1923  &   -26.81      &   698.41  \twoS   &   2371.53 \twoS   &   36.51   \twoS   &   55.17   \twoS   &   102.20  \twoS   &   179.60  \twoS   &   14  &   430 &   2193    &   36291   \\     Platinum    &   0.0376  &   1.5101  &   -48.56  \oneS   &   735.37  \twoS   &   2920.08 \twoS   &   17.44   \twoS   &   38.48   \twoS   &   104.69  \twoS   &   156.09  \oneS   &   34  &   932 &   9184    &   59756   \\     Silver  &   0.0250  &   2.0767  &   -96.58  \twoS   &   1048.60 \twoS   &   8771.42 \twoS   &   4.39        &   21.95       &   78.18       &   163.82  \twoS   &   315 &   6'661   &   76057   &   111035  \\     Australian Bank Bill 3M &   0.0005  &   0.0519  &   299.28  \twoS   &   5248.30 \twoS   &   364590.55   \twoS   &   27.00   \twoS   &   72.25   \twoS   &   130.24  \twoS   &   203.28  \twoS   &   2'443   &   4'541   &   411190  &   537365  \\     Canadian Bank Bill 3M   &   0.0024  &   0.0506  &   42.88   \oneS   &   1456.60 \twoS   &   19738.37    \twoS   &   19.17   \twoS   &   49.78   \twoS   &   135.91  \twoS   &   221.26  \twoS   &   1'783   &   3'446   &   205303  &   408228  \\     Euribor 3M  &   0.0012  &   0.0295  &   76.32   \twoS   &   1797.30 \twoS   &   33243.78    \twoS   &   89.68   \twoS   &   152.44  \twoS   &   263.86  \twoS   &   376.17  \twoS   &   28'455  &   32'541  &   1253952 &   1589255 \\     New Zealand Bank Bill 3M    &   0.0011  &   0.0363  &   156.65  \twoS   &   2118.90 \twoS   &   49989.65    \twoS   &   76.46   \twoS   &   155.79  \twoS   &   259.73  \twoS   &   364.35  \twoS   &   220 &   136 &   63039   &   70274   \\     Short Sterling 3M   &   0.0018  &   0.0424  &   17.80       &   1830.90 \twoS   &   34413.00    \twoS   &   59.35   \twoS   &   129.74  \twoS   &   244.83  \twoS   &   363.65  \twoS   &   6'388   &   11'994  &   786150  &   1041323 \\     Eurodollar  &   0.0026  &   0.0431  &   131.20  \twoS   &   2812.70 \twoS   &   93663.21    \twoS   &   116.41  \twoS   &   181.15  \twoS   &   318.82  \twoS   &   392.11  \twoS   &   39'664  &   16'242  &   3136864 &   895134  \\     AEX (Netherlands)   &   -0.0133 &   1.5396  &   -22.67      &   1013.40 \twoS   &   7498.03 \twoS   &   46.31   \twoS   &   86.79   \twoS   &   156.92  \twoS   &   253.75  \twoS   &   1'931   &   2'366   &   41800   &   79304   \\     CAC 40 (France) &   -0.0044 &   1.5408  &   -3.46       &   746.75  \twoS   &   2929.66 \twoS   &   36.11   \twoS   &   66.48   \twoS   &   129.88  \twoS   &   221.36  \twoS   &   5'924   &   5'242   &   351323  &   381862  \\     DAX (Germany)   &   0.0008  &   1.5721  &   -3.70       &   830.23  \twoS   &   4126.65 \twoS   &   28.27   \twoS   &   68.89   \twoS   &   145.43  \twoS   &   230.89  \twoS   &   10'730  &   20'555  &   228371  &   162915  \\     EURO STOXX 50 (Europe)  &   -0.0082 &   1.6192  &   11.02       &   783.26  \twoS   &   3434.34 \twoS   &   50.97   \twoS   &   103.50  \twoS   &   188.80  \twoS   &   288.50  \twoS   &   3'799   &   25'840  &   416090  &   2795034 \\     FTSE MIB (Italy)    &   -0.0156 &   1.5338  &   -26.31      &   833.06  \twoS   &   4210.57 \twoS   &   39.90   \twoS   &   73.75   \twoS   &   148.48  \twoS   &   268.26  \twoS   &   2'309   &   2'052   &   11628   &   45977   \\     FTSE 100 (United Kingdom)   &   -0.0001 &   1.2572  &   -9.71       &   926.07  \twoS   &   5757.65 \twoS   &   59.07   \twoS   &   94.93   \twoS   &   186.20  \twoS   &   321.70  \twoS   &   3'771   &   10'389  &   240624  &   647792  \\     Hang Seng (Hongkong)    &   0.0135  &   1.6649  &   -16.32      &   949.17  \twoS   &   6200.07 \twoS   &   10.32       &   57.15   \twoS   &   120.85  \twoS   &   202.39  \twoS   &   1'619   &   10'961  &   33608   &   121727  \\     IBEX 35 (Spain) &   0.0023  &   1.5751  &   6.20        &   777.89  \twoS   &   3353.76 \twoS   &   20.09   \twoS   &   44.29   \twoS   &   102.28  \twoS   &   188.23  \twoS   &   2'338   &   1'684   &   46959   &   69191   \\     KOSPI 200 (South Korea) &   0.0175  &   1.8296  &   -44.71  \oneS   &   761.27  \twoS   &   3239.77 \twoS   &   9.80        &   32.55   \oneS   &   115.75  \twoS   &   224.64  \twoS   &   3'199   &   21'372  &   36127   &   114246  \\     MSCI Taiwan &   0.0030  &   1.8566  &   -31.66      &   968.52  \twoS   &   6617.40 \twoS   &   46.07   \twoS   &   97.77   \twoS   &   170.87  \twoS   &   262.07  \twoS   &   408 &   1'958   &   25092   &   221379  \\     NASDAQ 100 (U.S.)   &   -0.0089 &   1.9399  &   7.76        &   903.03  \twoS   &   5339.96 \twoS   &   31.70   \twoS   &   93.67   \twoS   &   199.40  \twoS   &   322.55  \twoS   &   7'312   &   281 &   35905   &   9260    \\     Nikkei 225 (Japan)  &   -0.0063 &   1.6453  &   -12.16      &   874.19  \twoS   &   4846.92 \twoS   &   27.41   \twoS   &   49.96   \twoS   &   115.91  \twoS   &   200.30  \twoS   &   151 &   1'290   &   15735   &   67237   \\     S\&P Toronto 60 (Canada)    &   0.0125  &   1.2849  &   -58.78  \oneS   &   1156.30 \twoS   &   10962.79    \twoS   &   32.43   \twoS   &   61.59   \twoS   &   142.15  \twoS   &   230.70  \twoS   &   573 &   1'539   &   63260   &   144992  \\     S\&P 500 (U.S.) &   0.0040  &   1.3219  &   -2.63       &   1282.40 \twoS   &   14163.06    \twoS   &   38.01   \twoS   &   82.31   \twoS   &   173.96  \twoS   &   261.28  \twoS   &   19'130  &   4'015   &   403594  &   182424  \\     IPC (Mexico)    &   0.0228  &   1.4116  &   -0.59       &   880.18  \twoS   &   4939.79 \twoS   &   34.95   \twoS   &   73.64   \twoS   &   124.08  \twoS   &   195.83  \twoS   &   1   &   169 &   1086    &   55327   \\     Bovespa (Brazil)    &   -0.0135 &   1.8909  &   -26.57      &   606.92  \twoS   &   1423.80 \twoS   &   13.67   \oneS   &   58.73   \twoS   &   101.27  \twoS   &   178.58  \twoS   &   204 &   2'389   &   27676   &   312498  \\     MSCI Singapore  &   0.0085  &   1.4114  &   -43.15  \oneS   &   1001.30 \twoS   &   7326.78 \twoS   &   14.36   \oneS   &   64.26   \twoS   &   137.04  \twoS   &   247.84  \twoS   &   81  &   595 &   4123    &   56762   \\     AUD/USD &   0.0079  &   0.8860  &   -43.54  \oneS   &   1158.80 \twoS   &   10933.65    \twoS   &   19.48   \twoS   &   58.86   \twoS   &   131.11  \twoS   &   241.61  \twoS   &   N/A &   N/A &   N/A &   N/A \\     EUR/USD &   0.0085  &   0.6700  &   9.27        &   463.11  \twoS   &   395.45  \twoS   &   6.31        &   22.59       &   67.66       &   152.46  \oneS   &   N/A &   N/A &   N/A &   N/A \\     GBP/USD &   0.0004  &   0.5929  &   -45.30  \oneS   &   736.82  \twoS   &   2920.61 \twoS   &   3.35        &   40.97   \twoS   &   136.90  \twoS   &   239.83  \twoS   &   N/A &   N/A &   N/A &   N/A \\     NZD/USD &   0.0124  &   0.8917  &   -41.20      &   587.22  \twoS   &   1310.25 \twoS   &   7.39        &   23.55       &   84.87       &   172.86  \twoS   &   N/A &   N/A &   N/A &   N/A \\     BRL/USD &   -0.0074 &   1.1436  &   -49.34  \oneS   &   1024.00 \twoS   &   7834.59 \twoS   &   19.81   \twoS   &   58.41   \twoS   &   130.30  \twoS   &   191.40  \twoS   &   N/A &   N/A &   N/A &   N/A \\     CAD/USD &   0.0087  &   0.5996  &   -10.18      &   622.54  \twoS   &   1532.79 \twoS   &   18.68   \twoS   &   50.68   \twoS   &   130.16  \twoS   &   229.81  \twoS   &   N/A &   N/A &   N/A &   N/A \\     CHF/USD &   0.0160  &   0.7299  &   -22.03      &   1218.40 \twoS   &   12404.99    \twoS   &   7.54        &   44.20   \twoS   &   105.18  \twoS   &   191.89  \twoS   &   N/A &   N/A &   N/A &   N/A \\     INR/USD &   -0.0102 &   0.4514  &   -83.39  \twoS   &   1750.20 \twoS   &   31272.79    \twoS   &   22.96   \twoS   &   45.01   \twoS   &   138.67  \twoS   &   287.85  \twoS   &   N/A &   N/A &   N/A &   N/A \\     JPY/USD &   -0.0005 &   0.6857  &   49.31   \oneS   &   1099.90 \twoS   &   9532.93 \twoS   &   11.25   \oneS   &   36.77   \oneS   &   101.95  \twoS   &   151.66  \oneS   &   N/A &   N/A &   N/A &   N/A \\     KRW/USD &   0.0018  &   0.7174  &   62.96   \twoS   &   5505.20 \twoS   &   397837.97   \twoS   &   22.50   \twoS   &   142.56  \twoS   &   370.24  \twoS   &   534.95  \twoS   &   N/A &   N/A &   N/A &   N/A \\     MXN/USD &   -0.0088 &   0.7140  &   -74.34  \twoS   &   1423.20 \twoS   &   18837.97    \twoS   &   22.67   \twoS   &   62.23   \twoS   &   128.15  \twoS   &   198.38  \twoS   &   N/A &   N/A &   N/A &   N/A \\     NOK/USD &   0.0077  &   0.8140  &   -9.00       &   576.40  \twoS   &   1125.91 \twoS   &   5.39        &   29.01       &   98.07   \twoS   &   181.81  \twoS   &   N/A &   N/A &   N/A &   N/A \\     PLN/USD &   0.0088  &   0.9634  &   -39.42      &   773.60  \twoS   &   3382.81 \twoS   &   11.68   \oneS   &   52.42   \twoS   &   118.06  \twoS   &   249.66  \twoS   &   N/A &   N/A &   N/A &   N/A \\     SEK/USD &   0.0076  &   0.8347  &   0.29        &   598.55  \twoS   &   1307.98 \twoS   &   8.89        &   34.02   \oneS   &   98.45   \twoS   &   221.08  \twoS   &   N/A &   N/A &   N/A &   N/A \\     SGD/USD &   0.0077  &   0.3432  &   7.99        &   817.99  \twoS   &   3941.20 \twoS   &   4.41        &   29.67       &   85.70   \oneS   &   154.16  \oneS   &   N/A &   N/A &   N/A &   N/A \\     TRY/USD &   -0.0383 &   1.3971  &   -668.12 \twoS   &   13878.00    \twoS   &   2731629.47  \twoS   &   28.88   \twoS   &   65.38   \twoS   &   173.38  \twoS   &   310.09  \twoS   &   N/A &   N/A &   N/A &   N/A \\     ZAR/USD &   -0.0152 &   1.1655  &   -109.65 \twoS   &   1467.00 \twoS   &   20691.50    \twoS   &   6.60        &   34.75       &   60.13       &   130.08      &   N/A &   N/A &   N/A &   N/A \\     \end{longtable}     \noindent {\em Notes:} The Jarque-Bera statistic tests the null hypothesis that the daily returns are normally distributed. The Ljung-Box statistic tests the null hypothesis that daily return residuals exhibit no autocorrelation for a fixed number of lags (L). The average dollar volume is the notional value of contracts for all maturity months traded on an average day, defined as: number of contracts traded x futures price x multiplier x exchange rate. There is no volume and open interest data for the currency futures because they were constructed as forwards from spot exchange rates and the country specific interest rate term structure (see further appendix). Volume and open interest data for contracts from the London Metals Exchange (LME) is only available from mid September 2005 onwards.      \noindent \begin{tabular}{  r @{\hspace{0.1cm}} l }       * & Indicate statistical significance at the 5\% level. \\       ** &  Indicate statistical significance at the 1\% level. \\     \end{tabular}     \thispagestyle{empty}     \end{landscape}     \restoregeometry     \end{document}


title: Writing multiplication dots

text: I try to write a multiplication dot and use `\cdot`, `4 = 2/cdot{2}`. But I get the error message `Missing $ inserted`. What have I forgotten?


title: How to get `psfragfig` with sibling or super directories on windows?

text: Assume the following simple latex with some .eps file `testeps.eps` in the: same directory, the parent directory, and a subdirectory called `testsub`.               \documentclass{article}     \usepackage{pstool}     \begin{document}         \psfragfig*[width=15cm]{testeps} {}         \psfragfig*[width=15cm]{testsub/testeps} {}         \psfragfig*[width=15cm]{../testeps} {}     \end{document}      The first two work fine, the last says:               "I can't write on file `../testeps-pstool.tex'}     "Emergency stop }     No file "../testeps.tex" or "../testeps-psfrag"      I am using miktex on Windows with something like the following for my PdfLaTex (in TeXstudio, but I don't think that matters).               pdflatex.exe" -shell-escape -synctex=1 --aux-directory=C:\Windows\Temp  -interaction=nonstopmode %.tex      I have tried every permutation of `-shell-escape` and write18 I could find. Of course, I used to use `\graphicspath` before I converted to psfragfig, but it isn't compatible?


title: Removing border from last column

text: I have a simple table:               \begin{table}[htbp]         \centering         \begin{tabular}{|c|c|c|}             \hline             X & Y & Z \\ \hline             &   &   \\ \hline              &   &   \\ \hline             &   &   \\              \hline         \end{tabular}     \end{table}      I would like to remove the border from all cells in the last column `Z`. Is this possible by any chance?


title: Footer on last page

text: I begin with LaTeX and use `fancyhdr`. So I've got a sweet footer for all my pages but...I'd like to create one another which would be active on last page only. This footer will contain my informations and perhaps, some copyrights on my document. It will be as wide as my page width, like the footer of these several pages :   * http://www.mobilibook.com/   * http://www.centre-equestre-dupin.fr/ A colored band which can be modified easily... Is this possible ? Can you help me please ?


title: multicolumn long table or enumeration

text: I would like to generate a multi-column table that wraps within columns of the document, and splits across pages. There are a couple of similar questions here How do I create a really long table in a two column layout? Two-column longtable or tabular But neither seem really to resolve the problem. Criteria: The table/list will be generated with a loop, with an arbitrary number of rows. It should split over pages. It should be usable in a multicols environment. The closest solution seems to be to use a list instead of a table, but this has the problem of lining up the top rows when the list is wrapped in a multicols environment. Below is a sample document:               \documentclass[12pt]{article}     \usepackage[margin=1in]{geometry}     \usepackage{xcolor,array}     \usepackage{multicol}     \usepackage{ifthen,enumitem}     \def\stnum{30} % number of items     \newcolumntype{C}{>{\centering}p{.5in}}          \setlist{nolistsep}     \pagestyle{empty}     \begin{document}          \enlargethispage{3\baselineskip}     \begin{multicols*}{2}     \begin{enumerate}[label={\bfseries\arabic*.\qquad},leftmargin=1.3in]     \item[Item \#]     \whiledo{\value{enumi}<\stnum}{     \item \begin{tabular}{CC}T & F\end{tabular}     \item[]{\color{black!20}\rule{1.5in}{3ex}}     }     \end{enumerate}     \end{multicols*}     \end{document}      The main problem is how to line up the rows properly (as if this were a table.) A secondary problem would be to have the equivalent of a repeated column header when the columns wrap. Here's a partial picture of the output of the document above: ![output of code](http://i.stack.imgur.com/KDgj7.png)


title: Classic thesis margins macro

text: Why if I use the `\documentclass{book}` for examples, the following code work, and if i use `classicthesis` i get errors? Sorry for the lenght, but this is the MWE. In the example the `\textwidth` founded, don't is applied, so I don't think that the stuff related to the margins are implicated in the errors. The problem is with the .aux file for me. * * *               \documentclass{scrreprt}          \usepackage[%                pdfspacing,%                linedheaders,%                ]{classicthesis}                  \usepackage{pgf}             \usepackage{xparse}             \usepackage{siunitx}             \usepackage{environ}             \usepackage{booktabs}             \usepackage{amsmath,amssymb,amsthm,amsfonts}          % 1 comment this: \input{\nameofthisfile.aux} line     % 2 compile     % 3 uncomment this: \input{\nameofthisfile.aux} line     % 4 compile          %                                    put here the name of this .tex file             \newcommand{\nameofthisfile}{testing}          \ExplSyntaxOn          \bool_new:N \g_has_run_bool     \tl_new:N \l_aw_text_tl     \int_new:N \l_aw_tot_int     \int_new:N \g_aw_tot_alph_int     \int_new:N \g_wid_space_int     \int_new:N \g_space_int     \fp_new:N \g_rat_space_int     \fp_new:N \g_aw_avg_width_fp     \dim_new:N \myalphabetwidth     \dim_new:N \mytextwidth     \input{\nameofthisfile.aux} %                                                           THIS LINE     \tl_const:Nn \c_aw_the_alphabet_tl {abcdefghijklmnopqrstuvwxyz}          % this can be changed to an evironment or renamed or whatever     \NewDocumentCommand {\avgwidthstart} {}       {         \aw_avg_width:w       }          \NewDocumentCommand {\avgwidthend}{}{}          % Here is the environment version, using just "text" as a name is probably a bad idea.     \NewEnviron{avgtext}     {       \expandafter\avgwidthstart\BODY\avgwidthend     }          \makeatletter          \cs_new:Npn \aw_avg_width:w #1 \avgwidthend       {         % if first run, then generate variables to be used         \bool_if:NF \g_has_run_bool           {             \tl_map_inline:Nn \c_aw_the_alphabet_tl             {               \int_new:c {g_##1_int}               \fp_new:c {g_rat_##1_fp}               \fp_new:c {g_wid_##1_fp}             }           }         \tl_set:Nn \l_aw_text_tl {#1}              % this can be used rather than the preceding line to take capital          % letters into account, but is Slooooooow         %\tl_set:Nx \l_aw_text_tl {\tl_expandable_lowercase:n {#1}}              \int_set:Nn \l_aw_tot_int {\tl_count:N \l_aw_text_tl}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_get_counts:n         \deal_with_spaces:n {#1}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_ratios:n         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_avg_width:n         \fp_gset_eq:NN \g_aw_avg_width_fp \l_tmpa_fp         \fp_zero:N \l_tmpa_fp              % the dimension \myalphabetwidth gives the width of the alphabet based on your character freq,         % can be accessed by \the\myalphabetwidth         \dim_gset:Nn \myalphabetwidth {\fp_to_dim:n {\fp_eval:n {26*\g_aw_avg_width_fp}}}              % the dimension \mytextwidth gives the recommended \textwidth based on 66 chars per line.         % can be accessed by \the\mytextwidth         \dim_gset:Nn \mytextwidth {\fp_to_dim:n {\fp_eval:n {66*\g_aw_avg_width_fp}}}         \protected@write\@mainaux{}{\mytextwidth=\the\mytextwidth}         \bool_gset_true:N \g_has_run_bool              % and lastly print the content         #1       }          \makeatother          \cs_new:Npn \aw_get_counts:n #1       {         % make a temporary token list from the document body          \tl_set_eq:NN \l_tmpb_tl \l_aw_text_tl         % remove all occurrences of the character         \tl_remove_all:Nn \l_tmpb_tl {#1}         % add to appropriate int the number of occurrences of that character in current block         \int_set:Nn \l_tmpa_int {\int_eval:n{\l_aw_tot_int -\tl_count:N \l_tmpb_tl}}         % add to appropriate int the number of occurrences of that character in current block         \int_gadd:cn {g_#1_int} {\l_tmpa_int}         % add this to the total         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}       }          \cs_new:Npn \deal_with_spaces:n #1       {         \tl_set:Nn \l_tmpa_tl {#1}         % rescan body with spaces as characters         \tl_set_rescan:Nnn \l_tmpb_tl {\char_set_catcode_letter:N \ }{#1}         % find number of new characters introduced.  add to number of spaces and alph chars         \int_set:Nn \l_tmpa_int {\tl_count:N \l_tmpb_tl -\tl_count:N \l_tmpa_tl}         \int_gadd:Nn \g_space_int {\l_tmpa_int}         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}         % since this comes after the rest of chars are dealt with, tot_alph is final total         \fp_set:Nn \g_rat_space_fp {\g_space_int/\g_aw_tot_alph_int}         % get width of space and use it.  obviously space is stretchable, so i'll assume         % that the expansions and contractions cancel one another over large text.  is this         % a terrible assumption???         \hbox_set:Nn \l_tmpa_box {\ }         \fp_gset:Nn \g_wid_space_fp {\dim_to_fp:n {\box_wd:N \l_tmpa_box}}         \fp_add:Nn \l_tmpa_fp {\g_wid_space_fp*\g_rat_space_fp}       }          \cs_new:Npn \aw_calc_ratios:n #1       {         % divide number of occurrences of char by total alphabetic chars         \fp_gset:cn {g_rat_#1_fp}{{\int_use:c {g_#1_int}}/\g_aw_tot_alph_int}       }          \cs_new:Npn \aw_calc_avg_width:n #1       {         % only need to find char widths once         \bool_if:NF \g_has_run_bool           {             % find width of char box             \hbox_set:Nn \l_tmpa_box {#1}             \fp_gset:cn {g_wid_#1_fp}{\dim_to_fp:n {\box_wd:N \l_tmpa_box}}           }         % multiply it by char frequency and add to avg width         \fp_add:Nn \l_tmpa_fp {{\fp_use:c {g_wid_#1_fp}}*{\fp_use:c {g_rat_#1_fp}}}       }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % This part is just for fun. Delete it and the showtable command from the document if     % it isn't wanted         \newlength{\alphabet}%         \settowidth{\alphabet}{\normalfont abcdefghijklmnopqrstuvwxyz}%     \tl_new:N \l_aw_tab_rows_tl     \seq_new:N \g_aw_theor_rats_seq     \seq_new:N \g_aw_the_alphabet_seq          \seq_gset_split:Nnn \g_aw_theor_rats_seq {,}     {0.0651738,0.0124248,0.0217339,0.0349835,0.1041442,0.0197881,0.0158610,0.0492888,0.0558094,0.0009033,0.0050529,0.0331490,0.0202124,0.0564513,0.0596302,0.0137645,0.0008606,0.0497563,0.0515760,0.0729357,0.0225134,0.0082903,0.0171272,0.0013692,0.0145984,0.0007836,0.1918182}          \NewDocumentCommand {\showtable}{}         {           \clearpage           \aw_make_table:         }          \cs_generate_variant:Nn \seq_set_split:Nnn {NnV}     \cs_new:Npn \aw_make_table:         {           \thispagestyle{empty}           \seq_set_split:NnV \g_aw_the_alphabet_seq {} \c_aw_the_alphabet_tl           %takes corresponding letter/theoretical ratio pairs from sequences and applies function           \seq_mapthread_function:NNN \g_aw_the_alphabet_seq \g_aw_theor_rats_seq \aw_generate_row:nn           \begin{center}             Total\,characters\,=\,\fp_eval:n {\g_aw_tot_alph_int}           \end{center}           \begin{table}[h]           \centering           \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{llll}             \toprule             {Average\,\texttt{\textbackslash textwidth}}&{Average\,character\,width}&{Average\,alphabet\,width}&{Alphabet\,width}\\             \midrule             \the\mytextwidth&\fp_eval:n {round(\g_aw_avg_width_fp,5)}pt&\the\myalphabetwidth&\the\alphabet\\             \bottomrule           \end{tabular}\par           \end{table}           \vfil           \begin{equation*}           \begin{split}           \,\texttt{\textbackslash textwidth}&=\frac{\fp_eval:n {\g_aw_tot_alph_int}\cdot \fp_eval:n {round(\g_aw_avg_width_fp,5)}\mathrm{pt}}{\fp_eval:n {\g_aw_tot_alph_int}/66}=\fp_eval:n {\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/({\g_aw_tot_alph_int}/66)}\mathrm{pt}\\           \\1           \mathrm{Total\,line\,type}&=\frac{\fp_eval:n {\g_aw_tot_alph_int}\cdot \fp_eval:n {round(\g_aw_avg_width_fp,5)}\mathrm{pt}}{\fp_eval:n {\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/({\g_aw_tot_alph_int}/66)}\mathrm{pt}}=\fp_eval:n {\g_aw_tot_alph_int/66}\\           \\           \mathrm{Characters\,for\,line\,type}&=\frac{\fp_eval:n {round(\g_aw_avg_width_fp,5)}\mathrm{pt}}{\fp_eval:n {\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/({\g_aw_tot_alph_int}/66)}\mathrm{pt}}=\fp_eval:n {\fp_eval:n {(\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/({\g_aw_tot_alph_int}/66))/round(\g_aw_avg_width_fp,5)}}           \end{split}           \end{equation*}           \vfil           \begin{table}[h]           \centering           \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{cSSS}             \toprule             {Letter}&{Actual}&{Theoretical}&{Difference}\\             \midrule             spaces&\fp_eval:n {\g_rat_space_fp*100}\%&19.18182\%&\fp_eval:n {{\g_rat_space_fp*100-19.18182}}\%\\             \tl_use:N \l_aw_tab_rows_tl             \bottomrule           \end{tabular}\par           \end{table}         }          \cs_new:Npn \aw_generate_row:nn #1#2         {           \tl_put_right:Nn \l_aw_tab_rows_tl {#1&}           \tl_put_right:Nx \l_aw_tab_rows_tl {\fp_eval:n {100*{\fp_use:c {g_rat_#1_fp}}}\%&}           \tl_put_right:Nn \l_aw_tab_rows_tl {\fp_eval:n{100*{#2}}\%&}           \tl_put_right:Nx \l_aw_tab_rows_tl {\fp_eval:n {{\fp_use:c {g_rat_#1_fp}*100-\fp_eval:n {#2}*100}}\%}           \tl_put_right:Nn \l_aw_tab_rows_tl {\\}         }          \ExplSyntaxOff                    \begin{document}          \avgwidthstart     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean faucibus luctus diam, id convallis mauris faucibus ut. Aenean accumsan dignissim posuere. Praesent et diam nec est lobortis faucibus. Fusce sit amet placerat velit. Curabitur tortor velit, imperdiet imperdiet condimentum in, blandit ac augue. In vulputate volutpat ligula, malesuada porta mi eleifend at. Praesent ut augue vel nulla molestie ornare ac a sem. Donec luctus volutpat ipsum sed consectetur. Maecenas at lacus a tortor congue blandit. Vestibulum elementum risus dapibus sem blandit adipiscing. Pellentesque vulputate ullamcorper vulputate. In suscipit facilisis libero.     \avgwidthend          \showtable{}          \end{document}


title: Positioning of rotated nodes in a matrix

text: I'm trying to create a tikz drawing similar to this picture: ![The desired result](http://i.stack.imgur.com/tNNIH.png) In the code below I have used matrix nodes for both of the "parts" but I can't get the phases (in the picture above the rectangles with text going upwards) to align properly. They are rotated nodes (so the text is pointing upwards) What I'd like to achieve an where I seek your advice:   * Both "parts" should be of equal height (but they are not of equal width, they contain different numbers of phases)   * The height of the parts are determined by the height of the highest phase   * All phases should be of equal height   * I'm using beamer, so anything should be compatible to beamer   * I do not insist on using `matrix` or `rounded corners` although the latter would be nice to have.   * Any suggestion on how to reduce the space between the brace an the description node would be nice (I tried all sort of `inner sep`, `outer sep` and `node distance` but nothing seemed to help. Thanks. * * *               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{matrix,positioning,decorations.pathreplacing}     \begin{document}     \begin{tikzpicture}     \tikzstyle{phase}=[draw,fill=white,rotate=90,sloped];     \tikzstyle{every matrix}=[ampersand replacement={\&}];         \matrix (xA)[matrix anchor=east,draw,rounded corners,fill=blue!20]         {%              \node (title1) {First Part}; \\             \node[phase](phase1_1){Short Name}; \&             \node[phase](phase1_2){Longer Name}; \&             \node[phase](phase1_3){Even longer name}; \&             \node[phase](phase1_4){VSN}; \&             \node[phase](phase1_5){Last phase name}; \\         };              \matrix(xB)[matrix anchor=west,draw,rounded corners,fill=red!20]         {             \node (title2) {Second Part}; \\             \node[phase](phase2_a){Name}; \&             \node[phase](phase2_b){Another name}; \&             \node[phase](phase2_c){Another another name}; \&             \node[phase](phase2_d){Different name}; \&             \node[phase](phase2_e){Name other than others}; \&             \node[phase](phase2_f){Name of last phase}; \\         };     \draw[decorate,decoration={brace,raise=1ex}] (xB.north west) -- ( xB.north east);     \node(description)[above=of xB.north]{Description over brace};          \end{tikzpicture}     \end{document}      * * * ![What I got up to now](http://i.stack.imgur.com/Wt2YE.png)


title: How to make table with rotated table headers in LaTeX

text: I saw a table created in PowerPoint and wanted to know how to do it in LaTeX. The table is shown below. The aspects of the table that I'm most interested in are the rotated table headers as well as `Knowledge Areas` and `Process` labels outside the table. ![screenshot](http://i.stack.imgur.com/70vj2.png) Here is what I've come up with so far after seeing Rotated column titles in tabular suggested in the comments (thanks!)                   \documentclass{article}     \usepackage{adjustbox}     \usepackage{array}     \usepackage{booktabs}     \usepackage{multirow}          \newcolumntype{R}[2]{%         >{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%         l%         <{\egroup}%     }     \newcommand*\rot{\multicolumn{1}{R{90}{1em}}}% no optional argument here, please!          \begin{document}          \begin{table} \centering         \begin{tabular}{clcccccccccc}             & & \multicolumn{10}{c}{Knowledge Areas} \\             & & \rot{Integration} & \rot{Scope} & \rot{Time} & \rot{Cost}              & \rot{Quality} & \rot{Human Resource} & \rot{Communication}              & \rot{Risk} & \rot{Procurement} & \rot{Stakeholder Management} \\             \midrule             \multirow{5}{*}{{Processes}}             & Initiating             & * &   &   &   &   &   & * &   &   & * \\             & Planning               & * & * & * & * & * & * & * & * & * & * \\             & Executing              & * &   &   &   & * & * & * &   & * & * \\             & Monitoring and Control & * & * & * & * & * &   & * & * & * & * \\             & Closing                & * &   &   &   &   &   & * &   & * & * \\             \bottomrule         \end{tabular}         \caption{Some caption}     \end{table}          \end{document}      With the result looking like: ![enter image description here](http://i.stack.imgur.com/7xIA0.png) I'm not so concerned about the row coloring (sorry, should have mentioned that before). There are just a few things I don't know how to do:   1. How can I make `Stakeholder Management` stack on top of each other?   2. How can I rotate `Processes` on the left-hand side? The `\rot` command I used in the table header didn't work, presumably because it is in the `\multirow` command.


title: Reference with natbib

text: I have tried the natbib with the following basic commands               \usepackage[round]{natbib}     \bibliographystyle{plainnat}          document \citet{Ama12} with Ama12 as a cite key in my bib file Andlib.bib          \bibilography{Andlib.bib}      I get the report:               package natbib error:Bibliography not compatible with Author-year citations...Mand\NAT@FORCE@numbers{}\NAT@force@numbers      How can I overcome this problem such that my document can compile with quickbuild?


title: Setting English font size in non-English documents in XeLatex

text: Consider a non-English document compiled in XeLatex, the standard font size is equal for all English and non-English text. How is it possible to set the size of the English text and change the font face?


title: Vertical spacing of chapters numbers in ClassicThesis

text: I would to remove the upper line in chapters titles provided from the lineheaders option of `classicthesis`. I want to know if the vertical spacing of the chapters numbers is correct also if I have removed that line.               \documentclass{scrreprt}          \usepackage[%                eulerchapternumbers,                pdfspacing,%                linedheaders,%                ]{classicthesis}                   \newcommand*{\titlevspace}[1]{\vspace*{\dimexpr #1\textheight - 1\baselineskip \relax}}              % chapters         \ifthenelse{\boolean{@linedheaders}}%         {% lines above and below, number right         \titleformat{\chapter}[display]%                          {\titlevspace{.2125}}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}%             {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%         \titleformat{name=\chapter,numberless}[display]%             {\relax}{}{0pt}%             {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%         }              % spacing              \titlespacing*{\chapter}{0pt}{1\baselineskip}{2.4\baselineskip}                    \begin{document}          \chapter{Dolor}          \end{document}      * * * in this line the `\\\` at the end, should be maintained?                 {\titlevspace{.2125}}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}%      or the titles look better with this settings?                 {\titlevspace{.2125}}{\raggedleft{\color{halfgray}\chapterNumber\thechapter}}{0pt}%


title: Latex align error?

text: Why does the following code give me this error?:               "Extra } or forgotten \right)"      I have been through it and cannot work out why.               \begin{align}     C(t,xxx,\tau,N,X)&=N\Phi\sum_{i=1}^{n}\left[-(1+X_{\tau_{i}})P(t,T_{i})\left(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}}P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\right)\\     &+P(t,T_{i-1})[\left(\frac{\ln\frac{P(t,T_{i-1})}{(1+X_{\tau_{i}})P(t,T_{i})}}{\Sigma(t,T_{i-1},T_{i})}-\frac{1}{2}\Sigma(t,T_{i-1},T_{i})\right)\right]     \end{align}


title: The character ə in Plain TeX?

text: I'm part of a writing group and we are using **Plain TeX** (well, pdfTeX). Currently I need to write the symbol ə ("schwa"?), but I have no clue how to do this.


title: Display ICs with circuitikz

text: How can I represent a IC using circuitikz? I'm thinking of something like this: ![example](http://i.stack.imgur.com/ZBfdn.png) I checked the whole manual and searched this information on google, but found nothing. It's hard to believe that no one ever needed this before... One simple example of a document with regular components would be this:               \documentclass{article}     \usepackage[symbols]{circuitikz}     \usepackage{tikz}     \begin{document}          \begin{circuitikz} \draw      (0,0) to[C, l=$10\micro\farad$] (0,2) -- (0,3)       to[R, l=$2.2\kilo\ohm$] (4,3) -- (4,2)       to[L, l=$12\milli\henry$, i=$i_1$] (4,0) -- (0,0)      (4,2) to[D*, *-*] (2,0) to [D*, -*] (0,2)       to[R, l=$1\kilo\ohm$] (2,2)   to[cV, v=$0.3\kilo\ohm i_1$] (4,2)      (2,0) to[I, i=$1\milli\ampere$:15, -*] (2,2)     ;     \end{circuitikz}          \end{document}      However, I could find any way to include a IC image.


title: How can I use BibTeX to cite a web page?

text: I'm looking to cite a number of web pages using bibtex and I was wondering if there was a specific template of the form `@<template name here>` for doing that. If you could use the following website as an example that would be great http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm


title: How do I cite an online book?

text: > **Possible Duplicate:**   >  How can I use BibTeX to cite a web page? I want to cite this book: http://www.sce.carleton.ca/faculty/chinneck/po.html Here's the citation I was given as an example:               @Book{knuth:84,       author =   {Donald E. Knuth},       title =    {The {\TeX} Book},       publisher =    {Addison-Wesley},       year =     {1984},       edition =      {15th}     }      There is no publisher, no year, no edition etc. Should I do it like this ( How can I use BibTeX to cite a web page? ) ?


title: How to cite a URL in LaTeX?

text: > **Possible Duplicate:**   >  How can I use BibTeX to cite a web page? What is the standard method for citing a URL in LaTeX and having it in the bibliography?


title: Automatically convert colored PGFPlots in the appendix to grayscale

text: My document contains a lot of colored PGFPlots, which are generated from external data files. In order to save costs when printing, I would like to automatically convert the color of every PGFPlot in the appendix to grayscale, so that I can switch around graphics from the body part and the appendix with the color adjusting automatically. I found a couple of posts on how to automatically convert PDFs or included graphics to grayscale, but sadly no information on how to do the same with PGFPlots. In order to indicate what I mean, I have prepared a comparably long MWE, which is quite close to my real code: **mwe.tex** :               \documentclass[12pt,a4paper]{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[usenames,dvipsnames,svgnames,x11names]{xcolor}     \usepackage{pgfplots}     \usepgfplotslibrary{groupplots}     \pgfplotsset{compat=1.9}          \usepackage{adjustbox}     \usepackage{float}     \floatstyle{boxed}     \restylefloat{figure}     \floatplacement{figure}{htb!}     \usepackage{placeins}          \usepackage{lipsum}          \begin{document}         \section{Introduction}         \lipsum[1]              \section{Body}         \lipsum[2]              \begin{figure}             \begin{adjustbox}{max width=\textwidth,max height=\textheight}                 \begin{tikzpicture}                     \begin{groupplot}[ybar=0pt,/pgf/bar width=1,ymin=0,xmin=0.5,xmax=5.5,width=\textwidth,group style={group size=1 by 2,xticklabels at=edge bottom,yticklabels at=edge left,vertical sep=18pt},ylabel style={rotate=-90,text width=1.8cm,align=right},axis x line*=left,point meta=explicit symbolic,every node near coord/.append style={font=\small},nodes near coords={\ifnum\pgfplotspointmeta>0 \pgfplotspointmeta\fi},cycle list={fill=gray!50,draw=black}]                     \nextgroupplot [ymax=14,y=1.5mm,try min ticks=2,ylabel={Foo's Bar'ed}]                     \addplot +[fill=green!50] table [y index=1, meta index=1] {mwe.dat};                     \nextgroupplot [ymax=14,y=1.5mm,try min ticks=2,ylabel={Bar's Foo'ed}]                     \addplot +[fill=orange!50] table [y index=2, meta index=2] {mwe.dat};                     \end{groupplot}                 \end{tikzpicture}             \end{adjustbox}             \caption{Colored Figure}         \end{figure}              \lipsum[3]         \FloatBarrier              \section{Appendix}         \lipsum[4]              \begin{figure}             \begin{adjustbox}{max width=\textwidth,max height=\textheight}                 \begin{tikzpicture}                     \begin{groupplot}[ybar=0pt,/pgf/bar width=1,ymin=0,xmin=0.5,xmax=5.5,width=\textwidth,group style={group size=1 by 2,xticklabels at=edge bottom,yticklabels at=edge left,vertical sep=18pt},ylabel style={rotate=-90,text width=1.8cm,align=right},axis x line*=left,point meta=explicit symbolic,every node near coord/.append style={font=\small},nodes near coords={\ifnum\pgfplotspointmeta>0 \pgfplotspointmeta\fi},cycle list={fill=gray!50,draw=black}]                     \nextgroupplot [ymax=14,y=1.5mm,try min ticks=2,ylabel={Foo's Bar'ed}]                     \addplot +[fill=green!50] table [y index=1, meta index=1] {mwe.dat};                     \nextgroupplot [ymax=14,y=1.5mm,try min ticks=2,ylabel={Bar's Foo'ed}]                     \addplot +[fill=orange!50] table [y index=2, meta index=2] {mwe.dat};                     \end{groupplot}                 \end{tikzpicture}             \end{adjustbox}             \caption{Grayscale Figure}         \end{figure}     \end{document}      **mwe.dat** :               Day FooBar BarFoo      1   2      1           2   1      0           3   1      0           4   3      1           5   5      1              ![Screenshot of MWE Page 1](http://i.stack.imgur.com/LwKy8.png) ![Screenshot of MWE Page 2](http://i.stack.imgur.com/QFFW4.png)


title: How to remove an unwanted white space at the last end of a horizontal curly brace?

text: You can see there is an unwanted white space at the last term below. ![enter image description here](http://i.stack.imgur.com/FUU1r.png)               \documentclass[border=12pt]{standalone}     \usepackage{amsmath}     \begin{document}     $     \lefteqn{\textstyle\overbrace{\phantom{1+2+3+4}}^{\alpha}}1+2+         \underbrace{3+4+             \lefteqn{\textstyle\overbrace{\phantom{5+6+7}}^{\beta}}5+6}_{\gamma}+7     $     \end{document}      What causes the white space? And how to remove it?


title: Sub-enumeration with the same font size in beamer

text: I have a `beamer` slide with a several recursive sub-enumerations, e.g.:               \begin{enumerate}       \item Do A       \begin{enumerate}          \item Have B          \item Load C          \item Backup D          \begin{enumerate}            \item Connect to E            \item Transfer F          \end{enumerate}       \end{enumerate}       \item \ldots     \end{enumerate}      `beamer`'s default rendering is to make the font smaller for each extra level of indentation. How can I keep all the fonts with the same size, also, preferably, large size?


title: How do I alternate images and only have captions for the first one?

text: I'm trying to create an itemized list with alternating images in `beamer`. I've got the list part and the images to work, but things break down when I try to add captions. Basically, I only want to caption the first image. Whenever I try to do only that one, the captions show up onto the later images as well. I read the post: How do I alternate graphics in LaTeX beamer and was able to improve things, but the workaround was to add captions to the latter images, which I didn't want to do. Without captioning them the original caption would hang around, and sometimes the images would be shifted downward. Here is the code I've got right now: (please forgive me if it looks bumbly, I'm new at this)               \documentclass{beamer}     \usepackage{beamerthemeshadow}     \usepackage{graphicx}     \setbeamertemplate{caption}[]      \begin{document}     \frame{     \begin{columns}     \begin{column}{5cm}     \begin{itemize}     \item<1-> founded en el a\~{n}o de      \item<2-> populaci\'{o}n de m\'{a}s de 5000 personas     \item<3-> Hay un colegio de aproximamente 500 estudiantes     \end{itemize}     \vspace{1cm}      \end{column}     \begin{column}{8cm}     \begin{figure}      \includegraphics<1>[scale=0.25]{downtown}      \def\figurename{Image}     \caption{\only<1>{Foto por }\only<2>{Lago Flor}\only<3>{Colegio de Saranac Lake}}     \begin{center}     \includegraphics<2>[scale=0.5]{lakeflower}     \end{center}     \includegraphics<3>[scale=.21]{slhs}     \end{figure}     \end{column}     \end{columns}}     \end{document}      I've tried using only `\only<1>` but the same caption shows up when the later images appear. I played with `\onslide` a bit but didn't have any success. I tried making the later images their own figures, but that didn't solve it either. I'm using Texmaker with the embedded PDF viewer, though I've opened the output in an external viewer and it looks the same. I'm using the `pdflatex` mode. If anyone has an idea about this I would love to hear it. I feel like I'm missing something elemental that would make this work. I can always just duplicate the slide and get around this problem, but I feel like there must be a better way.


title: How do I add a line break in display math mode?

text: For instance, how do I add a break after the first line in               \[         a + b = c // what should I add here?         a = c - b     \]


title: Ensuring correct LaTeX compilation on different systems

text: I'm currently writing a document collaboratively and I need to make sure that the compilation is executed correctly on every possible system (e.g., that the document encoding - UTF-8 - is detected by most editors - if not all - the .tex file is opened in, that all packages are found during compilation, and so on). The final version of the LaTeX document will be compiled by other people, and I don't know which TeX distribution, platforms and editors will be used; for this reason, I'm in search of a general solution to the problem. What are the current best practices to achieve this goal? At present, I've thought about:   * inserting appropriate modelines into the preamble (like the TeXShop one `% !TEX encoding = UTF-8`) to solve the encoding problem, and   * using the `snapshot` package to get a list of all required dependencies and putting them along my LaTeX file in the RCS I'm using. Are there other points I'm missing?


title: Using organization in biblatex authortitle style

text: I am using `biblatex` with the `authortitle`-style and showing the references in footnotes using `\autocite`. I use `@manual` for some of my bib-entries because they don't have an author or don't specify one. How can I change the content of the footnote to show the author if available and fall back to the organization otherwise?


title: Error: The program miktex-pdftex.exe was not found!

text: My TeXworks doesn't let me compile my documents anymore due to the error: `The program miktex-pdftex.exe was not found!`: ![Texworks-error-message](http://i.stack.imgur.com/ytt8c.jpg) It is OK in TeXnicCenter but not here. I looked up the net to download the missing part, but couldn't find it. Any thoughts?


title: How to reduce the size of fractions typed in align environment?

text: When digit fractions align environment, this goes with a size `\displaystyle`. But I want the size is like the one shown in a paragraph. I tried with `\scriptstyle` but I get letters too small and the `\small` command not working under `align` environment. What I can do? Here I put a screenshot, lines down, to further clarify this idea and my question. Thanks in advance.               \documentclass{article}     \usepackage{showframe}     \usepackage{mathtools,amsmath}     \usepackage{amsthm}     \begin{document}          \begin{align*}     \rightarrow \quad &x=3,\frac{10}{3},\frac{11}{3}.   \tag{1}\\     \end{align*}     This is a text in paragraph: $\textrm{C.S}=\{3,\frac{10}{3},\frac{11}{3}.\}$          \end{document}       ![my screenshot](http://i.stack.imgur.com/h9sq5.jpg)


title: Error Filling Between Curves in Tikz

text: I'm trying to shade the region bounded by y=x^2, y=exp(-x), and the y-axis (in the first quadrant). This is the code I have so far:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \thispagestyle{empty}     \begin{tikzpicture}     \draw[very thin,color=gray,step=.5cm,dashed] (-0.5,-.5) grid (3,4);     \draw[->] (-1,0) -- (3.5,0) node[below right] {$x$};     \draw[->] (0,-1) -- (0,4.5) node[left] {$y$};     \draw [->,samples=100,domain=0:2] plot(\x,{(\x)^2});     \draw [->,samples=100,domain=-0.5:2] plot(\x,{exp(-1*(\x))});     \draw [fill=gray,fill opacity=0.2] {[smooth,samples=100,domain=0:0.70346] plot(\x,{exp(-1*(\x))}) } -- {[smooth,samples=100,domain=0.70346:0] plot(\x,{(\x)^2})};     \end{tikzpicture}     \end{document}      I'm getting a strange line going from the point of intersection to the origin, also an error about not being able to parse this coordinate. What am I doing wrong?


title: Math application/library that uses LaTeX?

text: I don't want to re-invent the wheel here, and I know that there are a lot of good math libraries out there for all sorts of things; what I'm wondering is if there's one that generates its answers in LaTex? (Could be any sort of TeX; I'm not really familiar with which ones are used for what) Well, it could look like anything (just linear algebra, just calculus, just physics or chemistry, etc.) but it would be nice if it were an application with its own GUI that generates copy-and-paste LaTex code from different inputs and a whole set of operations at the user's disposal. It doesn't have to be that great, though. I wouldn't mind coding this myself, but before I embark, I'd like to see what my options are so that I know where to start.


title: Roman numbers on annexes

text: I'd like to have roman numbered annexes like this: 1 First Section 2 Second Section 3 Final Section Bibliography Annexes I First Annex II Second Annex III Third Annex IV Fourth Annex I'm guessing I should do something like               \setcounter{section}{1}     \renewcommand\thesection{\Roman{section}}     \section*{Annexes}          \subsection{First Annex}      but how can I remove the section number and leave only the subsection number with a roman numeral?


title: Plot X-Axis: Make xticklabels cover a fixed range of bins?

text: I am using a tikzpicture plot. I have around 50 bins in my plot. The bins belong to two groups of data sets. I want to add 2 labels for the x-axis. The first one should cover bins 1-25 and the second one bin 26 to 50. Can I somehow define two labels with the xlabel or xticklabel parameter and tell them to center themselves in a bin-range? I tried to draw the x-axis labels by hand, but apparently I can't draw in the negative area of a plot? I tried it like this: `\filldraw[fill=blue] (9.1, -5) rectangle (15.9, -9);` The screenshot shows how its supposed to look. There are two descending dataset groups, the first one is labeled Dataset A, the second one Dataset B. If it would 20 bins each, the labels would (ideally) center themselves in the middle of their respective bin rage. If I can enter them hardcoded somehow it would be fine, too. ![enter image description here](http://i.stack.imgur.com/aUdOS.png) This is my minimal-working example of what I got so far:               \documentclass{article}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{relsize}     \usepackage{times}     \usepackage{url}     \usepackage{latexsym}     \usepackage{graphicx}     \usepackage{colortbl}     \usepackage{color}     \usepackage{caption}     \usepackage{pgfplots, pgfplotstable}     \usetikzlibrary{arrows}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{booktabs}          \usepackage{filecontents}     \definecolor{OgAns}{rgb}{0, 0.8, 0.4}      \begin{filecontents}{testdata.dat}     3   30     1   44     4   26     2   39     5   90     6   80     7   80     8   50     \end{filecontents}          \begin{document}     \begin{figure}     \begin{tikzpicture}             \begin{axis}[                    ybar stacked,                 ymin=0,                 ymax=100,                 bar width=5pt,                 legend style={at={(0.35, -0.4)},anchor=south west},                 legend columns=-1                           ]               \addplot[ybar,fill=OgAns]  file {testdata.dat};              \end{axis}         \end{tikzpicture}     \end{figure}               \end{document}      Any hints or suggestions?


title: Need to left align referenced image in mdframed Info box

text: I have been successful at creating a set of Warning, Note, and Info boxes using mdframed package, and they look very good. However, I need to left align an inserted image rather than have it on its own line above the text, but below the frame title. In fact, this question (and excellent answers!) got me where I am now: Rounded box with image and text. However, I need to modify the resultant box as described in my first paragraph (image left aligned and text to the right, but with the frametitle above the image). Here is what I have so far (I hope it is MWE, as I am not sure how to reference an external image in this example):               \documentclass[a4paper,11pt]{article}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage{lipsum}% Used for dummy text.          \definecolor{warning}{RGB}{255,231,231}          % Definition for Warning Boxes                          \mdfdefinestyle{warn}{roundcorner=10pt,       skipabove=10pt       skipbelow=10pt       leftmargin=20pt,       rightmargin=20pt,       backgroundcolor=warning,       innertopmargin=10pt,       innerbottommargin=10pt,       innerleftmargin=10pt,       middlelinewidth=0pt,       everyline=true,f       linecolor=warnline,       font=\normalfont\normalsize,       shadow=true,       frametitlefont=\normalfont\normalsize\bfseries,       frametitleaboveskip=1em,     }                                \begin{document}          \begin{mdframed}[style=warn, frametitle=Warning]     \includegraphics[scale=0.50]{<path>/<icon>} \\ Important warning not to be missed.     \end{mdframed}          \end{document}      It is important also that I can insert this Warning note by a simple line such as               \begin{warning}     This is the warning text.     \end{warning}      Thanks in advance for your assistance.


title: A proxy command for deprecation

text: I'm interested in defining a macro to deprecate other macros. The system on which we are working goes through a lot of refactorings and is used by more than a couple people, so we want to be able to mark a command as deprecated before it is removed from the macros file entirely. Specifically, I'd like to generalize               \let\fooDeprecated\foo     \renewcommand{\foo}{\warn{Deprecated command used}\fooDeprecated}      or, for that matter, anything else that will work as a simple LaTeX proxy macro (in the design pattern sense of the word "proxy"). Unfortunately, I can't seem to figure out where to stick the `\expandafter` magic to make this work. That is,               \newcommand{\deprecate}[1]{%         \let\csname #1Deprecated\endcsname\csname #1\endcsname%         \renewcommand{\csname #1\endcsname}{\warn{Deprecated command used}\csname #1Deprecated\endcsname}%     }      clearly doesn't work. Is there a better way to do this? If not, how do I figure out how to expand these things? Thanks!


title: Enumerate in multicols how to move the last element upwards

text: Code:               \documentclass{article}     \usepackage[a5paper]{geometry}     \usepackage{multicol}     \setlength{\parindent}{0cm}     \begin{document}     \begin{multicols}{2}       \begin{enumerate}       \item text 1       \item text 2       \item text 3       \item text 4       \item text 5       \end{enumerate}     \end{multicols}     \end{document}      Gives this: ![enter image description here](http://i.stack.imgur.com/XzNYA.png) How to move "text 5" upwards adjacent to "text 4"?


title: Tabular in dtx documentation

text: How to make table in `.dtx` documentation with vertical bars?               % \begin{tabular}{c|c}     %   |sf| & \emph{mathsf}\\     % \end{tabular}      fails, because `|foo|` is magic for verbatim.


title: friggeri CV biblatex problem?

text: I am trying to compile the cv template given here I am using ubuntu 13.04, TeXStudio 2.5.2 and TeXLive 2012. I set up texstudio to use `biber` to compile the `biblatex` entries and also modified the code provided by friggeri to use `biber` as the backend with the following code:               \RequirePackage[style=verbose, maxnames=99, sorting=ydnt, backend=biber]{biblatex}      However, I get the following error message: > Line 120: Package keyval Error: sorting undefined ...rticle}{article in > peer-reviewed journal} and as I try using this template to learn latex programming (I would like to make my own CV template) I am not able to find the mistake. I already googled quite a lot but was unable to find any solution to my problem


title: Bug with smooth style and \closedcycle in PGFPlots

text: Could you please confirm the bug?               \documentclass{standalone}     \usepackage{tikz,pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[axis lines=middle,xmin=0,ymin=0]     \addplot[fill,opacity=0.5,cyan,domain=0:5,smooth] % smooth breaks \closedcycle       {1/x} \closedcycle;     \draw[-latex] (axis cs:3,2) node[label=above:Oops!] {} --       (axis cs:4.9,0.15) node[circle,draw=red,dashed,inner sep=5pt] {};     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/ho7OG.png) Related: Pgfplots \closedcycle introduces unwanted slope


title: Is the longtable enviroment limited? I have a several pages long table

text: I am writing a long table with several complex things inside. When I realized I needed a multiple page table I tried to change `table` to `longtable`, but it just gives me a lot of errors. How can I achieve to get a multiple page table? code with normal table:               \documentclass[12pt,a4paper,final]{report}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}          \usepackage{booktabs}     \usepackage[table]{xcolor}          \usepackage{listings}     \colorlet{listingscolor}{black!15}     \lstnewenvironment{mylistings}       {\lstset{language=C++,         backgroundcolor=\color{listingscolor}, % set backgroundcolor         basicstyle=\footnotesize,% basic font setting         }%       }       {}          \lstnewenvironment{cpptable}       {\lstset{language=C++,         basicstyle=\footnotesize,% basic font setting         }%       }       {}               \begin{document}               \begin{table}[H]     \caption{C++ DIC class public functions.}     \centering     \begin{tabular}{>{\columncolor{listingscolor}}l c c c}     \toprule[0.2em]          \multicolumn{1}{c}{\textbf{Function in C++} }& \textbf{Input} & \textbf{Output} & \shortstack{\textbf{Document} \\ \textbf{corresponding chapter} }\\     \hline     \midrule     \multicolumn{4}{c}{Main setup and API functions. Public functions.}\\     \hline     \begin{cpptable}      getF()      \end{cpptable}      &        \begin{minipage}{1.5in}         \vspace{4pt}         \begin{itemize}        \item Subset center        \vspace{-10pt}        \item window size        \end{itemize}        \end{minipage}        \vspace{4pt}       &           \begin{minipage}{1.5in}         \vspace{4pt}         \begin{itemize}        \item Undeformed \\image subset        \end{itemize}        \end{minipage}        \vspace{4pt}              & \ref{sec:basic principles},\ref{sec:sub-pixel}\\       \hline                 \bottomrule     \end{tabular}          \label{tab:DIC class private}     \end{table}     \end{document}      What I have tried:               \documentclass[12pt,a4paper,final]{report}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}          \usepackage{booktabs}     \usepackage[table]{xcolor}          \usepackage{listings}     \colorlet{listingscolor}{black!15}     \lstnewenvironment{mylistings}       {\lstset{language=C++,         backgroundcolor=\color{listingscolor}, % set backgroundcolor         basicstyle=\footnotesize,% basic font setting         }%       }       {}          \lstnewenvironment{cpptable}       {\lstset{language=C++,         basicstyle=\footnotesize,% basic font setting         }%       }       {}               \begin{document}               \begin{longtable}[H]     \caption{C++ DIC class public functions.}     \centering     \begin{tabular}{>{\columncolor{listingscolor}}l c c c}     \toprule[0.2em]          \multicolumn{1}{c}{\textbf{Function in C++} }& \textbf{Input} & \textbf{Output} & \shortstack{\textbf{Document} \\ \textbf{corresponding chapter} }\\     \hline     \midrule     \multicolumn{4}{c}{Main setup and API functions. Public functions.}\\     \hline     \begin{cpptable}      getF()      \end{cpptable}      &        \begin{minipage}{1.5in}         \vspace{4pt}         \begin{itemize}        \item Subset center        \vspace{-10pt}        \item window size        \end{itemize}        \end{minipage}        \vspace{4pt}       &           \begin{minipage}{1.5in}         \vspace{4pt}         \begin{itemize}        \item Undeformed \\image subset        \end{itemize}        \end{minipage}        \vspace{4pt}              & \ref{sec:basic principles},\ref{sec:sub-pixel}\\       \hline                 \bottomrule     \end{tabular}          \label{tab:DIC class private}     \end{longtable}     \end{document}


title: Where is the tikz library named "quotes"?

text: I noticed it was mentioned a couple of times on this site, but I could not find any documentation for it.


title: How to preserve the same parskip in minipage

text: I have following structure:               \begin{document}          Paragraph1.     Paragraph2.          \begin{minipage}     Some paragraph1.     Some paragraph2.     \end{minipage}          \end{document}      How can I make the same spacing between paraghs in minipage section as in plain paragraphs? Would like to make it as macros, in order not to repeat it many times, but this failed:               \let\currentparskip\parskip     \newenvironment{minipage_parskip}{       \begin{minipage}{\textwidth}{         \setlength{\parskip}{\currentparskip}       }     }{       \end{minipage}     }


title: Why is \input not expandable?

text: In `latex.ltx` I found `\def\input{\@ifnextchar\bgroup\@iinput\@@input}` where `\@@input`is expandable. I would like to know if there is an expandable version of `\input`. The problem comes from an example with my package `alterqcm`.               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}       \newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%       %  \usepackage{fourier} % \square is defined with fourier     \usepackage{alterqcm}          \begin{document}     \begin{alterqcm}        \AQmessage{Soit $h$ la fonction telle que: $h:x\longmapsto x(x-1)$.}            \AQquestion{Par cette fonction: L'image de}{     {4 est 8},     {0 est 2},     {8 est 4},     {2 est 0}     }      \end{alterqcm}     \end{document}      Now it's possible to put the question in a file named 'question_1_2.tex'                 \AQmessage{Soit $h$ la fonction telle que: $h:x\longmapsto x(x-1)$.}           \AQquestion{Par cette fonction: L'image de}{     {4 est 8},     {0 est 2},     {8 est 4},     {2 est 0}     }       Now               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}       \newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%       \usepackage{alterqcm}          \begin{document}     \begin{alterqcm}            \input{question_1_2.tex}     \end{alterqcm}     \end{document}        gives an error `\omit misplaced`. I need to write :               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}       \newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%       \usepackage{alterqcm}          \makeatletter     \newcommand*\ExpandableInput[1]{\@@input#1 }     \makeatother            \begin{document}     \begin{alterqcm}      \ExpandableInput{question_1_2.tex}     \end{alterqcm}     \end{document}      1) Is it possible to use another macro or version of `\input`? 2) Why does the error disappear if I put                \begin{alterqcm}        ...      \end{alterqcm}        inside `question_1_2.tex`?


title: How to write norm which adjusts its size?

text: I need to write norm of sum, but the sum symbol is larger than tho norm symbol (||) and it doesn't look good. Is there any symbol for norm which will adjust its size?               \documentclass[12pt,a4paper]{article}         \begin{document}           \begin{equation}          ||\left(\sum_{n=1}^N \bf P_{\rm n}\rm\right) ||^2 = \left(\sum_n \frac{E_n}{c}\right)^2 - \left(\sum_n \bf p_{\rm n}\rm \right)^2            \end{equation}        \end{document}


title: What's the correct way to write norm?

text: > **Possible Duplicate:**   >  Absolute Value Symbols What is a correct way to write norm of a vector (or an operator)? Is there a substantial difference between the following possibilities? Which of them do you recommend?               \newcommand{\norm}[1]{\lVert#1\rVert}     \newcommand{\norm}[1]{\|#1\|}     \newcommand{\norm}[1]{\left\|#1\right\|}


title: Undefined control sequence error when using \abs

text: I have the following line of code that is throwing up an undefined control sequence error:               \begin{equation}     \vec{N} = \frac{\vec{T'}(t)}{\abs{\vec{T'}(t)}}     \end{equation}      The problem is with the `\abs` as removing it and running the code again resolves the error completely. I can't figure out what I'm doing wrong. I need to render vector N is vector T'(t) divided by the magnitude of the same.


title: How to write the absolute value symbol in inline and display equations? Which is the preferred way of doing this?

text: I've been trying things such as `|`, `\lvert` ... `\rvert`, and `\left|` ... `\right|`, but I'm not sure which are the best options for inline and display expressions, since sometimes formulas don't look good.


title: Bar chart given minimum and maximum values

text: I want to create a bar chart that looks like the one in the picture. ![diagram](http://i.stack.imgur.com/xEs4R.png) For each `x` value I have the minimum and maximum value that represent the height that each bar should have. My problem though is: how to create the bars given the maxinum and minimum value since in the manual I only found how to create them given coordinates like in the following code.               \begin{tikzpicture}       \begin{axis}[         x tick label style={           /pgf/number format/1000 sep=},           ylabel=Population,           enlargelimits=0.05,           legend style={at={(0.5,-0.15)},           anchor=north,legend columns=-1},         ybar interval=0.7,       ]       \addplot         coordinates {(1930,50e6) (1940,33e6)         (1950,40e6) (1960,50e6) (1970,70e6)};            \addplot         coordinates {(1930,38e6) (1940,42e6)         (1950,43e6) (1960,45e6) (1970,65e6)};            \addplot         coordinates {(1930,15e6) (1940,12e6)         (1950,13e6) (1960,25e6) (1970,35e6)};            \legend{Far,Near,Here}       \end{axis}     \end{tikzpicture}


title: Change BibTeX's language

text: I am writing a document in Greek. My bibliography, however consists mainly of English entries (along with a few Greek, French and German ones). If I just add the `.bib` file all entries are in Greek. If I change language before adding the `.bib` file entries are in English, so is the chapter title, which is not prefered in my case. I tried using               \selectlanguage{english}      on the very first line of my `.bib` file but it didn't work. I also tried               \LANGUAGE=english      as a field in the bibliography entry, but it didn't work either... Any ideas? Here follows my `.tex` files (I am using `subfiles`) and the `.bib` file. `main.tex`               \documentclass[11pt,a4paper]{book}     \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage{subfiles}     \usepackage[Glenn]{fncychap}     \usepackage{fancyhdr}          %!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     \usepackage{tocloft}     \makeatletter     \newcommand*{\tocwithouttitle}{\@starttoc{toc}}     \makeatother     %--------------------------------------------------------------------------------     \makeatletter     \newcommand*{\lofwithouttitle}{\@starttoc{lof}}     \makeatother     %--------------------------------------------------------------------------------     \makeatletter     \newcommand*{\lotwithouttitle}{\@starttoc{lot}}     \makeatother     %--------------------------------------------------------------------------------     %!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!          \parskip 3mm     \footskip = 15mm     \begin{document}          %~~~~~~~~~~~~~~~~~~~~~~~Front-Page~~~~~~~~~~~~~~~~~~~~~~~~~~     \begin{titlepage}     Frontpage     \end{titlepage}          \pagenumbering{roman}          \textcolor{Darkblue}{\chapter*{\contentsname}}     \markboth{\MakeUppercase{\contentsname}}{\MakeUppercase{\contentsname}}     \textcolor{Darkblue}{\tocwithouttitle}     \addcontentsline{toc}{chapter}{Περιεχόμενα}          \newpage          \textcolor{Darkblue}{\chapter*{Κατάλογος Σχημάτων}}     \markboth{\MakeUppercase{Κατάλογος Σχημάτων}}{\MakeUppercase{Κατάλογος Σχημάτων}}     \textcolor{Darkblue}{\lofwithouttitle}     \addcontentsline{toc}{chapter}{Κατάλογος Σχημάτων}          \newpage          \textcolor{Darkblue}{\chapter*{Κατάλογος Πινάκων}}     \markboth{\MakeUppercase{Κατάλογος Πινάκων}}{\MakeUppercase{Κατάλογος Πινάκων}}     \textcolor{Darkblue}{\lotwithouttitle}     \addcontentsline{toc}{chapter}{Κατάλογος Πινάκων}          \newpage          \pagenumbering{arabic}          \subfile{introductionGR.tex}          \clearpage     \addcontentsline{toc}{chapter}{Βιβλιογραφία}     %\selectlanguage{english}     \textcolor{Darkblue}{\bibliography{test}}     \bibliographystyle{plain}     \end{document}      This is my subfile (named `introductionGR.tex`) with citations...               \documentclass[main.tex]{subfiles}     \begin{document}     \textcolor{Darkblue}{\chapter{Εισαγωγή}}     Ο κόσμος στον οποίο ζούμε είναι αποτέλεσμα βίαιων διεργασιών που έλαβαν χώρα πριν από     περίπου $14$ δισεκατομύρια χρόνια\cite{UniverseAge}. Η φυσική υψηλών ενεργειών ή   σωματιδιακή φυσικής βρίσκεται\cite{bar2} στο προσκήνιο      \end{document}      Last but not least my `.bib` file (named `test.bib`)               \selectlanguage{english}     @article{UniverseAge,         author    = "N. Jarosik et al",         title     = "Seven-year Wilkinson Microwave Anisotropy Probe (WMAP) Observations: Sky Maps, Systematic Errors, and Basic Results",         journal   = "The Astrophysical Journal Supplement Series",         volume   = "192",         number   = "14",         pages    = "15",         year      = "2011",         month    = "February",     }          @BOOK{bar2,         AUTHOR = "Astar, R. M.",         TITLE = "Foo Bar Baz",         PUBLISHER = {MIT Press},         ADDRESS = {Cambridge, MA},         YEAR = 1989}      I have also tried `package babellib` but it's not working either... The code I used:                \usepackage{babelbib}      \selectbiblanguage{english}      Note: I don't want to use XeLaTeX. Isn't it possible? * * * Error #1:               LaTeX Error:Command \c@lofdepth already defined.                 Or name \end...illegal, see p.192 of the manual.     See the LaTeX manual or LaTeX Companion for explanation.      The line that has a problem is               \newcounter{lofdeth}      which is in a subfigure file!(?) Error #2:               LaTeX Error:Command \c@lofdepth already defined.                 Or name \end...illegal, see p.192 of the manual.     See the LaTeX manual or LaTeX Companion for explanation.      The line that has a problem is               \newcounter{lotdeth}      which is in a subfigure file!(?) Error #3:               LaTeX Error:Something's wrong--perhaps a missing \item.     See the LaTeX manual or LaTeX Companion for explanation.      The line that has a problem is               \contentsline {chapter}{Perieq'omena}{\textlatin {iii}}{chapter*.1}      which is in main.toc Note: `Perieq'omena` is the Greeklish word for Contents. The correct word would be `Περιεχόμενα`. Error #4:               LaTeX Error:Something's wrong--perhaps a missing \item.     See the LaTeX manual or LaTeX Companion for explanation.      The line that has a problem is               \addvspace {10\p@ }      which is in main.lof Error #5:               LaTeX Error:Something's wrong--perhaps a missing \item.     See the LaTeX manual or LaTeX Companion for explanation.      The line that has a problem is               \addvspace {10\p@ }      which is in main.lot I think that Error #3 might have a connection to my issue. I am using kerkis font. But the problems remains even if I use the default babel one. * * * Warnings for MWE Warning #1:               LaTeX Font Warnig:Some font shapes were not available,defaults substituded.      Warning #2:               LaTeX Font Warnig: Font shape 'OT1/MAK/m/n' undefined                        using 'OT1/cmr/m/n' instead on input line 1      Warning #3:               LaTeX Warnig: Overwriting file './test.bib'


title: listings line numbers work with one lstlisting but not another

text: The first listing has its line numbers ignoring the stepnumber while the second is just fine. Guess it might have to do with using math mode but mathescape applies to both, so if that is the case it is not obvious what to do to me               \documentclass[a4paper, twoside]{book}          \usepackage{listings}     \lstset{         basicstyle=\small,         keywordstyle=\ttfamily,         identifierstyle=\ttfamily,         numbers=left,         numberstyle=\tiny,         stepnumber=5,         numbersep=5pt,         numberfirstline=true,         firstnumber=1,         mathescape=true         }               \begin{document}          \begin{lstlisting}     g = $\infty$          for $v$ in vertices:         s = $\emptyset$         r = $\{v\}$         pred[v] = $\emptyset$         d[v] = $0$         while not r == $\emptyset$:             x = $x \in r$             s = s $\cup$ x             r = r $\setminus$ x             for     \end{lstlisting}          \begin{lstlisting}     step = 1     res = new Graph()          def BFS(v,currentLength,maxLength):         if currentLength < maxLength:             if not label[v]:                 label[v] = step                 step = step + 1             for w in Neighborhood(v):                 if label[w]:                     continue                 pred[w] = v                 res.Append(v,w)                 BFS(w,currentLength + 1, maxLength)          root = PickVertex()     BFS(root,0,k)     \end{lstlisting}               \end{document}


title: \cdot not working in moderncv

text: If I try to use `\cdot` in my .tex document (moderncv) then I'm getting error like this:               ! Missing $ inserted.     (inserted text)                     $     here_it_gives_line_number_and_hint      This line have this structure: `\tlcventry[orange]{year}{0}{DESC_1}{\href{http://DESC_1}{DESC_1} \cdot \href{http://DESC_1}{DESC_1}}{DESC_1}{ \scriptsize{\underline{\textbf{DESC_1}}} }{DESC_COMMENT}` When I remove `\cdot` from it, then my document compiles sucessfully.


title: New command employing \multirow and \multicolumn

text: I define a new command like this:               \newcommand{\rowcol}[4]{ %         \multicolumn{#1}{#3}{\multirow{#2}{*}{#4}} %     }      I then use it inside the column as,               \rowcol{2}{2}{|c|}{Factor}}&\multicolumn{2}{c|}{Replication}&Total \\ \cline{3-4}      Is there any mistake in doing this, I'm getting error.


title: put a figure into the list of table?

text: I've copied a table from another .pdf and inserted it as a figure in my latex code. Is there an easy trick to consider his label, his caption everything as it was a table? And of course I would like it to appear in the list of table instead of in the list of figure. Tks! Edit: I've tried something like this:               \begin{table}[h!]      \begin{figure}      \includegraphics[width=.6\textwidth]{fig.png}      \end{figure}      \caption{tab}      \label{tab}      \end{table}       but it gave me this error:               ! LaTeX Error: Not in outer par mode.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \includegraphics


title: lst include has first line indented

text: When I'm including a source file, by way of `\lstinputlistings{file/path/to/file}` However, This results in the following below: ![image](http://i.stack.imgur.com/sp1x2.png) Why is the first line not being formatted correctly? And how do i fix it? I've tried adding newlines before but that has no effect.


title: ledmac vs. setspace: Don’t change spacing of critical notes

text: Normaly `setspace` tries to set only the stretch of main text an footnotes are unchanged. In combination with `ledmac` the critical notes are stretched too. Is there a way to _unstretch_ the notes like normal footnotes?               \documentclass{scrbook}     \usepackage{xltxtra}          \usepackage{setspace}         \AtBeginDocument{\setstretch{2}}         % without \AtBeginDocument it leads to an arithmetic overflow         % don't know why ...          % für die Edition     \usepackage{ledmac}     \newcommand{\BNote}[3][]{%             \edtext{#2}{\lemma{}\Bfootnote{#3}}%     }     \footparagraph{B}          \begin{document}     \beginnumbering     \setstanzaindents{2,0,0,0,0,0,0,0,0,0,0,}     \stanza     inspirat genio. Sed quae depingere vocem &     dextra potest oculisque echo signare videndam? &     \BNote{clarus}{very long text to show the problem\textbf{C}} circa urbes et famae voce lyraeque. &     Illum laetus Hymen plausu iuvenumque choreis &     At tandem \BNote{vergente}{urgente very long text to show the problem\textbf{H}} die festoque peracto &     \BNote{At}{ac very long text to show the problem\textbf{C}} cito colloquio facto dictaque salute &     spondet et oblato sua fata \BNote{paciscitur}{pasciscitur very long text to show           very long text to show the problem\textbf{H}} auro.     \&     \endnumbering     \end{document}      After lockstep’s answer seem to work fine it stopped working when using `ledpar`in addition to `ledmac`. Here’s the new example.               \documentclass{scrbook}     \usepackage{ledmac,ledpar}     \newcommand{\BNote}[3][]{%             \edtext{#2}{\lemma{}\Bfootnote{#3}}%     }     \footparagraph{B}     \usepackage{setspace}     \begin{document}         \begin{spacing}{2}             \begin{pages}                 \begin{Leftside}                     \beginnumbering                     \setstanzaindents{2,0,0,0,0,0,0,0,0,0,0,}                     \stanza                     inspirat genio. Sed quae depingere vocem &                     dextra potest oculisque echo signare videndam? &                     \BNote{clarus}{very long text to show the problem\textbf{C}}                         circa urbes et famae voce lyraeque. &                     Illum laetus Hymen plausu iuvenumque choreis &                     At tandem \BNote{vergente}{urgente very long text to                         show the problem\textbf{H}} die festoque peracto &                     \BNote{At}{ac very long text to show the problem\textbf{C}}                         cito colloquio facto dictaque salute &                     spondet et oblato sua fata \BNote{paciscitur}{pasciscitur                         very long text to show                           very long text to show the problem\textbf{H}} auro.                     \&                     \endnumbering                 \end{Leftside}                 \begin{Rightside}                     \beginnumbering                     \setstanzaindents{2,0,0,0,0,0,0,0,0,0,0,}                     \stanza 1 & 2 & 3 & 4 & 5 & 6 & 7 \&                     \endnumbering                 \end{Rightside}                 \Pages             \end{pages}         \end{spacing}     \end{document}