title: How to change geometry for one page without using \newgeometry or \restoregeometry

text: I am trying to establish one geometry for my first page (not a title page), and use another for the rest of the document. However, because I am trying to make a template, and thus do not want to rely on a user to put in \newgeometry or \restoregeometry in the text of the document, I would like to establish these geometries in the preamble. Is there any way to do this? **A minimum working example**               \documentclass{article}     \usepackage{lecturenotes}          \usepackage{afterpage}          \thispagestyle{plain}               \begin{lecture}{01}{Sample Lecture Notes}{John Sam}{01/01/2000}{Mark John}{PHYSICS 124: Physics of Energy}          \afterpage{\newgeometry{top=2cm, bottom=2.5cm, outer=5.5cm, inner=2cm, heightrounded, marginparwidth=3.5cm, marginparsep=0.4cm, includeheadfoot}}               \end{lecture}     \theend      **The style 'lecturenotes'**                   \def\fileversion{1.0}     \def\filedate{2014/02/05}     \NeedsTeXFormat{LaTeX2e}               \usepackage{graphicx}     \usepackage{amsmath,amssymb,amsthm,amsfonts}     \usepackage[top=0.5cm, bottom=2.5cm, outer=5.5cm, inner=2cm, heightrounded, marginparwidth=3.5cm, marginparsep=0.4cm, includeheadfoot]{geometry}     \usepackage{fancyhdr}     \pagestyle{fancy}          \newcommand{\handout}{        \noindent        \begin{center}        \framebox{ \vbox{ \hbox to 13.5cm { {\bf {\course}} \hfill {Lecture \lecturenum\ -- \lecturedate} }            \vspace{4mm}            \hbox to 13.5cm { {\Large \hfill {\lecturetitle}  \hfill} }            \vspace{2mm}            \hbox to 13.5cm { {\it {Lecturer: \lecturer} \hfill {Notes by: \lecturescribe}} }          }        }        \end{center}        \vspace*{4mm}     }          \newenvironment{lecture}[6]{         \begin{document}         \global \def \lecturenum {#1}         \global \def \lecturetitle {#2}         \global \def \lecturescribe {#3}         \global \def \lecturedate {#4}         \global \def \lecturer {#5}         \global \def \course {#6}         \handout     }               \lhead{\lecturedate}     \chead{\lecturetitle}     \rhead{Lecture \lecturenum}     \lfoot{}     \cfoot{\thepage}     \rfoot{}          \newcommand{\theend}{\end{document}}


title: stata mlogit margins margins, dydx(*) predict(outcome()) export to LaTeX table

text: I am estimating a multinomial logistic regression model in STATA               mlogit Y X1 X2 X3 X4 X5      Then using a loop I get the marginal effects               est store m     forval i = 0/5 {     est res m     margins, dydx(*) predict(outcome(`i')) post     est store m`i'     }     estout m0 m1 m2 m3 m4 m5      And I want to add these results everytime along with the coefficients of the corresponding outcome of the mlogit using the estadd command and then store them and export them in tex using esttab. I would normally write (to export the .tex table)               <fit model>     estadd margins, dydx(*)     estout, cells("b margins_b" "se(par) margins_se(par)")     est store A          esttabA using table1.tex replace f star(* 0.10 **0.05 ***0.001)     cells("b(fmt(3)star) margins_b(star)" "se fmt(3)par)")     stats(N r2_p chi2 p pr, fmt(0 3)      But this works only for margins, dydx(*) atmeans but these do not change for the different outcomes, where I want to get each time the coefficient and next to it the marginal effects               Outcome1   Coeff     Marginal Effect          Variable1  coeff11   margeff11       Variable2  coeff12   margeff12       Variable3  coeff13   margeff13            Outcome2   Coeff     Marginal Effect       Variable1  coeff21   margeff21       Variable2  coeff22   margeff22       Variable3  coeff23   margeff23      Can anyone help me do that?


title: TikZ pictures does not appear in poster

text: I'm making a poster with LaTeX using the template available here http://www.damtp.cam.ac.uk/user/eglen/damtp/cuposter/. For some reason, images created using TikZ do not appear in the poster. It compiles just fine, and other images added using `\includegraphics{}` appear. Here is, what seems to me a relevant portion of the code. The same piece of code, along with the initial TikZ includes and definitions worked fine in the LNCS template. Please let me know if I can add anything more informative.               \documentclass[noback]{cuposter}          \usepackage{mathptmx}     \usepackage{xspace}     \usepackage{amsmath}     \usepackage{pifont}     \usepackage{psfrag}     \usepackage{graphicx}     \usepackage{wrapfig}          % Tikz stuff     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{positioning}     \usetikzlibrary{fit,chains}          \tikzset{latent/.style={circle,fill=white,draw=black,inner sep=1pt,      minimum size=20pt, font=\fontsize{10}{10}\selectfont},     obs/.style={latent,fill=gray!25},     const/.style={rectangle, inner sep=0pt},     factor/.style={rectangle, fill=black,minimum size=5pt, inner sep=0pt},     >={triangle 45}}          \pgfdeclarelayer{b}     \pgfdeclarelayer{f}     \pgfsetlayers{b,main,f}          % shapename, fitlist, caption, pos     \newcommand{\plate}[4]{     \begin{pgfonlayer}{b}         \node (invis#1) [draw, color=white, inner sep=2pt,rectangle, fit=#2] {};     \end{pgfonlayer}          \begin{pgfonlayer}{f}         \node (#1) [draw,inner sep=0pt, rectangle,fit=(invis#1),#3,#4] {};     \end{pgfonlayer}     }          \begin{document}          .     .     .          \begin{figure}         \begin{center}             \begin{tikzpicture}         \node [matrix,matrix anchor=mid, column sep=5pt, row sep=20pt] {         % hidden layer         \node (inv) [draw=none] {}; &         \node (inv) [draw=none] {}; &         \node (inv) [draw=none] {}; &         \node (h1) [latent] {$h_1$}; &         \node (h2) [latent] {$h_2$}; &         \node (hlabel) [draw=none] {$\mathbf{h}$};         \\              % visible layer         \node (inv) [draw=none] {}; &         \node (inv) [draw=none] {}; &         \node (x1) [latent] {$v_1$}; &         \node (x2) [latent] {$v_2$}; &         \node (x3) [latent] {$v_3$}; &         \node (x4) [latent] {$v_4$}; &         \node (xlabel) [draw=none] {$\mathbf{v}$}; &                 \node (inv) [draw=none] {}; &                \\         };              % connections         \draw [-] (x1) -- node [left=2pt] {} (h1);         \draw [-] (x1) -- node [left=2pt] {} (h2);         \draw [-] (x2) -- node [left=2pt] {} (h1);         \draw [-] (x2) -- node [left=2pt] {} (h2);         \draw [-] (x3) -- node [left=2pt] {} (h1);         \draw [-] (x3) -- node [left=2pt] {} (h2);         \draw [-] (x4) -- node [left=2pt] {} (h1);         \draw [-] (x4) -- node [right=2pt] {W} (h2);         \end{tikzpicture}         \end{center}     \caption{A simple Restricted Boltzmann Machine with four visible, two hidden, and no bias units.}     \label{fig:rbm}     \end{figure}          .     .     .          \end{document}      Thanks!


title: finding out HTML equivalents of latex math symbols

text: Unlike the other unresolved questions about painless latex to HTML conversion, I just want to know the conversions for math symbols. For example, when I give               \Leftrightarrow       as input to that program, I should get back               ⇔      Alternatively, is there an equivalent of : detexify.kirelabs.org/classify.html for HTML symbols?


title: Missing caption prefix in figures and tables when using XeLaTeX

text: I've recently switched from PDFLaTeX to XeLaTeX, and noticed that captions on my figures and tables don't have the usual "Рис." and "Таблица" prefix any more (Fig. and Table in Russian), only a number followed by a colon, or additionally a period in case of "Рис.". Is it something wrong with encoding/font? Example:               \documentclass[a4paper]{article}     \usepackage[russian]{babel}     \usepackage{fontspec}     \setmainfont{Times New Roman}     \begin{document}       Привет!       \begin{table}         \centering         \begin{tabular}{cc}           x & y \\           0 & 1         \end{tabular}         \caption{Зашибенная таблица}       \end{table}     \end{document}      Output: ![Screenshot](http://i.stack.imgur.com/SCaVH.png)


title: Remove or Change heading on certain Chapters

text: I have headings in all my chapters (on the top corner stating which chapter you are reading), however at the end of my document I have a chapter which is not numbered as my appendix and glossary. For these chapters the heading is the same as the last chapter numbered.               \chapter{Chapter 1}     \chapter*{Chapter 1}      For the first command the heading changes, however for the second command (chapters which are not numbered) it does not change. How can I change the heading for those chapters also? My heading commands are:               \usepackage{fancyhdr}     \fancyhead[R]{        \itshape        \ifnum\value{chapter}>0 \fi \nouppercase        \leftmark}     \fancyhead[L]{}     \fancyfoot[C]{\thepage}{}     \renewcommand{\headrulewidth}{0pt}      I have added               \chaptermark{...}      under the chapter which are unnumbered. This adds the name of the chapter to the header but I would like to remove the number. Assuming that Ch 6 is my last chapter, Right now my header reads : *Chapter 6. Title of chapter 6  Chapter 6. Glossary Chapter 6. Appendix* However, I would like to have : *Chapter 6. Title of chapter 6 (Last chapter) Glossary Appendix*


title: How to create this Mathematica animation in beamer

text: I apologize in advance if my question seems confusing or trivial. How to successfully create an animated PDF Beamer for this _Animation Mathematica_ file, available on the following link European Option Prices and Greeks in 3D. It seems it's impossible as we can't use the **Mathematica** player in . **cdf** format. Thanks for any help.


title: How can I separate design from content?

text: I am new to LaTeX and have completed my first document recently, and it came out to be excellent. However, I am not going to make several more documents which shall be similar. I found that although the style file provides a big relief, there are still a lot of design elements embedded in the document itself. My question:   1. Is there a way to separate design from content?   2. Do I need special tools to achieve that? I come from HTML5/CSS background which might explain my expectation. Or maybe the expectation itself is incorrect. More information: My documents are small articles ( weekly results from an experiment) running 2-3 pages. They contain mostly text and some graphs and figures which are automatically generated by a script. I wanted to automate this document generation using scripts. The strategy was that the content is generated from the experiment and the design template remains unchanged.


title: Import and scale LaTeX table data from file (only ampersand stuff)

text: Is it possible to create a table and include only the pure data from an external file (only ampersand delimited stuff). Is it also possible to scale a table because data is vast and I don't want to keep on messing with table width and heights??               \begin{table}[H!]        \centering       \begin{tabular}{llllllll}     \input{stuff};     \end{tabular}        \caption{This is a caption}      \label{xxxx}         \end{table}      I want to import the data on the \input{stuff} part


title: How to get the available space for an image

text: I want to design a figure (in a external graphics editor, e.g, Illustrator) to exactly fit (without scaling!) the whole available space on an empty page of my document minus the caption of the figure. The caption is given and its extension should be be concerned when determining the available space left for the figure. How can I get the available image dimensions minus the caption?


title: package for making the script in MiKTeX colorful

text: I uninstalled my MiKTeX and now after re-installing the software, my scripts in the environment of the MiKTeX are not shown by colors. I use **TexWorks** IDE. for example, when you write `\usepackage{}` it is shown fully black while it used to be shown in blue color. Entire the text is black. As another example, comments used to be shown in Green. Which package should I install or which settings should I change in **Texworks** to do so?


title: How to make (force) line-break in Chapter Title (in ToC, Chapter, Header) - if possible?

text: I've found how to make different text for Title appearing in ToC, Chapter and headers Chapter title in header too long :               \chapter[medium-length title for TOC, if wanted]{full title name}     \chaptermark{short title for running headers}      How to make ("force") line-break (if possible) in each of those three titles:   * in ToC   * in Chapter   * in Header ?


title: How to increase bufsize for lualatex or pdflatex?

text: I work with large TikZ graphics for which the default bufsize of lualatex/pdflatex is too small:               Unable to read an entire line---bufsize=200000.     Please increase buf_size in texmf.cnf.      Is there a quick way to increase the buffer size for either lualatex or pdflatex _without_ editing texmf.cnf? If there is no quick solution, could someone please describe the obscure configuration mechanism of LaTeX that needs to be executed to process changes made to texmf.cf? Also, where is texmf.cnf in a standard installation of a Ubuntu texlive package? What happens to my changes to texmf.cf when I update the texlive package?


title: Row-wise and Column-wise break of extra wide tables, and add a proper label

text: There is a question "Column-wise break of extra wide tables" Column-wise break of extra wide tables and a very useful answer to it.               \documentclass[twoside]{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{array}     \usepackage{caption}     \newcounter{tablepage}     \makeatletter     % #1 no of pages     % #2 caption     % #3 table      % table usesnormal tabular except     % Replace & by \thbreak after column(s) you want repeated.     % replace & by \tbreak at points you want page to break.     % must be a \tbreak before final \\     % any nested tabulars must be inside {} to hide the &     % \multicolumn is allowed but can not span a break.     % might want to replace \cleardoublepage by a cmmand to get onto left pf speread     % the tabular preamble needs as many columns (including heading columns) as the      % page with the most columns.     \long\def\widesplit#1#2#3{%     \def\row{\rowz\c@tablepage}%     \cleardoublepage     \setcounter{tablepage}{0}%     \loop     \refstepcounter{tablepage}%     \noindent\begin{minipage}{\columnwidth}\centering     \ifnum\c@tablepage=\@ne         \captionof{table}{#2}%       \else     \captionof*{table}{#2 (page \thetablepage\ of #1)}%      \fi      #3\end{minipage}%      \clearpage      \ifnum#1>\c@tablepage       \repeat}           \begin{document}           \def\rowa#1\thbreak#2\tbreak#3\\{#1&#2\\}            \def\rowz#1{%       \ifnum#1=\@ne         \expandafter\rowa        \else         \expandafter\rowq\expandafter{\the\numexpr#1-1\expandafter\relax\expandafter}%       \fi}           \def\rowq#1#2\thbreak#3\tbreak{\rowz{#1}#2\thbreak}       \centering      \footnotesize            \widesplit{5}{some boring numbers}{%       \begin{tabular}{>\bfseries{l}rrrrr}       \row           Sample \thbreak   Sample 1 &   Sample 2 &   Sample 3 &   Sample 4 &   Sample 5   \tbreak   Sample 6 &   Sample 7 &   Sample 8 &   Sample 9 &  Sample 10 \tbreak  Sample 11 &   Sample 12 &  Sample 13 &  Sample 14 &  Sample 15 \tbreak  Sample 16 &  Sample 17 &  Sample 18 &  Sample 19 &  Sample 20 \tbreak  Sample 21 &  Sample 22 &  Sample 23 &  Sample 24 \tbreak\\[2ex]       \row       \rlap{Major element abundances (wt\%)} \thbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            \tbreak\\       \row       SiO2 \thbreak         25 &         81 &         36 &         75 &         23 \tbreak         21 &         65 &         84 &          1 &         59 \tbreak         38 &         16 &          3 &         56 &         29 \tbreak         34 &          3 &         59 &         55 &         17 \tbreak          2 &         81 &         59 &         43 \tbreak\\       \row       TiO2 \thbreak         48 &         96 &          0 &         90 &         61 \tbreak         72 &         83 &         16 &         10 &          1 \tbreak         40 &         83 &         35 &         31 &         76 \tbreak         31 &         57 &          8 &         83 &        100 \tbreak         14 &         12 &         48 &         69 \tbreak\\       \row      Al2O3 \thbreak          7 &         14 &         99 &         53 &         89 \tbreak         65 &         88 &         17 &         76 &         81 \tbreak         43 &         87 &         15 &         71 &         17 \tbreak         85 &         59 &        100 &         96 &         85 \tbreak         74 &         50 &         59 &         36 \tbreak\\      \row      Fe2O3 \thbreak         32 &         34 &         23 &         86 &         50 \tbreak         58 &          8 &         29 &         88 &         27 \tbreak         49 &         16 &         19 &         89 &         45 \tbreak         88 &         79 &         42 &         42 &         29 \tbreak         10 &         60 &         87 &         97 \tbreak\\       \row       FeOt \thbreak         35 &         42 &         83 &          0 &         55 \tbreak         51 &         35 &         11 &         43 &         44 \tbreak         69 &         30 &         49 &         55 &         56 \tbreak          4 &         74 &         72 &         98 &         94 \tbreak         14 &         35 &         59 &         34 \tbreak\\      \row        MnO \thbreak         64 &         48 &         52 &         65 &         61 \tbreak         16 &         73 &         56 &         73 &         54 \tbreak         75 &          7 &         18 &         84 &         52 \tbreak         38 &         46 &         91 &         59 &         90 \tbreak         31 &         84 &         54 &         32 \tbreak\\       \row        MgO \thbreak         48 &         97 &         83 &         47 &         43 \tbreak         41 &         37 &         71 &         92 &         57 \tbreak         76 &         36 &          8 &         37 &         94 \tbreak          6 &         50 &         57 &         80 &         63 \tbreak         25 &         18 &         85 &         16 \tbreak\\        \row        CaO \thbreak         56 &         11 &         68 &         49 &          6 \tbreak         20 &         31 &         74 &         72 &         24 \tbreak         39 &         38 &         68 &         69 &         73 \tbreak         23 &         40 &         32 &         63 &         93 \tbreak         28 &         56 &         12 &         18 \tbreak\\        \row       Na2O \thbreak         73 &         18 &          0 &         62 &         98 \tbreak         61 &         59 &         42 &         97 &         47 \tbreak         74 &         31 &         40 &          3 &         75 \tbreak          2 &         52 &         96 &         67 &         44 \tbreak         84 &          9 &         35 &         51 \tbreak\\        \row        K2O \thbreak         69 &          0 &         52 &         73 &         23 \tbreak         11 &         12 &         70 &         86 &         46 \tbreak         29 &         84 &         77 &         47 &         25 \tbreak         43 &         97 &         48 &         30 &         94 \tbreak         83 &         93 &         23 &         25 \tbreak\\        \row       P2O5 \thbreak         92 &         80 &         59 &          6 &         90 \tbreak         99 &         54 &         64 &         96 &         84 \tbreak         58 &         18 &         37 &          7 &         55 \tbreak         89 &         34 &         53 &         59 &         56 \tbreak         38 &         23 &         63 &         89 \tbreak\\       \row       LOI§ \thbreak         51 &         65 &         64 &          2 &         67 \tbreak         51 &         58 &         55 &         60 &         48 \tbreak         64 &         54 &         56 &         46 &         78 \tbreak         70 &         38 &         44 &         45 &         37 \tbreak         66 &          7 &         34 &         76 \tbreak\\        \row        Mg\# \thbreak         20 &         27 &         34 &         40 &         66 \tbreak          3 &          7 &         42 &         19 &         85 \tbreak         35 &         24 &         31 &         40 &         14 \tbreak         39 &         31 &        100 &          0 &         41 \tbreak         19 &         14 &         75 &          5 \tbreak\\        \row        CIA \thbreak         24 &         57 &          1 &         80 &         86 \tbreak         72 &         38 &         11 &         51 &         23 \tbreak         49 &         94 &         43 &         65 &         15 \tbreak          5 &         41 &         21 &         32 &         83 \tbreak         22 &         16 &         63 &         51 \tbreak\\[2ex]        \row          \rlap{Trace element abundances (ppm)} \thbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            &            \tbreak            &            &            &            \tbreak\\        \row          V \thbreak         91 &        421 &        256 &        480 &        669 \tbreak        888 &        403 &        456 &        661 &         77 \tbreak        997 &        729 &        647 &         77 &         69 \tbreak        163 &         52 &        589 &        772 &        267 \tbreak        110 &        998 &        547 &        789 \tbreak\\         \row         Cr \thbreak        635 &        712 &        208 &        938 &        754 \tbreak        600 &         91 &        531 &        211 &        798 \tbreak        880 &        240 &        197 &        671 &        298 \tbreak        921 &        538 &        577 &         49 &        195 \tbreak        596 &        744 &        719 &        910 \tbreak\\         \row         Co \thbreak        288 &        182 &        672 &        825 &        197 \tbreak        466 &        204 &        803 &        943 &        321 \tbreak        444 &        134 &        471 &         22 &        191 \tbreak        188 &        457 &        481 &        288 &        971 \tbreak        475 &        906 &        261 &        243 \tbreak\\         \row         Ni \thbreak        492 &        234 &         46 &         62 &        213 \tbreak        531 &        808 &        557 &        599 &        356 \tbreak        681 &        487 &        929 &         36 &        729 \tbreak         84 &        962 &        918 &        260 &        688 \tbreak        373 &        363 &        679 &         51 \tbreak\\         \row         Cu \thbreak        675 &        494 &        754 &        743 &        119 \tbreak        404 &        142 &        402 &        120 &        643 \tbreak        576 &        135 &        870 &        205 &        639 \tbreak        775 &        549 &         82 &        933 &        222 \tbreak         55 &        567 &        672 &        354 \tbreak\\          \row         Zn \thbreak        440 &        656 &        667 &        193 &        305 \tbreak        758 &        814 &        660 &        811 &        519 \tbreak        885 &        488 &        223 &        182 &        120 \tbreak        448 &         58 &        830 &        173 &        473 \tbreak        847 &        809 &         22 &        456 \tbreak\\          \row         Ga \thbreak        782 &        639 &        282 &        906 &        595 \tbreak         39 &        901 &         73 &        825 &        330 \tbreak        937 &        860 &         48 &        920 &        968 \tbreak        150 &        967 &        838 &        819 &        997 \tbreak        430 &        635 &        959 &        672 \tbreak\\          \row         Rb \thbreak        422 &        930 &        404 &        581 &        916 \tbreak        747 &        970 &         87 &        343 &        784 \tbreak        843 &        339 &        919 &        398 &        827 \tbreak        265 &        216 &        382 &        772 &         17 \tbreak        770 &        745 &        543 &        224 \tbreak\\          \row         Sr \thbreak        468 &         17 &        860 &        996 &        938 \tbreak        416 &        594 &        506 &        226 &        572 \tbreak        507 &        432 &         54 &        484 &        517 \tbreak        629 &        793 &        721 &        743 &        481 \tbreak        306 &        948 &        387 &        239 \tbreak\\          \row         Pb \thbreak        429 &        280 &         83 &        495 &        980 \tbreak        715 &        225 &        540 &         58 &        513 \tbreak        653 &        149 &        893 &        918 &        553 \tbreak        879 &        136 &        266 &        900 &        811 \tbreak        942 &        706 &        344 &        528 \tbreak\\            \row          U \thbreak        669 &        507 &        455 &        714 &         83 \tbreak         39 &         83 &        175 &        466 &        940 \tbreak        794 &        232 &        600 &        327 &        590 \tbreak        723 &        597 &        759 &        377 &        214 \tbreak        372 &        627 &        746 &        102 \tbreak\\          \row         Cs \thbreak        408 &        615 &        657 &        539 &        612 \tbreak        907 &        615 &        820 &        650 &        133 \tbreak        870 &        605 &        691 &        190 &        741 \tbreak        245 &        370 &        486 &        269 &        475 \tbreak        258 &        320 &        909 &        204 \tbreak\\          \row          Y \thbreak        291 &        830 &        767 &        872 &        522 \tbreak        639 &        159 &        548 &        236 &        718 \tbreak        701 &        762 &        965 &        323 &        770 \tbreak        688 &         22 &         11 &        930 &        329 \tbreak        657 &        778 &        432 &        581 \tbreak\\          \row         Zr \thbreak        902 &        131 &        233 &        211 &        399 \tbreak        315 &        730 &        852 &         76 &        973 \tbreak        350 &        887 &        201 &        895 &        691 \tbreak        885 &        223 &        830 &        690 &        477 \tbreak        424 &        756 &        659 &        166 \tbreak\\          \row         Nb \thbreak        594 &        969 &        833 &        663 &        243 \tbreak        154 &        197 &        104 &        317 &        834 \tbreak        901 &        891 &        997 &        934 &        328 \tbreak        261 &        982 &        581 &        781 &        933 \tbreak        625 &        783 &        711 &        354 \tbreak\\         \row         Ba \thbreak        790 &        957 &        606 &        730 &        754 \tbreak        928 &        646 &          0 &        389 &         71 \tbreak        616 &        434 &        107 &        126 &        692 \tbreak        118 &        983 &         24 &        281 &        808 \tbreak        743 &        381 &        139 &        856 \tbreak\\           \row         La \thbreak        624 &        859 &        233 &        176 &        540 \tbreak        138 &        188 &        475 &        478 &        203 \tbreak        614 &         53 &        435 &        694 &         66 \tbreak        860 &        628 &        271 &        338 &        799 \tbreak        924 &        877 &        777 &        721 \tbreak\\         \row         Ce \thbreak        826 &        471 &        327 &        809 &        496 \tbreak        180 &        378 &        155 &         61 &        345 \tbreak        736 &        341 &        201 &        634 &        393 \tbreak        932 &        498 &        334 &         29 &        319 \tbreak        254 &         79 &        691 &         52 \tbreak\\         \row         Pr \thbreak        476 &        447 &        951 &        786 &        450 \tbreak        717 &        248 &        790 &        561 &        259 \tbreak        748 &        104 &        881 &        804 &        385 \tbreak        676 &        435 &        815 &        634 &        234 \tbreak        809 &        105 &        471 &        529 \tbreak\\         \row         Nd \thbreak        758 &        523 &        672 &        159 &        405 \tbreak        597 &        657 &        307 &         28 &         28 \tbreak         30 &        273 &         74 &        189 &        403 \tbreak        326 &         19 &        735 &        121 &        992 \tbreak         26 &        723 &        243 &        927 \tbreak\\       \row         Sm \thbreak        307 &        422 &        764 &        933 &        197 \tbreak        180 &        956 &        276 &        347 &        492 \tbreak        534 &        760 &        904 &        247 &          0 \tbreak        518 &        593 &        714 &        223 &        619 \tbreak        634 &         39 &        265 &        445 \tbreak\\     \row         Eu \thbreak        463 &        194 &        627 &        954 &         32 \tbreak        940 &        824 &        229 &         58 &        684 \tbreak        780 &        761 &        348 &        464 &         39 \tbreak        577 &        432 &        920 &        425 &        799 \tbreak          3 &        207 &        208 &        398 \tbreak\\      \row         Gd \thbreak        863 &        274 &        512 &        718 &        770 \tbreak        900 &        221 &        674 &        342 &        553 \tbreak        522 &        945 &        880 &         23 &        605 \tbreak        544 &        214 &        987 &        348 &        445 \tbreak        763 &        893 &        607 &        162 \tbreak\\       \row         Tb \thbreak        162 &        547 &         73 &        216 &        420 \tbreak        242 &        451 &        196 &        987 &        649 \tbreak        184 &        256 &        218 &         86 &        962 \tbreak        203 &         37 &        494 &        286 &        663 \tbreak        612 &        549 &        537 &        594 \tbreak\\       \row         Dy \thbreak        265 &         21 &        889 &        312 &        756 \tbreak         94 &        976 &        188 &        147 &        839 \tbreak        527 &        442 &        849 &        948 &        570 \tbreak        553 &        902 &        290 &         81 &        758 \tbreak        759 &        598 &        344 &        104 \tbreak\\       \row         Ho \thbreak        218 &        503 &        999 &        465 &        573 \tbreak        586 &        122 &        991 &        241 &        710 \tbreak        182 &         87 &        965 &        746 &         90 \tbreak        638 &         35 &        122 &        389 &        892 \tbreak        815 &        617 &        116 &        895 \tbreak\\       \row         Er \thbreak        571 &        932 &        738 &        653 &        986 \tbreak        430 &        992 &        432 &        823 &        542 \tbreak        444 &        702 &        524 &         58 &        248 \tbreak        914 &        697 &        420 &        913 &        754 \tbreak        596 &        429 &        995 &        927 \tbreak\\       \row         Tm \thbreak        551 &         72 &        654 &        819 &        593 \tbreak          7 &        110 &        707 &        535 &         74 \tbreak        142 &        150 &        610 &        564 &        859 \tbreak        451 &        832 &        822 &        938 &        877 \tbreak        954 &        430 &         41 &        657 \tbreak\\       \row         Yb \thbreak        815 &        643 &        650 &        217 &        962 \tbreak        612 &        926 &        524 &        559 &        500 \tbreak        822 &        630 &        901 &        525 &        407 \tbreak        563 &        575 &        161 &        505 &        166 \tbreak        207 &        680 &        418 &        478 \tbreak\\       \row         Lu \thbreak        106 &        597 &        551 &        650 &        391 \tbreak        850 &        589 &        649 &          6 &        277 \tbreak        129 &        566 &        109 &        922 &        767 \tbreak        173 &        525 &        250 &        449 &        662 \tbreak        221 &        831 &        969 &        479 \tbreak\\        \row         Hf \thbreak        100 &        833 &        566 &        331 &         36 \tbreak        589 &         33 &        785 &        862 &        447 \tbreak        469 &        284 &        329 &        116 &        608 \tbreak        256 &        665 &         41 &         74 &        527 \tbreak        479 &        300 &        800 &         51 \tbreak\\       \row         Ta \thbreak        337 &        757 &        903 &        411 &        745 \tbreak        638 &        243 &        584 &        336 &        477 \tbreak        994 &        307 &        349 &        981 &        572 \tbreak        364 &        822 &        609 &        198 &        478 \tbreak        922 &        854 &        819 &        130 \tbreak\\       \row         Th \thbreak       1000 &        520 &        222 &        998 &        774 \tbreak         88 &        843 &        259 &        424 &        845 \tbreak        884 &        739 &        666 &        673 &        531 \tbreak        934 &        322 &        682 &        754 &        944 \tbreak        153 &        779 &         20 &        890 \tbreak\\      \end{tabular}}      \end{document}      I am wondering how one can add label to the table. How is it possible to make this piece of code work in the longtable environment? The problem with the label is no where inside the table code seems to be a proper location of the label, as there would be warning that "label without proper caption".


title: Command to get N equally spaced dots in mathmode

text: In mathmode, we have `\cdots`, `\vdots`, _etc._ , to indicate repetitive patterns or ellipsis. These commands print three equally spaced dots. Is there a command that achieves the same, only for an arbitrary number of _N_ dots?


title: How do I set right alignment in a longtable column with a fixed width?

text: How do I set right alignment in a `longtable` column with a fixed width? I have `\begin{longtable}{p{3cm}p{8cm}}` and I'd like my first column to be aligned on the right.


title: Remove justification from a longtable?

text: Using :               \documentclass[12pt,a4paper]{report}     \usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}     \usepackage{longtable}          \begin{document}     \begin{longtable}{|p{0.15\textwidth}|p{0.2\textwidth}|p{0.35\textwidth}|p{0.2\textwidth}|}       .       .       .     \end{longtable}     \end{document}      How do I remove justification from the table ? What about only the 4th column ?


title: xdvi does not show eps files inline

text: When run from the command line `xdvi` gives the following errors               $ xdvi text.dvi      gs: Unknown device: x11alpha     gs: Unrecoverable error: undefined in .uninstallpagedevice     gs: Operand stack:     gs:     defaultdevice     xdvik: read_from_gs: Connection reset by peer      and does not show eps files using debian (sid). What is wrong?


title: Custom numbered paragraphs gives odd page breaks

text: I was writing a specification document needing numbered paragraphs. I implemented it like this:               \reversemarginpar          \newcommand\countparagraphs{         \everypar{%             \addtocounter{paragraph}{1}%             \marginpar{\hfill\ttfamily\bfseries\arabic{paragraph} \textsection}%         }     }          \makeatletter     \@addtoreset{paragraph}{section}     \makeatother          \newcommand\CountedSection[1]{\section{#1}\countparagraphs}          \setlength{\parindent}{0pt}     \setlength{\parskip}{0.7\baselineskip}      This however gives odd page breaks. Specifically, the page breaks several paragraphs before the end of the page. I determined that this was caused by the use of `\marginpar{...}` and replaced it with               \hspace{-4em}\makebox[3em][r]{...}\hspace{1em}      which solves the problem. I would however like to know what really happened here. Why does `\marginpar` affect the page breaking? Here's a MWE:               \documentclass[a4paper]{article}          \usepackage[margin=3cm]{geometry}          \newcommand\countparagraphs{\everypar{\marginpar{!}}}          \newcommand\CountedSection[1]{\section{#1}\countparagraphs}          \title{MWE}          \begin{document}          \maketitle          \tableofcontents          \setlength{\parindent}{0pt}     \setlength{\parskip}{0.7\baselineskip}          \CountedSection{Lipsum 1}     Lorem ipsum dolor sit amet, consectetur adipiscing elit.          Praesent mollis ornare ullamcorper.          Nunc fringilla luctus justo auctor consequat.          Sed fringilla metus facilisis diam ultrices eleifend.          Sed eget leo nec neque lobortis hendrerit.          In fringilla dui vitae lectus vehicula a vehicula dui bibendum.          Nunc condimentum, nunc nec feugiat ornare, augue dolor lobortis arcu, id posuere neque orci at enim.          Sed vehicula, nibh a tristique imperdiet, ante erat vulputate nulla, in accumsan odio felis at odio.          Fusce orci lorem, sollicitudin sed imperdiet vitae, fermentum ut urna.          Etiam nec iaculis diam. Duis ante elit, imperdiet id ornare sit amet, porta porttitor nunc.          Nullam magna sem, imperdiet eget fermentum et, accumsan ut enim.          \CountedSection{Lipsum 2}     Vivamus consequat volutpat quam, eu sollicitudin ligula varius vitae.          Maecenas tortor mi, molestie at faucibus vitae, dapibus eget nibh. In hac habitasse platea dictumst.          Nulla molestie ipsum ac sapien interdum eu faucibus eros viverra.          Nulla eu odio nunc. Ut ut libero ut eros adipiscing luctus.          Nunc non nulla odio. Curabitur ac facilisis orci.          Curabitur vitae dui metus, et blandit magna. Donec sollicitudin sodales orci non mollis.          \CountedSection{Lipsum 3}     Morbi lacinia scelerisque odio, sollicitudin tempus erat mattis ut.          In elementum auctor rhoncus. In sit amet lorem a ligula rhoncus accumsan quis non magna.          Vivamus sit amet erat at magna ultricies vulputate. Nunc tortor neque, blandit eu elementum malesuada, iaculis a eros.          Fusce vulputate, elit et iaculis fringilla, orci dui congue justo, at cursus elit velit vitae felis. Duis lacinia aliquam quam, sed vulputate risus porttitor vitae.          Sed dictum lectus eget quam pharetra hendrerit pharetra nibh ultricies. Donec vitae diam purus, a consequat ligula. Donec imperdiet vulputate consequat.          Nunc eleifend dapibus eleifend.          Donec lobortis enim ac quam sagittis fermentum.          Cras vestibulum accumsan nisl, et molestie justo blandit eu. Nunc pretium, tellus sed rutrum euismod, erat quam lacinia est, in convallis nisi ipsum nec dolor. Cras non urna enim.          \CountedSection{Lipsum 4}     Quisque ornare, felis eu tincidunt lacinia, sapien turpis molestie nulla, sed vestibulum massa arcu nec metus.          Phasellus placerat interdum congue.          Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla ac nibh nec diam rutrum placerat.          Vivamus in imperdiet nisi.          Donec nibh est, vehicula et molestie eu, lobortis in ante. Nullam aliquam orci et justo rhoncus porta.          Aliquam ac sodales purus.          \end{document}


title: eps-converted-to.pdf not found

text: I was trying to include a figure in LuaLatex, but got an error message of > `!Package pdftex.def Error: File 'test-eps-converted-to.pdf' not found.` The same code run in pdfLaTex+MakeIndex+bibTex. Is there a way to fix this? Also, is there anyway to include a directory or file pathway that contains a white space (e.g., c:\my project\tex)?               \documentclass{article}         \usepackage{graphicx,xcolor,colortbl}         \usepackage{epstopdf,epsfig}         \begin{document}         \begin{figure}         \includegraphics{test.eps}         \end{figure}         \end{document}


title: Symbols of height intermediate between \big and \Big needed

text: I consistently find that math symbols scaled with `\big`/`\bigl`/`\bigr` are too small and those scaled with `\Big`/`\Bigl`/`\Bigr` are too tall. Here is an example: ![too small or too large](http://i.stack.imgur.com/iqGgG.png)               \documentclass{article}     \usepackage{amsmath}               \begin{document}          \(\lvert x^2 + y^2 \rvert\)     \(\bigl\lvert x^2 + y^2 \bigr\rvert\)     \(\Bigl\lvert x^2 + y^2 \Bigr\rvert\)          \(\bigl\{ \bigl\lvert x^2 + y^2 \bigr\rvert  \mathrel{\big|}  5|x \wedge 7|y \bigr\}\)     \(\Bigl\{ \bigl\lvert x^2 + y^2 \bigr\rvert  \mathrel{\Big|}  5|x \wedge 7|y \Bigr\}\)          \(a/b \big/ c/d  \Big/  e/f \big/ g/h\)          \end{document}      In the first line, the middle/right formulas were created with `\big` and `\Big`, respectively. In the second line, the left-hand set uses `\big` for the set delimiters and its middle, and the right-hand set uses `\Big` for them. I want something larger than `\big` but not as huge as `\Big`. I'm not really asking anyone to fix this for me, which I suspect would be a nontrivial task. I am inquiring about the infrastructure for this and any possible future extensions.


title: TikZ: Background rectangles with equal width but 'fitting' height

text: I'm trying to make sort of a flow chart for a series of steps, but these steps are also grouped, and I'd like my diagram to reflect that. So I'm using the pgfonlayer/background environment to draw rectangles around these groups. I found a similiar example that uses the `fit` parameter to find the right dimensions. That example works nicely except for the fact that groups do not have an equal width, so the rectangles don't look very nice: ![ugly example](http://i.stack.imgur.com/VM6zW.png) That's the code for that (elicit is the first node "Wissenserhebung"):               \begin{pgfonlayer}{background}       \node [background, fit=(elicit)] {};       % others similiar     \end{pgfonlayer}      Then, I found another way to do it, with rectangles and lots of calculations: [nice example][2]                 \draw [background] ($(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(elicit.south east)!(matrix.east)+(0.2,-0.2)$);       \draw [background] ($(elicit.north west)!(interpret.north west)!(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(model.south east)!(matrix.east)+(0.2,-0.2)$);       \draw [background] ($(elicit.north west)!(representation.north west)!(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(representation.south east)!(matrix.east)+(0.2,-0.2)$);      With that code, I get nice rectangles, but they don't seem to be nodes so I cannot attach text to them. Is there a 'canonical' way of getting these rectangles with an equal width but fitting to the height of the nodes inside and able to get text attached? I found posts about modifying bounding rectangles, but I'm not sure if or how that could help me here. This is the full code (minus style definitions):               \begin{tikzpicture}     \matrix (matrix) [row sep=0.5cm,column sep=0.5cm] {       \node (elicit) [schritt] {Wissenserhebung}; & \\       \node (interpret) [schritt] {Interpretation}; & \\       & \node (model) [schritt] {Modellierung}; \\       \node (representation) [schritt] {Repräsentation}; & \\       \node (integration) [schritt] {Integration}; & \\       \node (maintenance) [schritt] {Wartung}; & \\     };          \path[->]       (elicit) edge (interpret)       (interpret) edge node[right] {\hspace{.35cm}\tiny Modellbasierter Ansatz} (model)       (interpret) edge node[right] {\tiny Rapid Prototyping} (representation)       (model) edge (representation)       (representation) edge (integration)       (integration) edge (maintenance);     \begin{pgfonlayer}{background}       % ugly, but nodes       %\node [background, fit=(elicit)] {};       %\node [background, fit=(interpret) (model)] {};       %\node [background, fit=(representation)] {};            % no nodes, but correct width       %\draw [background] ($(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(elicit.south east)!(matrix.east)+(0.2,-0.2)$);       %\draw [background] ($(elicit.north west)!(interpret.north west)!(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(model.south east)!(matrix.east)+(0.2,-0.2)$);       %\draw [background] ($(elicit.north west)!(representation.north west)!(elicit.north west)-(0.2,-0.2)$) rectangle ($(matrix.east)!(representation.south east)!(matrix.east)+(0.2,-0.2)$);     \end{pgfonlayer}     \end{tikzpicture}


title: How do I make a path with a custom head in tikz?

text: I want to make a half circle border, as an arrow head in a tikz diagram. Does anyone have an idea how to make this style?


title: Forcing \ref output

text: I am referencing a label like this `texttext \ref{p:1}, \ref{p:2} text` and after compiling my document I always get an output like this **"texttext 8, 9 text"**. Is there a way I can force an output like **"texttext 1, 2 text"**?


title: TikZ: position a node depending on width of text?

text: I need to use TikZ to draw two horizontally-spaced nodes, and an arrow between them, labelled by some text. But the arrow has to be exactly the right length to fit the text, and this will be part of a macro which could be called with text of highly variable length. The problem is that I don't know the width of the text until I've drawn the arrow and labelled it, but I have to place the nodes before I can draw the arrow. TikZ must have a solution for this - any ideas? Edit: the intention is for the arrow to reach right up to both nodes, so that it is clearly going 'from' the first node to the second, and for the arrow to only be just long enough for the text to fit as a label. So, the more text, the longer the arrow, and the further apart the nodes; the less text, the closer the nodes become.


title: How do you increase headrule length in fancyhdr?

text: It's pretty well-known how to increase the headrule width, but how do I increase its length (i.e. let it run into the margin).


title: Sorting with biblatex using sortname

text: I want to use the `firstinits=true` option of biblatex, and to disable the abbreviations for specific entries, I use `{{authorname}}`, as recommended in a previous question. However, biblatex is apparently unable to sort the bibliography in this case. No matter, I thought, I can just provide `sortname` for the few entries where this is necessary. But biblatex seems to ignore this, i.e. Baltasar appears first in my example.               \documentclass{article}     \usepackage{filecontents}     \usepackage[style=alphabetic,firstinits=true]{biblatex}          \begin{filecontents}{references.bib}         @report{example1,             author={Buthor, Baltasar},             title={Baltie's report}         }              @report{example2,             sortname={Author, Archibald},             title={Archie's report},             author={{Archibald Author}}         }     \end{filecontents}     \bibliography{references.bib}          \begin{document}       \nocite{*}       \printbibliography     \end{document}      How do I use the `sortname` field properly? Edit: I’m using an up-to-date TeXLive 2011, compiling with pdflatex and bibtex. Tried under both XP and Ubuntu.


title: Using ifthenelse for crop marks with tikz

text: How do I use to insert ifthenelse crop marks in Tikz. I want               ifthenelse{\printcrop=true}{\draw(0,0) -- ++(0,1);}{}      That is, if yes, make a drawing, else but do nothing. And yet, where I can choose the option true or false?


title: Biblatex not compress specific group

text: I am doing a literature review. And I want to put references about a certain topic inside the table. My question is very similar to: Sort but do not compress numeric citations in BibLaTeX However, I want only to disable the compression inside a table but keep sorting. Is that possible?


title: Position of the error bars in bar graphs in TiKZ

text: Help! I cant seem to get the position of the error bars right on top each bar. Also for some reason my legend seems to be off position too.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \pgfplotsset{compat=newest}               \colorlet{negro}{black}     \colorlet{gris}{black!70}     \colorlet{rojo}{red!70!black}     \colorlet{rojol}{red}          \begin{document}          \begin{center}     \begin{tikzpicture}     \begin{axis}[xscale = 1.45,      scaled ticks=false, tick label style={/pgf/number format/fixed},      xbar,       xmin = 1, xmax = 7,      ymin = -0.1, ymax = 0.25,      ytick = {-0.10, -0.05, 0.00, 0.05, 0.10, 0.15, 0.20, 0.25},      ylabel = Efecto en Pr(Voto),      xticklabels = {Género, Ruralidad, Pareja, Riqueza, Id. Part., Ideología},      ybar interval=0.5,      bar width=3pt,      grid = major,      legend style={cells={anchor=center, fill}, nodes={inner sep=1,below=-1.1ex}},area legend      ]       \draw [orange, very thick] (axis cs:0,0) -- (axis cs:7,0);       \addplot[color = negro, fill = negro,        error bars/.cd,       y dir=both,       y explicit,       error bar style={line width=1.5pt, gris},       error mark options = {       rotate = 90,        line width=1.5pt,        mark size = 3pt,        gris}       ]         coordinates{(1,-0.011097) +- (0,0.0380683)                     (2,0.0393206) +- (0,0.050079)                     (3,-0.019293) +- (0,0.0389844)                     (4,0.0078975) +- (0,0.0097073)                     (5,0.0234860) +- (0,0.0481639)                     (6,0.0336061) +- (0,0.0462397)                     (7,0)};       \addplot [color = rojo, fill = rojo,        error bars/.cd,       y dir=both,       y explicit,       error bar style={line width=1.5pt, rojol},       error mark options = {       rotate = 90,        line width=1.5pt,        mark size = 3pt,        rojol}       ]         coordinates{(1,-0.025222) +- (0,0.055507)                     (2,0.1337832) +- (0,0.0720284)                     (3,0.0517127) +- (0,0.0574637)                     (4,0.0053732) +- (0,0.0129013)                     (5,0.0741801) +- (0,0.0731692)                     (6,0.0181164) +- (0,0.0709312)                     (7,0)};      \addlegendentry{2008}      \addlegendentry{2012}      \end{axis}     \end{tikzpicture}     \end{center}          \end{document}


title: Retrieving coordinates of every character in a formula

text: I'm writing a program that uses LaTeX to display formula's. The user must be allowed to click on different parts of the formula, and the program should know on which part the user clicked. **Is there a way to retrieve the coordinates of all characters in a formula?** I would like to output these coordinates with LaTeX to a file and then read this file with the external program. Perhaps there is some LaTeX command that can be used like this:               $a=\sqrt{b^2+c^{\getcoords{2}}}$      which saves the coordinates of the digit `2` in a variable, which I can then write to an output file. Does anybody know anyway to achieve this? * * * OP's comment transcribed from comment section below: "The eventual goal of my program is that when the user clicks an element of the formula, the definition of this piece is displayed"


title: creating a list of random numbers using a loop

text: I am trying to write a loop that will generate a set of random variables to be used in the probsoln package. I would like to make a loop to generate A, B, C, etc. This exam will have a lot of questions and I would prefer to not define each individually. Then I would like to pass those numbers into the selected problem. I have tried using the `lcg` package, but I think that there might be some compatibility issues with the `probsoln` package. Here is the working code (without the loop):               \documentclass[12pt,a4paper,twocolumn]{article}     \usepackage[pdftex]{graphicx}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amssymb}     \usepackage{amsfonts} %This contains extra fonts needed for math     \usepackage{amscd}  %This allows you to draw commutative diagrams.     \usepackage{probsoln}     \usepackage{multicol}     \usepackage{enumerate}     \usepackage[T1]{fontenc}     \usepackage{color}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{tikz}     \usetikzlibrary{shapes,shapes.multipart}     \usetikzlibrary{arrows,backgrounds,snakes}     \usepackage{fancyhdr}          \usepackage[         top    = 1.50cm,         bottom = 1.50cm,         left   = 1.50cm,         right  = 1.50cm]{geometry}          \newcommand{\bigbrk}{\vspace*{2in}}     \newcommand{\bigbigbrk}{\vspace*{11in}}     \newcommand{\smallbrk}{\vspace*{.3in}}     \setcounter{section}{0}     \newcommand*\mycirc[1]{%       \begin{tikzpicture}         \node[draw,circle,inner sep=1pt] {#1};       \end{tikzpicture}}          \loadrandomproblems[ac-ma]{1}{ac-ma}     \input{ac-ma}          \newcounter{A}     \newcounter{B}     \newcounter{C}     \random{A}{1}{9}     \random{B}{1}{9}     \random{C}{1}{9}          \begin{document}          \begin{enumerate}     \item  \useproblem{AC.MA:DIST}{\arabic{A}}{\arabic{B}}     \end{enumerate}          \end{document}     \endinput      This `.tex` file is pulling from a problems database, which is in the code below: ### `ac-ma.tex`               \def\add#1#2{      \newcount\tmp      \newcount\tmptwo      \tmp=#1      \tmptwo=1      \advance\tmp by #2      \advance\tmp by \tmptwo      \number\tmp     }          \begin{defproblem}[2]{AC.MA:DIST}     If $(#1.95+#2.05)x=x$, then what is the value of $x$?     \begin{multicols}{4}     \begin{enumerate}     \correctitem $\displaystyle{\frac{1}{\add{#1}{#2}}}$     \incorrectitem $\add{#1}{#2}$     \incorrectitem $\add{-#1}{#2}$     \incorrectitem $\add{#1}{-#2}$     \end{enumerate}     \end{multicols}     \end{defproblem}          \begin{defproblem}[1]{GE.LA:E2}     $\angle A$ is a supplement of $\angle B$.  If the measure of $\angle A$ is $#1^\circ$, what is the measure of $\angle B$?     \begin{multicols}{4}     \begin{enumerate}     \incorrectitem \add{#1}{90}     \incorrectitem \add{#1}{180}     \incorrectitem \add{-#1}{90}     \correctitem \add{-#1}{180}     \end{enumerate}     \end{multicols}     \end{defproblem}          \begin{defproblem}[1]{GE.LA:E3}     $\angle P$ is a supplement of $\angle Q$.  If the measure of $\angle P$ is $(#1x)^\circ$, what is the measure of $\angle Q$?     \begin{multicols}{4}     \begin{enumerate}     \incorrectitem $90-#1x$     \incorrectitem $90+#1x$     \incorrectitem $180-#1x$     \incorrectitem $180+#1x$     \end{enumerate}     \end{multicols}     \end{defproblem}          \endinput     %%     %% End of file `ac-ma.tex'.      Any input or advice would be greatly appreciated! I am sorry for all of the packages in the preamble, but I will need them for later questions. Thank you for the help, but now I am trying to pass the numbers into the select randomly function by adding a line under enumerate:               \item  \selectrandomly{ac-ma}{1}{\myrandomC}      Unfortunately, it doesn't want to accept my arguments and I keep getting this error:               Problem `AC.MA:SYS' (in data base `ac-ma') requires 1 argument(s).      Please specify (e.g. {12}):      Do I need to wrap the inputs in something? I have tried using \thisproblem and \foreachproblem, but I keep getting the same error. @grames, I am now using the \esami package and I am trying to pull a random set of questions from the test1 file. Looking through the documentation, it looks like the appropriate command is \estraies[3]{test1}{beta}. I would then pass the questions: beta1, beta2, etc. into the \esercizi{beta1,beta2,beta3} command line. Unfortunately, it looks like I am doing something wrong because I keep getting the following error:               ! LaTeX Error: Lonely \item--perhaps a missing list environment.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.40 }          ?       Here is the code:               test1.tex              \newproblem{prob1         \FPsetpar{a}{0}{10}         \FPsetpar{b}{0}{10}         \item  If $(\a.95+\b.05)x=x$, then what is the value of $x$?         \vspace{10 mm}           \begin{answers}{2}\bChoices[random]             \Ans1 $0$ \eAns             \Ans0 \FPsv{a+b+1}\eAns             \Ans0 \FPsv{a+b}\eAns             \Ans0 $\displaystyle{\frac{1}{\FPsv{a+b}}}$ \eAns             \eChoices\end{answers}}              \newproblem{prob2         \FPsetpar{a}{2}{5}         \item  For what value of $x$ is the equation \begin{equation*}  \frac{x-\a}{\a+x}=0 \end{equation*} true?         \vspace{10 mm}           \begin{answers}{2}\bChoices             \Ans0 -\a \eAns             \Ans1 \a \eAns  \eFreeze             \Ans0 all real numbers \eAns  \eFreeze             \Ans0 There are no values for $x$ that would make the equation true. \eAns             \eChoices\end{answers}}              \newproblem{prob3         \FPsetpar{a}{2}{5}         \item  If $\a x-\a=xy-y$ and $x\neq1$, what is the value of $y$?         \vspace{10 mm}           \begin{answers}{2}\bChoices[random]             \Ans1 \a \eAns             \Ans0 -\a \eAns             \Ans0 0 \eAns \eFreeze             \Ans0 There are no values for $x$ that would make the equation true. \eAns             \eChoices\end{answers}}              \newproblem{prob4         \FPsetpar{a}{2}{5}         \item  If $\a x-\a=xy-y$ and $x\neq1$, what is the value of $y$?         \vspace{10 mm}           \begin{answers}{2}\bChoices[random]             \Ans1 \a \eAns             \Ans0 -\a \eAns             \Ans0 0 \eAns \eFreeze             \Ans0 There are no values for $x$ that would make the equation true. \eAns             \eChoices\end{answers}}               master_new.tex          \documentclass[a4paper,UKenglish]{article}     \usepackage[shufflerandom,xyz,twocolumns, autopstoff,nosolutions]{esami}     \usepackage{lmodern,textcomp}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % +=============================+     % |         DEFINITIONS         |     % +=============================+          \def\examname{The name of the exam}     \def\numcompiti{1}%%% The number of the versions     \date{2013/3/22}%%% THE DATE IN THE FORMAT YYYY/MM/DD     \def\Data{\longdate}%%% or \shortdate: the date in the heading          \begin{document}     \testversioni     \pagestyle{esame}     \whiledo{\thevers<\numcompiti}{\stepvers          % +=============================+     % |       THE SEED              |     % +=============================+          \FPeval\seme{round((\thenomefile+(3*\thevers)):0)}          \randomi=\seme     \permuta          \estraies[0]{test1}{beta}          \section*{Mathematics Achievement}     \begin{test}     \begin{questions}     \esercizi{betai,betaii}     \end{questions}     \end{test}          %\closevers     }     \end{document}      Any help would be greatly appreciated. Thanks MeTutel @grames ok, that's good to know. I haven't been able to get that working yet, but I will keep playing around with it. I have another question. Your package is using the PSTricks package for graphics, which from the documentation should be in the workarea space. I have changed the option to autostopon, but the graphic I am trying to generate is still not working. I hope that all of the questions are not a nuisance, but I am trying to read through the documentation and examples and play with the code before I submit questions. Here is the code I am using, problem file first. **eachtest.tex**               \newproblem{     \item  Determine the are of the figure below.          \begin{workarea}[10mm]{10mm}     \begin{pspicture}(4,5)     \psframe(0.7,2)(3.3,3)     \rput(2,2.5){First Example}     \end{pspicture}     \end{workarea}          \vspace{10 mm}       \begin{answers}{2}\bChoices[random]         \Ans0 Wrong \eAns         \Ans1 Right \eAns         \Ans0 Wrong \eAns         \Ans0 Wrong \eAns         \eChoices\end{answers}     }'          \documentclass[a4paper,UKenglish]{article}     \usepackage[shufflerandom,autopston,xyz,twocolumns,solutions]{esami}     \usepackage{lmodern,textcomp}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % +=============================+     % |         DEFINITIONS         |     % +=============================+          \def\examname{The name of the exam}     \def\numcompiti{1}%%% The number of the versions     \date{2013/3/22}%%% THE DATE IN THE FORMAT YYYY/MM/DD     \def\Data{\longdate}%%% or \shortdate: the date in the heading          \begin{document}     \testversioni          \pagestyle{esame}     \whiledo{\thevers<\numcompiti}{\stepvers          % +=============================+     % |       THE SEED              |     % +=============================+          \FPeval\seme{round((\thenomefile+(3*\thevers)):0)}          \randomi=\seme     \permuta          \section*{Mathematics Achievement}     \begin{test}     \begin{questions}     \esercizi{eachtest}     %\esercizi{probs-ac-ma,probs-ge-ma,probs-ge-qr}     \end{questions}     \end{test}          \closevers     }     \end{document}


title: Unit spacing with siunitx in an equation

text: I'm just starting to get to grips with the `siunitx` package, but I've noticed that there seems to be some issues with regards to unit notation spacing in an equation. With `siunitx` it is possible to put a space between the numerical value and the unit by leaving a space after the number of before the unit (e.g., `\num{3.7d10} \si{\becquerel}` or `\num{3.7d10}\si{ \becquerel}`). However, when I do this in equation mode there doesn't seem to be a way to create a space between the number and the unit. Am I missing something, or is this an inherent fault/problem?               \documentclass[12pt,a4paper]{report}     % International language package - allows use of special characters     \usepackage[utf8]{inputenc}     % Line spacing package - allows user to set line spacing     \usepackage{amsmath}     % Graphics package - allows document to include various graphics files     \usepackage{chemformula}     % SI Unit package - allows for standard unit notation     \usepackage{siunitx}     \DeclareSIUnit\curie{Ci}          \begin{document}          % no spaces     \num{3.7d10}\si{\becquerel} \\          % space before unit     \num{3.7d10}\si{ \becquerel} \\          % space after number     \num{3.7d10} \si{\becquerel} \\          % no spaces     \begin{equation}     \num{1}\si{\becquerel} = \num{2.703d11}\si{\curie} \\     \end{equation}          % spaces before units     \begin{equation}     \num{1}\si{ \becquerel} = \num{2.703d11}\si{ \curie} \\     \end{equation}          % spaces after number     \begin{equation}     \num{1} \si{\becquerel} = \num{2.703d11} \si{\curie} \\     \end{equation}          \end{document}


title: Persistent random steps decorations during beamer \uncover

text: I'm using a random steps decoration with a path that appears through several uncover transitions. Currently the decoration is redrawn in each instance of the slide. How can I change this behavior. A minimal example follows. Thanks.               \documentclass[presentation]{beamer}       \usepackage{tikz, pgf}       \usetikzlibrary{decorations.pathmorphing}       \begin{document}       \begin{frame}       \begin{center}       \begin{tikzpicture}       \uncover<1-3>{       \fill [decorate, decoration={random steps,segment length=2pt,amplitude=2pt}] (0,0) ellipse (0.5cm and 0.4cm);       }       \end{tikzpicture}       \end{center}       \end{frame}       \end{document}


title: Adding text to circle in TikZ

text: I drew a circle and wanted to add text $T_1$ inside it:               \draw (0,0) circle [radius=0.3] {$T_1$};      Why does this not work, and how can I fix it?


title: Which document classes have frame and pdfpageduration type commands?

text: Are these effects only available in the beamer class? Are there similar commands in other packages/classes? 1/22/2012- I want to have access to basic animation tools in order to make "live" text. The only package that I know is beamer but that assumes that you want to make a power-point style or slide presentation. I want some of the same capabilities but I do not want the way beamer changes all default settings of article class. For example consider explaining the stages of long division in an ordinary document.


title: I get the warning "Undefined control sequence" with \mathbb

text: I am doing my first LaTeX work using TeXstudios and I'm having trouble with an Undefined control sequence. When I've checked solutions on google it appears as this is caused by typos in the different commands. However, I have used the TeXstudios implemented menus to generate the codes so it shouldn't be any problem with that. The code I'm having trouble with is               $x\in\mathbb{R}^{n}$      which I intend to become x belonging to the real numbers with n as an exponent. I get the error               Undefined control sequence $x\in\mathbb


title: baselinestretch outside of LaTeX preamble?

text: What is the difference, in LaTeX's head, between these two documents:               \documentclass{article}     \usepackage{lipsum}     \begin{document}     \renewcommand{\baselinestretch}{2.0}     \lipsum[2]     \end{document}      ...and...               \documentclass{article}     \usepackage{lipsum}     \renewcommand{\baselinestretch}{2.0}     \begin{document}     \lipsum[2]     \end{document}      The first doesn't result in a double spaced document, I feel it should. Is it only possible to set `\baselinestretch` in the preamble, or can it be changed part way through a document? (Note: I'm using the `setspace` package for double spacing, I'm curious mostly as to the behavior of `\baselinestretch` here...)


title: XeLaTeX Ghostscript call for EPS to PDF conversion failing

text: Updated with properly minimalistic example.. I've been wrestling with this for a while now. I had a setup using pdfLaTeX with epstopdf that works nicely, but I need mathspec so I've moved to XeLaTeX. All of my figures are now causing problems. Example below:               \documentclass[twoside,english,xetex]{article}     \usepackage{amsmath}      \usepackage{mathspec}     \setmainfont{Linux Libertine}     \setmathsfont(Digits,Latin,Greek){Neo Euler}     \usepackage{graphicx}     \begin{document}          \section*{A heading}          Some maths.          \begin{equation}     \frac{V_{O}}{V_{I}}=-\frac{R_{F}}{R_{I}}     \end{equation}          And a figure.          \begin{figure}[hb]     \includegraphics{plotd}     \caption{A graph in EPS format}     \end{figure}          \end{document}      plotd calls a graph in EPS. File is available here http://ge.tt/4W5Mxsb1/v/0 It's not anything special, was created by Gnuplot. The error I'm getting out of XeLaTeX is as follows (the section where I think the error is likely to be:               LaTeX Font Warning: Font shape `EU1/NeoEuler(0)/m/it' undefined     (Font)              using `EU1/NeoEuler(0)/m/n' instead on input line 13.          <plotd.eps>     Overfull \hbox (16.34999pt too wide) in paragraph at lines 20--21     [][]      [1] ("C:\Users\Li'lOne\Documents\p1l2\minim.aux")MiKTeX GPL Ghostscript 9.05: **** Could not open the file C:/Users/LilOne/AppData/Local/Temp//xdvipdfmx.b3cf3efa229c343a1415f680eef8e9a9 C:/Users/LilOne/Documents/p1l2/plotd.eps .     **** Unable to open the initial device, quitting.          ** WARNING ** Couldn't open font map file "kanjix.map".     ** WARNING ** Filtering file via command -->mgs.exe -q -dNOPAUSE -dBATCH -dEPSCrop -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile="C:/Users/Li'lOne/AppData/Local/Temp//xdvipdfmx.b3cf3efa229c343a1415f680eef8e9a9" "C:/Users/Li'lOne/Documents/p1l2/plotd.eps" -c quit<-- failed.     ** WARNING ** Image format conversion for "C:/Users/Li'lOne/Documents/p1l2/plotd.eps" failed...     ** ERROR ** pdf_ref_obj(): passed invalid object.          Output file removed.      Full log available here: http://pastebin.com/ymNYwsYn Whilst I can use epstopdf by hand and convert each document, that will be a time consuming and not viable long term process. I have tried this on both Windows 7 using MikTeX 2.9 and Linux Mint 15 using the latest version of TeXLive (the above logs came from Windows but the errors are the same). My scripts are set to execute system commands so that isn't the issue. I'd be very grateful for any advice you can offer.


title: How to change the size of nodes?

text: How is it possible to change the size of a node, for example:               \begin{tikzpicture}          \draw  node[fill,circle]{} (0,0);%     \end{tikzpicture}      How to make the circle smaller or larger?


title: I just want to have the text in my pdf the same way I have it in my editor

text: I want to paste from the clipboard a plain text copied from a text editor (line wordpad++, vim, notepad etc), and I want TeX to respect the same line break formatting that the editor has. This works great between most text editors, however if I copy a text to a TeX editor and compile it, then it does not respect the line breaks. Of course I can put `\\\` or `\linebreak` or whatever other typesetting function, but I don't want that. Also simple ASCII symbols like the ampersand must also be escaped (`\&`) I just want to have the text in my `.pdf` the same way I have it in my editor, without further editing it in my TeX editor. Is there any function|style setting that can help me? Notice I also need word wrap for the quoted text.


title: Multiple bibliographies when each child document has its own directory

text: I'm using the `chapterbib` package for multiple bibliographies. I put the following two lines in the preamble.               \usepackage[square,numbers,sectionbib]{natbib}     \usepackage{chapterbib}      Included chapter files with               \include{Chapter01}      and added the bibliography to the end of each chapter with               \bibliographystyle{plainnat}     \bibliography{Bibliography}      This works perfectly. But when I put each chapter in its own sub directory and use `\input` rather than `\include` like this               \input{../101Chapter01/101Chapter01}      it produces the global bibliographies for each chapter. Any help will be highly appreciated.


title: Rotated multipage table at start of chapter

text: I'm working on an article in which I have to put a large and wide table. This table is directly at the start of a new chapter. Because it is very wide, I want to rotate this table (or use it in a landscape environment). Due to the size of the table, I want it to continue on multiple pages. This is how I've currently done this:               \documentclass[twocolumn]{article}     \usepackage{pdflscape}     \usepackage{longtable}     \usepackage{lipsum}          \begin{document}     \onecolumn     \section{Title}          \begin{landscape}     \centering     \begin{longtable}{|p{0.5cm}|p{5.5cm}|p{5.5cm}|p{5.5cm}|}     \caption{Long and wide table} \\     \hline      & \rule{0pt}{3ex}\textbf{Text} & \textbf{More text} & \textbf{Example} \\ \endhead     \hline     \rule{0pt}{3ex}1.1 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.2 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.3 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.4 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.5 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.6 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.7 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline     \rule{0pt}{3ex}1.8 & \lipsum[13] & \lipsum[13]& \lipsum[13]\\     \hline           \end{longtable}     \end{landscape}     \twocolumn     \end{document}      This works fine, except this table does not begin at the start of my section, but on the next page, leaving only the name of the new section on a blank page. I tried to solve this by using the hvfloat package, as is done here. To get this working I switched to a table instead of a longtable, but this introduces the problem that the table is put on one page (while it should be on multiple pages, thus a large part of the table is not visible since it is outside the page). I've put many hours in getting this working and on the internet I can't find any help, so can one of you guys help me out?


title: How to align index columns

text: I followed the example posted by @Schweinebacke Customizing Index - Adding chapter heading and verse number to index entries and it works great. However I would like to change the appeareance of index. To show the change I am attaching an image with this mail. I would like to align the columns of index, first column left justified, right column right justified and middle column left justified. I would really appreciate your help ![enter image description here](http://i.stack.imgur.com/jzDF5.jpg)


title: Generate LaTeX Truth Table with Python Cheetah

text: While looking for code which can automatically generate truth table in LaTeX I stumbled on this Python generator. It appears that the code can be used from Cheetah's framework. Can anybody point me to a simple example of use. I started reading documentation for Cheetah ? Additionally can people provide me with other examples of using Cheetah (or some other frame work) to automatically generate LaTeX code. **Edit:** I am not sure if Sphinx also could be used as a wrapper for above code.


title: circuitikz labeling

text: I am trying to create a few logic circuits for a class that I teach. After brief investigation I decided to use TikZ library circuit due to the lack of the support by PSTricks for American notation. It works like a charm apart of the fact that I have small problem with labeling. This is the picture I am trying to program. ![enter image description here](http://i.stack.imgur.com/Fig0p.png) This is the code               \documentclass{article}     \usepackage{circuitikz}     \begin{document}     \begin{center}       \begin{circuitikz}          \draw           (0,0) node[and port] (myand){AND}           (myand.in 1) node[anchor=east]{P}            (myand.in 2) node[anchor=east]{Q}            (0.9,0) node[scale=0.7,not port] (mynot){NOT}           (mynot.out) node[anchor=west]{S}           (myand.out) -- (mynot.in);       \end{circuitikz}     \end{center}     \end{document}      which produces this output ![enter image description here](http://i.stack.imgur.com/9jlOW.png) As you can see everything is almost perfect apart of the fact that I do not know how to center words "AND" and "NOT" into the middle of drawings. How do you change the absolute/relative position of labels in a circuit diagram? By the way this is the second time I use TikZ in my life and it took me only 5 minutes of playing to reproduce almost perfect image. It speaks volumes about the quality of TikZ.


title: Disabling "glue" and other vertical space adjustment?

text: I'm making a template that I can use for my résumé and CV which uses a horizontal line underneath section titles. I'm running into a problem where, when a page is nearly full, then the vertical whitespace near the line is adjusted so that it runs into the section title and looks horrible. I'd prefer if LaTeX just put the last line of the page onto the next page, rather than cramming it in and adjusting the whitespace. In response to this problem, I've been trying to disable any kind of "glue" that I can find, but to no avail. Mostly everything I've tried is in the examples below. I'm including two examples, one in which the page isn't full, and one in which it is, so you can see the difference. The first picture is from the code below, but with the second and third paragraphs removed. I apologize if this issue has already been addressed elsewhere, but I can't find a good solution. Also, please feel free to suggest improvements which are not directly related to my question. This is the first time I'm building a template like this from scratch, and I'm sure I'm doing it wrong (and breaking all the rules of typography). Thanks!               \documentclass[12pt]{article}     \usepackage[left=.95in,right=.95in,top=.95in,bottom=.95in]{geometry}     \pagestyle{empty}     \raggedbottom          \setlength{\parindent}{0in}     \setlength{\leftskip}{4pt}     \setlength{\rightskip}{\leftskip}     \setlength{\lineskiplimit}{-100pt}     \setlength{\baselineskip}{11pt plus 0pt minus 0pt}     \setlength{\normalbaselineskip}{11pt plus 0pt minus 0pt}     \setlength{\lineskip}{11pt plus 0pt minus 0pt}     \setlength{\normallineskip}{11pt plus 0pt minus 0pt}     \setlength{\parskip}{1pt plus 0pt minus 0pt}     \setlength{\topskip}{0pt plus 0pt minus 0pt}          \newcommand{\sect}[1]{\addvspace{15pt plus 0pt minus 0pt} {\large{\textsc{#1}}}%      \begin{center} \addvspace{-21pt plus 0pt minus 0pt} \line(1,0){474} \end{center}      \addvspace{-10pt plus 0pt minus 0pt} \par}     \newcommand{\plain}[1]{%      \begingroup \addtolength{\leftskip}{1pt} \addtolength{\rightskip}{1pt} #1 \par \endgroup       \addvspace{5pt plus 0pt minus 0pt}}          \begin{document}          \sect{Section}     \plain{Text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text.}     \plain{Text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text.}     \plain{Text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text              text text text text text text text text text text text text text text.}          \end{document}      ![Example 1](http://i.stack.imgur.com/mdZHU.jpg) ![Example 2](http://i.stack.imgur.com/zbDZa.jpg)


title: enumitem not working with foilhead

text: Is there any way to get, say, 10.1, 10.2, 10.3 in the following enumeration? I keep getting error ! Missing number, treated as zero.               \documentclass{beamer}     \usepackage{beamerfoils}     \usepackage[british]{babel}     \usetheme{Copenhagen}     \usefonttheme{structurebold}          \begin{document}     \foilhead{tst}     \begin{enumerate}[label=10.\arabic*.]     \item One     \item Two     \item Three     \end{enumerate}     \endfoil     \end{document}


title: Automatically capitalise the first word in each sentence

text: I'm writing a report together with another person, and he often neglects to use a capital letter at the start of each sentence. Is it possible to get LaTeX to correct this automatically instead of doing so by hand?


title: How to align equations when some inside are gathered

text: I have a set of equations where some are coupled with a brace and some text. I want all the equations aligned. Something like the following ASCII art:                S = LR           L = Ls  \               |  for s in {a, b}     Rs = sR  /      I tried this:               \begin{align*}     S &= LR \\     \left.     \begin{gather*}     L &= L_s\\     R_s &= sR     \end{gather*}     \;\;\right\}\;\;\text{for } s \in \{a, b\}\\     \end{align*}      But it doesn't compile (because `&` is not expected inside a `gather*` environment). Is it possible to do this?


title: Extract authors name from a bibtex entry

text: I have a bibtex list of references and i would like to get the authors' names from a specific entry in my `.bib` file. Is there a command for that?


title: Developing a document class using a Writer2LaTeX-generated document as a starting point

text: ## Background My university is finally starting to become more LaTeX-aware and has developed and published a document class for theses and memoirs. This class is based on the `memoir` class and is now distributed as part of TeX Live 2012. In my department, at least one professor uses LaTeX proficiently. I have started to work with this person in order to make LaTeX kown to other members of the department and, in particular, to members of the research center that employs me. Recently, while editing a thesis, I realized that many authors working with my research center were at a loss when it came to formatting their work according to the provided guidelines. After convincing the department that providing stylesheets and precise instructions would benefit everyone involved in authoring and editing, I was then given the job of developing templates for OpenOffice/LibreOffice and Microsoft Word. I have completed this task, and I would now like to create a corresponding LaTeX document class to promote the use of LaTeX as an alternative to the current word processor > InDesign > PDF workflow. ## The main question I have an OpenDocument Text template containing all the styles that authors are likely to need during the editing process. Because there is much differentiation in terms of text body paragraphs, block quote styles and the like, producing the LaTeX class from the ODT template seems to be most practical solution, as the LaTeX template needs to contain all of the same styles as the ODT template and remain aligned with it. I already use Writer2LaTeX to typeset all of the documents that I produce for my research center. Writer2LaTeX version 1.2 (currently in beta) generates a suitable preamble when a given document’s formatting has been correctly defined using styles exclusively as oppposed to manual formatting. I have an absolute requirement (which I think is reasonable in this day and age) that XeTeX or LuaTeX be used, because the field I work in (early modern literature) requires true Unicode support and most documents are bound to contain multiple languages (often French, English and Latin and occasionally polytonic Greek and Cyrillic-based languages). That is why I use Writer2LaTeX 1.2 with the engine set to “XeTeX”. Usually, all I need to do is add `fontspec` commands to the preamble and then I can typeset the document without any further intervention on the generated LaTeX. However, for a LaTeX-based workflow, copying a Writer2LaTeX preamble just won’t do. I need to develop a genuine class. My intuition is that I could use Writer2LaTeX as a starting point and keep the same command names for my class. These commands often begin with `\textStyle` and other such prefixes depending on the family of the ODT style from which they were generated. In this way, the class would retain concepts and distinctions that are close to OpenDocument’s style model. What I need to know is: can I just dump a preamble containing all the style commands I need into a class file? I do not know much about class development, but something tells me that it cannot be the best practice. What is the best route? Customizing Writer2LaTeX’s output by “opening the hood” and writing additional XSLT? I admit that I have yet to learn XSLT, for one thing. ### Sub-question How can I make Writer2LaTeX’s generated preamble more readable? In general, I am aware of the fact that LaTeX commands can be split on multiple lines by placing comment characters `%` at the end of individual statements, but is there a caveat to this approach in some particular cases? My goal is to make the class code as readable as possible: I would like it to look a bit like CSS, which in my opinion is one of the best-looking languages out there and is a charm to write. To sum it up: should I just make Writer2LaTeX’s output more readable and fine- tune it by adding `fontspec` definitions and the like, or should I take inspiration from Writer2LaTeX’s output and write my class from scratch using the standard class development tools? Edit: Here is an example of a preamble created by Writer2LaTeX. This was generated from one of my course assignment documents. The only command I have added myself is `\setmainfont{Brill}`.               % This file was converted to LaTeX by Writer2LaTeX ver. 1.2     % see http://writer2latex.sourceforge.net for more info     \documentclass[letterpaper,12pt]{article}     \usepackage{amsmath,amssymb,amsfonts}     \usepackage{fontspec}     \setmainfont{Brill}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{polyglossia}     \setdefaultlanguage{french}     \setotherlanguage{english}     \usepackage{color}     \usepackage{fancyhdr}     \usepackage[top=3.39cm,bottom=3.39cm,left=3.39cm,right=3.39cm,nohead,includefoot,foot=1.016cm,footskip=1.524cm]{geometry}     \usepackage{array}     \usepackage{hhline}     \usepackage{hyperref}     \hypersetup{colorlinks=true, linkcolor=blue, citecolor=blue, filecolor=blue, urlcolor=blue}     % footnotes configuration     \makeatletter     \renewcommand\thefootnote{\arabic{footnote}}     \renewcommand\@makefnmark{\mbox{\textstyleFootnoteanchor{\@thefnmark}}}     \makeatother     % Text styles     \newcommand\textstyleEmphasis[1]{\textfrench{\textrm{\textit{#1}}}}     \newcommand\textstyleSuperscript[1]{\textsuperscript{#1}}     \newcommand\textstyleNumberingSymbols[1]{#1}     \newcommand\textstyleStephanusnum[1]{\textrm{\textsuperscript{#1}}}     \newcommand\textstyleFootnoteanchor[1]{\textrm{\textsuperscript{#1}}}     % Headings and outline numbering     \makeatletter     \newcommand\cssection[1]{\textfrench{#1}}     \renewcommand\section{\@startsection{section}{1}{0.0cm}{0.559cm}{0.559cm}{\normalfont\normalsize\normalcolor\fontsize{16pt}{19.2pt}\selectfont\rmfamily\mdseries\cssection}}     \newcommand\cssubsection[1]{\textfrench{#1}}     \renewcommand\subsection{\@startsection{subsection}{2}{0.0cm}{0.28cm}{0.28cm}{\normalfont\normalsize\normalcolor\fontsize{12pt}{14.4pt}\selectfont\rmfamily\mdseries\itshape\cssubsection}}     \renewcommand\@seccntformat[1]{\csname @textstyle#1\endcsname{\csname the#1\endcsname}\csname @distance#1\endcsname}     \setcounter{secnumdepth}{0}     \newcommand\@distancesection{}     \newcommand\@textstylesection[1]{#1}     \newcommand\@distancesubsection{}     \newcommand\@textstylesubsection[1]{#1}     \makeatother     \raggedbottom     % Paragraph styles     \renewcommand\familydefault{\rmdefault}     \newenvironment{stylePii}{\clearpage\setcounter{page}{1}\pagestyle{Standard}     \thispagestyle{FirstPage}     \setlength\leftskip{0cm plus 1fil}\setlength\rightskip{0cm plus 1fil}\setlength\parindent{0cm}\setlength\parfillskip{0pt}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\fontsize{24pt}{28.8pt}\selectfont\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0.559cm plus 0.0559cm}\par}     \newenvironment{styleAuthor}{\renewcommand\baselinestretch{1.25}\setlength\leftskip{0cm plus 1fil}\setlength\rightskip{0cm plus 1fil}\setlength\parindent{0cm}\setlength\parfillskip{0pt}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\upshape\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0cm plus 1pt}\par}     \newenvironment{styleDate}{\renewcommand\baselinestretch{1.25}\setlength\leftskip{0cm plus 1fil}\setlength\rightskip{0cm plus 1fil}\setlength\parindent{0cm}\setlength\parfillskip{0pt}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\upshape\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0cm plus 1pt}\par}     \newenvironment{styleTextbody}{\renewcommand\baselinestretch{1.0}\setlength\leftskip{0cm}\setlength\rightskip{0cm}\setlength\parindent{0.559cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0cm plus 1pt}\par}     \newenvironment{styleQuotations}{\setlength\leftskip{1.131cm}\setlength\rightskip{1.131cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0.559cm plus 0.0559cm}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0.559cm plus 0.0559cm}\par}     \newenvironment{stylePv}{\setlength\leftskip{0cm}\setlength\rightskip{0cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0cm plus 1pt}\par}     \newenvironment{stylePi}{\setlength\leftskip{1.131cm}\setlength\rightskip{1.131cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0.559cm plus 0.0559cm}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0.559cm plus 0.0559cm}\par}     \newenvironment{styleCitationanglais}{\setlength\leftskip{1.131cm}\setlength\rightskip{1.131cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0.559cm plus 0.0559cm}\writerlistparindent\writerlistleftskip\begin{english}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{english}\unskip\vspace{0.559cm plus 0.0559cm}\par}     \newenvironment{styleCitationsuivant}{\setlength\leftskip{1.131cm}\setlength\rightskip{1.131cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0.559cm plus 0.0559cm}\par}     \newenvironment{stylePiv}{\renewcommand\baselinestretch{1.0}\setlength\leftskip{0cm}\setlength\rightskip{0cm}\setlength\parindent{0cm}\setlength\parfillskip{0pt plus 1fil}\setlength\parskip{0cm plus 1pt}\writerlistparindent\writerlistleftskip\begin{french}\leavevmode\normalfont\normalsize\normalcolor\writerlistlabel\ignorespaces}{\end{french}\unskip\vspace{0cm plus 1pt}\par}     % List styles     \newcommand\writerlistleftskip{}     \newcommand\writerlistparindent{}     \newcommand\writerlistlabel{}     \newcommand\writerlistremovelabel{\aftergroup\let\aftergroup\writerlistparindent\aftergroup\relax\aftergroup\let\aftergroup\writerlistlabel\aftergroup\relax}     \newcommand\labellistListileveli{\textstyleNumberingSymbols{•}}     \newcommand\labellistListilevelii{\textstyleNumberingSymbols{•}}     \newcommand\labellistListileveliii{\textstyleNumberingSymbols{•}}     \newcommand\labellistListileveliv{\textstyleNumberingSymbols{•}}     \newenvironment{listListileveli}{\def\writerlistleftskip{\addtolength\leftskip{0.4cm}}\def\writerlistparindent{}\def\writerlistlabel{}\def\item{\def\writerlistparindent{\setlength\parindent{-0.4cm}}\def\writerlistlabel{\makebox[0.4cm][l]{\labellistListileveli}\hspace{0cm}\writerlistremovelabel}}}{}     \newenvironment{listListilevelii}{\def\writerlistleftskip{\addtolength\leftskip{0.801cm}}\def\writerlistparindent{}\def\writerlistlabel{}\def\item{\def\writerlistparindent{\setlength\parindent{-0.4cm}}\def\writerlistlabel{\makebox[0.4cm][l]{\labellistListilevelii}\hspace{0cm}\writerlistremovelabel}}}{}     \newenvironment{listListileveliii}{\def\writerlistleftskip{\addtolength\leftskip{1.199cm}}\def\writerlistparindent{}\def\writerlistlabel{}\def\item{\def\writerlistparindent{\setlength\parindent{-0.4cm}}\def\writerlistlabel{\makebox[0.4cm][l]{\labellistListileveliii}\hspace{0cm}\writerlistremovelabel}}}{}     \newenvironment{listListileveliv}{\def\writerlistleftskip{\addtolength\leftskip{1.6cm}}\def\writerlistparindent{}\def\writerlistlabel{}\def\item{\def\writerlistparindent{\setlength\parindent{-0.4cm}}\def\writerlistlabel{\makebox[0.4cm][l]{\labellistListileveliv}\hspace{0cm}\writerlistremovelabel}}}{}     % Footnote rule     \setlength{\skip\footins}{0.119cm}     \renewcommand\footnoterule{\vspace*{-0.018cm}\setlength\leftskip{0pt}\setlength\rightskip{0pt plus 1fil}\noindent\textcolor{black}{\rule{0.25\columnwidth}{0.018cm}}\vspace*{0.101cm}}     % Pages styles     \fancypagestyle{Standard}{\fancyhf{}       \fancyhead[L]{}       \fancyfoot[C]{\thepage{}}       \renewcommand\headrulewidth{0pt}       \renewcommand\footrulewidth{0pt}       \renewcommand\thepage{\arabic{page}}     }     \fancypagestyle{FirstPage}{\fancyhf{}       \fancyhead[L]{}       \fancyfoot[L]{}       \renewcommand\headrulewidth{0pt}       \renewcommand\footrulewidth{0pt}       \renewcommand\thepage{\arabic{page}}     }     \pagestyle{Standard}     \sloppy     \title{Le rôle de l’harmonie et de la musique dans le Timée de Platon}     \author{}     \date{2013-02-01}      Not very clean-looking, as you can see, but I am sure that something good can come of it. The template I am working on for my research center has a similar set of styles.