title: How do I tell Texmaker where to look for packages

text: I recently installed texlive from the internet (using tar found here).   When the installation finished, I added the following lines to `/etc/bash.bashrc`:               PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH; export PATH     MANPATH=/usr/local/texlive/2013/texmf-dist/doc/man:$MANPATH; export MANPATH     INFOPATH=/usr/local/texlive/2013/texmf-dist/doc/info:$INFOPATH; export INFOPATH      The same three lines I added to `~/.profile` and to `~/.bashrc` Also I added this line to the manpath file (`/etc/manpath.config`):               MANPATH_MAP /usr/local/texlive/2013/bin/i386-linux  /usr/local/texlive/2013/texmf-dist/doc/man      I'm not really sure what it means to add those lines to those files, but it doesn't seem to change anything if I leave them there or if I cut them off. Now, when I try to compile something on Texmaker, I get an error:               ! LaTeX Error: File `package_name.sty' not found.      That comes from the file               /usr/share/texlive/texmf-dist/tex/latex/package_name/package_name.sty      So as I can see, Texmaker is looking for the packages on the path:               /usr/share/texlive/texmf-dist/tex/latex        but all the packages installed by texlive are on the path:               /usr/local/texlive/2013/texmf-dist/tex/latex      The first path, I think, came up when I installed (from Software Manager) the packages `texlive-latex-base` and `texlive-latex-extra`.   Now that I have the actual texlive, I removed those packages and manually remove the directories they created (So now `/usr/share/texlive/texmf- dist/tex/latex` doesn't even exist!) I tried removing and reinstalling Texmaker (after I deleted the previous directory), and same thing with TexLive (I installed TexLive first and then Texmaker), but nothing changed. Now, all I need to do is tell Texmaker where all the packages are, but I guess that's what adding those lines to the mentioned files is all about. So, I don't know. Did I do something wrong? Is there any other way to manually tell Texmaker where to find the packages? Thank you for reading this, I appreciate your time. I use Linux Mint 15 Olivia.


title: Short List of Figures in Memoir

text: I really like the appearance of the short list of contents, introduced in the `memoir` manual. What I want is a short list of figures command changing the LoF style similarly. Centered captions followed by page numbers, without these dots in between. I was trying to adopt the code of the short toc command, but it didn't work out. Here is the shorttoc command.               \documentclass [a4paper,11pt,oneside]{memoir}     \setsecnumdepth{section}     \setcounter{tocdepth}{3}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%% Short and long ToC     \makeatletter     \newcommand*{\setupshorttoc}{%       \renewcommand*{\contentsname}{Short contents}       \let\oldchangetocdepth\changetocdepth       \let\oldprecistoctext\precistoctext       \renewcommand{\precistoctext}[1]{}       \let\oldcftchapterfillnum\cftchapterfillnum       \renewcommand*{\changetocdepth}[1]{}       \setcounter{tocdepth}{0}% chapters       \renewcommand*{\cftchapterfont}{\hfill\sffamily}       \renewcommand*{\cftchapterpagefont}{\normalfont}       \renewcommand*{\cftchapterleader}{ \textperiodcentered\space}       \renewcommand*{\cftchapterafterpnum}{\cftparfillskip}     %%  \setpnumwidth{0em}     %%  \setpnumwidth{1.5em}       \renewcommand*{\cftchapterfillnum}[1]{%         {\cftchapterleader}\nobreak         \hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}       \setrmarg{0.3\textwidth}       \setlength{\unitlength}{\@tocrmarg}       \addtolength{\unitlength}{1.5em}       \let\oldcftpartformatpnum\cftpartformatpnum       \renewcommand*{\cftpartformatpnum}[1]{%         \hbox to\unitlength{{\cftpartpagefont ##1}}}       \let\oldcftbookformatpnum\cftbookformatpnum       \renewcommand*{\cftbookformatpnum}[1]{%         \hbox to\unitlength{{\cftbookpagefont ##1}}}}          \newcommand*{\setupparasubsecs}{%       \let\oldnumberline\numberline       \renewcommand*{\cftsubsectionfont}{\itshape}       \renewcommand*{\cftsubsectionpagefont}{\itshape}       \renewcommand{\l@subsection}[2]{         \ifnum\c@tocdepth > 1\relax           \def\numberline####1{\textit{####1}~}%           \leftskip=\cftsubsectionindent           \rightskip=\@tocrmarg     %%      \advance\rightskip 0pt plus \hsize % uncomment this for raggedright     %%      \advance\rightskip 0pt plus 2em    % uncomment this for semi-ragged           \parfillskip=\fill           \ifhmode ,\ \else\noindent\fi           \ignorespaces           {\cftsubsectionfont ##1}~{\cftsubsectionpagefont##2}%            \let\numberline\oldnumberline\ignorespaces         \fi}}          \AtEndDocument{\addtocontents{toc}{\par}}%%% OK          \newcommand*{\setupmaintoc}{%       \renewcommand{\contentsname}{Inhaltsverzeichnis}       \let\changetocdepth\oldchangetocdepth       \let\precistoctext\oldprecistoctext       \let\cftchapterfillnum\oldcftchapterfillnum       \addtodef{\cftchapterbreak}{\par}{}       \renewcommand*{\cftchapterfont}{\normalfont\sffamily}       \renewcommand*{\cftchapterleader}{\sffamily\cftdotfill{\cftchapterdotsep}}       \renewcommand*{\cftchapterafterpnum}{}       \renewcommand{\cftchapterbreak}{\par\addpenalty{-\@highpenalty}}       \setpnumwidth{2.55em}       \setrmarg{3.55em}       \setcounter{tocdepth}{2}       \let\cftpartformatpnum\oldcftpartformatpnum       \addtodef{\cftpartbreak}{\par}{}       \let\cftbookformatpnum\oldcftbookformatpnum       \addtodef{\cftbookbreak}{\par}{}     }          \makeatother          \begin{document}          \setupshorttoc     \tableofcontents          \setupparasubsecs     \setupmaintoc     \tableofcontents     \setlength{\unitlength}{1pt}     %%%%%% Test     \chapter{Chaper 1}     \section{Section2}     \subsection{Subsection3}          \chapter{Chapter 2}          \section{Section2}     \section{Section1}     \end{document}      And here is something I tried.               \documentclass [a4paper,11pt,oneside]{memoir}\makeatletter     \newcommand*{\setupshortlof}{%          \renewcommand*{\contentsname}{ShortLof}     \let\oldchangelofdepth\changelofdepth     \let\oldprecisloftext\precisloftext     \renewcommand{\precisloftext}[1]{}     \let\oldcftchapterfillnum\cftchapterfillnum     % \renewcommand*{\changelofdepth}[1]{}     %\setcounter{tocdepth}{0}% chapters     \renewcommand*{\cftchapterfont}{\hfill\sffamily}     \renewcommand*{\cftchapterpagefont}{\normalfont}     \renewcommand*{\cftchapterleader}{ \textperiodcentered\space}     \renewcommand*{\cftchapterafterpnum}{\cftparfillskip}     }     \makeatother          \begin{document}     \clearpage     \setupshortlof     \listoffigures     \end{document}      This doesn't work at all. Has anyone here already done such a thing or knows how to do it? * * * ### Update: Thx so far. This one works fine.               \documentclass [a4paper,11pt,oneside]{memoir}      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% Short LoF     \makeatletter     \newcommand*{\setupshortlof}{%     \renewcommand*{\listfigurename}{ShortLof}     %\let\oldchangelofdepth\changelofdepth     %\let\oldcftfigurefillnum\cftfigurefillnum     \renewcommand*{\cftfigurefont}{\hfill\sffamily}     \renewcommand*{\cftfigurepagefont}{\normalfont}     \renewcommand*{\cftfigureleader}{ \textperiodcentered\space}     \renewcommand*{\cftfigureafterpnum}{\cftparfillskip}     \renewcommand*{\cftfigurefillnum}[1]{%     {\cftfigureleader}\nobreak     \hbox to 1.5em{\cftfigurepagefont ##1\hfil}\cftfigureafterpnum\par}     \setrmarg{0.3\textwidth}     \setlength{\unitlength}{\@tocrmarg}     \addtolength{\unitlength}{1.5em}     \let\oldcftpartformatpnum\cftpartformatpnum      \renewcommand*{\cftpartformatpnum}[1]{%     \hbox to\unitlength{{\cftpartpagefont ##1}}}      \let\oldcftbookformatpnum\cftbookformatpnum      \renewcommand*{\cftbookformatpnum}[1]{%      \hbox to\unitlength{{\cftbookpagefont ##1}}}      }      \makeatother      \begin{document}           \clearpage      \setupshortlof      \listoffigures      \chapter{Chaper1}      \section{Section1}      \begin{figure}      \caption{Test1}%      \label{Test1}%      \end{figure}           \begin{figure}       \caption{Test2}%       \label{Test2}%      \end{figure}           \begin{figure}      \caption{Test3}%      \label{Test3}%      \end{figure}           \end{document}      Now I'd like to get rid of the figure numbers. I don't want them to be displayed in the LoF. How can I do this?


title: Beamer alt command like visible instead of like only

text: The `beamer` command `\alt<*overlay specification*>{foo}{bar}` will insert `foo` if the current slide is within the given overlay specification, and `bar` otherwise. It's equivalent to               \only<*overlay specification*>{foo}\only<*complementary overlay specification*>{bar}      Here is a sample document using it:               \documentclass{beamer}     \begin{document}     \begin{frame}     \begin{align*}     y &= \frac{(x^2+1)\sqrt{x+3}}{x-1} \\     \ln y &= \ln (x^2+1) + \frac{1}{2} \ln(x+3) - \ln(x-1) \\     \frac{1}{y} \frac{dy}{dx}           &= \frac{2x}{x^2+1} + \frac{1}{2(x+3)} - \frac{1}{x-1}     \end{align*}     So     \[     \begin{split}     \frac{dy}{dx} &= \left(\frac{2x}{x^2+1} + \frac{1}{2(x+3)} - \frac{1}{x-1}     \right)     \alt<2>{\frac{(x^2+1)\sqrt{x+3}}{x-1}}{y}     \end{split}     \]     \end{frame}     \end{document}      This is very useful and saves typing. But if one of the alternatives is larger than the other, it leads to jiggling slides. What I would like is a overlay-specification-aware command `\altvisible` that would take the same amount of space on each slide. So it would have to insert a box as big as the bigger of the two, and then set the correct material. So the above document with `\altvisible` instead of `\alt` would not jiggle. Any takers?


title: What is good practice when preparing a book for printing?

text: I'm writing my thesis using Latex and nearing its completion I'm beginning to worry about the quality of the hardcopy. I'm curious about what should be taken into consideration when preparing a document so that the printed document is of such a good quality as the PDF produced by Latex. From what I've read in some answers on this site, I have the following impressions:   * I should ask the printing shop for the binding correction for my page size and take it into account in my page layout.   * I should ask the printing shop for their available printing sizes and produce cropping marks if necessary.   * The colors in my document should be defined using CMYK instead of RGB (though I'm not certain on this), which makes me wonder if I should convert my current colors from RGB to CMYK. Are there any canonical things that are important when preparing a hardcopy? Of course I refer to things that can be done in the Latex source to improve the quality of the printed ouput (or to minimize the problems that may arise).


title: Vertical line only in one part of a table

text: I need some help on putting a vertical line in the second part of the table, I don't know how to do it since the `tabularx` I declared does need to have that only in the second part. The code I used is:               \begin{tabularx}{\linewidth}{|XX|}     \hline     \multicolumn{2}{|c|}{\textbf{title name}}\\     \hline     something: & else \\     something: & else \\     something: & else \\     \hline     \multicolumn{2}{|c|}{bla bla blah}\\     \hline     title text: & description 1 \\     title text: & description 1 \\     \hline     \end{tabularx}      And the render of the table looks like this: ![http://i.stack.imgur.com/nFQI1.png](http://i.stack.imgur.com/8psWA.png) I just need a `\vline` between title text and description (it I use `\vline` it works only for the first line but the description text and sometimes the title, are few lines long).


title: How to use same texmf directory with different operating systems?

text: For some reasons I have to install a 64-bit RPM based Linux (Fedora or SUSE) beside a 32-bit Debian-based Linux (Ubuntu or Arch) on my machine. I want to use same TeXLive Installation from both OSs. Am I able to introduce the texmf directory of Ubuntu (`/usr/local/.../texmf-dist`?) to Fedora or vice versa? How?


title: This elliptical-orbit diagram compiled fine with TikZ 2.10 but fails with TikZ 3.0. Why?

text: I borrowed some code on Kepler's 2nd Law from the linked post here on TeX answered by Tosco. I haven't compiled the document it is in awhile but needed today. When I did, I was told dimension too large. The dimension too large points to the following lines:               % \draw[very thin,->](\oldx,\ol dy)--++(\forcex,\forcey);     \ifnumgreater{(\n - \startone) * (\endone - \n)}{-1}      Prior to some update(not sure which one broke it), this code compiled and worked correctly. Now it doesn't. What can be done about this?               \documentclass[convert = false, tikz]{standalone}          \usepackage{amsmath}     \usepackage{etoolbox}     \usetikzlibrary{backgrounds}          \begin{document}          \gdef\myposx{10.0}     \gdef\myposy{0.0}     \gdef\vx{0.0}     \gdef\vy{4.6}     \gdef\forcefactor{150}     \gdef\deltat{0.025}     \gdef\smallmass{1}     \gdef\startone{100}     \gdef\endone{200}     \gdef\starttwo{1800}     \gdef\endtwo{1900}     \gdef\pathone{}     \gdef\pathtwo{}          \begin{tikzpicture}[scale = .2]       \filldraw(0, 0) circle [radius = 0.5cm];       \foreach \n in {1, ..., 3625}       {         \pgfextra{%           \global\let\oldx\myposx           \global\let\oldy\myposy           \pgfmathsetmacro{\currentsquareddistance}{\myposx * \myposx + \myposy *             \myposy}           \pgfmathsetmacro{\currentforce}{\forcefactor / \currentsquareddistance}           \pgfmathsetmacro{\currentangle}{atan2(\myposx, \myposy)}           \pgfmathsetmacro{\currentforcex}{-1 * \currentforce * cos(\currentangle)}           \pgfmathsetmacro{\currentforcey}{-1 * \currentforce * sin(\currentangle)}           \pgfmathsetmacro{\currentvx}{\vx + \deltat * \currentforcex / \smallmass}           \pgfmathsetmacro{\currentvy}{\vy + \deltat * \currentforcey / \smallmass}           \pgfmathsetmacro{\currentposx}{\myposx + \deltat * \currentvx}           \pgfmathsetmacro{\currentposy}{\myposy + \deltat * \currentvy}           \global\let\myposx\currentposx           \global\let\myposy\currentposy           \global\let\vx\currentvx           \global\let\vy\currentvy           \global\let\forcex\currentforcex           \global\let\forcey\currentforcey           \global\let\myangle\currentangle           \ifnumequal{\n}{\startone}{%             \global\let\startonex\oldx             \global\let\startoney\oldy             \xappto{\pathone}{(\oldx, \oldy)}           }{}           \ifnumequal{\n}{\starttwo}{%             \global\let\starttwox\oldx             \global\let\starttwoy\oldy             \xappto{\pathtwo}{(\oldx, \oldy)}           }{}           \ifnumequal{\n}{\endone}{%             \global\let\endonex\myposx             \global\let\endoney\myposy             \xappto{\pathone}{,(\myposx,\myposy)}           }{}           \ifnumequal{\n}{\endtwo}{%             \global\let\endtwox\myposx             \global\let\endtwoy\myposy             \xappto{\pathtwo}{,(\myposx, \myposy)}           }{}         }         % \draw[very thin,->](\oldx,\ol dy)--++(\forcex,\forcey);         \ifnumgreater{(\n - \startone) * (\endone - \n)}{-1}         {           \pgfextra{%             \xappto{\pathone}{,(\myposx, \myposy)}           }         }         {}         \ifnumgreater{(\n - \starttwo) * (\endtwo - \n)}{-1}         {           \pgfextra{%             \xappto{\pathtwo}{,(\myposx, \myposy)}           }         }         {}         \draw(\oldx, \oldy)--(\myposx, \myposy);       }       \begin{scope}[on background layer]         \filldraw[blue, opacity = .5] (0, 0)%         \foreach \point in \pathone         {%           --\point         }--(0, 0);         \filldraw[blue, opacity = .5] (0, 0)%         \foreach \point in \pathtwo         {%           --\point         }--(0, 0);       \end{scope}     \end{tikzpicture}     \end{document}


title: 3d model cannot be displayed (movie15, pdflatex)

text: I try to include a 3d model in a PDF file, but I get the error message: "A 3D data parsing error has occurred.", when I try to display it in Acrobat Reader 9.3 under Ubuntu 10.10. I translated the tex file that you can find in the zip file under http://meshlab.sourceforge.net/wiki/index.php/U3D_support I figure that there are the following error sources:   * U3D file is corrupt or incompatible   * the movie15 package is too old or incompatible   * the tex file does not use the right options I am currently unable to create my own u3d files with MeshLab and I did not find any other example files on the internet. I already "replaced" the movie15.sty that is inside the zip file with movie15.sty that is shipping with Ubuntu. I would be very greatful if someone could point me in the right direction. For your convinience the beginning of the tex file:               \documentclass[a4paper]{article}     \usepackage[3D]{movie15}     \usepackage[UKenglish]{babel}     \usepackage[colorlinks=true]{hyperref}      \begin{document}     \title{Embedding interactive 3D object in a PDF using MeshLab and U3D}     \author{Visual Computing Group - ISTI - CNR\\ \href{http://vcg.isti.cnr.it}{http://vcg.isti.cnr.it}}     \maketitle     \begin{center}     \includemovie[         poster,         toolbar, %same as `controls'         label=lau.u3d,         text=(lau.u3d),         3Daac=60, 3Droll=0, 3Dc2c=0 745.639 0, 3Droo=745.639, 3Dcoo=22.607 -1618.68 -149.864,         3Dlights=CAD,         3Drender=Wireframe     ]{\linewidth}{\linewidth}{Laurana.u3d}     ...


