title: Appending a line (of fixed length) to a spring drawn with tikz coil

text: Looking at the nice answer here: Draw mechanical springs in TikZ, I would like to attach a line of fixed length (say 5mm) to the top of the spring (to the platform) and bottom of the spring (to the mass). The key here is I would like these segments to remain (with length 5mm) whether the spring in the answer to the post above is uncompressed or compressed. **Edit: Here's what I've got thus far, but getting my linear segment from the bottom of the coil to the top of the mass is giving me trouble.**               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,patterns}     \usetikzlibrary{calc,patterns,decorations.markings}     \usetikzlibrary{positioning,snakes}          \begin{document}          \begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick}]          \tikzstyle{spring}=[thick,decorate,decoration={aspect=0.5, segment length=1mm, amplitude=2mm,coil}]     \tikzstyle{dampener}=[thick,decoration={markings,       mark connection node=dmp,       mark=at position 0.5 with       {         \node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=15pt,minimum height=3pt,draw=none] {};         \draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);         \draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);       }     }, decorate]     \tikzstyle{platform}=[fill,pattern=north east lines,draw=none,minimum width=2cm,minimum height=0.3cm]          \node (g) [platform,anchor=north] {};          \node[draw=none,below=1.25cm of g,inner sep=-2,minimum size=0mm] (topspring){};          \node[draw=none,below=1.25cm of topspring] (bottomspring){};     \node[draw=none,below=.5cm of bottomspring] (attachment){};          \node[circle,below=.5cm of attachment] (pt2){$m$};          \draw [dampener](topspring.north)--(g.south) node[draw=none,pos=.52,right=.4cm] {$b$};     \draw [spring] (topspring.south) -- (bottomspring.north) node[draw=none,pos=.5,right=.25cm] {$k$};     \draw [thick] (bottomspring) -- (attachment);          \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/VsuPA.png) **Edit #2: A little modification of Harish's answer allowed me to get the look I was after, with the coil tightness varying with the displacement of the mass.** ![enter image description here](http://i.stack.imgur.com/1W0F3.png) **Edit #3: Harish's answer gives a very efficient solution for adjusting multiple parameters.**


title: How can I use todonotes with beamer?

text: I'm creating a presentation using beamer and I would like to denote bits that need to be done later using the `todonotes` package. But there appears to be some conflict between the two packages. I get errors of the form               ! LaTeX Error: Float(s) lost.      I'm guessing this is because the slides don't have a margin in which to place the todo bubbles. What's the best way to get around this? I'm looking for something easier than manually adding the `inline` option to every use of `\todo`.


title: Memoir and geometry

text: I am using geometry with memoir. I use it to change the margins of my document temporarily, e.g.:               ....     \savegeometry{the_original_geometry}     \newgeometry{top=2.5cm, bottom=2.5cm,headsep=0cm}     ....     \loadgeometry{the_original_geometry}     ....      I think memoir supplies its own set of commands for adjusting margins. I looked into the documentation but I couldn't find a command that was as intuitive as those above, and that allows me to switch quickly between two types of layouts Is there a way to do this using `memoir`'s commands and avoid using the `geometry` package ? Also, a related question: How do I get geometry or memoir to print the current values of `top`, `bottom` and `headsep`?


title: Page breaks in table rows

text: I want to make a document that contains a synopsis of events, like               YEAR           HISTORY          CULTURE             SCIENCE          1770        History para-     culture para-      science para-                 graph history     graph culture      graph science                 paragraph.        paragraph cult-    paragraph sci-                                   re paragraph.      ence paragraph                 History para-                        science para-                 graph history     culture para-      graph science                 paragraph his-    graph culture      paragraph.                 tory paragraph    paragraph                 History para-                      graph.          1771        History para-     culture para-      science para-                 graph history     graph culture      graph science                 paragraph...      paragraph ...      ence ...      I tried to use a `longtable` to achieve such a result, but run into the problem that `longtables` do not allow page breaks within cells, but only inbetween rows. In my example, page breaks are only possible between the 1770 and 1771 row, but not for example, if one of the rows itself becomes too long for one page. The text of the paragraphs comes from a database and is automatically assembled. So manual adjustments are not an option. Exists there any alternative for `longtables` that allows page breaks inside a row, or is there any other way to achieve such a layout without using tables?


title: A special fraction macro with raised fraction bar

text: I need to create a macro which allows me to get a fraction with a raised fraction bar. In a first approach, I mean to create two boxes (numerator and denominator), separated by a fixed horizontal rule that runs all the numerator and denominator width. However, actually I have not sufficient TeX notions to do this, thus I'm typesetting my documents with a simply `\raisebox{.85pt}{$\displaystyle{\frac{#1}{#2}}$}`. ![different height of fracions](http://i.stack.imgur.com/JFBz6.png) The picture above shows the problem: in this one, on the left there is the raised fraction, on the right the default fraction. As you can see, my trivial resolution does not solve the problem of the height of the whole fraction, which is too high. I must tell you that this problem is due to the use of a non-standard TeX font: plus and minus symbols belong to mathematical pi fonts, and their mid- line does not coincide with the TeX primitive. So, is there a way to fix the fraction height and raise only its bar?


title: biblatex. comfortable author citing

text: I'm at the end of writing a text, and I'm not very lucky about the way I had to handle author names so far. I'm using the solution from Citing author's full name in biblatex the first time it appears and cite authornames with `\citeauthor{key}`. Well, this can become hard to read in the source code, if you always have to deal with keys, especially if you have more entries with the same author. So I'm looking for a way to make author citing more convenient. Look at the following MWE:               \documentclass{article}     \usepackage[style=verbose-ibid]{biblatex}     \usepackage{filecontents}          \begin{filecontents*}{mybib.bib}     @book{kpv,         author={Immanuel Kant},         title={Kritik der praktischen Vernunft}     }     @book{krv,         author={Immanuel Kant},         title={Kritik der reinen Vernunft}     }        @book{sz,         author={Martin Heidegger},         title={Sein und Zeit}     }     @book{sg,         author={Martin Heidegger},         title={Der Satz vom Grund}     }     \end{filecontents*}          \addbibresource{mybib.bib}               \makeatletter     \newcommand*{\cbx@seennames}{}     \newrobustcmd*{\cbx@nameseen}[1]{%       \listxadd{\cbx@seennames}{\detokenize{#1}}}     \newrobustcmd*{\cbx@ifnameseen}[1]{%       \xifinlist{\detokenize{#1}}{\cbx@seennames}}          \DeclareNameFormat{citeauthor}{%       \cbx@ifnameseen{#1#3#5#7}         {\ifcase\value{uniquename}%            \usebibmacro{name:last}{#1}{#3}{#5}{#7}%          \or            \ifuseprefix              {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}              {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%          \fi}%         {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%          \cbx@nameseen{#1#3#5#7}}%       \usebibmacro{name:andothers}}     \DeclareCiteCommand{\citeauthor}       {\boolfalse{citetracker}%        \boolfalse{pagetracker}%        \usebibmacro{prenote}}       {\indexnames{labelname}%        \printnames[citeauthor]{labelname}}       {\multicitedelim}       {\usebibmacro{postnote}}     \makeatother          \begin{document}     \noindent{}\citeauthor{sz} has shown that\ldots, but \citeauthor{kpv} presumes that\ldots.          However, \citeauthor{krv} lived in the 18. century, \citeauthor{sg} in the 20.          \nocite{*}          \printbibliography     \end{document}         **Idea 1:** Let LaTeX automatically generate commands like `\kant` and `\heidegger` out of the .bib-file. I don't know if this is possible, but that would be my absolute favourite. **Idea 2:** Let biblatex automatically generate dummy entries (i.e. @book) for every author. So, in my example below it had to generate the entries `@book{kant,authorname={Immanuel Kant}}` and `@book{heidegger,authorname={Martin Heidegger}}` and I can at least use `\citeauthor{kant}`. This all could become more difficult, if you have more authors for one record: `\heideggeretal`


title: Can one reconfigure packages after \usepackage?

text: Is it possible to change the options a package was invoked with after the fact? That is, could one define `\OopsIWishIHadWrittenDraftWhenIncludingGraphicx` so that               \documentclass{article}     \usepackage[final]{graphicx}     \OopsIWishIHadWrittenDraftWhenIncludingGraphicx     \begin{document}     ...     \end{document}      would produce the same result as               \documentclass{article}     \usepackage[draft]{graphicx}     \begin{document}     ...     \end{document}      ?


title: Best way to vertically align leftwordgroup with top of wordbox or bitbox