title: Large table is placed on extra page

text: I am using LaTeX, and I have a large table in my report, the height of table is a little more than half of the paper. all the text after the table will go to the next page, and in this page just the table remain and a lot of space after and before the table!


title: Incomplete parametric curve, ''written letter e''

text: I have tried plotting some parametric curves like `(x^3-3*x,3*x^2-9)`, and it works fine. The following, however, does not work: `(x-x/(1+x^2),1/(1+x^2)`. I have tried several ways of plotting it but the best I can get is just a cusp, and not the loop above it -- part of the graph is omitted as if it has to be the graph of a (single) function. The last thing I've tried is                   \begin{tikzpicture}             \begin{axis}[                     xmin=-8,xmax=4,                     ymin=-8,ymax=4,                     grid=both,                     ]                     \addplot [domain=-3:3,samples=50]({x-x/(1+x^2)},{1/(1+x^2)});              \end{axis}         \end{tikzpicture}      and it generates the cusp but not the loop. I'm sorry about everything that's incorrect and ugly. I just really need help now. **Edit** : I have received the help I came here for, thank you! The problem is solved: Instead of `({x-x/(1+x^2)},{1/(1+x^2)})` it should be `({x-2*x/(1+x^2)},{1/(1+x^2)})`. So the error wasn't even TeX-related, although I now trust TeX more than I did before. I should have double-checked but didn't even think about it -- it is when I am that tired that I ask for help. For your added prestige, you have found an error in Masahisa Adachi's ''Embeddings and Immersions'' (translated by Kiki Hudson).


title: Create two documents from one texclipse project

text: We have one main LaTeX project in texclipse for our Help Documentation and that works great. However we have a folder and tex file on installation instructions of our software which we would like to also build as a document of its own. What strategy can we follow in texclipse to achieve that? We want to be able to create other documents from that main one.


title: End of paragraph with ornament

text: How to make a line with ornament like one below {TEX} logo on this site? What is specific term for it?


title: How to input an endmark in an environment different from the proof environment?

text: I want to put an endmark in the `solution` environment, I tried               \documentclass{article}     \usepackage{amsthm}     \usepackage{amssymb,amsmath}     \newtheorem{mytheorem}{Theorem}[section]     \newtheorem{ex}{Example}[section]     \begin{document}     \section{Section one}     \begin{mytheorem}     If \(U\) or \(V\) then...          \begin{proof}[Proof]     The Proof             \begin{equation*}                 Ax = b.             \end{equation*}     \end{proof}     \end{mytheorem}          \begin{ex}     This is a example     \end{ex}     \begin{proof}[Solution]     \renewcommand{\qedsymbol}{\ensuremath{\diamondsuit}}     This is a solution     \end{proof}     \end{document}      How do I write a command in the preamble to put an endmark in the `solution` environment?


title: ConTeXt + XeTeX (TeXLive 2012) does not work for Indic scripts like Malayalam

text: This is a follow up question to What is the state of support for (Unicode) Indic scripts in Context? I have been trying to get texexec/mkii to work with XeTeX engine, but the resulting rendering is incorrect - reordering of Malayalam characters do not happen. Running the following minimal example through XeLaTeX (version 3.1415926-2.5-0.9998 TeXLive 2012) gives correct output:               \documentclass{article}     \usepackage{fontspec}     \setmainfont[Script=Malayalam]{Rachana}     \begin{document}     മലയാളം \TeX ഉപയോഗിച്ച് ടൈപ്പ്സെറ്റ് ചെയ്തത്     \end{document}      Correct rendering screenshot here: ![enter image description here](http://i.stack.imgur.com/4wdaI.png) The same with ConTeXt "texexec --xetex" (version ConTeXt ver: 2012.05.30 11:26 MKII fmt: 2013.1.1 int: english/english) results in incorrect rendering.               \usemodule[simplefonts]     \setmainfont[Rachana]     \starttext     മലയാളം \TeX ഉപയോഗിച്ച് ടൈപ്പ്സെറ്റ് ചെയ്തത്     \stoptext      Incorrect rendering screenshot: ![enter image description here](http://i.stack.imgur.com/ppIpk.png) What possibly am I missing? The font used is Rachana, which can be found from Savannah download page (version 5.0.1)


title: beamer's fragile frame as default

text: Is there a way to specify _fragile_ mode as default for all frames? Now I know how to define a fragile frame: `\begin{frame}[fragile]`.


title: Expansion of first token in a tabular cell

text: ### Background I currently do some work on the `collcell` package which collects the content of a `tabular`/`array` cell and provides it to a user defined macro, e.g. using `>{\collectcell\mymacro}c<{\endcollectcell}`. ### The Problem I discovered that the very first token of every cell is expanded prior to the insertion of the `>{...}` code. I'm not sure how and where this is done. Does anyone know:   1. What expands this token (i.e. the `array`/`tabular` LaTeX code or the plainTeX `\halign` code or else?) and where   2. Why this is done (I have some wage idea, but I'm very interested about "the official" reason)   3. Can I stop it from being expanded somehow? I mean for my package in an user friendly way? (I really have to read the relevant part of _The TeXBook_ again when I have more time.)


title: How tell \hyperref to insert a \target= in the resulting \href=

text: I am using MikTeX and \includepackage{hyperref} package to insert links to websites in my documents. The Adobe reader opens a new tab for each link in the PDF, and that is what I want. Next I want to get the same behavior when I generate HTML using some LaTeX to HTML converter. I am using plasTeX. How do I tell hyperref via \href{site}{text} that I want the HTML code to have a \target="blank" inside the                   [a]href="site"]text[/a]       in the resulting HTML? (For this post I used [] instead of <> to display the HTML code above)