text: This code               \documentclass{article}     \usepackage{bytefield}          \begin{document}     \begin{bytefield}[leftcurly=.,leftcurlyspace=0pt]{32}       \begin{leftwordgroup}{0}         \wordbox{1}{\the\height}       \end{leftwordgroup} \\       \begin{leftwordgroup}{\raisebox{\totalheight}4}         \wordbox{2}{\the\height}       \end{leftwordgroup} \\       \begin{leftwordgroup}{\raisebox{6ex}{12}}         \wordbox{2}{\the\height}       \end{leftwordgroup}     \end{bytefield}     \end{document}      results in ![enter image description here](http://i.stack.imgur.com/4Ckne.jpg) I'd like to get the 0 and the 4 left word groups to be vertically aligned with the top of their corresponding wordboxes. However, the only way I've found to do that is to trial and error it with \raisebox{6ex}. \height and \totalheight seem to refer to the height of the text in the group. leftwordgroup doesn't make \height available the same way wordbox and bitbox does. Is there a more precise way to specify the vertical alignment of the left wordgroup? ### Update Thanks for taking the time to help me out with this. When this was applied to a more sophisticated use of bytefield, it's a bit off.               \documentclass{standalone}     \usepackage{bytefield}     \usepackage{stackengine}     \newcommand\topwg[2]{%       \makebox[3ex][l]{\makebox[2ex][r]{\tiny{#1}}}\belowbaseline[-.3\ht\strutbox]{#2}     }          \begin{document}     \begin{bytefield}[leftcurly=.,leftcurlyspace=0pt]{32}       \bitheader{0,8,16,24} \\       \topwg{0}{\begin{leftwordgroup}{}           \begin{rightwordgroup}{Standard Header}             \wordbox{1}{\the\height}           \end{rightwordgroup}       \end{leftwordgroup}} \\       \topwg{4}{\begin{leftwordgroup}{}         \wordbox{2}{\the\height}       \end{leftwordgroup}} \\       \topwg{12}{\begin{leftwordgroup}{}         \wordbox{2}{\the\height}       \end{leftwordgroup}}     \end{bytefield}     \end{document}      ![enter image description here](http://i.stack.imgur.com/VvGyP.png) Again, thanks a lot for your help.


title: Scanning all the siunits in a document

text: When the macro `\tableofcontents`, is given it takes all the chapters, parts, sections, ... and generates the Table of Contents for the Whole Document. Even the `\listoftables` and `\listoffigures` do that. Now, I have a set of `siunits` in my document used with a tcolorbox modification `\begin{siunit}...\end{siunit}`, How do I define a command that scans all these `siunit`s envronments and generates a page of all the siunits used. Here is the Source Code:               \documentclass[12pt, a4paper]{book}     \usepackage{setspace}     \usepackage[many]{tcolorbox}     \usepackage[detect-all]{siunitx}     \DeclareSIUnit\gauss{G}     \usepackage[pagestyles]{titlesec}     \usepackage{amsmath}     %\usepackage{empheq}     %%--------tcolorbox setting for the SI Units display---------%%     \newtcolorbox{siunit}{enhanced,       colframe=red!60!black,colback=yellow!50!white,arc=4pt,boxrule=1pt,       drop fuzzy shadow,before=\begin{center},after=\end{center},hbox}     %\tcbset{highlight math style={enhanced,     %  colframe=red!60!black,colback=yellow!50!white,arc=4pt,boxrule=1pt,     %  drop fuzzy shadow}}     \newtcbox{\picturebox}[1][]{nobeforeafter,math upper,tcbox raise base,       enhanced,watermark graphics=example-grid-100x100bp.jpg,% from package mwe       colback=white,frame hidden,boxrule=0pt,arc=10pt,       watermark stretch=1.00,watermark opacity=0.4,#1}     %%--------Chapter and Section headings display------------%%     \makeatletter     \renewcommand{\thechapter}{\Roman{chapter}}     \titleformat{\chapter}[display]     {\bfseries\Large\filleft} %\centering doesn't work only \filleft     {\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}     {4ex}     {\titlerule     \vspace{2ex}%     \filright}     [\vspace{2ex}     \titlerule]          \renewcommand{\thesection}{\Roman{section}}     \titleformat{\section}     {\LARGE\bfseries}     {}{1em}{}     \titlespacing{\section}     {-2.15pc}{3.5ex plus .1ex minus .2ex}{1.5ex minus .1ex}          \makeatletter          \newpagestyle{mystyle}{     \headrule \sethead[\thepage][][\chaptertitlename\ \thechapter. \chaptertitle]     {\sectiontitle}{}{\thepage}}          \begin{document}     \pagestyle{mystyle}     \frontmatter     \begin{titlepage}          \end{titlepage}     \mainmatter     \include{magnetic}     \end{document}       magnetic.tex:               \chapter{Magnetic Materials}     \section{Introduction}     Magnetic materials have had various applications in ancient and modern society. A magnetic compass made of lodestone (magnetite) was used for navigation since the north pole of a compass point toward the south pole of Earth's magnetic field. In the modern era, magnetism and magnetic materials find applications in various fields.          \section{Origin of Magnetic properties of\\ materials}     Magnetic properties of materials have their origin in :     \begin{enumerate}     \item Permanent magnetic moments of their atoms and$/$or     \item Induced magnetic moments due to the change of motion of the electric charges of the atoms in an external magnetic field.     \end{enumerate}     The magnetic moments of atomic nuclei are generally neglected as they are very small.          \paragraph{Permanent magnetic moment of atoms}is due to the orbital and spin motions of unpaired electrons (i.e., electrons in the incompletely filled valence shell). Electrons in completely filled valence shells have no magnetic moment.(Eg. He, Ne, Ar etc). Some of the important terms in the study of magnetic materials is given below.          \paragraph{Magnetic fields}are generated by movement of electric charges. \textit{\bfseries Magnetic field} is the region of space where moving charges, current carrying elements or other magnetic objects will experience a force.          \paragraph{Magnetic moment}of a magnet is a quantity that determines the force the magnet can exert on electric currents and the torque that a magnetic field will exert on it. A loop of electric current generates a \textit{magnetic dipole field}. \textit{Magnitude} of the magnetic dipole moment is the product of the current and the area of the loop. Magnetic dipole is often represented schematically as an arrow. The head of the arrow is the North pole.\par     \begin{siunit}     SI unit :  Ampere. square metre (\si{\ampere\square\meter})     \end{siunit}          \paragraph{Magnetic Field lines} run from the North pole to the South pole.     \paragraph{Magnetic Flux}The group of magnetic field lines emitted outward from the north pole of a magnet is called \textit{magnetic flux}.\par     \begin{siunit}     SI~unit :  Weber (\si{\weber})     \end{siunit}     One weber is equal to $1$ x $10^8$ magnetic field lines. Direction of flux at any point in space indicates the direction of force that would be experienced by a North pole placed at that point.          \paragraph{Intensity of Magnetization M}A Material with a net (nonzero) magnetic moment is magnetized. \textit{Intensity of Magnetization M} is the magnetic moment per unit volume within the material.\par     \begin{siunit}     SI unit :  Ampere per metre (\si{\ampere\per\meter})     \end{siunit}     M depends on the following:     \begin{enumerate}     \item Number density of magnetic dipole moments within material.     \item Magnitude of the magnetic dipole moments.     \item The arrangement of the magnetic dipoles within the material and so on.     \end{enumerate}          \paragraph{Magnetization M}in materials mainly arises from spins of unpaired electrons within the material and to a lesser extent from their orbital motion.          \section{Magnetic field}     A \textbf{magnetic field} is a field of force produced by moving electric charges, by electric fields varying with time and by the \textbf{intrinsic} magnetic field of elementary particles due to their spin. Magnetic field is a vector field and is most commonly defined in terms of the Lorentz force that it exerts on moving electric charges. The magnetic field can be visualized as magnetic field lines.\par     There are two separate but closely related fields to which the name 'magnetic field' can refer:     A magnetic \textbf{B} field called \textit{magnetic induction} or \textit{magnetic flux density} \par     %{\centering \tcbox{SI unit :  tesla, T}} %%tcolorbox not properly aligned when using \centering -- thought will complete in a single line     \begin{siunit}     SI unit :  tesla, \si{\tesla}     \end{siunit}     and  a magnetic \textbf{H} field called \textit{magetic field strength} or \textit{magnetizing field}\par     %{\centering \tcbox{SI unit :  Ampere per metre $A.m^{-1}$}}     \begin{siunit}     SI unit :  Ampere per metre (\si{\ampere\per\meter})     \end{siunit}     Magnetic field strength \textbf{H} is measured in $A/m$, and magnetic flux density \textbf{B}, measured in $Nm/A$, also called tesla (T).          \paragraph{Magnetic flux density or magnetic induction B}\textit{Magnetic Flux density} \textbf{B} is the amount of magnetism induced in a body and it is a function of the \textit{magnetizing force} \textbf{H}.     The \textit{magnetic induction}, \textbf{B} is defined as the amount of magnetic flux through a unit area taken perpendicular to the direction of the magnetic flux.     \begin{siunit}     \begin{minipage}{0.75\linewidth}     SI unit  : Weber per metre square (\si{\weber\per\square\meter}) or tesla (\si{\tesla})     \par     CGS unit  : gauss ($\SI{1}{\tesla} = \SI{10000}{\gauss}$)     \end{minipage}     \end{siunit}          \paragraph{Manetic field strength, H}Magnetic field strength \textbf{H} is the amount of magnetizing force. Magnetic field strength is a vector quantity whose magnitude is the strength of a magnetic field at a point in the direction of the magnetic field at that point.     \begin{siunit}     SI~unit  : Ampere~per~metre (\si{\ampere\per\meter})     \end{siunit}          \section{Relation between B and H}     \textit{In free space or outside of a material (i.e., in vacuum) the \textbf{B} and \textbf{H} fields are indistinguishable (they only differ by a multiplicative constant).}     \begin{gather*}     B = \mu_{0}.H \quad \text{(in vaccum)} \\     \mu_{0}   \rightarrow \text{magnetic permeability of free space (vacuum)}     \end{gather*}     where $\mu_{0} = 4\pi~\text{x}~10^7 N.A^{-2}~(H.m^{-1})$ \par     Inside magnetic material,  $B = \mu.H = \mu_{0}.H + \mu_{0}.M $ where $\mu$ is the \\ \textit{magnetic permeability of medium}.


title: Can TikZ dashed lines emulate PSTricks dashed lines?

text: Dashed lines differ between TikZ and PSTricks:![Dashed line comparison between TikZ and PSTricks](http://i.stack.imgur.com/xBzCN.png) PSTricks provides symmetry about the midpoint, and full dashes are guaranteed at each end. Can Ti _k_ Z be configured to achieve this? (By default TikZ does not provide midpoint symmetry, and truncates the last dash.) The latex which produced the above sample:               \documentclass[11pt]{standalone}     \usepackage{color}     \usepackage{tikz}     \usepackage{pst-node}          \newcommand{\bookend}{{\color{blue}\rule{1pt}{1ex}}}     \newcommand{\tikzdash}[1]{\bookend\tikz[baseline=-.5ex,ultra thick]{\draw[line width=2pt,dash pattern=on 4pt off 2pt] (0,0) -- (#1,0);}\bookend}     \newcommand{\pstricksdash}[1]{\bookend\rnode{a}{\rule{0ex}{1ex}}\hspace{#1}\rnode{b}{\rule{0ex}{1ex}}\ncline[linewidth=2pt,linestyle=dashed,dash=4pt 2pt]{a}{b}\bookend}          \begin{document}          \begin{tabular}{cc}     \begin{tabular}{l}     \\     Ti\emph{k}Z \\[1ex]     \tikzdash{30pt} \\     \tikzdash{31pt} \\     \tikzdash{32pt} \\     \tikzdash{33pt} \\     \tikzdash{34pt} \\[2ex]     \end{tabular}     &     \begin{tabular}{l}     \\     PSTricks \\[1ex]     \pstricksdash{30pt} \\     \pstricksdash{31pt} \\     \pstricksdash{32pt} \\     \pstricksdash{33pt} \\     \pstricksdash{34pt} \\[2ex]     \end{tabular}     \end{tabular}          \end{document}


title: Scale only dataset read from file without scaling whole graphics

text: I have datasets which vary strong in range. So i want to scale my dataset to adjust it to my template, so that the grids, axes and so on are identical with the neighbour-subfigures. What is the easiest way to do this? As mentioned I don't want the scale whole image. It's like               \begin{tikzpicture}[scale=4]           \draw[step=0.2cm, very thin,color=black!20] (-0.01,-0.01) grid (2.09,1.19);         \draw[->] (-0,0) -- (2.09,0) node[right] {$t$};         \draw[->] (0,0) -- (0,1.19) node[above] {$y_1$};              \foreach \x in {0,0.2,...,2.1}  \node[anchor=north, font=\tiny] at (\x,0) {\num[round-mode=places,round-precision=1,decimalsymbol=comma]{\x}};         \foreach \y in {0,0.2,...,1.1}  \node[anchor=east, font=\tiny] at (0,\y) {\num[round-mode=places,round-precision=1,decimalsymbol=comma]{\y}};                    \draw[thick] plot file {Grafik/tikz/fr_t.dat}  ;     \end{tikzpicture}      I don't want to scale the whole picture but only dataset and y-axis values. Something like               .     .     \foreach \y in {0,2,...,10.1}   \node...     \draw[thick] plot file[scaling=0.1] {Grafik/tikz/fr_t.dat}  ;     .     .


title: import latex longtable into lyx with format changing

text: I apologize if my question was asked alot previously i am generating my tables from stata into latex then i try to import those tables (longtables) inside a table float in lyx the result is a mess because of the format i would like to widen the margins of the float so that all columns appear i would like to add the longtable option which seems disabled in a float in order to see the rest of the table in the next page I also would like to define the placement as here definitely without any page breaks Can anyone help me with this thank you in advance Tania


title: Where to download pdftex 1.40.4

text: In the readme of the microtype package page7, it is said that pdftex >= 1.40.4 is recommended. I have miktek on windows xp and my version is :               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)       Where can I get the latest version ? I have just updated my miktex distribution and there is no more updates to be applied.


title: How can I typeset a bibkey with &?

text: 1. I would like to typeset a catalog of all my BibTeX entries.   2. I have been using `&` in many `bibkey`'s such as `Author&Editor:2000`.   3. But I cannot `\catcode38=12` globally. My question is: how can I typeset such a `bibkey` both in a section heading, and in the table of contents, and also cite it? This is what I want to achieve: ![enter image description here](http://i.stack.imgur.com/sXvaZ.jpg) With:               \newcommand\entry[1]{%      \catcode38=12\relax      \section{#1}      \fullcite{#1}}          \entry{Author&Editor:2000}      But I get:               ! Misplaced alignment tab character &.      For example:               \documentclass{article}          \usepackage[backend=biber]{biblatex}     \addbibresource{foo.bib}          \usepackage{filecontents}     \begin{filecontents}{foo.bib}     @book{Author&Editor:2000, author={Author}, editor={Editor}, title={Title 0}, year={2000}}     @book{Author&Editor:2001, author={Author}, editor={Editor}, title={Title 1}, year={2001}}     @book{Author&Editor:2002, author={Author}, editor={Editor}, title={Title 2}, year={2002}}     \end{filecontents}          \newcommand\entry[1]{%      \catcode38=12\relax      \section{#1}      \fullcite{#1}}          \begin{document}          \tableofcontents          \entry{Author&Editor:2000}     \entry{Author&Editor:2001}     \entry{Author&Editor:2002}          \end{document}


title: Colored chapter titles with the quotchap package

text: I already changed the chapter numbers using               \definecolor{chaptergrey}{}      But there must be some way to change the chapter titles also. Someone knows how?


title: Drawing a chord net with TikZ

text: I have a problem drawing a chord network with TikZ. This is my code so far:               \begin{tikzpicture}         \xdef\N{16}         \xdef\deltadegree{360/\N}         \draw[thick] (0,0) circle (6);              \foreach \i in {0,...,15} {             % predecessor             \pgfmathparse{mod(\i-1,\N)}             \draw[color=red] (-\i*\deltadegree+90:6) -- (-1*\pgfmathresult*\deltadegree+90:6);                       % successor             \pgfmathparse{mod(\i+1,\N)}                 \draw (-\i*\deltadegree+90:6) -- (-1*\pgfmathresult*\deltadegree+90:6);                  % fingers             \foreach \j in {0,...,4}{                 \pgfmathparse{mod(\i+2^\j,\N)}                 \draw (-\i*\deltadegree+90:6) -- (-1*\pgfmathresult*\deltadegree+90:6);             }         }              \foreach \i in {0,...,15}             \node[circle,fill=white,draw=black,thick] at (-\i*\deltadegree+90:6) {\i};     \end{tikzpicture}      The problem with this code is, TikZ only draws lines from node 6 to every other node, but i thought it iterates over all nodes, calulates the destination for each finger, and draws that line. What am I doing wrong?


title: how to adjust array inside 50% of linewidth

text: I've couple of tables drawn using array; one of the sample is mentioned below: How can I automatically adjust table to get fit inside 50% of line-width?                $\displaystyle \boldsymbol{\begin{array}{|*{20}{c|}}     \hline        {Student} & \begin{gathered}       Length{\text{ of the }} \hfill \\       {\text{pendulum (cm)}} \hfill \\     \end{gathered}  & \begin{gathered}       No.{\text{ }}of \hfill \\       {\text{oscillations (n) }} \hfill \\     \end{gathered}  & \begin{gathered}       {\text{Total time }} \hfill \\       {\text{for(n) oscillation (s)}} \hfill \\     \end{gathered}  & \begin{gathered}       {\text{Time period }} \hfill \\       {\text{(s)}} \hfill \\     \end{gathered}   \\     \hline        I & {64.0} & 8 & {128.0} & {16.0}  \\        \hline        {II} & {64.0} & 4 & {64.0} & {16.0}  \\        \hline        {III} & {20.0} & 4 & {36.0} & {9.0}  \\        \hline      \end{array}  }$


title: why minipage environment prevents \thepage counter update?

text: Here is the code, that demonstrates the problem:               \documentclass{article}     \usepackage{lipsum}     \usepackage[a4paper]{geometry}          \begin{document}          \lipsum[1-6]     \begin{minipage}{\textwidth}     \lipsum[7]     \end{minipage}     current page = \thepage          \end{document}      All text in minipage appears on the second page (this is the desired behavior), but I get 'current page = 1' on the second page. Why?


title: Asana Math calligraphic capital R with XeTeX

text: I am having problems getting a calligraphic ‘R’ with Asana Math. This is my minimal:               \font\asanacal="Asana Math:script=math;mapping=script;+salt"     \font\asanascr="Asana Math:script=math;mapping=script"     \textfont2=\asanacal     \textfont6=\asanascr          $ \fam2 ABCDEFGHIJKLMNOPQRSTUVWXYZ $          $ \fam6 ABCDEFGHIJKLMNOPQRSTUVWXYZ $     \bye      ![enter image description here](http://i.stack.imgur.com/SUlnT.png) I get a script R instead of calligraphic R. This is my `script.map`:               LHSName "script"     RHSName "UNICODE"     pass(unicode)     U+0041 > U+1D49C     U+0042 > U+212C     U+0043 > U+1D49E     U+0044 > U+1D49F     U+0045 > U+2130     U+0046 > U+2131     U+0047 > U+1D4A2     U+0048 > U+210B     U+0049 > U+2110     U+004A > U+1D4A5     U+004B > U+1D4A6     U+004C > U+2112     U+004D > U+2133     U+004E > U+1D4A9     U+004F > U+1D4AA     U+0050 > U+1D4AB     U+0051 > U+1D4AC     U+0052 > U+211B     U+0053 > U+1D4AE     U+0054 > U+1D4AF     U+0055 > U+1D4B0     U+0056 > U+1D4B1     U+0057 > U+1D4B2     U+0058 > U+1D4B3     U+0059 > U+1D4B4     U+005A > U+1D4B5     U+0061 > U+1D4B6     U+0062 > U+1D4B7     U+0063 > U+1D4B8     U+0064 > U+1D4B9     U+0065 > U+212F     U+0066 > U+1D4BB     U+0067 > U+210A     U+0068 > U+1D4BD     U+0069 > U+1D4BE     U+006A > U+1D4BF     U+006B > U+1D4C0     U+006C > U+1D4C1     U+006D > U+1D4C2     U+006E > U+1D4C3     U+006F > U+2134     U+0070 > U+1D4C5     U+0071 > U+1D4C6     U+0072 > U+1D4C7     U+0073 > U+1D4C8     U+0074 > U+1D4C9     U+0075 > U+1D4CA     U+0076 > U+1D4CB     U+0077 > U+1D4CC     U+0078 > U+1D4CD     U+0079 > U+1D4CE     U+007A > U+1D4CF


title: How to check if a font exists in XeLaTeX

text: Is there a way to check if a font exists in XeLaTeX? I am aware of Check for missing fonts/characters in XeLaTeX?, but sadly the one answer only refers to the log. I am interested for a test via code. Background: I am trying to define a command that checks a series of fonts and uses the first one that it finds (similar to the CSS properties)                p{font-family:"Times New Roman",Georgia,Serif;}      I intend to use pgf keys and here is a MWE example.                \documentclass{article}      \usepackage{ifxetex}      % Generic defaults      \ifxetex        \usepackage{fontspec}        \defaultfontfeatures{Mapping=tex-text}        \setmainfont{Times New Roman}        \setsansfont{Minion Pro}     \else        \usepackage{mathpazo}        \usepackage[T1]{fontenc}     \fi     \usepackage{pgfkeys}     \usepackage{lipsum}     \makeatletter     % keys     \pgfkeys{/fonts/.is family}     \def\cxset{\pgfqkeys{/fonts}}      \cxset{%       serif/.code=\rmfamily,       Serif/.code=\rmfamily,       font-name/.store in =\fontname@cx,     }     \cxset{        serif,        font-name=Times New Roman,     }          \ifxetex       \defaultfontfeatures{Mapping=tex-text}       % code to be added here for iterating through list etc..       \setmainfont{\fontname@cx}       \setsansfont{Minion Pro}     \fi     \makeatother     \begin{document}     \lipsum[1]     \end{document}      Ultimately the key               font-family={Times New Roman, Some Other Font, Another Font, serif}      should iterate via all the font names. if none is found the serif value will trigger the default `\rmfamily`. I can code the iteration etc, but I am stuck on the test.


title: Bullet points do not appear (in \itemize environment with Hebrew font David CLM)

text: I am writing Hebrew using the David CLM font (from Culmus). Using this font there are no bullet points in `\itemize` environments. I do not understand why. It works as it is supposed to work with other fonts. I thought all that stuff was independent from the actual font! Here is a MWE:               % !TEX encoding = UTF-8 Unicode     % !TEX TS-program = xelatex     \documentclass[14pt]{scrbook}     \usepackage{fontspec}     \usepackage{xltxtra}     \usepackage{polyglossia}          \setdefaultlanguage{hebrew}     \setmainfont{David CLM}          \begin{document}     \begin{itemize}     \item למה     \item אין פה     \item נקודות?     \end{itemize}     \end{document}


title: calc package incompatible with \setlength in \g@addto@macro?

text: I want to systematically have some indentation in `\parbox`es and `minipage` environments. To do this, I add the following code in the preambule of my LaTeX file:               \makeatletter     \g@addto@macro\@parboxrestore{\setlength{\parindent}{1.5em}}     \makeatother      It works, except when I load the `calc` package. I get then               ! Missing number, treated as zero.     <to be read again>       etc. It seems `\g@addto@macro` does not like the way `\setlength` is redefined in `calc`. How could one solve this problem? Here is a minimal working example:               \documentclass{article}     \makeatletter     \g@addto@macro\@parboxrestore{\setlength{\parindent}{1.5em}}     \makeatother     \usepackage{calc}     \begin{document}     \begin{minipage}{\textwidth}     \end{minipage}     \end{document}


title: Problem with pdflatex and colored output files: PNG and PDF

text: I need to create PNG and PDF files from the same .tex source using `pdflatex` (Texlive 2010, Ubuntu). To make PNG files, there's no problem with `dvipng` utility. But with PDF files (created by the `pdflatex --output-format=pdf` command), I've no colored output, just black text. This is my code, can I fix this problem? How?               \documentclass[dvips]{minimal}          \usepackage{color}          \definecolor{colore}{cmyk}{0.3000,1.0000,1.0000,0.3000}          \begin{document}          \textcolor{colore}{ test text }          \end{document}


title: Rearrange data in pgfplotstable

text: I have a `\pgfplotstable` with data (loaded from a file) like this one:               \pgfplotstableread{       s       f       0.0     95.9638       0.2380665    160.565       0.511     190.435       0.705    270.435       1.0         455.9638     }\data      I need to generate this `\pgfplotstable` rearranging rows and columns of `\data`:               \pgfplotstableread{       s       f       1.0         270.435       0.705    190.435       0.511     160.565       0.2380665    95.9638       0.0     <95.9638 or any other value>     }\customdata      The rows are in inverted order and the second column displaced 1 element above. Any advice, please?


title: Question mark shown instead of citation using harvard

text: I am getting `[?]` when citing using `harvard`. If I use `\citeasnoun` I get the citation. How do I solve this problem. I am using TeXnicCenter with MikTeX 2.9 and installed the `harvard` package.               \documentclass[a4paper,12pt]{article}     \usepackage{float,epsfig}     \usepackage{pifont,epsfig}     \usepackage[dvips]{color}     \usepackage{graphicx,color}     %\usepackage{harvard}     \usepackage{natbib}     \usepackage[sort]{cite}     %\usepackage{ifpdf}     \usepackage{cleveref}     \newtheorem{theorem}{Theorem}     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{example}[theorem]{Example}     \newtheorem{remark}[theorem]{Remark}     \newtheorem{definition}[theorem]{Definition}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{corollary}[theorem]{Corollary}     \usepackage{amsfonts}     \renewcommand{\baselinestretch}{1.0}     \parindent=0pt                  % Do not indent paragraphs     \setlength{\hoffset}{-0.5cm}     \setlength{\voffset}{-2.0cm}     \setlength{\textheight}{9.3in}     \setlength{\textwidth}{5.8in}     \begin{document}     ------      \bibliographystyle{agsm}      \bibliography{ref}     %\input{bio_2}     \end{document}      When I use `natbib` I get it correct. I also wish to replace `&` with `and` when I use `\citet` in `natbib`.


title: esint package leads to misprinted integrals

text: If I print a document using the package `esint` and the `mathpazo` font the integral signs (`\int`, `\iint`) are all cut at the bottom. I tested different printers with both a Linux and Mac system and got the same result. Everything is fine if I remove the `esint` package. Is there a chance to remove this problem or is there a package that produces similar output to `\iint` with `esint`? Minimal example that reproduces the problem for me:               \documentclass{scrbook}     \usepackage{esint}     \usepackage[sc]{mathpazo}          \begin{document}     \[ \int_{-\infty}^\infty \]     \end{document}      And a more evolved example               \documentclass{scrbook}          \usepackage[english]{babel}          \usepackage[utf8]{inputenc}          \usepackage[automark]{scrpage2}     \pagestyle{scrheadings}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[mathscr]{euscript}     \usepackage{amsthm}     \usepackage{mathtools}          \usepackage[sc]{mathpazo}     \linespread{1.05}     \usepackage[T1]{fontenc}          \frenchspacing          \usepackage{esint}          \usepackage{textcomp}     \usepackage{bm}          \begin{document}          \[ \int_{-\infty}^\infty \]          \end{document}


title: latex/bibtex problem to do a single bibliography

text: Is it possible to do an organized bibliography with LaTeX and BibTeX ? Only a bibliography without any text but some section, subsection etc with BibTeX references ? I mean without having the references at the end but in the differents sections. I know the command `\nocite*` and the `multibib` package but it doesnt work for that.


title: How to properly display backticks in verbatim environment?

text: I am preparing a beamer presentation where I need to display some markdown code involving backticks. Specifically, I want to show backticks in the `verbatim` environment. However, LaTeX renders them as open quotation marks. **How can I ensure backticks in the verbatim environment display as backticks?** Here's a minimal example:               \begin{verbatim}     Example: `2 + 2`     \end{verbatim}      An ideal solution would not require me to change the code itself.


title: centering vertically the abstract element

text: How can I put at the center of the page the element abstract?I put it in a blank page but it is at the top. I would center it vertically.any idea?


title: Accessing special glyphs in a font with xeLaTeX

text: The Palatino Sans Family contains a special font for arrows that I'd like to use from `xeLaTeX`. The Windows font preview shows examples using the German sentence "Franz jagt im komplett verwahrlosten Taxi durch Bayern": ![Windows font preview](http://i.stack.imgur.com/N3tEC.png) However I get only "?" in the PDF if I try the same sentence from LaTeX. So the questions is, how can I get an overview of all symbols in the font and how can I access the different characters?               % !TEX TS-program = xeLaTeX     \documentclass[fontsize=12pt,ngerman]{scrartcl}     \usepackage[a4paper]{geometry}     \usepackage{fontspec}          \usepackage{xkeyval,polyglossia}     \setmainlanguage[spelling=new]{german}     \usepackage{csquotes}     \usepackage{blindtext}               \newfontface\ultralightarrows{Palatino Sans Com Ultra Light Arrows}          \begin{document}          {\ultralightarrows Franz jagt im komplett verwahrlosten Taxi durch Bayern}           \end{document}      ![Result](http://i.stack.imgur.com/lSHJQ.png)


title: Who should care about lpe?

text: Edd Barett, a TeXLive maintainer for OpenBSD has just committed lpe (an extensible drawing editor for LaTeX) to the ports tree. People who are familiar with my posts on this forum knows that when it comes to graphics and TeX I am PostScript bias (PSTricks and even pure PostScript more recently). However, I am curios to see if anybody is using lpe and how does it compare to other common approaches to create images for TeX (MetaPost, PSTricks, TikZ/PGF, Asymptote, Matlibplot, Sketch etc.)? It looks might be an interesting tool for Lua users (I am not one of those people).


title: Automatically generated BINGO cards

text: I am trying to automatically generate a series of BINGO cards. So, I need a 5 x 5 table with square cells that allow text wrapping. I also want to randomly assign a word to each cell from a "bank" of 30 different words, and I need the center cell to, of course, be labeled "FREE". This means that for each card, 6 words from the bank will not be used. I know that this can be accomplished with tikz and some macros, but I am not familiar with the macros needed to randomly select the words, and I am having trouble finding adequate help on the web. Can someone please help? Thanks! \-- I mostly figured out my own question; however, I still have one major problem as stated after the MWE:               \documentclass[10pt]{article}          \usepackage{xstring}     \usepackage{tikz}     \usetikzlibrary{calc}          \newcommand*{\random}[5]{%     \pgfmathparse{random(5)}%     \ifcase\pgfmathresult\relax     \or#1\or#2\or#3\or#4\or#5     \fi%     }          \newcommand*{\randomtwo}[6]{         \pgfmathparse{random(6)}         \ifcase\pgfmathresult\relax         \or#1\or#2\or#3\or#4\or#5\or#6     \fi%     }          \newcommand*{\randomthree}[6]{         \pgfmathparse{random(6)}         \ifcase\pgfmathresult\relax         \or#1\or#2\or#3\or#4\or#5\or#6     \fi%     }          \newcommand*{\randomfour}[6]{         \pgfmathparse{random(6)}         \ifcase\pgfmathresult\relax         \or#1\or#2\or#3\or#4\or#5\or#6     \fi%     }          \newcommand*{\randomfive}[6]{         \pgfmathparse{random(6)}         \ifcase\pgfmathresult\relax         \or#1\or#2\or#3\or#4\or#5\or#6     \fi%     }          \newcommand*{\randomsix}[6]{         \pgfmathparse{random(6)}         \ifcase\pgfmathresult\relax         \or#1\or#2\or#3\or#4\or#5\or#6     \fi%     }          \def\NumOfColumns{5}%     \def\Sequence{1, 2, 3, 4, 5}%          \newcommand{\Size}{3.25cm}     \tikzset{Square/.style={     inner sep=0pt,     text width=\Size,      minimum size=\Size,     draw=black,     align=center,     }     }          \begin{document}          \begin{tikzpicture}[draw=black, thick, x=\Size,y=\Size]     \foreach \row in \Sequence{%         \foreach \col in \Sequence {%             \pgfmathtruncatemacro{\value}{\col+\NumOfColumns*(\row-1)}             \def\NodeText{\random{\randomtwo{radioactivity}{$\alpha$ particle}{$\gamma$-ray}{in--situ leaching}{half--life, $t_{\frac{1}{2}}$}{GM counter}}{\randomthree{Manhattan Project}{$3-5$ \%}{$^{232}$Th}{breeder}{greenhouse gas}{ICP--MS}}{\randomfour{NRC}{conversion}{solid}{Rocky Flats}{smoke detector}{Trinity}}{\randomfive{START}{Yucca Mountain}{Chart of the Nuclides}{Chernobyl}{Savannah River Site}{Hanford Site}}{\randomsix{PUREX}{UO$_2$}{Y--12}{Bq}{LSC}{gaseous diffusion}}}             \pgfmathsetmacro{\ColRowProduce}{\col*\row}             \IfEq{\ColRowProduce}{9}{% If is center square                 \node [] at ($(\col,-\row)-(0.5,0.5)$) {FREE};             }{                 \node [Square] at ($(\col,-\row)-(0.5,0.5)$) {\large \NodeText};             }         }     }         \end{tikzpicture}                            \end{document}      The biggest problem is that I get repeat words on my BINGO card. Can I set up a loop to prevent this? Also, if anyone has a way of cleaning up this code, I would be grateful.


title: Polynomial Long Division Using Polynom

text: I have been toiling around `polynom` package to typeset polynomial long division. The `polynom` package produces wonderful long division with step by step process. But I just have two problems. Let me tell you what I need exactly Here is the output that I produced with `polynom` for `\polylongdiv{X^3+X^2-1}{X-1}` ![enter image description here](http://i.stack.imgur.com/Mw4sP.jpg) But instead of spaces for the missing x, I want to have 0x. Is it possible to do that? I checked the documentation and I couldn't find a way to do this. You can read the documentation here: http://www.cs.brown.edu/system/software/latex/doc/polynom.pdf I also realized that the polynomials aren't formatted inside the math environment. So is there anyway to format these equations inside math environment also? I tried putting `$` signs around `\polylongdiv{X^3+X^2-1}{X-1}`, but that didn't change anything. Equations inside math environment produces something like this ![enter image description here](http://i.stack.imgur.com/tsUSh.jpg) I am very new to latex. So please help me. **Update: @polgab helped me solve the second question of producing math environment like output. I just need the solution for question 1 now which is I want to have 0x in the place of missing x instead of a space which is being produced by polynom.**


title: Wrapping \cmidrule in a macro

text: In my earlier solution for Multivariate polynomial long division using LaTeX I had wrapped `\cmidrule` in a macro as its syntax alowing to shorten the end points was not standard:               \newcommand*{\CMidRule}[3]{\cmidrule[\cmidrulewidth](l{#1}r{#2}){#3}}%      I wanted to use `xparse` to to allow for the two shift parameters to be optional, but then ran into problems.   1. Using this only **once** per line works just fine as illustrated in the above linked question. However, an attempt to use this for two separate `\cmidrule` is problematic in that a vertical shift is produced between subsequent uses (as illustrated in the third table below).  ![enter image description here](http://i.stack.imgur.com/Wp50g.png)   2. Furthermore my attempt to use `\NewDocumentCommand` from the `xparse` package to allow for two optional parameters does not even compile (hence have commented out the line in the fourth table). The error message is: > >     Misplaced \noalign. >     \cmidrule ->\noalign >                         {\ifnum 0=`}\fi \@ifnextchar [{\@cmidrule > }{\@cmidrule ... >      l.40 \CMidRuleX{0.0ex} >                            {0.0ex}{1-1}\CMidRuleX{0.0ex}{0.0ex}{2-2} >   ## References:   * How to make a \cline or \cmidrule narrower? ## Question:   * How do I properly define `\NewDocumentCommand{\CMidRuleX}{O{0.0ex} O{0.0ex} m}{}`? ## Code:               \documentclass{article}     \usepackage{booktabs}     \usepackage{xparse}          \newcommand*{\CMidRule}[3]{\cmidrule[\cmidrulewidth](l{#1}r{#2}){#3}}%          \NewDocumentCommand{\CMidRuleX}{%         O{0.0ex}% #1 = left adjust         O{0.0ex}% #1 = right adjust         m%   #3 = columns to span         }{%         \cmidrule[\cmidrulewidth](l{#1}r{#2}){#3}%     }%               \begin{document}     \section*{Direct use of cmidrule works just fine}     \begin{tabular}{rc}       Left & Right \\       \cmidrule{1-1}\cmidrule{2-2}         2  &   3   \\     \end{tabular}     \hspace{1.0cm}     \begin{tabular}{rc}       Left & Right \\       \cmidrule[\cmidrulewidth](l{0.0ex}r{0.5ex}){1-1}\cmidrule[\cmidrulewidth](l{0.5ex}r{0.0ex}){2-2}         2  &   3   \\     \end{tabular}     %     \bigskip     \section*{Wrapping cdmidrule in a macro does not work}     \begin{tabular}{rc}       Left & Right \\       \CMidRule{0.0ex}{0.5ex}{1-1}\CMidRule{0.5ex}{0.0ex}{2-2}         2  &   3   \\     \end{tabular}     \hspace{1.0cm}     \begin{tabular}{rc}       Left & Right \\       %\CMidRuleX[0.0ex][0.0ex]{1-1}\CMidRuleX[0.0ex][0.0ex]{2-2}         2  &   3   \\     \end{tabular}     \end{document}


title: Centered text, aligned left

text: This is probably a rather trivial question, but I don't see an obvious way on how to solve it. I want to center a piece of text, but i want to have the centered text be aligned left. So I would like:               \begin{center}     line1     line2     line3     \end{center}      but where line1, line2 and line3 are aligned left, but still are centered.


title: pgfkeys: Store unknown keys in a command

text: Does `pgfkeys` have some some predefined handler to store unknown keys and their values in a command as a list? E.g. in the following example I would like to get a command which contains `blub=1, bla=\textbf{2}`. (I want to pass the unknown keys to `\includegraphics`).               \documentclass{article}     \usepackage{pgfkeys}          \pgfqkeys{/my key}{      x/.initial={0.5},      .unknown/.code={\pgfkeyscurrentname=\pgfkeyscurrentvalue}}          \begin{document}          \pgfkeys{/my key/.cd, x=2, blub=1, bla=\textbf{2}}     \end{document}


title: Biblatex: How to get the information in note field

text: I use the following format for my bibliography.               @thesis {RefKey,     AUTHOR = {LastName, F.},      TITLE = {Thesis Title},       NOTE = {Ph.D. thesis},     SCHOOL = {University},       YEAR = {Year},     }      I can receive the informations _AUTHOR_ , _TITLE_ , _SCHOOL_ and _YEAR_ by using `\citeauthor{RefKey}`, `\citetitle{RefKey}`, `\citelist{RefKey}{institution}` and `\citeyear{RefKey}`. However, I am **not** able to get the information in _NOTE_ field by `\citelist{RefKey}{note}`. Also in `@article` and `@book`, the same problem occurs. Is there a way to receive the data in _NOTE_ field?


title: Order of `float` and `caption` packages in preamble

text: I am using `float` and `caption` packages in my document, and also packages like `tabularx`, `listings`, `algorithm`... that (as far as I know) define floating _elements_ or elements that have captions associated to them. In the particular case of `listings` package, I think it also calls or loads `float`, if I am not wrong. So, my question is this: Where in the preamble is it better or more appropriate to load `float` and `caption` packages — _before_ or _after_ loading other packages that create floating environments? Sorry if my question doesn't make sense, maybe I didn't get the whole idea... Anyway, really looking forward to your answers,


title: Preserve vertical spacing between paragraphs in different pages

text: I am trying to include some vertical spacing between two lines. In the example below, the space between questions 2 and 3 should have been the same as between 1 and 2. However, as you can see in this screenshot; the result is not the desired one. ![](http://i.stack.imgur.com/eZboM.png) The code used to produce that document is the following. I would welcome any additional comments on improving this code as I am really new to this.               \documentclass[letterpaper,12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{xcolor}     \usepackage{amstext}     \usepackage{fancyhdr}     \usepackage{graphicx}     \pagestyle{fancy}          \chead{}     \definecolor{cbseblue}{HTML}{7388c7}     \definecolor{cbsegreen}{HTML}{bcd490}     \renewcommand{\headrule}{{\color{cbseblue} \hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}     \renewcommand{\footrule}{{\color{cbseblue}\vskip-\footruleskip\vskip-\footrulewidth\hrule width\headwidth height\footrulewidth\vskip\footruleskip}}          \lfoot{\color{cbseblue}\textit{June 5, 2012 - 14:04:23}}     \cfoot{\color{cbseblue}\thepage}          \fancyhfoffset[R]{0in}     \renewcommand{\headrulewidth}{1.2pt}     \renewcommand{\footrulewidth}{1.2pt}     \renewcommand{\headsep}{26pt}     \renewcommand{\footruleskip}{0.1in}          \setlength{\parindent}{0pt}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         \oddsidemargin  -0.5in         \evensidemargin  0.0in         \textwidth       7.5in         \headheight      0.5in         \topmargin      -0.7in         \textheight      8.9in     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}     \vspace*{-10pt}     \begin{center}     \Large { \bfseries Model Exam 3 }     \\[46pt]     \end{center}      \textbf{1.} Differentiate the function $\sin \left( {{x^2} + 5} \right)$ w.r.t. $x$ $\frac{{dy}}{{dx}} = 2x\cos \left( {{x^2} + 1} \right)$ {\color{cbseblue}\textit{[1 pts]}}     \\[440pt]     \textbf{2.} Differentiate $y = \sin \left( {{x^2} + 5} \right)$ w.r.t. $x y = \sin \left( {{x^2} + 5} \right) \frac{d}{{dx}}\left( y \right) = \frac{d}{{dx}}\sin \left( {{x^2} + 5} \right)$ {\color{cbseblue}\textit{[1 pts]}}     \\[440pt]     \textbf{3.} Find the values of  $a,\;b,\;c$$\;$and$\;$$d$ from the equation: $\left[ {\begin{array}{*{20}{c}}       {\;\;\;\;a - b}&{2a + c} \\        {2a - b}&{3c + d}      \end{array}} \right] = \left[ {\begin{array}{*{20}{c}}       { - 1}&5 \\        \;\;\;\;0&{13}      \end{array}} \right]$ {\color{cbseblue}\textit{[1 pts]}}     \\[220pt]     \end{document}      Another thing to take into consideration is that the questions of this exam come from a database, where the user who entered them also assigned a coefficient for the space to be reserved for the solution (let's say from 1, 2, 3, 4, or 5). So when building the pdf, I am first creating the tex file programatically by having a loop as below:                   //php code         foreach($questions as $question) {              echo $question['content']."\n";              $space = 110 * $question['coefficient'];              echo '\\\['.$space.'pt]."\n";         }


title: Clean import of LaTeX into LyX: environment instead of ERT

text: I am importing a LaTeX code into LyX. This code has multiple uses of amsmath environments (lemma, theorem etc.). After importing, all theese environments turn into ERT boxes in LyX. I was wondering if there is any way to import LaTeX into LyX preserving the amsmath environments? I think there should be a way to do this as AMS modules exist in LyX. To experiment a little bit, I tried to check if LyX can import its own LaTeX code properly. I first created a LyX document using Theorems (AMS) module. Then I exported the LyX document into LaTeX code (see below) and imported the code back into LyX. This produced a LyX document with ERT instead of the theorem environment. What can possibly go wrong?               %% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[letterpaper]{geometry}     \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amssymb}     \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.       \theoremstyle{plain}       \newtheorem*{thm*}{Theorem}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \makeatother     \makeatother     \usepackage{babel}     \makeatother     \usepackage{babel}     \begin{document}     \begin{thm*}     Let $\theta$ be a real number, then\[     \sin^{2}\theta+\cos^{2}\theta=1.\]     \end{thm*}     \end{document}


title: Vector frame on all pages

text: I would like a regular frame about 0.5cm outside the text margin for every page in a report. I have checked different options such as the Wallpaper package, Showframe package and the showframe option of Geometry. I've also seen one-page only solutions using Tikz. I have an unspecified number of pages in the document, and I would like the frame on every page, enclosing the all the text of the page (including page numbers, headers and footers). I'd also like some choice in the line style (such as double line, dashed, or dotted). I have a hunch that this could be done with Pstricks or with Tikz, but my knowledge of either of these is marginal...any help would be appreciated.


title: Can a LyX (RCS) "revert to repository version" be undone?

text: In LyX I accidentally clicked 'Version Control' -> 'Revert to Repository Version' as it's just below 'Check In changes' option. This resulted in loss of all work since last check in, and using 'redo' is not possible. Is it possible to undo a revert like this?


title: Searching a musical quarter note symbol to insert into text

text: I want to simple write a musical quarter note in text. I however know that there is the `\textmusicalnode` available. But this does not give me a quarter note. The usage of e.g. the `harmony` or `wasysym` package which would give me `\Vier` or `\quarternote` as quarter note but produces erros in combination with the `amssymb` package. What should I do to solve this? **EDIT** This is what I include as packages in my preamble.               \RequirePackage{fix-cm}     \documentclass[a4paper,12pt,bibtotoc,liststotoc,BCOR=16mm,headinclude,numbers=noendperiod]{scrreprt}          \usepackage[ngerman,english]{babel}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{fontspec}     \usepackage{verbatim}     \usepackage[onehalfspacing]{setspace}     \usepackage{chngcntr}     \usepackage{enumerate}     \usepackage[style=alphabetic-verb,bibstyle=alphabetic,hyperref=true]{biblatex}     \usepackage[hang,small]{caption} % small and hanging captions     \usepackage{lmodern}    %% Type1 font for non english language     \usepackage{graphicx}   %% graphics     \usepackage{subfig}     %% to place graphics beside each other     \usepackage{listings}   %% to include code listings     \usepackage{xcolor}     %% syntax highlight in code listings     \usepackage{amsfonts}   %% number-symbols in formulas     \usepackage{mathrsfs}     \usepackage{xfrac}      %% slanted fractions with font fixtures     \usepackage[plainpages=false]{hyperref}     \usepackage{fancyhdr}   %% fancy headings and footers          \usepackage{harmony}    %% musical symbols      I get the following errors if I use the `harmony` package though:               Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:231     LaTeX Error: Command `\Finv' already defined.           Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:232     LaTeX Error: Command `\Game' already defined.          Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:237     LaTeX Error: Command `\beth' already defined.          Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:238     LaTeX Error: Command `\gimel' already defined.          Latex Error: /usr/local/texlive/2011/texmf-dist/tex/latex/amsfonts/amssymb.sty:239     LaTeX Error: Command `\daleth' already defined.


title: Are there good books retracing the history of (La)TeX?

text: I am interested by books focused on the history of (La)TeX from philosophical point of view. That is to say: no textbook, no introduction to LaTeX for beginners but books describing the model of the software1, comparing this model to others, trying to analyze its evolution through time, the community, ... Do you have any references (not only books; it could be websites or unpublished papers)? * * * 1\. I am not sure if we can call LaTeX a software. And this is the kind of debate I am interested to read about.


title: Mark key-value class options as used

text: I have written a wrapper for the `scrartcl` class in the following way:               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{mycls}[2012/08/23]          \RequirePackage{kvoptions}          \DeclareStringOption{title}     \DeclareStringOption{subtitle}          \ProcessKeyvalOptions*          \PassOptionsToClass{fleqn, openbib, headings=big, DIV=12}{scrartcl}     \LoadClassWithOptions{scrartcl}      This way I can provide some default arguments for `scrartcl` like `DIV=12` and still override them by passing               \documentclass{title=mytitle, subtitle=thesubtitle, DIV=10}      The problem I have, is that `srcartcl` marks the other options, e.g., `title=mytitle` as unused > LaTeX Warning: Unused global option(s) which is certainly false. I tried unsetting the options with               \DisableKeyvalOptions{mycls}{title}      right after `\ProcessKeyvalOptions*`, but that didn't work. How can I mark those options as used?


title: Filling a complex region with TikZ

text: I'm trying to fill a complex region which is defined by six intersections of 4 hyperbolas. As you can see here: ![enter image description here](http://i.stack.imgur.com/4CvYS.png) In particular I want to fill the region which is bounded and defined by the 6 points. I know the exact coordinates of the `p_i`'s and the exact equations of each hyperbola. How can I concatenate them and fill the region? For the sake of completeness, here's the code I have so far:               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}          \def\bndmax{5}     \def\bndmin{0.2}     \def\xS{1.5}     \def\gR{1.618034} % The golden ratio          \begin{tikzpicture}       \draw (-3,-3) grid (3,3);       \tikzset{func/.style={thick,color=orange!90}}       \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (\x,{-1/\x});       \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (-\x,{1/\x});       \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (\x,{1/\x});       \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (-\x,{-1/\x});            \begin{scope}[shift={(\xS,1/\xS)}]         \tikzset{func/.style={thick,color=orange!60,dashed}}         \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (\x,{-1/\x});         \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (-\x,{1/\x});         \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (\x,{1/\x});         \draw[func,domain=-\bndmax:-\bndmin] plot [samples=200] (-\x,{-1/\x});       \end{scope}            \fill (\xS,1/\xS) circle (2pt);            \pgfmathsetmacro\x{-\gR*\xS}       \pgfmathsetmacro\y{1/(\gR*\xS)}       \coordinate (p1) at (\x,\y);            \pgfmathsetmacro\x{-(1/\gR)*\xS}       \pgfmathsetmacro\y{\gR*(1/\xS)}       \coordinate (p2) at (\x,\y);            \pgfmathsetmacro\x{1/(\gR*\gR)*\xS}       \pgfmathsetmacro\y{\gR*\gR/\xS)}       \coordinate (p3) at (\x,\y);            \pgfmathsetmacro\x{(1/\gR)*\xS}       \pgfmathsetmacro\y{-\gR*(1/\xS)}       \coordinate (p4) at (\x,\y);            \pgfmathsetmacro\x{\gR*\xS}       \pgfmathsetmacro\y{-1/(\gR*\xS)}       \coordinate (p5) at (\x,\y);            \pgfmathsetmacro\x{\gR*\gR*\xS}       \pgfmathsetmacro\y{1/(\gR*\gR*\xS)}       \coordinate (p6) at (\x,\y);            \foreach \i in {1,2,3,4,5,6}       \fill[red] (p\i) circle (2pt) node[right]{$p_{\i}$};          \end{tikzpicture}     \end{document}


title: How good a juggler is TeX?

text: I recently made an adaptation of `pgfpages` which allows one to gather in several typeset pages and then lay them out in some layout over several physical pages (the original `pgfpages` only allows one physical page). Thinking about other possible extensions, I started wondering just how many typeset pages TeX can hold in its memory at a time. In the comments to a Village's self-answer on How to sort the order of pages so that they can be printed in a folded book?, there's a hint that TeX can hold a large number of pages before actually shipping any out. And when I think about what little I know about a PDF document, it would appear that TeX has to process the entire document before it can actually write a single page to the output (I believe that the PDF has to say at the start how long it is). PGFPages works by storing the pages in boxes, so this might be a bit different to how TeX stores actual pages before writing them to the file. If this is different, I'm more interested in how many boxes TeX can hold at a single time. I realise that this also might be system-dependent, in which case I'd like to get some idea of how it is dependent, and what the "stock TeX" can do as I'd rather not modify the memory capabilities just for this juggling ability. So how many boxes can TeX juggle before it runs the risk of dropping them?


title: Are there any packages similar to fncychap?

text: I use `fncychap` this way:               \usepackage[Conny]{fncychap}      This lets me have pretty decent chapters, ToC and title page design. But the options are scarce and too popular. Are there any other packages I can use in the same way?               \usepackage[Otherstyle]{otherpack}


title: Acrobat Reader changes my theme's color

text: I have a problem visualizing my Beamer presentation with Acrobat Reader 9.5.1 on Ubuntu 12.04. I'm using the PaloAlto theme and when I visualize the presentation in Acrobat on some random frames the structure's theme changes becoming brighter and this is very annoying. Surfing the web I found a solution that seemed to work for many lucky people having the same problem:               \pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}         but unfortunately I wasn't lucky enough and adding that to my document's preamble didn't solved the problem. I tried to visualize the presentation with Evince, Okular and Windows 7 (Acrobat Reader) and all worked fine. Thank you in advance for your time.


title: Measuring TikZ leaves and using measurements to set sibling distance?

text: # TL;DR Summary: Is there some way to measure the width of a leaf node and pass this measurement back up the tree to be used in setting `sibling distance`? (One might want to do a similar thing for `level distance` as well.) # Example: Suppose that I have a simple tree where the leaf nodes each contain the same image:               \documentclass{standalone}     \usepackage{tikz}          \pgfdeclareimage{image}{fptp-ballot}          \begin{document}       \begin{tikzpicture}         \node {root} [level/.append style={level distance=4cm}]           child foreach \c in {1,2} {             node [fill=red!10] {\pgfuseimage{image}}};       \end{tikzpicture}     \end{document}      With the default setting for `sibling distance`, the leaves overlap: ![enter image description here](http://i.stack.imgur.com/2WrP7.png) One way that we could measure the width of the leaf is to create an invisible temporary leaf, `tmp`, and use the `let` operation for paths to compute its width:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}          \pgfdeclareimage{image}{fptp-ballot}          \begin{document}       \begin{tikzpicture}         \node (tmp) [fill=red!10, transparent, overlay] {\pgfuseimage{image}};              \path let \p{leafwidth} = ($(tmp.east)-(tmp.west)$) in          node {root} [level/.append style={level distance=4cm, sibling distance=\x{leafwidth}}]           child foreach \c in {1,2} {             node [fill=red!10] {\pgfuseimage{image}}};       \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/rVCxA.png) The problem with this approach is: It seems clumsy to need to create a temporary leaf, `tmp`, when the leaves that I really want to measure already exist later in the code. This makes things less modular. If I change the leaves, then I need to change the `tmp` node correspondingly (or factor out the leaf code with a macro and style). In other words, I'd like a solution that works _locally_ regardless of what I put inside the leaves -- a single image, a matrix with arbitrary cell content, etc. # Question: Is there some way to directly measure the width of an _actual_ leaf node and pass this measurement back up the tree to be used in setting `sibling distance`? I would like to write something like the following:               \begin{tikzpicture}       \node {root} [level/.append style={level distance=4cm, sibling distance=\x{leaf1width}}]         child foreach \c in {1,2} {           node (leaf\c)              [fill=red!10] {\pgfuseimage{image}}           let \p{leaf\c width} = ($(leaf\c.east)-(leaf\c.west)$) in};     \end{tikzpicture}      Here I am directly measuring the widths of the _actual_ leaves and am trying to use this to set `sibling distance` at the root node. Unfortunately, this gives the error "Undefined control sequence. `<argument> \x{leaf1width}`", presumably because `\p{leaf\c width}` is not defined until the leaves are reached. Is there any way to fix this code? I thought about using the `late options` key, but the TikZ manual states that > An already existing node is determined [...] and, then, the options are > executed in a local scope. Most of these options will have no effect since > you _cannot change the appearance of the node_ , that is, you cannot change > a red node into a green node using late options. Indeed, the following compiles without error, but the `sibling distance` is not affected.               \begin{tikzpicture}       \node (root) {root} [level/.append style={level distance=4cm}]         child foreach \c in {1,2} {           node (leaf\c)                [fill=red!10] {\pgfuseimage{image}}           let \p{leaf\c width} = ($(leaf\c.east)-(leaf\c.west)$) in           (root) [late options={level/.append style={sibling distance=\x{leaf1width}}}]};     \end{tikzpicture}


title: Why is "width=\textwidth" setting not properly scaling graphic?

text: I'm including a jpg figure in my LaTeX document like this:               \begin{figure}[htbp]\centering         % fbox here only for illustrative purposes         \fbox{\includegraphics[width=\textwidth,keepaspectratio]{Pictures/PoolofBethesda-CarlBloch}}     %   \includegraphics[width=\textwidth,keepaspectratio]{Pictures/LesNocesdeCana-PaoloVeronese}         \caption{\emph{Healing at the Pool of Bethesda} (1883) by Carl Bloch.}         \label{fig:Bethesda}     \end{figure}      However, the picture is not being properly scaled. I want the picture to be as wide as the text on the page with the aspectratio kept the same. I get this instead; you can see the box where the image should be: ![Example of image not being scaled properly](http://i.stack.imgur.com/N4Eqw.jpg) If I simply replace the image with a different image (as shown in the commented line above) everything works as expected. **Why isn't my image being scaled properly? Am I missing something obvious?** The original image is this: ![Original image](http://i.stack.imgur.com/lht00.jpg) PS. I'm using the `graphicx` package with no options.


title: Decimal point in LaTeX Math Mode

text: I am writing a large document with equations in LaTeX. I suddenly noticed that a small unusual problem is occurring. I am writing an equation as follows:               \begin{equation}     f_{c}(t) = 1.0 + 0.024 C(t) - 3.5\cdot10^{-3} C(t)^{2} + 2.8\cdot10^{-4} C(t)^{3}     \end{equation}      but the result of this in my final pdf looks like               f_{c}(t) = 1 0 + 0 024 C(t) - 3 5\cdot10^{-3} C(t)^{2} + 2 8\cdot10^{-4} C(t)^{3}      That is, all decimal points disappeared and were generated like a whitespace. I cannot find any reason why this is happening. How can I fix this? * * * @Herbert concerning Fonts, i am now loading this :               \usepackage{xunicode}     \usepackage{xltxtra}     \defaultfontfeatures{Mapping=tex-text} % converts LaTeX specials (``quotes'' --- dashes etc.) to unicode     \setromanfont [Ligatures={Common}, BoldFont={Times New Roman}, ItalicFont={Times New Roman}]{Times New Roman}     \setsansfont [Ligatures={Common}, BoldFont={Calibri}, ItalicFont={Calibri}]{Calibri}     \setmonofont[Scale=0.8]{Monaco}       @Seamus my working file looks like this, as an example for equation               \input preamble     \begin{document}     \selectlanguage{english}     \begin{equation}     \epsilon_{clear}(t) = 0.711 + 5.6\cdot10^{-3}\ \vartheta_{dew}(t)     \end{equation}     \end{document}      where my preamble is following layout file:               \usepackage[squaren]{SIunits}     \usepackage{cite,xunicode,xltxtra}         \defaultfontfeatures{Mapping=tex-text}     \setromanfont [Ligatures={Common}, BoldFont={Times New Roman}, ItalicFont={Times New Roman}]{Times New Roman}     \setsansfont [Ligatures={Common}, BoldFont={Calibri}, ItalicFont={Calibri}]{Calibri}     \setmonofont[Scale=0.8]{Monaco}           % HEADINGS     \usepackage{sectsty}      \usepackage[normalem]{ulem}     \chapterfont{\sffamily\bfseries\upshape\Huge}     \sectionfont{\sffamily\bfseries\upshape\Large}     \subsectionfont{\sffamily\bfseries\upshape\large}      \subsubsectionfont{\sffamily\bfseries\upshape\normalsize}           \RequirePackage[times]{quotchap}     \renewcommand{\sectfont}{\sffamily\bfseries\upshape\Huge}          \makeatletter     \newcommand\citaat{\if@openright\cleardoublepage\else\clearpage\fi\thispagestyle{plain}}          % chapters that do not start at new page...     \newcommand\chapterNoPageBreak{\thispagestyle{plain}\global\@topnum\z@\@afterindentfalse\secdef\@chapter\@schapter}       \makeatother          \usepackage[dutch,english]{babel}          \usepackage{fancyhdr,graphicx,listings}     \renewcommand\lstlistlistingname{List of Listings} % default is Listings     \lstset{language=JAVA}          \usepackage{fancyhdr}     \pagestyle{fancyplain}          \usepackage{moreverb}          \addtolength{\headheight}{3pt}         % allow 1 lines in 12pt     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0pt}     \renewcommand{\plainheadrulewidth}{0pt}     \renewcommand{\plainfootrulewidth}{0pt}          \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}          \lhead[\fancyplain{}{\rm\thepage}]{\fancyplain{}{\rightmark}}     \chead[]{}     \rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{\rm\thepage}}     \lfoot[]{}     \cfoot[]{\fancyplain{\rm\thepage}{}}     \rfoot[]{}          \input{macros.def}      ...


title: Create list of abbreviations

text: I want to create something similar to `\listoffigures`, `\listoftables` etc. What I've done so far:               \def\startloa#1     {         \begingroup             \begin{listofabbrv}{SPMD}             \@input{\jobname.#1}             \end{listofabbrv}             \global\@nobreakfalse         \endgroup         \newpage     }          \newcommand{\listofabbreviations}     {         \@startloa{loa}     }          % abvr{abvr}{text}     \def\abvr#1#2     {         \makeatletter         \immediate\write\tempfile{\backslash item[#1] #2}         \makeatother     }          \newwrite\tempfile          \begin{document}              \immediate\openout\tempfile=\jobname.loa              \listofabbreviations              \abvr{NULL}{/dev/null}              \immediate\closeout\tempfile          \end{document}      The `\begin`/`\end{listofabbvr}` is predefined in the style I'm using, so I can't change it. Is it done this way:               \begin{listofabbrv}{SPMD}         \item[NULL] /dev/null     \end{listofabbrv}      The main problems:   * The `\abvr` command does not work. The file output is:              \delimiter "026E30F item[NULL] /dev/null      instead of              \item[NULL] /dev/null        * The command `\listofabbreviations` does not work. Is there something wrong with `\def\startloa`? A little snippet of the output log:              ERROR:     74  ! You can't use `\spacefactor' in vertical mode.     75  \@->\spacefactor      76                   \@m      77  l.133   \listofabbreviations     78                                  79  ! Missing $ inserted.     --- x --- x ---     ERROR:     79  ! Missing $ inserted.     80  <inserted text>      81                  $     82  l.133   \listofabbreviations     83                                  84  ! Missing $ inserted.     --- x --- x ---     ERROR:     84  ! Missing $ inserted.     85  <inserted text>      86                  $     87  l.134      88             89  [3]     --- x --- x ---


title: How to add a shadow to a tikz line?

text: I have the following `tikz` picture.               \documentclass{standalone}          \usepackage{tikz}     \usepackage{xcolor}          \begin{document}          \begin{tikzpicture}[       arr/.style={->,   blue, very thick},       lbl/.style={draw, blue, very thick},       ]       \draw[fill=red, very thin] (-1,-1) rectangle (1,1);            \draw[arr] (-2,0) .. controls (-.75,-.25)  and ( -.25,.75) .. (.5,0); % ARROW       \node[lbl, anchor=north west] at (.5,0) {};                           % RECTANGLE     \end{tikzpicture}          \end{document}      ![tikz arrow](http://i.stack.imgur.com/FC3vj.png) How can I add a shadow under the blue rectangle? How can I add a shadow that follows the blue arrow?


title: Why is \newpage ignored sometimes ?

text: I have the following towards the end of an article. The bibliography is short (4 entries). What's happening is that on the very last page of document I get the chart and immediately afterwards the References section, despite the `\newpage` directive. While I personally prefer everything on one page, I have a requirement to put the references on a different page. Is LaTeX ignoring `\newpage` because it finds plenty of space to use on that page? If so, I'm confused why it does so even when told explicitly to start a new page. I cannot post the entire article so hopefully the excerpt below will be helpful.               bla bla bla     bla bla bla     bla bla bla          \begin{figure}[htp]       \centering       \includegraphics{my-image}       \caption{caption here}\label{my-label}     \end{figure}          \newpage     \begin{thebibliography}{99}


title: How can I create a show/hide button?

text: I would like to create a show/hide button that appears on a typeset PDF so that when it is clicked, the content appears. This is similar to the ideas here: Hide all but one instances of a custom environment and here: hide proof environment for restructuring, but I would like the option to show up in the PDF itself as a simple button that could be clicked (or something similar) Ideally, this would end up looking something like this:               \documentclass{article}     \newcommand{showhide}[1]{Does what I am describing}          \begin{document}          \showhide{Displays a button, that when clicked, shows this text     and when clicked again, hides this text.}          \end{document}      Anyone know how do do this, or something similar?


title: Positioning of equations (begin equation command)

text: This is a follow up from my previous question, Positioning of equations. I managed to get my equations alligned to the left, but in my latex document, I have also been using:               \begin{equation}     X^2 := x^2 - 123. \nonumber     \end{equation}      I have alot of other equations that I want to be centered. For example, for all my equations wrapped around:               \begin{equation}     \end{equation}      How would I center it? Thanks, my code is below. ![enter image description here](http://i.stack.imgur.com/X59yO.jpg)               \documentclass[11pt,a4paper]{report}     \usepackage[fleqn]{amsmath}     \setlength{\mathindent}{0pt}     \usepackage{amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}          \theoremstyle{plain}     \newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each chapter     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposition}     \newtheorem*{cor}{Corollary}          \theoremstyle{definition}     \newtheorem{defn}[thm]{Definition} % definition numbers are dependent on theorem numbers     \newtheorem{exmp}[thm]{Example} % same for example numbers     \newtheorem{conj}[thm]{Conjecture}          \theoremstyle{remark}     \newtheorem*{rem}{Remark}     \newtheorem*{note}{Note}               \title{My Thesis Title}     \author{My Name}     \date{\today}     \renewcommand\labelenumi{(\theenumi)}     \renewcommand\theenumi{\roman{enumi}}     \setlength{\parindent}{1em}          \begin{document}          \chapter{Addition}          \begin{exmp}      Here is an example.     \begin{align} \nonumber     (a+b)^3 &= (a+b)^2(a+b)\\ \nonumber     &=(a^2+2ab+b^2)(a+b)\\ \nonumber     &=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\ \nonumber     &=a^3+3a^2b+3ab^2+b^3 \nonumber     \end{align}     \end{exmp}          \begin{exmp}     A simple equation:     \begin{equation}     X^2 := x^2 - 123. \nonumber     \end{equation}     \end{exmp}     \end{document}


title: How does one use the Old English fonts? e.g. for ring ideals

text: I'd like the Old English fonts used for ideals, cardinality of the reals, etc. Example: ![alt text](http://i.stack.imgur.com/mDnyn.png)


title: How do I do an iterated intersection?

text: I want the index to appear under the intersection symbol.


title: Add "just a little more" padding to my table?

text: I have a table resembling a matrix with a extra lines for emphasis. This table may also contain `frac{}` items which do fit into the cell but sort of "hit" the boundaries. Trouble is, that I have quite a few of those tables. Is there an easy way to increase the padding for all of those tables? Possibly without touching every single table? A picture illustrating the issue: ![Notice how eg \(x5|x3\) looks odd](http://i.stack.imgur.com/Whc8Y.png) The source for this looks like this:               \begin{tabular}{c||c|c|c||c|c|c|c||c|c}             & $x_1$ & $x_2$ & $x_3$            & $x_4$           & $x_5$ & $x_6$ & $x_7$ & RS     & Q     \\ \hline \hline       $x_2$ & 0     & 1     & $\frac{1}{3}$    & $\frac{1}{3}$   & 0     & 0     & 0     & 50     & 150   \\ \hline       $x_5$ & 0     & 0     & $\frac{5}{6}$    & $-\frac{2}{3}$  & 1     & 0     & -0.5  & 20     & 24    \\ \hline       $x_6$ & 0     & 0     & $\frac{1}{12}$   & $-\frac{2}{3}$  & 0     & 1     & -0.25 & 25     & 300   \\ \hline       $x_1$ & 1     & 0     & 0.25             & 0               & 0     & 0     & 0.25  & 25     & 100   \\ \hline \hline       $-z$  & 0     & 0     & $\frac{79}{120}$ & $\frac{23}{30}$ & 0     & 0     & -0.575& -172.5 &     \end{tabular}


title: What exactly does \pagenumbering do?

text: I am trying to squelch the page numbers using the code from here. This works fine, if one uses ordinary page numbers. If the page numbers are modified with the pagenumbering command, it doesn't work anymore. Here is the MWE:               \documentclass{scrbook}     \usepackage{accsupp}     % Defining the squelch command     \DeclareRobustCommand\squelch[1]{%       \BeginAccSupp{method=plain,ActualText={}}#1\EndAccSupp{}}     % Trying to squelch the page numbers     \let\oldthepage\thepage     \def\thepage{\squelch{\oldthepage}}          \begin{document}     \pagenumbering{roman}     \chapter{First Chapter}     \newpage     \pagenumbering{arabic}     \chapter{Next Chapter}         \end{document}


title: File scrlayer-scrpage.sty cannot be found

text: The following code leads to an error               ! LaTeX Error: File `scrlayer-scrpage.sty' not found.      Here is my code:               \documentclass[fontsize=10,a4paper,twoside]{scrreprt}     \usepackage[T1]{fontenc}     \usepackage[automark,headsepline,footsepline]{scrlayer-scrpage}     \usepackage[utf8]{inputenc}     \usepackage[frenchb]{babel}     \usepackage{a4}          \usepackage{scrpage2}     \KOMAoptions{BCOR=2mm,DIV=15}          \pagestyle{scrheadings}     \cfoot{Le pied de page}     \lehead{En haut à gauche pair}     \lohead{En haut à gauche impair}     \cehead{centre pair}     \cohead{centre impair}          \begin{document}     My first latex document          Hello world !     \end{document}      I don't understand why since KOMA-script is installed (if I remove the `scrlayer-scrpage` line, it works). I run pdftex under Mac OSX 10.9.1 (pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)). What should I do to use `scrlayer-scrpage` package ? **EDIT: THE SOLUTION** As indicated in comments, the problem came from an incomplete update of the packages. So contacting the responsible for scrlayer-scrpage package was the solution, and then update your installation.


title: \verb in csquotes

text: The following code gives me an error:               \documentclass[ngerman]{article}     \usepackage{babel,csquotes}     \begin{document}     \enquote{\verb|foo|}     \end{document}      I guess this is the classic "you can't use verbatim material in commands" problem. Is there a solution to this besides writing `\texttt{foo}` or using quotation marks directly?


title: Pre-compiling with a different syntax

text: I am looking for a _pre_ -compiler to introduce a **customized** syntax into LaTeX. Hope that an example will be worth a thousand words: I would like to compile this               \thm     The sum      $ 1+2+3     is equal to     $$[six] 6.      % this line will be skipped     \proof     $$ 1+2 &= 3     $$ 1+2+3 &= 6      to obtain this               \begin{theorem}     The sum     $ 1+2+3 $     is equal to     \begin{align}     \label{six}     6.     \end{align}     \end{theorem}     \begin{proof}     \begin{align*}     1+2 &= 3\\     1+2+3 &= 6     \end{align*}     \end{proof}      and then run the standard LaTeX compiler on the latter. I was wondering if there is some fast/clever way to do this.


title: I can't get pythonTEX to work, too few arguments

text: I have tried to get the `pythontex` package to work in LaTeX but I get the typical(?) output, after I ran LaTeX, the python code and the LaTeX again. Then I found that I get "`pythontex.py`: error: too few arguments" when I run the code. So I guess I'll have to give in the name of the `pythontex` code but where?               \documentclass[oneside]{memoir}     \usepackage{pgfplots}     \usepackage{pythontex}     \begin{document}     \py{2+2}     \end{document}


title: Using \uncover in beamer with a counter

text: I am using a table in my presentation and it is ordered by date but I want some major dates to be visible on the first slide and all other dates to become visible slide by slide. I thought it would be a nice way to define a command:               \newcounter{coveredRows}     \newcommand{\uncoverrowauto}[3]{         \addtocounter{coveredRows}{1}         \uncoverrow{\value{coveredRows}-}{#1}{#2}{#3}     }     \newcommand{\uncoverrow}[4]{         \uncover<#1>{#2} & \uncover<#1>{#3} & \uncover<#1>{#4}\\     }      And I would like to have a table like this:               ..           11.06. & ..begin.. & 24\\     \uncoverrowauto{11.06.}{begin subtask1}{24}     \uncoverrowauto{22.06.}{end subtask1}{25}     25.06.& ..mile stone.. & 26\\     \uncoverrowauto{25.06.}{begin subtask2}{26}     \uncoverrowauto{29.06.}{end subtask2}{26}     ..      So it could become a big table and I am lazy so I would like to auto increment the counter when the rows are uncovered. Unfortunately this doesn't work, it compiles infinite number of slides. Is there a nice solution for my wish or is the only way to define the slide manually where the different rows are uncovered? **EDIT** As mentioned by David, here is a full example of what I have:               \documentclass{beamer}          \begin{document}          \begin{frame}         \titlepage     \end{frame}          \begin{frame}         \frametitle{Outline}         \tableofcontents     \end{frame}          \section{Plan}              \newcounter{coveredRows}         \setcounter{coveredRows}{1}         \newcommand{\uncoverrowauto}[3]{             \addtocounter{coveredRows}{1}             \uncoverrow{\value{coveredRows} -}{#1}{#2}{#3}         }         \newcommand{             \uncoverrow}[4]{\uncover<#1>{#2} & \uncover<#1>{#3} & \uncover<#1>{#4}\\         }          \begin{frame}         \frametitle{Plan}         \framesubtitle{Dates}              \centering         \begin{tabular}{| c l c |}             \hline             Date    & Explanation & Week\\             \hline\hline             11.06. & Begin of work & 24\\             \uncoverrowauto{11.06.}{Begin of subtask one}{24}             \uncoverrowauto{22.06.}{End of subtask one}{25}             25.06.& Mile stone of work & 26\\             \uncoverrowauto{25.06.}{Begin of subtask two}{26}             \uncoverrowauto{29.06.}{End of subtask two}{26}             \uncoverrowauto{02.07.}{Begin of subtask three}{27}             \uncoverrowauto{30.07.}{Begin of subtask four}{31}             \uncoverrowauto{03.08.}{End of subtask four}{31}             \uncoverrowauto{17.08.}{End of subtask three}{33}             \uncoverrowauto{24.08.}{Planned end of work}{34}             03.09. & End of work & 36\\             \hline         \end{tabular}          \end{frame}     \end{document}


title: ConTeXt: Left-justify text to overlap hidden/disabled frame border

text: # Background Looking to left- and right-align text in a footer. # Problem The following image shows that the word "Betasec" is not left-aligned with the black horizontal line above it: ![Extra Space](http://i.stack.imgur.com/x3dTI.png) I believe this is because the rule thickness for the `\defineframed` causes the border to be taken into consideration when typesetting, even though the left (and right) borders are hidden. Similarly, the page number is not fully right-aligned (also due to the frame's thickness). # Code The following code reproduces the problem:               % Define the appearance for the section name in the footer.     \defineframed[FooterSection][       frame=off,       topframe=on,       align=flushleft,       width=\makeupwidth,       rulethickness=1.6pt,       location=bottom,       foregroundstyle=\tfx\ss,       height=broad,       top=\vskip1.5em,       offset=0pt,     ]          % Define the appearance of the page number in the footer.     \defineframed[FooterPage][       frame=off,       location=bottom,       foregroundstyle=\tfx\bold\ss,     ]          % Include the section name and page number in the footer.     \setupfootertexts       [\FooterSection{\getmarking[section]}]       [\FooterPage{\pagenumber}]          \starttext       \startfrontmatter         \startstandardmakeup           \startalignment[middle]\tfa{Title Page}\stopalignment         \stopstandardmakeup       \stopfrontmatter            \startchapter [title=Beta]         \startsection[title=Betasec] \stopsection       \stopchapter     \stoptext      # Question How would you force any text within a `\framed` environment to overlay the border?


title: Referencing todonotes by custom counter value?

text: I have my `todonotes` set up as follows:               \documentclass{article}     \usepackage{tikz}     \usepackage{todonotes}     \usepackage{hyperref}     \usepackage{setspace}     \usepackage{kantlipsum}          \newcounter{todoListItems}     \newcommand{\sstodo}[2][]     {\refstepcounter{todoListItems}{1}     \todo[caption={\protect\hypertarget{todo\thetodoListItems}{}\arabic{todoListItems}. #2}, #1]     {\begin{spacing}{1} \hfill \hyperlink{todo\thetodoListItems}{#2} \end{spacing} }}          \makeatletter\let\chapter\@undefined\makeatother               \begin{document}          \listoftodos          \kant[1] \sstodo{First}          \kant[2] \sstodo{Second}          \kant[3] \sstodo{Third}          \end{document}      As you can see, I have a custom counter set up to count the `todos` (instances of the custom `\sstodo`) and print the value in the list of todos. I'd like to be able to reference a given `todo` and have the number of the `todo` pulled printed with the `\ref`. I'd like to do this in a way where the labels for the `todos` are automatically generated. I also realize that I might be thinking about how to accomplish what I'm looking for in the wrong way. What I'm after is an easy way to cross-reference todonotes that doesn't require manually adding a label to each `todonote`. The purpose of this is to allow for easy referencing of `todo` items among collaborators. I tried using the solution here but was unable to get it to work (though that is what made me change my `\addtocounter` to `\refstepcounter`).


title: AUCTeX: How to enable auto expansion of sub and superscript in custom math environment

text: With help from the question How to add custom math-environments I taught AUCTeX that `IEEEeqnarray` and its starred counterpart are math environments. I added the following to my `.emacs`               ;; teach auctex IEEEeqnarray     (add-hook 'LaTeX-mode-hook 'add-my-latex-environments)      (defun add-my-latex-environments ()        (LaTeX-add-environments           '("IEEEeqnarray" LaTeX-env-label)          '("IEEEeqnarray*" LaTeX-env-label)))      In the `custom-set-variables` section I added               (custom-set-variables     '(font-latex-math-environments (quote ("display" "displaymath" "equation" "eqnarray" "gather" "multline" "align" "alignat" "xalignat" "IEEEeqnarray" "IEEEeqnarray*")))      And finally made reftex aware of it               ;; Additionally, reftex code to recognize this environment as an equation      (setq reftex-label-alist        '(("IEEEeqnarray" ?e nil nil t)         ("IEEEeqnarray*" ?e nil nil t)))      There's some more emacs customisation stuff found at How to Typeset Equations in LaTeX Now my question is: **How can I teach AUCTeX that it should also auto-expand the sub- and superscripts in these custom environments?** At the beginning of my `.emacs` I set               (setq TeX-electric-sub-and-superscript t) ; auto-expand sub- and superscript      But even though I integrated the `IEEEeqnarray` environments into AUCTeX with the above customisations, it doesn't auto-expand the `_` and `^` symbols in these environments, as it does in, e.g. `eqnarray`. I love this functionality, and need it in my custom math environments as well.


title: Achemso: Can I remove the "S"1 from the bibliography in supporting information of the achemso package, manuscipt=suppinfo

text: I am compiling my supporting information for a paper, and I am using the `manuscript=suppinfo` from the `achemso` package, which labels all of my figures and such with `S1`, which is great. The problem is that my bibliography is also listed as `S1,S2,..`etc, is there an easy way to remove the "S" from the bibliography? Would it be simpler to not use the `manuscipt=suppinfo` and simply add               renewcommand{\thefigure}{S\arabic{figure}}      type of a command to add the "S" where I need it?


title: ALL CAPITAL Roman Numeral Chapter Style. How?

text: **Question revised:** What must I do to make "Chapter 1" display as "CHAPTER I", "Chapter 2" as "CHAPTER II", and so forth? **Background and details:** This is a requirement for my thesis. I've searched a good while but not been successful in finding what I need without messing up what I already have. I found in the Wiki (here) about choosing different chapter styles, however, none of those listed are what I need. I need "CHAPTER" to display in all capitals, and to use roman numerals for the number of the chapter (not the page number though). And it must not change how I've (because of help from this awesome forum community) been able to get the page numbers in the correct places. **Other details that may be relevant:**   * I'm using LyX version 2.0.6.   * Document class: book (Memoir).   * Modules selected: Custom Header/Footerlines.   * Page Layout -> Headings style: Default.   * Not two-sided.   * Margins: 4cm above, 3cm below, 4cm left, and 3cm right.   * LaTeX Preamble:              \makeevenfoot{headings}{}{}{\thepage}     \makeoddfoot{headings}{}{}{\thepage}     \makeevenhead{headings}{}{}{}     \makeoddhead{headings}{}{}{}          \copypagestyle{chapter}{plain} % make chapter a page style of its own     \makeevenfoot{chapter}{}{}{\thepage}     \makeoddfoot{chapter}{}{}{\thepage}     \makeevenhead{chapter}{}{}{}     \makeoddhead{chapter}{}{}{}      **Question again:** What must I do to make "Chapter 1" display as "CHAPTER I", "Chapter 2" as "CHAPTER II", and so forth? **Thank you** for your time and any help you provide!


title: Why are there no \bibstyle commands in my .aux file?

text: I'm trying to compile this minimal piece of code:               \documentclass{article}          \usepackage[backend=biber]{biblatex}     \addbibresource{example.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      My `example.bib` is the file one can find here. However, upon running `latex minimal.tex`, I get the warnings               LaTeX Warning: Empty bibliography on input line 9.          (./minimal.aux)          LaTeX Warning: There were undefined references.               Package biblatex Warning: Please (re)run Biber on the file:     (biblatex)                minimal     (biblatex)                and rerun LaTeX afterwards.      And the `minimal.aux` only contains two lines of code,               \relax      \abx@aux@sortscheme{nty}      thus running `bibtex minimal.aux` results in errors concerning `\citation` commands not found etc. Am I missing something obvious? Is it something subtle?


title: pgfplots: Rescaling axis using factor, with nice tick labels/locations

text: I am trying to normalize the axis of a pgfplots graph by certain values, something like `2000` for the y-axis and `19099` for the x-axis. The y-axis looks nice as expected, but the x-axis being scaled by a not nice number, produces tick labels that are something like `0.52`, `1.05`, `1.57`, etc. rather than `0.5`, `1`, `1.5` etc. Is there a way to scale the axis but still place the ticks at nice locations automatically? Minimal working example:               \documentclass{standalone}       \usepackage{pgfplots}       \begin{document}         \begin{tikzpicture}           \begin{axis}[             xmin = 0,xmax = 70000,             ymin = 0,ymax = 5000,             scaled x ticks=manual:{}{\pgfmathparse{(#1)/(19099)}},             scaled y ticks=manual:{}{\pgfmathparse{(#1)/(2000)}},           ]           \end{axis}         \end{tikzpicture}       \end{document}      ![output of code](http://i.imgur.com/7zM6w.png) **UPDATE** Trying @Jake approach, gives me errors when I plot a function within my axis, see following:               \documentclass{standalone}       \usepackage{pgfplots}       \begin{document}         \begin{tikzpicture}           \begin{axis}[             xmin = 0,xmax = 70000,             ymin = 0,ymax = 5000,             domain=0:70000,             x coord trafo/.code={               \pgfkeys{/pgf/fpu=true}               \pgfmathparse{(#1)/(19099)}               \pgfkeys{/pgf/fpu=false}             },             y coord trafo/.code={               \pgfkeys{/pgf/fpu=true}               \pgfmathparse{(#1)/(2000)}               \pgfkeys{/pgf/fpu=false}             },     %        scaled x ticks=manual:{}{\pgfmathparse{(#1)/(19099)}},     %        scaled y ticks=manual:{}{\pgfmathparse{(#1)/(2000)}},             ]             \addplot {2000+0.001*(x/60)^2};           \end{axis}         \end{tikzpicture}       \end{document}      This produces errors, such as: ``! Illegal unit of measure (pt inserted).`


title: TikZ: small circle as an arrow tip

text: I know that the TikZ Arrow Tip Library (`arrows`) defines a circle arrow `[-o]`, however this circle is too large for me. Is there any way I can control the size of the circle on the end of line?