title: Why does something work in one editor but not the other?

text: I have a Windows desktop at home, running TeXniccenter, and a Linux netbook running Texstudio. I would compile the PDF in Texniccenter without any error, but on Texstudio, I'd get errors. It works the other way as well, i.e. no error on Texstudio but rife with errors on TeXnicCenter. I often get errors concerning overfull or underfull hbox. Here's the code in question: All that remains to be seeing is whether the partial derivatives of these functions satisfy the Cauchy-Riemann equations.               \begin{eqnarray*}     \frac{\partial u}{\partial x} &=& \frac{1}{\sqrt{x^2+y^2}} \cdot \frac{1}             {2\sqrt{x^2+y^2}} \cdot 2x = \frac{x}{x^2+y^2}\\     \frac{\partial u}{\partial y} &=& \frac{1}{\sqrt{x^2+y^2}} \cdot \frac{1     {2\sqrt{x^2+y^2}} \cdot 2y = \frac{y}{x^2+y^2}\\     \frac{\partial v}{\partial x} &=& \frac{1}{1+\frac{y^2}{x^2}} \cdot \frac{-y}     {x^2} = \frac{-y}{x^2+y^2}\\     \frac{\partial v}{\partial y} &=& \frac{1}{1+\frac{y^2}{x^2}} \cdot \frac{1}          {x} = \frac{1}{x+\frac{y^2}{x}} = \frac{x}{x^2+y^2}     \end{eqnarray*}      And the error happens right where the endarray line is. Why do I get different errors on different editors? Thank you


title: How to force a text to appear after a table

text: I have to show a set of four tables: one after another. Each table has almost middle page of information, and I really need them to appear before the next block of text. An example of LaTeX code is shown below:               text text text text...          \begin{table}         \caption{table 1}     ...............     \end{table}          \begin{table}         \caption{table 2}     ...............     \end{table}          \begin{table}         \caption{table 3}     ...............     \end{table}          \begin{table}         \caption{table 4}     ...............     \end{table}          next text next text next text      As these tables cannot fit in one page, LaTeX need two or three pages to show all of them. But, here is my problem: since there are empty spaces between one table and another (because of the end of the pages), LaTeX put the subsequent text in these spaces, showing the rest of the tables after it. In other words, I want LaTeX to behave exactly as the code says: first show all the tables (no matter how much empty space may exist between them), and only show the rest of the text after the last table.


title: Several volumes in biblatex

text: I'm wondering on how to get the plural version of "volume" with biblatex when mentioning several numbered volumes? Something like:               @BOOK{ref,     author =       "author",     title =        "title",     year =         "year",     publisher =    "publisher",     location =     "location",     volume =       "1-2-4"     }      Using key "volumes" is not the solution.


title: how to change the algorithm environment?

text: I am interested in changing the algorithm environment so that the numbered "Algorithm" title appears _at the bottom_ instead of at the top, and also the three rulers (one above the Algorithm caption, second below the Algorithm caption, and third at the bottom of the whole environment) won't be there. I couldn't find a way of doing it according to here: http://cs.brown.edu/about/system/software/latex/doc/algodoc.pdf Any ideas how to do that? (Maybe I should define a new environment which is very similar to the Figure environment instead, only the heading is Algorithm instead of Figure?)


title: How does one automatically escape a sequence of text, like "verbatim" but without the formatting?

text: I want to escape TeX codes on a range of text; this is for a macro providing slightly neater URL formatting. The code I have now is,               \newcommand{\serifurl}[2]{\textsf{\href{#1://#2}{#2}}}      where the first arg is the protocol (http) and second is rest of the link. While the link is generated correctly for the PDF, the tilde characters are not escaped (they turn into whitespace), making the print version incorrect. I want something like `\verb` without the formatting.


title: Typesetting nested chess variations in Skak

text: I am hoping to use Skak to typeset my chess notes, and as part of the learning process, I decided to typeset a page from a chess book I own. I got as far as the following before I stumbled.               \documentclass[10pt,twocolumn]{article}          \usepackage{skak}             \begin{document}          \begin{center}         \textbf{Botvinnik -- Smyslov} \\         \textit{World Championship Match (17)} \\         \textit{Moscow 1957} \\         Gr\"{u}nfeld Defence     \end{center}          \newgame     \styleC          \mainline{ 1. Nf3 Nf6 2. g3 g6 3. c4 c6 4. Bg2 Bg7 5. Nc3 O-O 6. d4 d5 7. cxd5 cxd5 8. Ne5 b6}          A satisfactory way of developing.  After \variation{8... Nc6 9. Nxc6 bxc6} Black would be saddled with a weak pawn at c6.          \mainline{9. Bg5 Bb7 10. Bxf6 Bxf6 11. O-O}          In the variation \variation{11. e4 dxe4 12. Nxe4 Bxe5 13. dxe5 Nd7 14. f4 Nc5} Black has a good game.          \mainline{11... e6 12. f4}          If \variation{12. e4 Nc6 13. exd5 Nxe5 14. dxe5 Bxe5 15. dxe6 Bxg2 16. exf7+ Rxf7 17. Kxg2 Bxc3 18. bxc3 Qxd1 19. Rfxd1 Rc8 20. Rd3 Rc4}, and Black can successfully battle for a draw in the rook ending.          \end{document}      I would like to insert the variation (13. Nxc6 Bxc6 14. exd5 exd5) between the half-moves 13. exd5 and 13...Nxe5 of the last line. My first attempt was to use \variations within \variations, but that failed due to a discrepancy in move counts. Then I tried to be clever and spent some time playing with convoluted \hidemoves and \restoregame tricks, but still no luck. Any suggestion as to how I can typeset nested variations?


title: Install ConTeXt manually without using first-setup.bat

text: For some reason or the other, when I try to install ConTeXt on my machine (Windows 7 OS), it gives an error as shown below: ![enter image description here](http://i.stack.imgur.com/mubMJ.png) ![enter image description here](http://i.stack.imgur.com/BFPbf.png) So I have tried and tried and tried and tried. You get the point. I was wondering if it is possible to just download the files that it is supposed to download and install manually. I am looking at this page but don't know if am in the right place. And if so, how can install it manually; that is, in the correct folders? NOTE: I have read some of the posts here but I have not reached a solution. By the way, it does not download anything.


title: Don't do any fills in TikZ

text: I have a macro that will draw several things in a TikZ picture using some styles I defined, which include fills:               \documentclass{article}     \usepackage{tikz}     \tikzset{%     mystyle1/.style={fill=red,font={\bfseries}},     mystyle2/.style={fill=yellow,draw=blue}     }     \newcommand{\doit}{%      \begin{tikzpicture}       \node[mystyle1,circle]at(0,0){Text1};       \node[mystyle2,rectangle] at (3,0){Text2};      \end{tikzpicture}     }     \begin{document}     Foo          \doit          bar     \end{document}      Which looks like ![have](http://i.stack.imgur.com/b5nio.png) How can I tell TikZ, before or after the `\tikzset`, to > don't do the fills but everything else without redefining all the styles? (Here it's only two, but in my real applications it's many and they may change.) So, the result should look like this: ![want](http://i.stack.imgur.com/z9gGf.png) I thought, that something like               \tikzset{every node/.append style={fill=none}}      should work, but it doesn't.


title: Passing arguments to mdwlist environments

text: I'm trying to make a `description` list more compact. I figured the easiest way to do this would be to use `mdwlist`'s description* environment. This reduces the spacing between list items. I'd also like to reduce the left margin to 0pt. From the Compacted List section of the `mdwlist` documentation: > Some list environments accept arguments. You can pass an argument to a list > environment using an optional argument to its compact variant. For example, > `\begin{foolist*}[{someargument}]` So, I should be able to do something like `\begin{description*}[leftmargin=0pt]`, no? Unfortunately, that returns > LaTeX Error: Something's wrong--perhaps a missing `\item`. So, that's obviously not going to work. Can this be done using the `mdwlist` package? Or, am I left recreating the `description*` environment with just a small change?


title: Create and center nice EBNF

text: I used the package `syntax` to create the following EBNF.   1. I would like to center it, however `\begin{center}...\end{center}` and other commands do not seem to work on the `grammar` environment.   2. When I set `\grammarindent` to a larger value also the `::=` gets indented. Do you have an idea how I can indent the `\alt` behind the `::=`?               \documentclass[a4paper,12pt]{article}     \usepackage[nounderscore]{syntax}     \begin{document}     \shortverb{\|}     \setlength{\grammarindent }{2cm}     \begin{grammar}     <stmt> ::= <stmt>; <stmt> | \textbf{skip} | $v := $ <expr> | \textbf{input} $\vec{v}$ | \textbf{output} $\vec{v}$             \alt \textbf{if} <expr> \textbf{then} <stmt> \textbf{else} <stmt> | \textbf{while} <expr> <stmt>          <expr> ::= $v$ | \textbf{tt} | \textbf{ff} | <expr> $\lor$ <expr> | $\lnot$<expr>.     \end{grammar}      \end{document}


title: Scaling bibitem symbols in beamer[poster]

text: Beamer has an option to draw a _cute little article icon_ (official wording from the manual) next to each `\bibitem` when displaying the bibliography. When using beamerposter, often this cute icon is a bit too little. Is there a way to scale it? MWE:               \documentclass{beamer}       \usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}          \usetheme{Berlin}           \begin{document}       \begin{frame}       \begin{thebibliography}{9}        \bibitem{}{Benner, Byers \newblock An arithmetic for matrix pencils: theory and new algorithms \newblock Numer. Math. 06}       \end{thebibliography}       \end{frame}      \end{document}      Example: ![enter image description here](http://i.stack.imgur.com/9DuWS.png)


title: Message Sequence chart

text: I'm drawing a `sequencediagram` with LaTeX. By now it looks like this: ![enter image description here](http://i.stack.imgur.com/zXsW4.jpg)   * Is it possible to remove the grey boxes?   * Is it possible to put a space between handshake and `ws.connect`? This is my Code:               \begin{figure}[hbtp!]     \begin{center}         \fbox{         \begin{sequencediagram}             \newthread{c}{:Client}             \newinst[4]{s}{:Server}                  \begin{call}                 {c}{Handshake}                 {s}{Handshake}             \end{call}                  \begin{call}                 {c}{ws.connect}                 {s}{ws.connectes}             \end{call}                  \mess{c}{ws.message}{s}             \mess{s}{ws.message}{c}             \mess{c}{ws.message}{s}              \end{sequencediagram}         }     \caption{WebSockets}     \end{center}     \end{figure}


title: autoref not adding "scheme", when converting .eps with auto-pst-pdf

text: ## Problem/Question I'm encountering problem using `\autoref` (from `hyperref` package) to reference a `scheme`-environment (provided `chemstyle` package), when using `\includegraphics[*]{*.eps}` (working with `auto-pst-pdf` package), as it will omitt "Scheme" in the typesetted reference. Is this an known issue, and is there any way to bypass this problem? I already tried to use                 \def\schemeautorefname{Scheme}      in preamble - without any succes. ## M(N)WE               \documentclass{article}          \RequirePackage[runs=2,crop=off]{auto-pst-pdf}     \RequirePackage[varioref=false]{chemstyle}     \RequirePackage{hyperref}          \begin{document}     %usage on an .eps file     \begin{scheme}[H]         \centering         \caption{Caption}         \includegraphics{./EPS.eps}         \label{schm:test1}     \end{scheme}     Test \autoref{schm:test1}... (Not working)     %usage on an .png file     \begin{scheme}[H]         \centering         \caption{Caption}         \includegraphics{../PNG.png}         \label{schm:test2}     \end{scheme}     Test \autoref{schm:test2}... (Working)     \end{document}


title: Removing character from a hyperref link

text: I would like to suppress a character from a `hyperref` link that is built via `\url`, but the textual representation should keep that character. For example, if the character is `*`, I want `\url{http://tex.stackexchange*.com}` act as `\href{http://tex.stackexchange.com}{http://tex.stackexchange*.com}`. An embarrassingly failing attempt to hack the `\hyper@linkurl` macro is given in the MWE, just to show some effort.               \documentclass{article}     \usepackage{hyperref}     \begin{document}     \makeatletter     \renewcommand\hyper@linkurl{%       \begingroup         \lccode`\~=`\*\relax         \lowercase{\def~}{}%         \catcode`\*\active         \lccode`\~=0\relax         \my@hyper@linkurl     }     \def\my@hyper@linkurl#1#2{%        \edef\x{\toks0={#2}}\x        \Hy@pstringdef\Hy@pstringURI{\the\toks0}%        \hyper@chars        \leavevmode         \pdfstartlink           attr{%             \Hy@setpdfborder             \ifx\@pdfhightlight\@empty             \else               /H\@pdfhighlight             \fi             \ifx\@urlbordercolor\relax             \else               /C[\@urlbordercolor]%             \fi           }%           user{%            /Subtype/Link%            \ifHy@pdfa /F 4\fi            /A<<%              /Type/Action%              /S/URI%              /URI(\Hy@pstringURI)%              \ifHy@href@ismap                /IsMap true%              \fi              \Hy@href@nextactionraw            >>%           }%           \relax         \Hy@colorlink\@urlcolor#1\Hy@xspace@end         \close@pdflink       \endgroup     }     \makeatother     \url{http://tex.stackexchange*.com}     \end{document}      This is trying to make the star active, and let it be replaced by an empty group in the assignment to `toks0`, but it does not work. It also does not feel right to replicate so much code from `hyperref`. What is a better way to achieve this?


title: How can one make LaTeX break lines between graphics correctly?

text: Consider the following code:               \documentclass[]{scrartcl}     \usepackage[demo]{graphicx}     \setlength{\parindent}{0cm}          \begin{document}     \includegraphics[width=3.5cm]{}     \includegraphics[width=3.5cm]{}     \includegraphics[width=3.5cm]{}     \includegraphics[width=3.5cm]{}     \includegraphics[width=3.5cm]{}     \includegraphics[width=3.5cm]{}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus molestie     nunc non lectus convallis auctor. Cras nisl arcu, placerat et pretium at,     blandit ut nunc. Proin ut est ac dolor porttitor pellentesque. Donec commodo     ornare nisi. Nam non elit in arcu placerat rhoncus nec sed erat. Donec non mi     velit, quis malesuada ante.     \end{document}      which produces this output: ![beginning of the document](http://i.stack.imgur.com/MazzA.png) Why is it that LaTeX does not break the line when there is no more space left for an entire figure? How can I ensure LaTeX breaks the lines correctly?


title: yticklabel in Thousands of pounds/dollars/euros pgfplots

text: I'd like to display the `yticklabel` as Thousands `\euro` or `\pounds`, but doesn't quite looks right, what do you think?                       \documentclass{article}         \usepackage{tikz}          \usepackage{pgfplots}         \pgfplotsset{compat=newest}         \usetikzlibrary{pgfplots.units}         \usepgfplotslibrary{units}         \begin{document}           \begin{tikzpicture}     \begin{axis}[     title = {Optimalization based upon co-occurences},     xbar,     width=10cm,     change y base,     y SI prefix=kilo,y unit=Thousands,     xtick={1,...,5},     yticklabel={\pgfmathprintnumber{\tick}\pounds{}},     xticklabels={{Bloodstream infections (BSI)},{Surgical site infections (SSI)},{Ventilator-associated pneumonia (VAP)},{Urinary tract infections (UTI)},{Others}},         grid=major,      x tick label style={rotate=45,anchor=east},   ]          \addplot[fill=blue,draw=black,ybar,error bars/.cd,y dir=both,y explicit]      coordinates     {     (1, 36441   )+-(    207256  ,   2883    )     (2, 25546   )+-(    134602  ,   1783    )     (3, 9969    )+-(    12034   ,   7904    )     (4, 1006    )+-(    1361    ,   650 )     (5, 1000    )+-(    5000    ,   800 )          };     \end{axis}     \end{tikzpicture}         \end{document}      Would be nice if it looked like the graph below. Any suggestions? I see a siunitx library but no specific example around. Surely there is one... ![enter image description here](http://i.stack.imgur.com/mleKx.png)


title: \paragraph & \label{}

text: I am working with about 4000 aphorisms and this is the way I structured my document. I created 4000 sections in one document and named it "aphorisms" i.e.               \section{aphorism - 1} \label{1.1.1}      \section{aphorism - 1} \label{1.1.2} and so on       I can not change the label name because thats how they are numbered and I don't want loose this reference. Then I ran the file and it created `aphorisms.aux` file, For my document Lessons_1 wherever I needed the aphorism quoted I used `\nameref*{}` and I included previously generated aux file and later excluded using `\includeonly{}` to stop the output to PDF. It created a beautiful document I wanted. Below is non working example, but to show the structure of my documents arrangement.               \documentclass[fleqn,12pt,a4paper]{article}     \RequirePackage{my_Custom_package}          \includeonly{Lessons_1}          \begin{document}      \doublespacing          \include{aphorisms}     \include{Lessons_1}          \end{document}       my question is can it be done like this using paragraphs in place of sections and label names as `\label{a1.1.1}` etc. This way I can create explanation of each aphorism by various author, by creating something like `\paragraph{ } \label{}` for each author. Then I can easily create as shown below, This would become template to many other projects I am planning to undertake in future.               \nameref*{1.1.1} % aphorism     \nameref*{a1.1.1} % Explanation of Author A     \nameref*{b1.1.1} % Explanation of Author B      This project is to revive some ancient texts. Your help is greatly appreciated.


title: Bad Character code (256)/ \select@language{greek}

text: I was trying to install `minted` package in `TeXLive`. I installed it and then run `sudo tlmgr update --all`. It was running slow so I stopped it using `Ctrl+Z` in an `ubuntu` terminal and then I run `sudo tlmgr update --list`. After that I installed `texlive-latex-extra` and `python-pygments`. Later on I run `sudo tlmgr update --all` again and let it finish. After that I am trying to run a simple code using `listings` and greek but I get an error > Bad Character code (256) A MWE that illustrated the problem is the following               \documentclass{book}          \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     % %\usepackage[utf8]{inputenc}     \usepackage{kerkis}     \usepackage{pifont}     % %      \newcommand{\sw}{\selectlanguage{english}}     \newcommand{\sq}{\selectlanguage{greek}}     \newcommand{\eng}[1]{\latintext#1\greektext}     \newcommand{\gre}[1]{\greektext#1\latintext}          \usepackage{xcolor}     \usepackage{listings}     \usepackage{textcomp}          \definecolor{listinggray}{gray}{0.9}     \definecolor{lbcolor}{rgb}{0.9,0.9,0.9}          \lstdefinestyle{JavaStyle}{             backgroundcolor=\color{lbcolor},         tabsize=4,     %   rulecolor=,         language=Java,      % choose the language of the code             basicstyle=\scriptsize,     % the size of the fonts that are used for the code             upquote=true,             aboveskip={1.5\baselineskip},             columns=fixed,             showstringspaces=false,             extendedchars=false,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=single,             numbers=left,             showtabs=false,             showspaces=false,             showstringspaces=false,             identifierstyle=\ttfamily,             keywordstyle=\color[rgb]{0,0,1},             %commentstyle=\color[rgb]{0.026,0.112,0.095},             commentstyle=\itshape\color{green!40!black},             stringstyle=\itshape\color{red!90!black},             numberstyle=\itshape\color{yellow!50!black}     }          \lstdefinestyle{CppStyle}{             backgroundcolor=\color{lbcolor},         tabsize=4,     %   rulecolor=,         language=C++,       % choose the language of the code             basicstyle=\scriptsize,     % the size of the fonts that are used for the code             upquote=true,             aboveskip={1.5\baselineskip},             columns=fixed,             showstringspaces=false,             extendedchars=false,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=single,             numbers=left,             showtabs=false,             showspaces=false,             showstringspaces=false,             identifierstyle=\ttfamily,             keywordstyle=\color[rgb]{0,0,1},             %commentstyle=\color[rgb]{0.026,0.112,0.095},             commentstyle=\itshape\color{green!40!black},             stringstyle=\itshape\color{red!90!black},             numberstyle=\itshape\color{yellow!50!black}     }     \begin{document}      This is a dummy text. kjhbki     \end{document}      The `.aux` file says               \relax      \select@language{greek}     \@writefile{toc}{\select@language{greek}}     \@writefile{lof}{\select@language{greek}}     \@writefile{lot}{\select@language{greek}}      while the `.log` file can be found here Any idea why is this happening and how to fix this? Note that if I remove the `listings` preamble, delete all produced files and build the document, everything works fine.


title: Colored underbraces for annotating equations

text: I am trying to implement my previous Powerpoint presentation in `beamer`. I have a figure like ![enter image description here](http://i.stack.imgur.com/jkQ5H.png) I want to create something like this in `beamer`. I wrote a equation as follows but I couldn't write the description underneath the equation as shown in figure:               \begin{equation}     \partial _t(m_x m_yHu)+ \partial_x(m_yHuu)+\partial_y(m_xHvu)+\partial_z(m_xm_ywu)-m_xm_yf_cHv     \end{equation}      Any help/suggestion is highly appreciated.


title: How to avoid overfull \hbox warning?

text: The following code compiles but throws this error/warning : Overfull \hbox (7.65448pt too wide) in paragraph at lines 21--21 Visually there is nothing wrong though, and the box does not cross the page margins ? How can I avoid this error without messing things up ?               \documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}          \usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}     \usepackage{babel}     \usepackage[none]{hyphenat}          \usepackage[dvipsnames,table]{xcolor}     \usepackage{color}     \definecolor{vanillegeel}{RGB}{255,240,216}     \definecolor{appelsien}{RGB}{255,160,8}          \usepackage{empheq}          \begin{document}          \begin{center}     \noindent\fcolorbox{appelsien}{vanillegeel}{\begin{tabular}{ll}\hspace{-1.9mm}\parbox{3.4cm}{\includegraphics[scale=0.13]{SABENA-logo_origineel.pdf}}     & \parbox{11.8cm}{{\footnotesize\bf\emph{\reflectbox{S}$\mspace{-1mu}$abena}-lijnen ?!}\\     \footnotesize Vermits ik nergens een benaming vond voor de karakteristieke 'uitgerokken gespiegelde S\nobreakdash-lijnen' die radioreflecties op lijnvliegtuigen in spectrogrammen vertonen, wees me iemand (\emph{Georges De Greef}) op de vormgelijkenis met een bekende logo van de ter ziele gegane nationale luchtvaartmaatschappij \emph{Soci\'{e}t\'{e} Anonyme Belge d'Exploitation de la Navigation A\'{e}rienne} (1923\nobreakdash-2001), wat me inspireerde om de \emph{Doppler}-signaallijnen dan maar '\,\emph{\reflectbox{S}$\mspace{-1mu}$abena}-lijnen' te noemen.\\     De gespiegelde beginletter benadrukt de vormgelijkenis.\\     De titel-illustratie verwijst eveneens naar de SABENA-logo.}\end{tabular}\hspace{-1.6mm}}     \end{center}          % If needed, the embedded PDF image can be found at :     % https://dl.dropbox.com/u/52458256/SABENA-logo_origineel.pdf          \end{document}


title: Language problems with biblatex and babel

text: I am trying to use `biblatex` with `IEEEtran` and `babel`, however I am having an error: `Package babel Error: You haven't defined the language ENGLISH yet.`. With regular `Bibtex` everything works as usual. The MWE is the following:               \documentclass[english]{IEEEtran}          \usepackage{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}           \usepackage[strict,autostyle]{csquotes}     \usepackage[style=ieee,backend=bibtex]{biblatex}     \bibliography{/usr/local/texlive/2012/texmf-dist/doc/latex/biblatex-ieee/biblatex-ieee.bib}          \usepackage{blindtext}          \begin{document}          \Blindtext          \nocite{*}     \printbibliography          \end{document}


title: How to install the package "slashbox" using tlmgr?

text: I'd like to install the package slashbox to my MacTex/TeXlive installation (on Mac OSX) using `tlmgr`. The package seems to be still available on CTAN, but my attempts to install it, failed:               sudo tlmgr install slashbox     sudo tlmgr install /macros/latex/contrib/slashbox      with the error message: > tlmgr: package repository http://mirror.informatik.uni- > mannheim.de/pub/mirrors/tex-archive/systems/texlive/tlnet package slashbox > not present in package repository. Which repository to I have to use, or is it impossible to install it via `tlmgr`


title: How can I read in files paragraph by paragraph?

text: I have an interesting project here and, while I could do it manually, it seems to me to be an interesting puzzle to automate it. I have the following structure:               ./     +- main.tex     |     +- originals/     |  |     |  +- poem1.tex     |  |     |  +- poem2.tex     |     +- translations/        |        +- poem1.tex        |        +- poem2.tex      I'd like to leverage the `parallel` package (or imitate its functionality) and set these poems side-by-side. How can I read in these files paragraph-by- paragraph as aiming to insert a `\ParallelPar` after each one to align the paragraphs? Please let me know if there are any more details I can provide. Since this MWE is rather complicated, a mock-up of the scenario is provided as a gist:               git clone https://gist.github.com/11165565.git      Be sure to compile with XeLaTeX.


title: Parametric Title Page

text: I'm relatively new to writing `TeX`, but have hopes and dreams of being able to do this with it. I've done some looking around, and had little luck finding much detail on it. If someone could either help point me in the right direction on some documentation or set me straight I'd appreciate it. I have several pieces of documentation that I need to write up for different projects. Each of these could/should have a similar but not terribly different Title Page containing the company logo, department name, subgroup in the department, and some variables (i.e. project name, start date, rev #.) I would like to know if it's possible to accomplish some sort of inclusion in this manner?


title: newcommand does not work with \fi

text: I tried the command `\newcommand{\fistudenti}{\fi}` but it seems to work properly only in some cases. Here below there are two insances when it works and when it does not: WORKS:               \documentclass[0pt]{book}     \usepackage[english]{babel}     \def\PentruStudenti{1}     \newcommand{\fistudenti}{\fi}      \begin{document}                   \if\PentruStudenti1     show     \fistudenti     \end{document}         But if I put `\PentruStudenti{0}` it does not work:               \documentclass[0pt]{book}     \usepackage[english]{babel}     \def\PentruStudenti{0}     \newcommand{\fistudenti}{\fi}      \begin{document}                   \if\PentruStudenti1     show     \fistudenti     \end{document}         Where do I do the mistake?


I get this warning:               No support for \ordinal for language 'UKenglish' on input line xxx      The input line refers to the generated *.toc file:               \contentsline {chapter}{Bibliography}{117}{hiddenchapter.2}      There are lots of similar lines in that file, only this one (it is the last line of the file) causes the warning. So I am unsure whether it is directly caused by this line, of the referenced input line is incorrect... I tried looking around on the Internet for clues, but could not any details about this warning. So, what does this warning exactly mean? What might be the cause of it? And how can I prevent it? (I do not like having warnings, so I would really like to get rid of it, if possible!) A minimal example that triggers the warning is:               \documentclass[UKenglish]{book}          \listfiles     \usepackage{babel,datetime,fancyhdr}     \fancyfoot[CO,CE]{\today}     \pagestyle{fancy}     \let\monthnameUKenglish\monthnameenglish     \let\dayofweeknameUKenglish\dayofweeknameenglish     \let\dayofweeknameidUKenglish\dayofweeknameidenglish          \begin{document}          \newpage     \today          \end{document}      The `\listfiles` output of this minimal example is:                *File List*         book.cls    2007/10/19 v1.4h Standard LaTeX document class         bk10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)        babel.sty    2013/05/16 v3.9f The Babel package      english.ldf    2012/08/20 v3.3p English support from the babel system     datetime.sty    2010/09/21 v2.58 Date Time Package     fmtcount.sty    2012/10/24 v2.02       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     fcprefix.sty    2012/09/28     fcnumparser.sty    2012/09/28       amsgen.sty    1999/11/30 v2.0     fc-english.def    2012/06/18     dt-UKenglish.def    2010/07/07     fancyhdr.sty         fc-UKenglish.def    2012/06/18      pdfTeX is version `3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)` Additional notes:   * Not using the `datetime` package seems to get rid of the warning..?   * Specifying the language in `\documentclass` instead of `\usepackage{babel}` _and_ using `english` instead of `UKenglish` solves the warning. But obviously, I would like to use the `UKenglish` or `british` settings.


title: Insert an image before another already cited

text: I know is not the best, but I'd like to display an image before another already referred. I mean I'd like to cite image 2 before image 1 but display them in the correct order. This is becasue image 1 is very small and I want to display it at the top (or bottom of the page) while image 2 is very big and is iserted in its own page. LaTeX correctly display images in the order I recall them in the text, but I'd like to avoid this, but only for these two images. > E.g. > > Text text text see Image 2. Text text text see Image 1. > > Display image 1 in the same page (top or bottom). > > Newpage with image 2. How can I do this? Thankyou!


title: Bold Typewriter Type fonts

text: I found out that there are `cmbtt10` and `cmttb10` fonts available. Unfortunately they are not used until I activate them with the `\font` macro, so just searching for those fonts is not possible. The `cmbtt10` seems too thick. The `cmttb10` looks quite what I need, but its characters are too wide. Both seems to be a low resolution font. I also learned that these fonts are created with METAFONT the first time they are activated, but need the Typewriter Type font source. Are there other fonts that are created in the same manner from Typewriter Type? Is it possible to create a better resolution (like 600~1200 DPI)? How difficult is to define my own modification?


title: tabular as matrix

text: I have the attached figure and I need to have arrows from the entries of the table on the right-hand-side (one which says Dimensions List DL) to nodes of the tree. I think the best way to do this is to define the table as a matrix of nodes rather than as tabular, but I could not get it to work and would appreciate any assistance. I would like to be able to specify the table to be to the right of node N11 (perhaps with some x,y coordinate adjustment). Here is the code I have and the figure generated following it.               ![\documentclass{scrartcl}      % KOMA script (my preference)          \usepackage{graphicx}     \usepackage{subfig}     \usepackage{tikz-rdf}     \usepackage{tikz}     \usepackage{tkz-graph}     \usepackage{tkz-berge}     \usetikzlibrary{matrix,arrows,positioning}     \usetikzlibrary{shapes,shapes.callouts,,decorations.text,shapes.misc,decorations.pathmorphing,shapes.geometric,backgrounds,fit,positioning,arrows}          \begin{document}          \thispagestyle{empty}          \begin{figure*}\[ht!\]%               \begin{minipage}\[c\]{0.7\textwidth}         \centering         \scalebox{.5}{         \begin{tikzpicture}\[node distance=1.5cm, every edge/.style={link}\]     %     %Inserting nodes N1-N3     %                 \node\[circle,draw\] (n0){$N_{0}$};             \node\[circle,draw\] (n1)\[below left=of n0\]{$N_{1}$};             \node\[circle,draw\] (n2)\[below left=of n1\]{$N_{2}$};             \node\[circle,draw\] (n3)\[below left=of n2\]{$N_{3}$};                 \node\[circle,draw\] (n4)\[below left=of n3\]{$N_{4}$};             \node\[circle,draw\] (n5)\[below right=of n2\]{$N_{5}$};                 \node\[circle,draw\] (n8)\[below right=of n0\]{$N_{8}$};                 \node\[circle,draw\] (n11)\[below right=of n0,xshift=1.5cm\]{$N_{11}$};                 \node\[circle,draw\] (n6)\[below right=of n1\]{$N_{6}$};                 \node\[circle,draw\] (n7)\[below right=of n6\]{$N_{7}$};             \node\[circle,draw\] (n9)\[below right=of n8\]{$N_{9}$};                 \node\[circle,draw\] (n10)\[below =of n9\]{$N_{10}$};                 \node\[circle,draw\] (n12)\[below right=of n11\]{$N_{12}$};     %     %Inserting edges     %                 \draw\[-\] (n0) -- (n1);             \draw\[-\] (n1) -- (n2);             \draw\[-\] (n2) -- (n3);             \draw\[-\] (n3) -- (n4);                 \draw\[-\] (n2) -- (n5);                 \draw\[-\] (n0) -- (n8);                 \draw\[-\] (n0) -- (n11);                 \draw\[-\] (n1) -- (n6);                 \draw\[-\] (n6) -- (n7);                 \draw\[-\] (n8) -- (n9);                 \draw\[-\] (n9) -- (n10);                 \draw\[-\] (n11) -- (n12);         %     %Inserting node labels     %                 \node\[rectangle\] (root)\[above left=of n0,xshift=1cm,yshift=-1.3cm\]{root};             \node\[rectangle\] (salary)\[above left=of n1,xshift=1cm,yshift=-1.3cm\]{salary};             \node\[rectangle\] (gender)\[above left=of n2,xshift=1cm,yshift=-1.3cm\]{gender};             \node\[rectangle\] (title)\[above left=of n3,xshift=1cm,yshift=-1.3cm\]{title};                 \node\[rectangle\] (nat)\[above left=of n4,xshift=1cm,yshift=-1.3cm\]{nationality};                 \node\[rectangle\] (nat1)\[below=of n5,yshift=1.3cm\]{nationality};                 \node\[rectangle\] (title2)\[above left=of n6,xshift=1cm,yshift=-1.3cm\]{title};                 \node\[rectangle\] (nat2)\[below=of n7,yshift=1.3cm\]{nationality};                 \node\[rectangle\] (year)\[above left=of n8,xshift=1cm,yshift=-1.3cm\]{year};                 \node\[rectangle\] (inPr)\[above left=of n9,xshift=1cm,yshift=-1.3cm\]{inProceedings};                 \node\[rectangle\] (papT)\[below right=of n10,yshift=1.3cm,xshift=-1cm\]{paperTitle};                 \node\[rectangle\] (loc)\[above =of n11,yshift=-1.3cm\]{locatedIn};             \node\[rectangle\] (name)\[below=of n12,yshift=1.3cm\]{name};     %     %Dimension list and the links to T-tree     %             \scalebox{1.1}{             \node (dl) \[right=of n11,xshift=2cm,yshift=-1.5cm,rectangle split,                                    rectangle split parts=9, draw,align=center,anchor=center\]{%                 salary\nodepart{two}gender\nodepart{three}title\nodepart{four}nationality                         \nodepart{five}year\nodepart{six}inProceedings\nodepart{seven}paperTitle                 \nodepart{eight}locatedIn\nodepart{nine}name                 };                  }             \node(dlhead)\[above=of dl,xshift=0.7cm,yshift=-1.7cm\] {\large{$\begin{array}{c} \textrm{Dimension}\\\textrm{List }DL\end{array}$}};              \draw\[->,dashed,red\]   (dl.text) to \[out=170, in= 90\] (n1);%from salary         \draw\[->,dashed,red\] (dl.two) to \[out=170, in= 90\] (n2); %from gender         \draw\[->,dashed,red\] (dl.three) to \[bend right\] (n3); %from title         \draw\[->,dashed,red\] (dl.four) to \[bend right\] (n4.15); %from nationality         \draw\[->,dashed,red\] (dl.five) to \[bend right\] (n8); %from year         \draw\[->,dashed,red\] (dl.six) to \[bend right\] (n9); %from inProceedings         \draw\[->,dashed,red\] (dl.seven) to (n10); %from paperTItle         \draw\[->,dashed,red\] (dl.eight) to (n11); %from locatedIn         \draw\[->,dashed,red\] (dl.nine) -- (n12); %from name         \end{tikzpicture}         }           \end{minipage}      \caption{T-index}%       \vspace{-0.2in}      \label{fig:star}     \end{figure*}                    \end{document}]      ![enter image description here](http://i.stack.imgur.com/BOSgG.png)


title: How to add a parameter to a LaTeX class via the LyX layout?

text: I want to have this LaTeX document class code produced by LyX:               \documentclass[english]{lni}      My Layout class looks like this:               #% Do not delete the line below; configure depends on this     # \DeclareLaTeXClass[lni]{article (LNI)}     # Input general definitions     Input stdclass.inc      The custom LNI class defaults to German. It is installed properly and works fine but I get some German output (e.g., "Literatur" instead of "References"). According to the LNI guide, passing the `[english]` parameter is required for english output. How do I change it to add the layout file to support the `[english]` parameter?


title: Aligning subfigures

text: I am trying to align two subfloats so that their captions are on the same horizontal line. The figures themselves should be centered. The code I have is the following, but what I am getting is in the attached figure. What am I doing wrong?               \documentclass{scrartcl}        % KOMA script (my preference)          \usepackage{graphicx}     \usepackage{subfig}     \usepackage{tikz-rdf}     \usepackage{tikz}     \usepackage{tkz-graph}     \usepackage{tkz-berge}     \usetikzlibrary{shapes,shapes.callouts,,decorations.text,shapes.misc,decorations.pathmorphing,shapes.geometric,backgrounds,fit,positioning,arrows}          \begin{document}          \begin{figure*}[ht!]%         \subfloat[\scriptsize Transaction Database $D$]{           \begin{minipage}[c]{0.3\textwidth}         \centering         \scalebox{.7}{         \begin{tabular}{| p{1cm} | p{1.5cm} | p{4cm} |}\hline             Vertex ID & Entity \mbox{vertex} &  Adjacent Attribute Properties \\ \hline \hline             001 & Person1 & salary, gender, title \\ \hline             002 & Person2 & salary, gender, title, nationality \\ \hline             003 & Person3 & salary, gender, title \\ \hline             004 & Person4 & salary, gender, title, nationality \\ \hline             005 & Person5 & salary, gender, nationality \\ \hline             006 & Person6 & salary, title, nationality \\ \hline             007 & Paper1 & year, inProceedings, paperTitle \\ \hline             008 & Paper2 & year, inProceedings, paperTitle \\ \hline             009 & Paper3 & year, inProceedings, paperTitle \\ \hline             010 & School1 & locatedIn, name \\ \hline             011 & School2 & locatedIn, name \\ \hline             012 & School3 & locatedIn, name \\ \hline         \end{tabular}         }           \end{minipage}            \label{fig:db}%            }%     %     \subfloat[\scriptsize T-Index]{               \begin{minipage}[c]{0.7\textwidth}         \centering         \begin{tikzpicture}[node distance=1.5cm, every edge/.style={link}]     %     %Inserting nodes N1-N3     %                 \node[circle,draw] (n0){$N_{0}$};         \end{tikzpicture}           \end{minipage}            \label{fig:fp}%            }%     %       \vspace{-0.2in}      \caption{T-index}%       \vspace{-0.2in}      \label{fig:star}     \end{figure*}                    \end{document}        ![enter image description here](http://i.stack.imgur.com/I5faq.png)


title: Image shift / offset

text: I'm writing text with some custom images (symbols) in the text line, I add them using `\includegraphics`, but the images align with the text at the bottom, which is annoying, since the images are slightly larger than the text. How do I move the image a bit lower, so that the image stops just a bit below the text. E.G. The diagram `$\includegraphics{images/diagram_A}$` is neat. It would be nice to have in the $ enviroment.


title: One enumerate item per table cell

text: I have an enumeration of 15 items. How can I make those items appear in a 3x5 table? So I want to have exactly one enumerate item per table cell:               ----------------------------------     | 1. This is | 2     | 3 Another |     | item 1     | text  | item      |     ----------------------------------     | 4  etc.    | 5     |  6        |     ----------------------------------     ...


title: Why is the % symbol not showing with XeTeX?

text: I'm using XeTeX and my % symbol is not showing when I compile to PDF! I've added my code below. I've gone through the XeTeX companion guide (maybe not very thoroughly) and Googled, but I can't find out why this is happening. I would totally appreciate anyone telling me why it's not working and how to fix it.               \begin{description} \fontspec[]{ArchitectsDaughter} As 1\% RF = 1 cM, two genes which lie 100 cM apart should have a recombination frequency of 100 \% \end{description}      Thanks in advance! BTW, I'm using XeTeX and LaTeX at the same time... if this bit of information is helpful... * * * EDIT: Apparently my font doesn't have a `%` glyph... and now I feel like a total dork for not coming to that conclusion sooner. * * *


title: How to add a PDF file in appendix in Lyx?

text: I'm writing a thesys Using LyX, it worked fine up to now. I need to insert a PDF of 4 pages in Appendix, so I looked for a solution. Here in StackOverflow I found a possible solution, using a pdfpages package and a command to add the file. Unfortunately this solution doesn't work, lyx reports the following error: `!pdfTeX error: pdflatex (file test.pdf): cannot find image file` I package is correctly declared in preample, file test.pdf is in the same folder of my thesys files. I tried to substitute the file with a 1 page PDF, and change `\includepdf{test.pdf}` with `\includepdf{test}` and `\includepdf{./test.pdf}`. The resulting error is always the same :-( Is there a solution? Is it really possible importing a PDF in LyX? Thanks in advance


title: How to draw a sine wave on a circular path in tikz

text: I want to draw circular waves like these: ![enter image description here](http://i.stack.imgur.com/V7SLt.png) in TikZ.


title: How to scale both data and error bars in pgfplots

text: I am able to scale the data using the `y filter` option in pgfplots plot object (like here How to scale existing coordinates data in pgfplots?). However the error bars are not rescaled as expected. Is there a workaround for this? In this example, the "original" y-value is 1+/-0.5, after `y filter/.code={\pgfmathparse{\pgfmathresult*10}\pgfmathresult}` the data shows as 10+/-0.5 (instead of the expected 10+/-5.) ![enter image description here](http://i.stack.imgur.com/1Q4jQ.png) The complete code follows:               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}     \addplot+[         only marks,          x filter/.code={\pgfmathparse{\pgfmathresult*1}\pgfmathresult},          y filter/.code={\pgfmathparse{\pgfmathresult*10}\pgfmathresult}     ] plot[error bars/.cd, y dir=both, y explicit] coordinates {      ( 1, 1 ) +- ( 0, 0.5)      ( 2, 1 ) +- ( 0, 0.5)      ( 3, 1 ) +- ( 0, 0.5)      ( 4, 1 ) +- ( 0, 0.5)     } ;     \end{axis}     \end{tikzpicture}     \end{document}      NOTE: `x error filter/.code = ...` is not valid code apparently.


title: Citing the source of an equation?

text: I cant find a good way of adding a `\cite` to an equation. I'd like to give a reference to the equation's source, but I can't figure out how to typeset it nicely. If I include it in with the equation itself, it pushes the alignment leftwards and feel too much like it's invading the equation's space. I've tried putting an `\hfill\cite{example}` on the line after the equation, but there's too much vertical space between the equation and the reference. I'd love to know if there's a commonly accepted way of doing this that I haven't managed to find. Failing that, if anyone has any not-too-inelegant compromises, that'd be great too.


title: Leading zeros when cross referencing

text: I have a custom counter and output it with leading zeros. When I reference it, I get some real strange output, but the enumeration itself works. Preamble:               \newcounter{reqcount}     \setcounter{reqcount}{3}          \newcommand{\threedigits}[1]{%         \ifnum #1<100 0\fi%         \ifnum #1<10 0\fi%         \number#1}      Document               \refstepcounter{reqcount}\label{req}     [DR-\threedigits{\arabic{reqcount}}] % Works, outputs [DR-001]     [DR-{\ref{req}}] % Outputs [DR-4<100 04<10 004]      * * * Someone posted this answer but it was removed. I don't know why, but the code below works and the above does not.               \documentclass{article}          \newcounter{reqcount}     \setcounter{reqcount}{0}          \newcommand{\threedigits}[1]%     {%         \ifnum #1<10 00%         \else%             \ifnum #1<100 0%             \fi%         \fi%         \number#1%     }          \newcommand\DR[1]% macro to typeset a new DR item     {%         \refstepcounter{reqcount}\label{DR:#1}%         [DR-\threedigits{\value{reqcount}}]%     }          \makeatletter     \newcommand\refDR[1]% macro to cross-reference to a particular DR item     {%             [DR-\expandafter\threedigits\ref{DR:#1}]%     }     \makeatother          \begin{document}          %.... 88 DR items later     \setcounter{reqcount}{1}          \DR{foo} blah blah          As seen in~\refDR{foo}, blah blah blah          \end{document}


title: Remove photo padding in moderncv classic

text: When `\photo` is used in moderncv, it includes a `~3px` padding between the image and the border. How does one remove this? I have found the part of the `moderncvstyleclassic.sty` that deals with the photo (line 160), but don't know how to change it. I'd also like to know how to change the colour of the border, or even remove it entirely.


title: Specific type of header

text: I'm preparing my extended research abstract for submission to colleges for college applications. Right now, in my file I have a title, author, etc. What I want to do is insert a short note (preferably in grayscale or some other font that distinguishes it from the abstract) at the very top of the first page (above the title) that describes the research and names the department the abstract would be sent to etc. How might I do this?


title: Does Kerkis font work with xelatex?

text: I'm a confused on whether xelatex and kerkis font can be used together. I'm using Ubuntu 13.10, Tex Live 2013/Debian, and I have the kerkis font installed. Though, if I try to compile the following snippet:               \documentclass{article}          \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{xltxtra}          \usepackage{kerkis}     \setmainfont[Mapping=tex-text]{Kerkis}          \usepackage{amsmath}          \begin{document}     Hi!     \end{document}      I get the following errors: > /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source > abbreviation K for Kerkis. ... snip ... kpathsea: Running mktexmf Kerkis ! I > can't find file `Kerkis'. <*> ...:=ljfour; mag:=1; nonstopmode; input Kerkis > ... snip ... kpathsea: Running mktexmf Kerkis ! I can't find file`Kerkis'. > <*> ...:=ljfour; mag:=1; nonstopmode; input Kerkis I've searched into tex.stackexchange.com and it appears as if Kerkis works only with Babel. Is there a definitive answer? If the answer is no, what other fonts do you suggest instead ? Thanks!


title: Enumeration across many sections

text: I am trying to combine enumeration over multiple sections: it is not working.               \documentclass[12pt]{article}     \usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry}     \usepackage[usenames,dvipsnames]{xcolor}          \begin{document}          \begin{enumerate}           \begin{center}      \textbf{class X}     \end{center}          \item \hangindent=7mm \noindent \footnotesize \textcolor{blue}{AAAAA} \normalsize     \item \hangindent=7mm \noindent BBBBB          \begin{center}      \textbf{class Y}     \end{center}          \item \hangindent=7mm \noindent \footnotesize \textcolor{blue}{CCCCC} \normalsize          \end{enumerate}           \end{document}      I get the error               Something's wrong--perhaps a missing \item.      How do I achieve enumeration automatically for all items marked \item while not enumerating section titles placed in between them? EDIT: the answer below results in the centered section heading actually being offcenter, to the right a bit. How do I completely center them?


title: z-order of objects

text: When I draw objects in PSTricks, objects are placed in the order I draw them, i.e. objects that appear later in the picture hide those that appear earlier, for example here:               \begin{pspicture}(70,70)     \psframe[fillcolor=green!20,fillstyle=solid](0,0)(30,30)     \psframe[fillcolor=blue!20,fillstyle=solid](10,10)(40,40)     \end{pspicture}      the blue square partially hides the green square. In CSS it is possible to give each object a "z index", such that objects with a larger z-index hide those with a smaller z-index, so for example if I give the green square a z-index of 10 and the blue square a z-index of 0, the green square will hide the blue square no matter in what order they are placed in the document. Is there a similar option in PSTricks? (Of course in the above example it is possible to just switch the order of the squares in the picture, but in more complex pictures, with many different objects that some of them come from macros etc., it may be very difficult).


title: How to correctly write number ranges?

text: Suppose I would like to write something like: "She has between 1-5 cookies on her at all times."; what is correct way to write such a number range in TeX? Is it:               $1$-$5$       Or:               $1\text{-}5$      Or something else entirely? To me, both of the above seem clumsy.


title: Is there a way to create a staggered table in latex?

text: I need to make a staggered table, essentially the first row of the table would have 1 cell, the second row would have 2 cells, the third row 3 cells and so on. Is there a way to do this with the tabular? If not what package would I want to use?


title: Aligning x- and y-axis with lattice points on a graph using PGF/TikZ

text: This question is a consequence of a previous question that I posted on the group regarding the plotting of lattice points or a trellis on an axis (ref. Drawing lattice/trellis graphs using PGF/TikZ). On the advice of two group members, I have been able to plot something that looks like this: ![enter image description here](http://i.stack.imgur.com/pLOir.jpg) The code that I used to generate this graph is:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}               \begin{figure}[h!]       \centering       \begin{tikzpicture}         \coordinate (Origin)   at (0,0);         \coordinate (XAxisMin) at (-3,0);         \coordinate (XAxisMax) at (5,0);         \coordinate (YAxisMin) at (0,-2);         \coordinate (YAxisMax) at (0,5);              \coordinate (Bone) at (0,2);         \coordinate (Btwo) at (2,-2);              \draw [thin, gray,-latex] (XAxisMin) -- (XAxisMax);% Draw x axis         \draw [thin, gray,-latex] (YAxisMin) -- (YAxisMax);% Draw y axis              \clip (-3,-2) rectangle (10cm,10cm); % Clips the picture...         \pgftransformcm{1}{0.6}{0.7}{1}{\pgfpoint{3cm}{3cm}} % This is actually the transformation                                                          %  matrix entries that gives the slanted                                                          % unit vectors. You might check it on                                                          % MATLAB etc. . I got it by guessing.              \draw[style=help lines,dashed] (-14,-14) grid[step=2cm] (14,14); % Draws a grid in the new coordinates.     %    \filldraw[fill=gray, fill opacity=0.3, draw=black] (0,0) rectangle (2,2); % Puts the shaded rectangle         \foreach \x in {-7,-6,...,7}{                           % Two indices running over each           \foreach \y in {-7,-6,...,7}{                       % node on the grid we have drawn              \node[draw,circle,inner sep=2pt,fill] at (2*\x,2*\y) {}; % Places a dot at those points           }         }              \draw [ultra thick,-latex,red] (0,0) -- (0,2) node [above left] {$b_1$};         \draw [ultra thick,-latex,red] (0,0) -- (2,-2) node [below right] {$b_2$};         \draw [ultra thick,-latex,red] (0,0) -- ($(0,2)+(2,-2)$) node [below right] {$b_1+b_2$};         \draw [ultra thick,-latex,red] (0,0) -- ($2*(0,2)+(2,-2)$) node [above left] {2$b_1+b_2$};         \draw [thin,-latex,red, fill=gray, fill opacity=0.3] (0,0) -- ($2*(0,2)+(2,-2)$) --             ($3*(0,2)+2*(2,-2)$) -- ($(0,2)+(2,-2)$) -- cycle;       \end{tikzpicture}       \caption{Babai's algorithm works poorly if the basis is ``bad''.}       \label{figure:solving-CVP-bad-basis}     \end{figure}          \end{document}      The problem that I am experiencing is not being able to align the axis with the origin of the lattice. Also, the variables that have been defined for the origin, and other points on the lattice do not appear to have the effect that I expect (that is, they appear to be absolute coordinates relative to the axis, as opposed to points relative to the lattice). Consequently, I have to hard code these when it comes to plotting them. Any advice as to what I am doing wrong would be appreciated.


title: An alternative to utf8 and arabtex under memoir documentclass

text: I'd like to use `utf8` and `arabtex` packages under the `memoir` `documentclass`, but it seems unlikely to happen (previous discussion). What would be a good alternative, no transliteration and something that works with T1 encoding?               \documentclass[a4paper,oneside,12pt]{memoir}     \usepackage[T1]{fontenc}     \usepackage{arabtex}     \usepackage{utf8}               \begin{document}          بسم الله الرحمن الرحيم          \end{document}      This will produce an error:               ("C:\Program Files\MiKTeX\tex\latex\arabtex\arabtex.sty"     ("C:\Program Files\MiKTeX\tex\latex\arabtex\aconfig.sty")     ("C:\Program Files\MiKTeX\tex\latex\arabtex\arabaux.sty")          ! Class memoir Error: Font command \it is not supported.          See the memoir class documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.551 \settransfont {\rm \it }                                   % standard font for transliteration


title: PDF with un-copyable text in LuaLaTeX

text: In Is it possible to produce a PDF with un-copyable text?, it was suggested the following code to disable the coyable text from a pdf viewer.               % pdflatex is required     \documentclass{article}     \usepackage[resetfonts]{cmap}     \usepackage{fancyvrb}     \begin{VerbatimOut}{OT1.cmap}     %!PS-Adobe-3.0 Resource-CMap     %%DocumentNeededResources: ProcSet (CIDInit)     %%IncludeResource: ProcSet (CIDInit)     %%BeginResource: CMap (TeX-OT1-0)     %%Title: (TeX-OT1-0 TeX OT1 0)     %%Version: 1.000     %%EndComments     /CIDInit /ProcSet findresource begin     12 dict begin     begincmap     /CIDSystemInfo     << /Registry (TeX)     /Ordering (OT1)     /Supplement 0     >> def     /CMapName /TeX-OT1-0 def     /CMapType 2 def     1 begincodespacerange     <00> <7F>     endcodespacerange     8 beginbfrange     <00> <01> <0000>     <09> <0A> <0000>     <23> <26> <0000>     <28> <3B> <0000>     <3F> <5B> <0000>     <5D> <5E> <0000>     <61> <7A> <0000>     <7B> <7C> <0000>     endbfrange     40 beginbfchar     <02> <0000>     <03> <0000>     <04> <0000>     <05> <0000>     <06> <0000>     <07> <0000>     <08> <0000>     <0B> <0000>     <0C> <0000>     <0D> <0000>     <0E> <0000>     <0F> <0000>     <10> <0000>     <11> <0000>     <12> <0000>     <13> <0000>     <14> <0000>     <15> <0000>     <16> <0000>     <17> <0000>     <18> <0000>     <19> <0000>     <1A> <0000>     <1B> <0000>     <1C> <0000>     <1D> <0000>     <1E> <0000>     <1F> <0000>     <21> <0000>     <22> <0000>     <27> <0000>     <3C> <0000>     <3D> <0000>     <3E> <0000>     <5C> <0000>     <5F> <0000>     <60> <0000>     <7D> <0000>     <7E> <0000>     <7F> <0000>     endbfchar     endcmap     CMapName currentdict /CMap defineresource pop     end     end     %%EndResource     %%EOF     \end{VerbatimOut}          \usepackage{lipsum}          \begin{document}          \lipsum          \end{document}      This procedure works with pdfLaTeX and LuaTeX. In the second case(compile with LuaTeX), when I use some fonts I have installed on my OS, does't work. Is it because I have to write another cmap file? If yes, how can I write it? If there is no LuaLaTeX solution, can somebody tell me if there is an external free software capable of removing copyable text from a pdf?


title: How to customize the table of contents using TikZ?

text: Are you aware of tentatives to customize the table of contents with `TikZ`? I am thinking of fancy graphical objects (coloured ovals, squares, rectangles...) coming with "chapter" or the numbering, for instance. That could obviously involve the `titletoc` package. **Edit 1** : below is a try. Maybe the `pfgpicture` environment is more relevant for the TOC.               \documentclass{book}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usepackage{kpfonts}     \usepackage{titletoc}     \contentsmargin{0cm}     \titlecontents{chapter}[0pc]     {\addvspace{30pt}%     \begin{tikzpicture}%     \draw[help lines,step=.4cm,color=red] (0,0) grid (3.2,1.2);%     \pgftext[left,x=.1cm,y=.6cm]{\Large\sc chapter};%     \fill[fill=white,draw=red] (2.7,.6) circle (0.35cm);%     \pgftext[x=2.7cm,y=.6cm]{\thecontentslabel};%     \end{tikzpicture}\\\color{red}\large\sc\bfseries}%     {}     {}     {\;\titlerule\;\large\bfseries \thecontentspage}%     \titlecontents{section}[2.4pc]     {\addvspace{1pt}}     {\contentslabel[\thecontentslabel]{2.4pc}}     {}     {\hfill\small \thecontentspage}     []     \titlecontents*{subsection}[4pc]     {\addvspace{-1pt}\small}     {}     {}     {\ --- \small\thecontentspage}     [ \textbullet\ ][]     \begin{document}     \tableofcontents     \chapter{(title chapter 1)}     \section{(title section 1)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \section{(title section 2)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \chapter{(title chapter 2)}     \section{(title section 1)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \section{(title section 2)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \end{document}       ![toc tikz 1](http://i.stack.imgur.com/87fta.png) **EDIT 2:** second try but I do not know how to access the title of a chapter with titletoc?               \documentclass{book}     \usepackage[utf8]{inputenc}     \usepackage{kpfonts}     \usepackage[tmargin=2cm,rmargin=3.8cm,lmargin=3.8cm,bmargin=2cm]{geometry}     \usepackage{tikz}     \definecolor{doc}{RGB}{0,60,110}     \usepackage{titletoc}     \contentsmargin{0cm}     \titlecontents{chapter}[0pc]     {\addvspace{30pt}%     \begin{tikzpicture}[remember picture, overlay]%     \draw[fill=doc!30,draw=doc!30] (-4,-.1) rectangle (-1,.5);%     \pgftext[left,x=-3.7cm,y=0.2cm]{\color{white}\Large\sc\bfseries chapter\ \thecontentslabel};%     \end{tikzpicture}\color{doc!40}\large\sc\bfseries}%     {}     {}     {\;\titlerule\;\large\sc\bfseries Page \thecontentspage     \begin{tikzpicture}[remember picture, overlay]     \draw[fill=doc!25,draw=doc!20] (2pt,0) rectangle (6,0.1pt);     \end{tikzpicture}}%     \titlecontents{section}[2.4pc]     {\addvspace{1pt}}     {\contentslabel[\thecontentslabel]{2.4pc}}     {}     {\hfill\small \thecontentspage}     []     \titlecontents*{subsection}[4pc]     {\addvspace{-1pt}\small}     {}     {}     {\ --- \small\thecontentspage}     [ \textbullet\ ][]          \makeatletter     \renewcommand{\tableofcontents}{%     \chapter*{%     \vspace*{-20\p@}%     \begin{tikzpicture}[remember picture, overlay]%     \pgftext[right,x=15cm,y=0.2cm]{\color{doc!30}\Huge\sc\bfseries \contentsname};%     \draw[fill=doc!30,draw=doc!30] (13,-.75) rectangle (20,1);%     \clip (13,-.75) rectangle (20,1);     \pgftext[right,x=15cm,y=0.2cm]{\color{white}\Huge\sc\bfseries \contentsname};%     \end{tikzpicture}}%     \@starttoc{toc}}     \makeatother     \begin{document}     \tableofcontents     \chapter{Questions of Design}     \section{(title section 1)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \section{(title section 2)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \chapter{Questions of Drawing}     \section{(title section 1)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \section{(title section 2)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \chapter{Questions of Technique}     \section{(title section 1)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \section{(title section 2)}     \subsection{(title sub-section 1)}     \subsection{(title sub-section 2)}     \end{document}       ![enter image description here](http://i.stack.imgur.com/8Wj8F.png)


title: How to create alternating rows in a table?

text: Sometimes you can see in books tables, that have alternating background color for rows in a table to support readability. How I can achieve this with LaTeX? And yes, I could put macros `\odd` and `\even` into each row, but in that case I would have to change all following rows, if I input later another row into the table. I want TeX to decide itself, which row is odd or even and put the appropiate style into it.


title: Section headers not sticking with first paragraph

text: I'm seeing lots of section/subsection headers getting split up from their paragraphs across page and column boundaries. I've never seen this before, but I'm also using a class file that's new to me, so I suspect it has something to do with a mistake in the class file itself. I'm a relative TeX novice and haven't ever spent much time with class files, so it's pretty overwhelming, but some spelunking has turned up some clues. The full class file is available here, but what seems like a (potentially) relevant snippet is included below:               % Rationale for changes made in next four definitions:     % "Before skip" is made elastic to provide some give in setting columns (vs.     % parskip, which is non-elastic to keep section headers "anchored" to their     % subsequent text.     %     % "After skip" is minimized -- BUT setting it to 0pt resulted in run-in heads, despite     % the documentation asserted only after-skip < 0pt would have result.     %     % Baselineskip added to style to ensure multi-line section titles, and section heads     % followed by another section head rather than text, are decently spaced vertically.     % 12 Jan 2000 gkmt     \def\section{%         \@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%         {0.5pt}{\baselineskip=14pt\secfnt\@ucheadtrue}%     }          \def\subsection{%         \@startsection{subsection}{2}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}         {0.5pt}{\baselineskip=14pt\secfnt}%     }     \def\subsubsection{%         \@startsection{subsubsection}{3}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%         {0.5pt}{\baselineskip=14pt\subsecfnt}%     }          \def\paragraph{%         \@startsection{paragraph}{3}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%         {0.5pt}{\baselineskip=14pt\subsecfnt}%     }          \let\@period=.     \def\@startsection#1#2#3#4#5#6{%             \if@noskipsec  %gkmt, 11 aug 99             \global\let\@period\@empty             \leavevmode             \global\let\@period.%         \fi         \par         \@tempskipa #4\relax         \@afterindenttrue         \ifdim \@tempskipa <\z@             \@tempskipa -\@tempskipa             \@afterindentfalse         \fi         %\if@nobreak  11 Jan 00 gkmt             %\everypar{}         %\else             \addpenalty\@secpenalty             \addvspace\@tempskipa         %\fi         \parskip=0pt         \@ifstar             {\@ssect{#3}{#4}{#5}{#6}}             {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%     }      There's a mention in the comments about keeping section headers "anchored" - is it possible one of these changes has caused the headers to become unanchored? When I'm stuck using Word, this is just "Keep with next", but it doesn't seem quite that simple here. What can I do about this? Is there anything in my .tex file I might be doing that could cause this?


title: How to manage pictures in a single file to be easily picked by the main file?

text: I'm writing a paper with many TikZ pictures. To keep the main file readable, I keep the pictures as separate files, but unfortunately I have now too many files. What is a nice solution to keep all the pictures in one file (separate from the main file), giving them names, and then calling them from the main file?


title: Making given y-axis data in dB?

text: I learned recently how to draw in pgfplots and is really enjoying the output. I generate my data in matlab and then write it to a file. One line of the file will contain two entries, first x-axis data and then corresponding y-axis data. Now I realize, I actually want the y-axis data to be in dB , i.e. whatever current values are in that file, I want 'x' against '10*log(y)' where logarithm is base 10. But, now I can't go back to matlab and generate all this data again. So I have to do it within pgfplots. Is this possible? For a MWE, this is the data I have in a file by name fig1-line1.dat               0   0.095529     1   0.12026     2   0.1514     3   0.19061     4   0.23996     5   0.30209     6   0.38031     7   0.47878     8   0.60275     9   0.75882     10  0.95529      This is my current code which plots it.               \documentclass[a4paper]{article}     \usepackage{tikz}     \usetikzlibrary{backgrounds,shapes,shadows,fit,calc}     \usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri]     \usepackage{pgfplots}     \pgfplotsset{compat=1.3}% <-- moves axis labels near ticklabels (respects tick label widths)     \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}                    \pgfplotsset{every axis legend/.append style={legend pos = north west},legend cell align = {left}}          \pgfplotsset{%     tick label style={font=\normalsize},     title style={font=\normalsize,align=center},     label style={font=\normalsize,align=center},     legend style={font=\normalsize}                 }          \begin{axis}[%     xlabel = {Iterations},     ylabel = {Relative Error in Convergence $\epsilon_i$},     title  = {Convergence Rate v/s Iterations},     enlargelimits = true,     cycle list name = {color},     grid = major,     smooth,     scale = 1]          \addlegendentry{$K=2$, $M=3$}          \addplot [ color = {blue},                 mark  = {o},                style = {solid},                line width = 2pt] table {fig1-line1.dat};                    \end{axis}     \end{tikzpicture}     \caption{A larger example}     \end{figure}     \end{document}      So the current plot is 'x' against 'y'. Now I want to make it 'x' against '10*log(y)'? How do I do this?


title: Using \@ifnextchar to define a macro for "ante meridiem" time

text: I want to create a macro for times of days, as follows:               \newcommand{\pmtime}{a.m.\xspace}      The problem is that LaTeX thinks that the last period in a.m. denotes the end of a sentence, hence the space produced by `\xspace` is too large.               \newcommand{\amtime}{a.m.\ }      The above is not helpful either, since a regular size space is now added, even when the macro does in fact occur at the end of a sentence. I read about `\@ifnextchar` and tried the following:               \newcommand{\amtime}{a.m.\@ifnextchar.{}{\ }}      This expands to `a.m.ifnextchar.` in the text (in this case the macro is not followed by a period.


title: Convert Title Page from LaTeX (or the resulting PDF) into a PNG thumbnail

text: I have written a book in LaTeX using TeXStudio. My title page, which is the book cover, is created using LaTeX source (including images in it), rather than drawn in a graphical program, such as Illustrator. I need to create several different sized PNG thumbnails of the book cover for my website. The best result I was able to achieve was importing the PDF into Photoshop in 900 dpi and then exporting it as PNG. Howevever the text on the title page seems to be a little washed out. Is there a better way such as using LaTeX source for the title page to compile it into EPS and then opening the EPS file in Illustrator and exporting it to PNG using "Type Optimise" (I've done this for one of my vector graphics with good results). Or perhaps ImageMagic could be used for this? Any solution that would produce PDF -> PNG thumbnail with sharp text (and graphics) would be great!


title: Check if an entry is cited multiple times

text: I am trying to find out whether it is currently possible to have a test in Biblatex that tests at the very first time an entry is cited whether the same entry will be cited more than once in the current reference section (i.e. the entire paper, or the chapter in case of a book). The real world usage scenario is legal citations, namely the Canadian Guide to Uniform Legal Citation, which, while slightly ambiguous, states that "it is not necessary to establish a short form for cases if they are not referred to in any subsequent paragraph" (in practice, most papers I see will only give the short form if the case is cited subsequently, which makes sense as otherwise, given the abundance of cases cited just once in a usual paper, any way to make the footnote shorter is welcome). So let's say I cite _Elders Pastoral Ltd_ v _Bank of New Zealand_. The first footnote would then say " _Elders Pastoral Ltd_ v _Bank of New Zealand_ [1989] 2 N.Z.L.R. 180 (C.A.) [ _Elders_ ]", all subsequent footnotes would say " _Elders_ , _supra_ n. 1". However, I need the printing of the shorthand field to be conditional on the entry to be cited more than once. I have a vague idea that might be possible by doing something along the following lines. Here is my current macro to make a footnote for a case:               \newbibmacro*{footcite:jurisdiction}{%       \global\boolfalse{cbx:loccit}%       \ifciteseen         {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}           {\usebibmacro{footcite:ibid}}           {\usebibmacro{footcite:jurisdiction:note}}}         {\usebibmacro{footcite:full:jurisdiction}%      And here is the footcite:full:jurisdiction macro               \newbibmacro*{footcite:full:jurisdiction}{%        \printtext{%        \bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{%           \usedriver             {\DeclareNameAlias{sortname}{default}}             {jurisdiction}}}%        \usebibmacro{shorthandintro:jurisdiction}}        \usebibmacro{footcite:save}}}      So in the footcite:full:jurisdiction, I would make the `\usebibmacro{shorthandintro:jurisdiction}` dependent on the test for a variable and in the footcite:jurisdiction, I would set the variable in case the `\ifciteseen` yields true. This would then work after two LaTeX runs. However, my question would be what type of variable to use and how to to set it, so as to avoid errors (for instance, I think using a boolean and do an `\ifbooltrue` test would result in errors like "boolean variable cbx:???? not set" errors on the first run). Any ideas are very welcome.


title: Squiggly arrows in tikz

text: Is it possible to get a path in tikz that looks like `\rightsquigarrow`?


title: In-row table page break

text: I'm stuck on a problem for hours. I'm using the `tabularx` environment to create a double-column table where the second column takes up several lines. An example of that table is shown here. Since such a table could not fit in a single page on my document, I've been looking for a way to break it in more pages. Unfortunately, neither the `longtable` nor the `supertabular` package can split the table within a row. Could you please help me find a solution? In particular, if I can't get this result with a table is there a way to obtain it with some working alternative (I've already found the `parcolumns` and the `glossary` packages but I would like something that allows me to draw al least a vertical line to separate the two columns.