title: TOC and section headings colored

text: I am writing on a larger probject and I want to have colored headings (the part title and the chapter title, but not the section and subsection and so on). In the toc, I also want the part and the chapter headings e.g. to be blue, but also not the section subsection and so on. I tried                   \addtokomafont{disposition}{\color{blue}}         \addtokomafont{sectionentry}{\color{black}}          \addtokomafont{section}{\color{black}}      And I read also something about manipulating the \titleformat command. But I did not get it how to get this running. Would be nice if you can help me.               Here is my code:          \documentclass{book}     \usepackage{geometry}     \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}      \usepackage{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]     \hypersetup{        pdftitle={},     %  pdfauthor={},       pdfsubject={Statistics Book},        pdfkeywords={},        }     \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}     \usepackage{type1cm}              \usepackage{zref-abspage}     \usepackage{makeidx}             \usepackage{graphicx}             \usepackage{multicol}             \usepackage[bottom]{footmisc}     \usepackage{tocstyle}     \usetocstyle{allwithdot}      \usepackage{shadethm}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{marginnote}     \usepackage{wrapfig}     \usepackage{paralist}     \usepackage{amssymb}     \usepackage[framemethod=tikz]{mdframed}     \usepackage{ulem}          \definecolor{shadethmcolor}{rgb}{.9,.9,.95}%          \newtheoremstyle{mystyle}       {\topsep}{\topsep}{}{}%       {\bfseries}{:}{.5em}{}%          \theoremstyle{mystyle}          \newmdtheoremenv[hidealllines=true,backgroundcolor=shadethmcolor,skipabove=\topsep,     skipbelow=\topsep]{example}{example}          \begin{document}     \frontmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %     \setlength{\marginparwidth}{2.1cm}     \marginparsep = -4pt     \pagestyle{plain}     \pagenumbering{Roman}     \include{dedic}     \newpage\section*{}      \include{foreword}     \newpage\section*{}      \include{preface}     \newpage\section*{}      \include{acknow}     \newpage\section*{}      \include{acronym}     %     \     \shorttableofcontents{Inhalts\"ubersicht}{1}     \bookmark[page=15,rellevel=1,keeplevel,view={XYZ},color=red]{Inhalts\"ubersicht}     \bookmark[page=17,rellevel=1,keeplevel,view={XYZ},color=red]{Inhaltsverzeichnis}     \tableofcontents     \clearpage     \pagenumbering{arabic}       %                    \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \include{part1}      \include{chapter1}     \include{chapter2}     \include{chapter3}     \include{part2}     \include{chapter4}     \include{chapter5}     \include{chapter6}     \backmatter          \appendix           \include{appendix}          \listoffigures     \newpage     \listoftables     \backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\include{glossary}     %\include{solutions}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{Index}     \printindex          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{\"Uber den Autor}     \includepdf{ueberautor}     \includepdf{back}     \end{document}      Thanks a lot!


title: Include source code of pdf picture directly into LaTeX file

text: Suppose you have a (PDF)LaTeX file where you include pdf pictures via `\includegraphics`. Now, if you want to share the LaTeX file with another person, you always have to send not only the LaTeX file itself but also all the included pdf files containing the pictures. This is pretty inconvenient for recipient. It would be much more comfortable to copy the pdf source code right into the LaTeX file so that only one file has to be sent. Is that possible?


title: Making equations copyable in pdf

text: I would like to write a .pdf, where my readers could copy the rendered formulae and paste them directly in their TeX documents. ![Example formula](http://i.stack.imgur.com/IX0ti.png) And the copied text would automatically be:               \int x\sin ax\;\mathrm{d}x = \frac{\sin ax}{a^2}-\frac{x\cos ax}{a}+C      Is this possible?


title: Modified pattern does not see the pattern color option

text: I have modified the `north east lines` pattern to accept a `\LineSpace` option that sets the density of the pattern (see the question Can I control the density of a pattern in TikZ?). The code works very well but I can't modify the color of the pattern using the `pattern color` option as I did before.               \documentclass{minimal}     \usepackage{pgfplots}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{2mm}     \pgfplotsset{compat=newest}     \usetikzlibrary{patterns}          \pgfdeclarepatternformonly[\LineSpace]{my north east lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{\LineSpace}{\LineSpace}}{\pgfqpoint{\LineSpace}{\LineSpace}}%     {         \pgfsetlinewidth{0.4pt}         \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}         \pgfpathlineto{\pgfqpoint{\LineSpace + 0.1pt}{\LineSpace + 0.1pt}}         \pgfusepath{stroke}     }          \newdimen\LineSpace     \tikzset{         line space/.code={\LineSpace=#1},         line space=3pt     }               \begin{document}     \begin{tikzpicture}         \begin{axis}[             ymin=0, ymax=1,             xmin=-1, xmax=1]                          \addplot[                 pattern=my north east lines,                 line space=8pt,                 pattern color=green,                 draw=black]                  {x} \closedcycle;                         \addplot[                 pattern=north east lines,                 pattern color=red,                 draw=black]                 {-x} \closedcycle;         \end{axis}         \end{tikzpicture}     \end{document}      ![example](http://i.stack.imgur.com/sq0s0.jpg)


title: pgf stacked bar graph with line plot

text: I want to draw a stacked bar graph plot with one parameter as a line plot. Here is my code below -               \begin{tikzpicture}     \pgfplotstableread{Figures/measurements.dat}     \datatable          \definecolor{RYB1}{RGB}{51, 102, 153}     \definecolor{RYB2}{RGB}{102, 51, 0}     \definecolor{RYB3}{RGB}{204, 153, 0}     \definecolor{RYB4}{RGB}{51, 51, 0}     \definecolor{RYB5}{RGB}{204, 102, 0}          \pgfplotscreateplotcyclelist{colorbrewer-RYB}{         {fill=RYB1},         {fill=RYB2},         {fill=RYB3},         {fill=RYB4},         {fill=RYB5},         }          \begin{axis}[     symbolic x coords={1.2.1.a,1.2.3.b,1.1.3.c,1.1.1.d,1.3.1.e,1.3.3.f,3.3.3.g,1.3.3.h,1.1.3.i,1.1.1.j,1.2.1.k,1.3.1.l},     ybar stacked,     legend style={         legend columns=4,         at={(xticklabel cs:0.5)},         anchor=north,         draw=none     },       axis y line*=none,     axis x line*=bottom,     tick label style={font=\footnotesize},     legend style={font=\footnotesize},     label style={font=\footnotesize},     width=.8\textwidth,     bar width=6mm,     area legend,     x tick label style={rotate=90,anchor=east},         xlabel=Processor Configuration,     ylabel=Clock Cycles,     cycle list name=colorbrewer-RYB,     xtick=data,     xticklabels={1.2.1,1.2.3,1.1.3,1.1.1,1.3.1,1.3.3,3.3.3,1.3.3,1.1.3,1.1.1,1.2.1,1.3.1},     ]                 \addplot table[y=C] from \datatable ;          \addlegendentry{C};         \addplot table[y=E] from \datatable ;         \addlegendentry{E};         \addplot table[y=F] from \datatable ;         \addlegendentry{F};         \addplot table[y=D] from \datatable ;         \addlegendentry{D};     \end{axis}     \end{tikzpicture}      And here is the data file -                A  B   C   D   E   F   G     1.2.1.a 2044238 2025137 138 15859   1400    1358     1.2.3.b 2108559 2088724 894 14662   1898    2035     1.1.3.c 3498648 3482495 1610    11490   1405    1302     1.1.1.d 2097564 2089859 871 5021    898 569     1.3.1.e 3489783 3470704 138 15888   1405    1302     1.3.3.f 3496917 3481357 871 11110   1909    1324     3.3.3.g 2110448 2089855 871 16015   2476    885     1.3.3.h 4897582 4875299 1375    17401   1903    1258     1.1.3.i 2800891 2786201 877 10704   1405    1358     1.1.1.j 2740737 2733003 894 5027    898 569     1.2.1.k 3500439 3481371 138 15882   1400    1302     1.3.1.l 2111014 2088720 894 18347   1405    1302      Now in this graph the parameter D, I would like to have it as a line plot rather than bar graph. Could anyone please tell me what I should add in the code to make it happen? Thanks !


title: from tex source file jump to pdf in Texlipse

text: In TexWorks, it is easy to jump between tex source and pdf files. In Texlipse, jump from pdf to source is easily clicking the part of pdf file, but what is the symmetric easy way to jump from tex file to the corresponding part of pdf file?


title: create OML font encoding from a commercial font

text: I've bought the legacy sans and serif font package and I've inserted it into my TeX/LaTeX distribution, through pltotf, vptovf an similar utilities. Then I've created a package that allows me to use that fonts in math mode, as I've shown. However, I need to increase the stretch of some glyph boxes, for example the "f"-italic one, as shown in the picture below ![stretch of "f" glyph](http://i.stack.imgur.com/NBPAk.png) To get the second output, actually I need to add manually the `\,` instruction. So, how can I create the OML font encoding of legacy font, in order to adjust the skip between math glyphs? In addition, is this the right way to get the results I mean? I must say that I wont create a command like `\def\f{f\,}`, because in my opinion it is a trivial resolution


title: Drawing paths/nodes along a path in Tikz

text: I would like to draw a collection of nodes / paths. However, I'm too lazy to position them manually, I would like to specify their position along a given path. How can I do that? Here a picture of what I did so far. ![enter image description here](http://i.stack.imgur.com/CXlJ3.png) However, I want the points and labels to follow a curved path instead of a straight line. The picture was produce by the following code, which unfortunately relies on a glitch. Namely, this only works when the `\path` commands are straight lines between two points. If I add more points, the guiding path is being drawn as well, which is not my intention.               \begin{tikzpicture}     \draw (0,0) circle (2);     \path (135:2.2) node[anchor=east] {$Y$};          \def\mynode#1{node [pos=#1,after node path={(\tikzlastnode) +(0,-0.3) circle (0.05)}]}     \def\y#1#2{\mynode{#1} {$y_{#2}$}}          \path (0,-1) -- (-1.5,1.5)         \foreach \num/\pos in {1/0, 3/0.3, 5/0.53}             {\y{\pos}{\num}}         \foreach \pos in {0.7,0.75,0.8,0.82}             {\mynode{\pos} {}}         [fill];     \path (0,-1) -- (1.5,1.5)         \foreach \num/\pos in {2/0.2, 4/0.45}             {\y{\pos}{\num}}         \foreach \pos in {0.6,0.7,0.75,0.8,0.82}             {\mynode{\pos} {}}         [fill];     \end{tikzpicture}


title: English bibliography style

text: I try to create an english bibliography in TexShop on Mac. What I want is a bibliography formatted in plaindin like this: > [1] Woods, W. A.: What’s in a Link: Foundations for Semantic Networks. In: > Bobrow, D. G. (eds.) ; Collins, A. (eds.): Representation and Understanding. > Academic Press, 1975, S. 35–82 However, the output I get is: > [1] Woods, W. A.: What’s in a Link: Foundations for Semantic Networks. In: > Bobrow, D. G. (Hrsg.) ; Collins, A. (Hrsg.): Representation and > Understanding. Academic Press, 1975, S. 35–82 Note, that the difference is "eds." and "Hrsg.". The code of my .tex document is:               \documentclass[12pt,a4paper,oneside,openright]{report}      \begin{document}      Test \cite{Woods:75a}      \bibliography{mylit}      \bibliographystyle{plaindin}       \end{document}      The content of mylit.bib is:               @incollection{Woods:75a,         Author = {Woods, W. A.},         Booktitle = {Representation and Understanding},         Editor = {Bobrow, D. G. and Collins, A.},         Pages = {35--82},         Publisher = {Academic Press},         Title = {What's in a Link: Foundations for Semantic Networks},         Year = {1975}}      So, why do I get the german format? The system language of my computer is german. Can I change the bibliography language to english, or set the default langauge to english for latex? Thanks for your help, Mirko


title: How to set identifier "Listing 1" in listing in bold

text: I use figures and listings in a document. By default, the identifier "Figure 1" is set in bold, while "Listing 1" is normal. For consistent looks I would like to have either everythin bold or normal. How? **edit:** MWE (without the solution):               \documentclass{article}     \usepackage{listings}     \lstset{     language=C     }          \begin{document}          \begin{lstlisting}[        caption={[short] long long long.},        label={lst1}     ]     int main ( void )     {        return 0;     }     \end{lstlisting}          \end{document}


title: Bibliography style in CV

text: I'm using the following nice LaTeX template for CV. I'm getting the bibliography in the following style               Hyndman, R. J., M. L. King, I. Pitrun, and M. B. Billah etc      I want the `apacite` style. I tried the following code:               \usepackage{apacite}     \bibliographystyle{apacite}      but it did not work. I'd highly appreciate if you help me to figure out this. Thanks in advance


title: Indentation in \leftbar Environment

text: How do I control/remove the indentation automatically generated in the `\leftbar` environment?               \documentclass[11pt,letterpaper]{amsbook}     \usepackage{xcolor}     \definecolor{lightgray}{gray}{0.90}          \newtheorem{theorem}{Theorem}          \usepackage{framed}     \renewenvironment{leftbar}[1][\hsize]     {%      \def\FrameCommand      {%              {\color{black}\vrule width 3pt}%         \hspace{0pt}%must no space.         \fboxsep=\FrameSep\colorbox{lightgray}%     }%     \MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}%     }     {\endMakeFramed}          \begin{document}          \begin{leftbar}     \begin{theorem}     Fun Math     \end{theorem}     \end{leftbar}     \end{document}


title: moderncv classic header

text: I was trying to add an additional header for every new page of my CV (2nd page and onward), but unfortunately everything I tried ended in a failure. I've tried editing "moderncvstyleclassic.sty" and adding a new command similar to \makecvtitle command. I'm new to latex, so probably I just messed code somewhere.               \firstname{John}     \familyname{Doe}          (...) %personal info          \begin{document}          \makecvtitle % Print the CV title, so for the 1st page I don't need a new header          (...) %some info here           \clearpage     \header %%% I need a header here          \end{document}      I was looking to add black/gray color header with fonts 18/16 like:               John Doe                                                         Curriculum Vitae


title: TeX capacity exceeded with multiple font encodings

text: I work in humanities, so please forgive my lack of competence and the weirdness of my computing needs. Is there a way to make this work? I need to use three (for starters) languages in the same document. Lithuanian (`L7x`), polish (LaTeX seems to render it fine without stating `\usepackage{polski}`) and russian (`T2A`). I get the error message below as soon as I introduce any third language-specific symbol into the document.               ! TeX capacity exceeded, sorry [input stack size=5000].\L ->\L7x-cmd \L                       \L7x\L      l.9 ĄąĆćĘęŁ                       łŃńÓóŻż     !  ==> Fatal error occurred, no output PDF file produced!      Russian+lithuanian works fine, but a single "ł" triggers an error. The same with russian+polish and a "ė". A cyrillic character only causes non-fatal error (msg. below) for each symbol and cyrillic text is simply ignored in the output file.               ! Package inputenc Error: Unicode char \u8:ц not set up for use with LaTeX.      Here is a MWE               \documentclass{article}     \usepackage[L7x,T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[lithuanian,russian]{babel}     \begin{document}     %lithuanian         ĄąČčĘęĖėĮįŠšŲųŪūŽž     %russian     БбЖжЬьЯяЭэЩщШшПпЦц     %polish     ĄąĆćĘęŁłŃńÓóŻż     \end{document}


title: `enumitem` package can't be used in conjunction with `numprint` (or how to set enumerate item has the type of 01, 02, etc.)

text: I want get a enumerate list has shape _01_ , _02_ , etc. The LaTeX code               \documentclass{article}     \usepackage{enumitem}     \usepackage{numprint}     \begin{document}     \nplpadding{2}     \begin{enumerate}[label=\numprint{\theenumi}]     \item Hello, world!     \end{enumerate}      is good, but               \documentclass{article}     \usepackage{enumitem}     \usepackage{numprint}     \begin{document}     \nplpadding{2}     \begin{enumerate}[label=\numprint{\theenumi},leftmargin=*]     \item Hello, world!     \end{enumerate}      not.


title: Reduce vertical distance of "above right" to label a plot

text: How can I label a plot using `above right` but with reduced vertical distance? I tried a syntax like `above right= value1 and value2` but this isn't working for me. For example in the following plot: ![example](http://i.stack.imgur.com/YlD4W.png)               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}               \begin{document}     \begin{tikzpicture}     \begin{axis}[ymin=0, ymax=12]         \addplot[black] {1} node[pos=0.1, above right]{$y=1$};         \addplot[black] {2} node[pos=0.1, above right]{$y=2$};         \addplot[black] {3} node[pos=0.1, above right]{$y=3$ long info};         \addplot[black] {4} node[pos=0.1, above right]{$y=3$};     \end{axis}     \end{tikzpicture}     \end{document}


title: Problems with website formatting in apacite's reference page

text: This is a very specific problem, but it's driving me crazy. I'd like my output to look like this: Author, A. A., & Author, B. B. (Date of publication). Title of article. Title of Journal, volume number, page range. Retrieved from http://www.someaddress.com/full/url/ With the url the same font as the reference and without a period at the end of the reference. My problem is that I'm getting either the url in a different font or a period at the end of the reference. My `bib` file looks something like this:               @article{ rospa,       year = {n.d.},       title = {Seat Belts: A short history},       journal = {The Royal Society for the Prevention of Accidents},       howpublished = {Retrieved March 7, 2014, from         http://www.rospa.com/roadsafety/adviceandinformation/vehiclesafety/         in-carsafetycrash-worthiness/seat-belt-history.aspx}     }          @article{ ehow,       author = {Sefcik, Lisa},       title = {Seat belt law history},       journal = {eHow},       url = {http://www.ehow.com/facts\_5008257\_seat-belt-law-history.html},       urldate = {March 7, 2014},       year = {n.d,}     }      And my `tex` file looks something like this:               \documentclass[man, apacite]{apa6}     \AtBeginDocument{\urlstyle{APACsame}}     \author{weirdesky}     \title{test}     \shorttitle{test}     \begin{document}       \maketitle       \cite{rospa}       \cite{ehow}       \bibliography{test}     \end{document}      And I get the rospa citation with a period at the end and the ehow citation with the url in a weird font. I looked around and found \urlstyle{same} with apacite , and tried using the solution (although I don't know what it really does), but it didn't work. Is there a way around this, or am I going to have to use the literal section? I tried using \bibnodot{.}, but I get an undefined control sequence error.


title: Titlesec command blocked by frontmatter

text: \frontmatter blocks the propagation of the \titleformat from the preface to the first chapter. Is there a way to avoid that ?                 \documentclass[11pt,A4]{book}       \usepackage{titlesec}            \titleformat{\chapter}[display]       {\bfseries}{Title Above}{20pt}{\Huge}[\vspace{2ex}\titlerule\vspace{0.2ex}\titlerule]            \begin{document}       \chapter{Preface (before frontmatter)}       \frontmatter% blocks the propagation of the titleformat to the first chapter       \chapter{Chapter 1 (after frontmatter)}       \end{document}        ![enter image description here](http://i.stack.imgur.com/YBC2s.jpg) The upper title of Chapter 1 is shown only if \frontmatter is absent. ![enter image description here](http://i.stack.imgur.com/Av9zs.jpg) ![enter image description here](http://i.stack.imgur.com/sZG5o.jpg)


title: making low-quality PDF files clearer

text: Some research papers available on the web have low-quality outputs. For example, see this. It seems that it was converted from a PS file and typeset in (La)TeX. However, it has all the font information. Is there any way to make the PDF file clearer?


title: change the numbering in Beamer's table of content

text: Beamer's table of contents starts with bullet 1. How can I change that to bullet 0? The command \setcounter{section}{-1} in the preamble does not help.


title: TeX capacity exceeded with a 13 columns 18 rows spreadtab

text: Originally I had a spreadsheet with 13 columns and 18 rows. Applying pdflatex or xelatex to this sheet I got: ...                    cell K15     ! TeX capacity exceeded, sorry [save size=80000].      Then I reduced the size of the spreadsheet. With 10 columns and 16 rows or with 12 columns and 15 rows I could create pdf files with xelatex. With 10 columns and 17 rows, with 11 columns and 16 rows or with 12 columns and 16 rows it fails with "TeX capacity exceeded". I am using:               rose@lynx:/home/rose/Txt/projects/ClosePackingOfSpheres/Report/MyTest(117)$ xelatex -v     XeTeX 3.1415926-2.5-0.9999.3-2014010319 (TeX Live 2013)     kpathsea version 6.1.1     Copyright 2013 SIL International and Jonathan Kew.     There is NO warranty.  Redistribution of this software is     covered by the terms of both the XeTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the XeTeX source.     Primary author of XeTeX: Jonathan Kew.     Compiled with ICU version 52.1; using 52.1     Compiled with zlib version 1.2.8; using 1.2.8     Compiled with FreeType2 version 2.5.0; using 2.5.3     Compiled with Graphite2 version 1.2.1; using 1.2.4     Compiled with HarfBuzz version 0.9.23; using 0.9.26     Compiled with fontconfig version 2.11.0; using 2.11.1     Compiled with libpng version 1.6.8; using 1.6.10     Compiled with poppler version 0.24.5      on a Gentoo system. Any hint is appreciated. spreadsheet_test_10C_17R.tex (long lines with almost 500 characters):               \documentclass[10pt,a4paper]{article}     \usepackage[left=1cm,right=1cm,top=0.5cm,bottom=1.5cm,textheight=26cm,textwidth=18.5cm]{geometry}     \usepackage[latin1]{inputenc}       % allow Latin1 characters     \usepackage[english,german]{babel}     \usepackage{makeidx}     \usepackage[]{fp}         % for arithmetic fixed point operation     \usepackage{amsmath,amsfonts,amsthm,amssymb}     \usepackage{spreadtab}     \usepackage{caption}  %%  for captions out of figures and tables     \begin{document}     \setlength{\parindent}{0pt}     \FPset\Le{10}  %% \mu m     \FPupn\Vre{2 2 root 2 div 3 \Le{} pow mul}%     \FPround\VreR\Vre{1}%     \FPupn\Are{3 2 3 root mul 2 \Le{} pow mul } %     \FPupn\RzeroF{2 3 root 2 mul 3 sub 3 div}%     \FPupn\FourPI{4 \FPpi{} mul}%     \begin{equation}       \label{eq:faktor_1}       f_a(r,r_p)=1-3\left[2-\frac{3}{n(r)}+\frac{1}{n(r)^2}\right]\frac{r_p}{r_p+r}     \end{equation}     \begin{centering}     \STautoround{1}     \begin{scriptsize}     \begin{spreadtab}%       {{tabular}{|c|c|c|c|c|c|c|c|c|c|}}\hline       @$r [nm]$& @$r_0$                & @$n_R$                                    & @$n_T$                                              &  @ $S_T^{VC}(r,n_R)$               &    @$f_a(r,r_p)$                           & @ $S_T^{VC}(r,n_R)$                                                    & @ $S_T^{VC}(r,n_T)$                                                   &   @ $ S_T^{VC}(r,n_R) $                                           &  @ $ S_T^{VC}(r,n_T) $                                            \\                &                       &                                           &                                                     &  @ $r_p=0.0$                       &                                                                      \multicolumn{3}{|c|}{@ $r_p=0.3$  }                                                                                &                                                    \multicolumn{2}{|c|}{@ $ r_p=3 $}                                                  \\       \hline         1      &\STcopy{v} {\RzeroF*a3}&\STcopy{v} {1000*(\Vre/2)^(1/3)/(a3*2^0.5)}&\STcopy{v} {1000*(\Vre/2)^(1/3)/(a3*2^0.5)+1-6^0.5/2}&\STcopy{v}{\FourPI*(a3/1000)^2*c3^3}&                                            &   \STcopy{v} {\Are}                                                    & \STcopy{v}{\Are}                                                      &  \STcopy{v}{\Are}                                                 &   \STcopy{v}{\Are}                                                \\         2      &                       &                                           &                                                     &                                    &\STcopy{v}{1-3*(2-3/c4+1/c4^2)*0.3/(0.3+a4)}&\STcopy{v} {\FourPI*(a4/1000)^2*c4^3*(1-3*(2-3/c4+1/c4^2)*0.3/(0.3+a4))}&\STcopy{v}{\FourPI*(a4/1000)^2*d4^3*(1-3*(2-3/d4+1/d4^2)*0.3/(0.3+a4))}&                                                                   &                                                                   \\         4      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\         8      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\        11.37   &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\        16      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\        20      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &\STcopy{v}{\FourPI*(a9/1000)^2*c9^3*(1-3*(2-3/c9+1/c9^2)*3/(3+a9))}&\STcopy{v}{\FourPI*(a9/1000)^2*d9^3*(1-3*(2-3/d9+1/d9^2)*3/(3+a9))}\\        24      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\        27      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\        99      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\       125      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\       216      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\       334      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\       512      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\      1024      &                       &                                           &                                                     &                                    &                                            &                                                                        &                                                                       &                                                                   &                                                                   \\      \hline     \end{spreadtab}     \end{scriptsize}     \captionof{table}{Numerical Values [$\mu m^2$] with different probe radii [nm]}     \label{tab:Ratio_5}     \end{centering}     \vspace{5mm}     \end{document}


title: pdfTeX or pdfLaTeX under Windows/Java using Bytestream

text: I'm doing servlet programming and i was wondering if pdfTeX or pdfLaTeX have some handle for input or output bytestreams under windows. This way I could stream a string right in and stream the output as a PDF response to the client...any ideas?


title: Line break in multipart rectangle node with align specification

text: I'd like to ask how I can add a line break in a multipart rectangle node. Code that I've written should work but it is not. Can you tell me what I have done wrong, or how can I tune it to make it work.               \tikzstyle{umlclass}=[         draw=black,         fill=yellow!16,         rectangle split,         rectangle split parts = 3,         rectangle split part align={center,left,left},         execute at begin node = \ttfamily,     ]        \node[umlclass]{         <<interface>>\\         class         \nodepart{second}         +attribute     };


title: Sideways figures

text: I'm using the command `sidewaysfigures` to put my landscape graphics (`pdf` images) the right way. The images are correctly positioned in a new page, but the problem is that if I go on writing after the               \begin{sidewaysfigures}      ...       command, on the output the rotated images are shifted to the last page available. Of course I don't want this to happen and I've tried to specify `[h]` or `[!h]` commands but it doesn't seem to work! Does anyone know what's the problem and how to fix it?


title: Animations created in Texmaker not working in PDF X-change Viewer

text: At this site there is a very cute example of an interactive animation. If I _download_ the PDF directly, it works fine in both Adobe Acrobat _and_ in PDF X-change viewer (the latter is my preferred pdf-program). If I download the _sourcecode_ and compile it in Texmaker, it only works in Adobe. In PDF X-change the animation/figure is invisible. The same applies to animations I create myself by looping images etc. What is the reason for this?


title: Problem with algorithm(ic) and hyperref

text: The following code works ... fine!               \documentclass{book}          % \usepackage{subfig}     % \usepackage{subcaption}          \usepackage[colorlinks]{hyperref}          \usepackage{algorithm}     \usepackage[noend]{algorithmic}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     We outline this in Algorithm~\ref{alg1}.     %%     \begin{algorithm}     \caption{Algo}     \label{alg1}     \begin{algorithmic}       \STATE A     \end{algorithmic}     \end{algorithm}          \end{document}      But once I add either `subfig` or `subcaption` to it as hinted, I get the warning               name{algorithm.1} has been referenced but does not exist, replaced by a fixed one      and the link to the algorithm does not work. Note that the code does not make use of any feature of `subfig`, or `subcaption`. It must come from some macro redefinition in those packages. After searching around I found algorithmic-fix from our @AxelSommerfeldt, but that does not fix the warning. (Strangely, it is also not needed when `subfig` and `subcaption` are out.) What do I overlook?


title: Irregular tables in LaTeX

text: Is it possible to create a table with a layout as this one? ![enter image description here](http://i.stack.imgur.com/yCJcs.png) If yes, what packages should I use?


title: Footnote problem using paracol package

text: Look at this simple code:               \documentclass[12pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage[german]{babel}     \usepackage{paracol}          \begin{document}          Hello world!\footnote{A simple footnote.}          \columnratio{0.1}     \begin{paracol}{2}     D1.1     \switchcolumn     This is a simple definition.     \end{paracol}          This is a simple sentence.\footnote{Another simple footnote!}          \end{document}      It's producing a totally weird output. (Sorry, I'm not allowed to upload an image.) Why is the first footnote showing up right above the paracol environment? What am I doing wrong?


title: Why won't this header have proper small caps?

text: If I'm correct, small caps means if I had a word like, say, WORD, the W would be bigger than the other letters slightly, right? I have the following LaTeX code:               \newcommand{\header}[1]{         \begin{changemargin}{-0.5in}{-0.5in}             \bf\scshape\textsc{#1} \\         \lineover         \end{changemargin}     }      However, it won't display. It's just bolded, non-caps for the headers. Word is **Word**. The differences between `\sc`, `\scshape` and `textsc` is confusing me too.


title: Midrule that extends only over some of the columns in booktabs

text: I hope this isn't a silly question, the thing is that I want to create a table with a midrule applied in just some cells, I mean something like that (just between Item, Animal and Description): ![enter image description here](http://i.stack.imgur.com/qSvmi.png) I've always used the comand `midrule` in order to insert a horizontal line in the table, but it is always applied to the whole row and thats just what I don't want to. I hope somebody could help me out.


title: How to get language dependent quotation marks in citations with biblatex?

text: I cite german and french articles. In my bibliography the titles are given in quotation marks. Now, I would like to have the quotation marks dependent on the language of the article. I thought `biblatex` together with `csquotes` would handle this automatically but in fact all titles have german quotation marks (as this is the language of the main text). This is my header:               \documentclass[12pt,a4paper,twoside]{report}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[french,english,american,ngerman]{babel}     \usepackage[babel]{csquotes}     \usepackage[style=verbose-ibid,babel=other]{biblatex}


title: language in latex and in particular in biblatex

text: I write my thesis in French but some of my references are in German, English, and French. I use babel for the French but English titles are in French format! My document is this one:               \documentclass[a4paper,11pt,draft]{scrreprt}     \usepackage[T1]{fontenc}     \usepackage[english,francais]{babel}     \usepackage{csquotes}     \begin{document}     Mandelbrot~\cite{mandelbrot_77}         \bibliographystyle{plain}     \bibliography{biblio}     \end{document}      where my bib file is:               @book{mandelbrot_77,     title={Fractals: Form, Chance, and Dimension},     author={Mandelbrot, B.B.},     year={1977},     hyphenation={English}     }      The result is that there is a space before ":" in the English title. How can I solve this problem?


title: Redefine the \AtBeginShipout command (eso-pic, atbegshi)

text: I don't understand how to redefine/clear/reset a running `\AtBeginShipout`-command. So far, I've used `\AtBeginShipout{\AddToShipoutPicture*{...}}` to place proper images running through the document, but now I tried to redefine the pictures in the second part of my document –- without success. `\ClearShipoutPicture` takes no effect at all. I studied the documentation of `atbegshi` over and over ... I would be glad, if somebody could give me some assistance.


title: ConTeXt: Retain ToC Hyperlinks using alternative command

text: # Background A custom Table of Contents entry was suggested to move page numbers from the right-hand side to the left-hand side. # Problem The custom command loses ToC hyperlinks. I have tried to restore the hyperlinks as follows:               \goto{#3}[page(\currentlistentrylocation)]      This does not produce the correct page number link. Similar attempts include:   * \goto{#3}[#3]   * \gotopage{#3}   * \goto{#3}[page(#3)] It seems that these commands cannot reference a page number indirectly. # Code Minimal example:               \setupinteraction[state=start,]     \setupcombinedlist[content][interaction=all,]          % Set the page number to the left of the section title.     \define[3]\SectionToCEntry{%       \par \leftaligned\bgroup         \hbox to 2em{\goto{#3}[page(\currentlistentrylocation)]}%           \hskip 1em           \vtop{\hsize\dimexpr\textwidth-3em\relax#2}       \egroup \par%     }          \setuplist[section][       alternative=command,       command=\SectionToCEntry,     ]          \starttext       \placecontent       \dorecurse{4}{         \page         \section[title={Section A}]         \dorecurse{5}{\input knuth}         \section[title={Section B}]         \dorecurse{5}{\input ward}       }     \stoptext      # Question I am wondering:   * how would you retain the internal hyperlinks for such a custom ToC; or   * is there a simpler approach to reconfiguring the ToC? # Related Additional information:   * http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/strc-ref.mkvi   * http://wiki.contextgarden.net/Command/goto


title: Multiple references

text: I have several references like `\cite{a,b,c,d,e}` which produces an output like `[1], [2], [3], [4], [5]`. Is there a way to automatically generate the above as `[1]-[5]`?


title: Suggestions for fonts in classicthesis.sty

text: I found these suggestions for fonts in classicthesis.sty. What are they for kpfonts? Does `Palatino 10pt: 288--312pt | 609--657pt` mean that `\textwidth` must be between `288 and 312pt` and `\textheight` must be between `609 and 657pt`?               % Here are some suggestions for the text widths and heights:     % Palatino  10pt: 288--312pt | 609--657pt     % Palatino  11pt: 312--336pt | 657--705pt     % Palatino  12pt: 360--384pt | 768pt     % Minion      10pt: 264--288pt | 561--609pt     % Minion      11pt: 288--312pt | 609--657pt     % Minion      12pt: 336pt      | 672pt     % Libertine 10pt:     % Libertine 11pt:     % Libertine 12pt:     % kpfonts 10pt:     % kpfonts 11pt:     % kpfonts 12pt:


title: custom header using fancyhdr

text: I am looking to create a layout as follows in LaTeX. I tried using `fancyhdr` but I am unable to get it right.               \lhead{\includegraphics[height=0.75in]{translogo}}      \chead{\parbox{5cm}{INTEROFFICE   MEMORANDUM \\ Document Name \\}}     \rhead{\parbox{5cm}{ \today \\ \\ TOP \\ Confidential document \\}}      This is what it should look like:               ___________________________________________________________________________     |        |          INTEROFFICE MEMO                      | DATE          |      |LOGO    |           DOCUMENT NAME                        | Number        |     |        |                                                |               |     ___________________________________________________________________________          blah ...............     \lipsum          ____________________________________________________________________________


title: key values getting improperly passed through a property list getter function

text: I'm creating rather complicated diagram and would like to put all the controls all in one easy to find location and not scattered throughout the document. To do this, I've created _setter_ and _getter_ functions for a LaTeX3 property list. Here's the code:               \documentclass{article}     \usepackage{pstricks,pst-node}     \usepackage{xparse}     \ExplSyntaxOn     \prop_new:N \g__sunset_plist     \NewDocumentCommand{\setattr}{ mm }         {             \prop_gput:Nnn \g__sunset_plist {#1} {#2}         }     \DeclareExpandableDocumentCommand{\gettr}{ m }         {             \prop_get:Nn \g__sunset_plist { #1 }         }     \ExplSyntaxOff     \setattr{my_linestyle}{linestyle=dashed,linecolor=blue}     \setattr{my_line}{\psline[linestyle=dashed,linecolor=blue](A)(B)}     \pagestyle{empty}     \begin{document}          \begin{pspicture}(10,10)              \pnode(0,0){A}         \pnode(10,10){B}         \pnode(10,0){C}         \pnode(0,10){D}              \gettr{my_line}   %% <-- works as expected         \psline[\gettr{my_linestyle}](C)(D)  %% <-- not working          \end{pspicture}          \end{document}      The line                   \gettr{my_line}   %% <-- works as expected      works but I don't want to approach the problem this way. I'd prefer to write                   \psline[\gettr{my_linestyle}](C)(D)  %% <-- not working      because this line shows me exactly what I'm doing: drawing a line from point C to point D. What's _hidden_ are the attributes to that line. I'd prefer this approach. But what seems to be happening is that when `\gettr{my_linestyle}` is expanded, LaTeX sees:                   \psline[{linestyle=dashed,linecolor=blue}](C)(D)  %% <-- not working      How do I get my _getter_ function to expand without the surrounding `{...}`? **EDIT** Here's the error message               ! Package xkeyval Error: `linestyle=dashed,linecolor=blue' undefined in familie     s `,pstricks,pst-node'.          See the xkeyval package documentation for explanation.     Type  H <return>  for immediate help.      So it seems that some kind of expansion is happening before `xkeyval` is getting the keys.


title: Best way to customize the TOC

text: I am looking for a good way to customize my table of contents. I have seen this answer, but I think thats way beyond the thing I like to do. I have a `scrartcl` class document and want:   * to put `fcolorboxes` around the header (the "Contents") AND the actual table.   * numbers on the left replaced by a little circle   * (DONE) page numbers to be removed **Answer:**               \RequirePackage{tocloft}     \cftpagenumbersoff{section}      I don't know where and hoe to start. as promised the MWE of my problem: tex file:               \documentclass{test}     \usepackage[english]{babel}     \usepackage{blindtext}          \begin{document}          \begin{firstpage}{Some Subtitle}     \section{title for introduction}     \blindtext          \end{firstpage}          \section{some section}     \blindtext     \section{some other section}     \blindtext     \section{yet another section}     \blindtext     \end{document}       class file:               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{test}[2014/05/23 test class]          \LoadClass[9pt, twocolumn]{scrartcl}          \RequirePackage{titlesec} % for customize title     \RequirePackage{fontspec} % for arial usage use XeLaTeX compiler     \RequirePackage{scrextend} % for text indention     \RequirePackage{fancyhdr} % for headers and footers      \RequirePackage[top=1.5cm, bottom=4cm, left=1.5cm, right=1.5cm]{geometry} % page layout     \RequirePackage{tocstyle}          % set font to arial     \setmainfont{Arial}          % maybe scheisse... (um linebreaks bei paragraphs zu machen)     \addtolength{\parskip}{\baselineskip}          % avoid indention at new paragraph     \setlength{\parindent}{0pt}          % space between lines     \renewcommand{\baselinestretch}{1.3}           % header and footer layout          \pagestyle{fancy}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}          \setlength{\headsep}{2cm}               % header style for first page     \fancypagestyle{firstpagestyle}     {         \fancyhead[L]{}         \fancyhead[R]{}     }          \setlength{\columnsep}{1cm}          % toc style     \setcounter{secnumdepth}{0}               \newenvironment{firstpage}[1] {         \thispagestyle{firstpagestyle}         \onecolumn          \Huge FRAME News          \\[0.4\baselineskip]         \huge #1 \normalsize         \\[1.8\baselineskip]         \begin{minipage}[t]{0.35\textwidth}              \setcounter{tocdepth}{1}             \tableofcontents             \end{minipage}\hspace{1cm}         \begin{minipage}[t]{0.6\textwidth}       }     {         \end{minipage}         \clearpage          \twocolumn           \pagestyle{fancy}     }


title: Should \paragraph be used only under \subsubsection?

text: Very simple question: Is `\paragraph` _supposed to be used_ only under `\subsubsection` or do you use it directly under `\section` or `\subsection` as well (e.g., if there are no further sub sections necessary). I mean, because you wouldn't use `\subsubsection` directly under `\chapter` ...


title: How to combine hyperref and eqref

text: \documentclass{scrartcl}     \usepackage[english]{babel}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[colorlinks=true,linkcolor=green]{hyperref}     \begin{document}     \begin{align} \label{test}     a+b=c     \end{align}     \eqref{test}     \end{document}      How can I combine hyperref and eqref such that the braces () are also green and clickable and not only the 1?


title: TeX Live, Ubuntu - Update expl3 to l3kernel problem

text: I'm a noob with LaTeX. Trying to get my `import` package to work, I came across a dependency on the `ExplFileVersion` macro. Googling this issue, I realized I need to update my `l3kernel` package. The trouble is, `l3kernel` package doesn't exist on my system where the other TeX packages do (seemingly `/usr/share/texmf-texlive`). I did however find the following package: `/usr/share/texmf-texlive/tex/latex/expl3`. To my understanding this is the older version, which has to be replaced with `l3kernel`. I'm an Ubuntu 10.4 user, and I installed using `apt-get` the following packages: `texlive`, `texlive-full`, `texlive-latex-recommended` (which supposedly contains `l3kernel`) and `texlive-latex3`. I tried to download `l3kernel` and manually compile it with LaTeX, but it won't compile. If however somebody here thinks this is the correct way to go, I'll post the errors. Does anyone know what's to be done next?


title: Getting rid of a thin framing line when shading a triangle

text: I am trying to draw a shaded triangle with tikz, using the following code:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \fill[top color=green!40,middle color=white,shading angle=45]  (-2.5,-3) -- (12.5,3) -- (-2.5,3) -- cycle;     \end{tikzpicture}     \end{document}      I think it is hard to see in the image posted below, but just along the diagonal is a very thin line. Is there any way to get rid of this line? This is with Tikz/PGF version 2.10. ![tikz compiled image](http://i.stack.imgur.com/8zacW.png)


title: Multlined in align enviromnent: alignment of = and equation numbering

text: I'm using the `multlined` environment inside an `align` environment and want have the `=` aligned at the top and the equation numbering at the bottom. Is this possible? Here my MWE:               \documentclass{article}     \usepackage{mathtools,amsmath}     \begin{document}     \begin{align}     y &= a+b+c \\     &= \begin{multlined}[t]     a+b+ \\     c     \end{multlined}     \end{align}     \begin{align}     y &= a+b+c \\     &= \begin{multlined}[b]     a+b+ \\     c     \end{multlined}     \end{align}     \end{document}      ![enter image description here](http://i.stack.imgur.com/9b15A.png)


title: count the newlines in title

text: I am trying to automatically adjust the title page to get a pleasing result independent of the title size. This means that I have to count the number of line breaks in an argument. My MWE (not very pleasing to make it really minimal)               \documentclass{book}          \makeatletter          \newcommand{\maketitlepage}[1]{% the title page is generated here       \edef\caesar@titlespace{\the\dimexpr 210pt - 15pt * #1 \relax}% calculate the necessary space       \cleardoublepage%       \begingroup%       {%       \noindent\LARGE\@author\par       \vfill%       \noindent\fontsize{30}{38}\selectfont\@title\par       \vfill%       \vspace{\caesar@titlespace}%       \Large\noindent\publisher\par       }%       \endgroup%       \clearpage%     }          \makeatother          \title{This is\\a title}     \author{John Doe}     \newcommand{\publisher}{Some University}          \begin{document}     \maketitlepage{2} % two lines     \title{This is\\new\\a title}     \maketitlepage{3} % three lines          \end{document}      Please note that I manually count the lines and provide `\maketitlepage` the extra argument. I cannot figure out how to calculate it automatically.


title: Insert libreoffice table as input

text: > **This question led to a new package:**   >  `odsfile` Suppose you have an `localc` spreadsheet `myspread.ods` and you want to insert the content of the range `H4:I40` as a table into your latex document. I know that I can export the table or just do some copy and paste. However is it possible to write something like: `\includespread{file=myspread.ods,range=H4:I40}` Then the table in my `LaTeX`-document changes when the corresponding spreadsheet changes. Would be nice to have also the possibility to modify global appearence properties of the table as optional arguments of `\includespread`.


title: dvi to ps conversion problem [SOLVED: PyX graph issue]

text: when running dvips on a dvi (containing just a graph included via an .eps file) the generated ps file "drops" certain characters in the graph (decimal points in the labels on the axes and capital letters in the axis title). Note that the dvi correctly shows the graph in all its details. However, and this is what puzzling me the output of the dvips command DOES NOT give any error at all. It calls all the correct fonts without any problem. The fonts called are all CM, and dvips locates them correctly Any ideas ? Is it possible that certain pfb files are broken without dvips noticing that ? [Adding that the graph was generated using PyX 0.11 This turned out to be the problem as I note in the comment. a switch to PyX 0.12 solves the issue. I therefore add a PyX tag to this question.] Here is the dvips output This is dvips(k) 5.98 Copyright 2009 Radical Eye Software (www.radicaleye.com) ' TeX output 2012.11.07:0003' -> draft2.ps . [1 <./pic/Fig1ext.eps>]


title: Broken quotes with polyglossia

text: I have used the following setup to typset Telugu text using polyglossia and xelatex. But the quotes seem to be broken. They appear as typed in the source and are not transformed to the curly ones (as done by latex). I tried using csquotes, but in vain. As the characters corresponding to Latin set were not rendered using the font in my language, I put a small block of code (taken from tex.stackexchange.com) to render them with an English font. Is this by any chance the cause of the problem? If it is, then what is the workaround?               \documentclass{article}          %The following makes Telugu the default language of the document,      %while setting English as the other language.           %"Lohit Telugu" and "Cantarell" fonts can be substituted with your favorite ones.          \usepackage{polyglossia}     \setmainlanguage{telugu}     \setmainfont{Lohit Telugu}     \setotherlanguage{english}     \newfontfamily{\TelSubstFont}{Cantarell}               %The following is a workaround to substitute the font or default latin characterset     %with an English one, since none of the current Telugu fonts contains that set.          \XeTeXinterchartokenstate=1     \newXeTeXintercharclass\TelSubst          \count255="0000     \loop\ifnum\count255<"007F       \XeTeXcharclass\count255=\TelSubst       \advance\count255 by 1     \repeat          \XeTeXinterchartoks 0 \TelSubst = {\begingroup\TelSubstFont}     \XeTeXinterchartoks 255 \TelSubst = {\begingroup\TelSubstFont}     \XeTeXinterchartoks \TelSubst 0 = {\endgroup}     \XeTeXinterchartoks \TelSubst 255 = {\endgroup}               \begin{document}          తెలుగు భారత దేశము లోని దక్షిణ ప్రాంతములోని `ఆంధ్రప్రదేశ్' రాష్ట్ర అధికార భాష. భారత దేశం లో తెలుగు మాట్లాడే      7.4 కోట్ల (2000 సంవత్సరపు లెక్కలు) జనాభాతో ప్రాంతీయ భాషలలో మొదటి స్థానం లోవుంది. ప్రపంచంలోని ప్రజలు       అత్యధికముగా మాట్లాడే భాషలలో పదమూడవ స్థానములోనూ, భారత దేశములో హిందీ తర్వాత రెండవ స్థానములోను      నిలుస్తుంది. 1997 లెక్కల ప్రకారం ప్రపంచవ్యాప్తంగా 6.97 కోట్లు మందికి పైగా మొదటి భాషగా మాట్లాడతారు. అతి     ప్రాచీన దేశ భాషలలో సంస్కృతము, తమిళములతో బాటు తెలుగు భాషను అక్టోబరు 31, 2008న భారత ప్రభుత్వము      చేర్చింది.          \end{document}


I appear to be having a problem with embedding images in a tabular enviroment. I getting the following error:               ! LaTeX Error: File `\unskip ' not found.      and here is the offending piece of code. The compiler points me to the line beginning with \multicolumn               \begin{figure}[H]     \centering       \begin{tabular}{@{}cc@{}}           \includegraphics[scale=0.22]{lig_nontp_align.png} &           \includegraphics[scale=0.22]{transporthist.png} \\         \multicolumn{2}{c}{\includegraphics[width=.23\textwidth]}       \end{tabular}       \caption{\textit{Left:} Non-transport and ligand proteins aligned to the ligand HMM model. \textit{Right:} the three different sub-types of transmembrane proteins aligned to the ligand HMM model. }     \end{figure}      I can find problems to do with "\unskip" form googling, but not quite in this capacity. what seems to be the problem? Thanks.


title: Insert a photo inline with some text and math environment (align)

text: I'm trying to get sth like: ![enter image description here](http://i.stack.imgur.com/RwNNk.jpg) I've been having problem with the picture-inline-with-text part. A little help please. The `wrapfigure` package (which is known to be better) doesn't work. Nothing is shown in the pdf output file. The `minipage` works to some extent, but its always on the left side. I couldn't change it by editing the position parameter. Since I'm not quite familiar with this one. Maybe it could work. Hum? The `floatflt` works, but its not compatible quite right with the math environment which means the equations is still in the middle of the page. And the photo is overprinted. The `cutwin` package is apparently for only paragraphs with pure text. `Textpos` is also not working with the math environment. Here is the code:               \documentclass[a4paper,10pt, reqno]{amsbook}     \usepackage{wrapfig}     \usepackage{graphicx}     \graphicspath{{d:/ImagesforProjectLatex/}}          \begin{document}          \begin{solution}     \begin{wrapfigure}{r}{0.5\textwidth}       \begin{center}         \includegraphics[width=0.48\textwidth]{1}       \end{center}       \caption{A gull}     \end{wrapfigure}%\paragraph{}     Then nabla is applied from the left          \begin{align}     \nabla\times\strain\times\nabla &=& \parn{\e_1\p_1 + \e_2\p_2 + \e_3\cancel{\p_3}}\times\brak{x_2\e_1\e_3+x_1\e_2\e_3}\notag\\     &=&\p_1\parn{x_1}\e_3\e_3 - \p_2\parn{x_2}\e_3\e_3 = \bff{0}\quad \surd     \label{eq:}     \end{align}     \end{solution}     \end{document}      There is nothing wrong with the math part. So, the problem is only the photo.


title: Is it possible to render a PDF in sepia tones?

text: Is it possible to render a PDF in sepia tones, both the font color and overall document background? Preferably using `pdflatex`. The final effect could be something like this screenshot of Pocket in sepia mode. ![Screenshot of Pocket app with sepia theme](http://i.stack.imgur.com/SFspI.jpg)


title: Problem in Algorithm Code

text: I am trying to complete my research paper in LaTeX but getting following three errors. I have tried so many things from the internet but to no advantage. Could any one help me please? **1)** > File ended while scanning use of \ELSIF.\par \input{proposed-scheme} **2)** > LaTeX Error: Not in outer par mode.See the LaTeX manual or LaTeX Companion > for explanation.Type H for immediate help.... \begin{algorithm}[t] **3)** > LaTeX Error: Command \ALC@lno already defined.Or name \end... illegal, see > p.192 of the manual.See the LaTeX manual or LaTeX Companion for > explanation.Type H for immediate help.... \begin{algorithmic}[1] Error type 3 is coming many times. Here is the working example of the algorithm.               \documentclass[10pt,a4paper]{IEEEtran}         \usepackage{algorithmic}         \usepackage{algorithm}              \begin{document}     \begin{algorithm}         \caption{Abc..}         \label{alg1}         \begin{algorithmic}[1]         \STATE Phase 1: Compute (abc)         \STATE abc         \FOR {condition}         \STATE Compute abc        \ENDFOR              \STATE Phase 2: Optimization (xyz)         \FOR {condition}     \STATE xyz             \IF {condition}         \STATE xyz             \ELSIF {condition}         \STATE xyz         \ENDIF         \ENDFOR         \STATE return xyz to Algorithm 1         \end{algorithmic}         \end{algorithm}         \end{document}


title: No paragraph in datatool's DTLforeach possible when using a textblock from textpos

text: I'd like to print labels using the datatool and the textpos packages. Yet as soon as I insert a paragraph inside the textbox which is inside the \DTLforeach loop, I get the "Paragraph ended before \DTLifnumeq was complete." error message. The following example compiles without error: File testdb.csv:               field1,field2,field3     row11,row12,row13     row21,row22,row23      File example01.tex:               \documentclass[11pt,a4paper]{article}     \usepackage[absolute]{textpos}     \usepackage{datatool}     \DTLloadrawdb{testdb}{testdb.csv}          \begin{document}         \DTLforeach*{testdb}{\addFieldi=field1}{%             \DTLifnumeq{\DTLcurrentindex}{1}{%                 \begin{textblock}{3}(1,1)                   \addFieldi                   more text.                 \end{textblock}%             }{}%         }     \end{document}      After inserting a paragraph after the \addFieldi command, the example (called example02.tex) does not compile anymore: File example02.tex:               \documentclass[11pt,a4paper]{article}     \usepackage[absolute]{textpos}     \usepackage{datatool}     \DTLloadrawdb{testdb}{testdb.csv}          \begin{document}         \DTLforeach*{testdb}{\addFieldi=field1}{%             \DTLifnumeq{\DTLcurrentindex}{1}{%                 \begin{textblock}{3}(1,1)                   \addFieldi                        more text.                 \end{textblock}%             }{}%         }     \end{document}      I couldn't find a solution on how to circumvent the error. Thanks a lot for your help!


title: How to remove end-if in algorithms

text: I am writing an algorithm in latex, but there are lots of `end-if` and `end- while`s in my algorithms which makes it un-professional and ugly. Is there a way to remove them from output of latex?               \IF{condition}             \IF{another condition}               \STATE do something               \STATE do something else           \ELSE               \STATE do it           \ENDIF     \ELSE           \IF{condition}               \STATE do something               \STATE do another thing           \ELSE               \IF{condition}                   \STATE function               \ENDIF           \ENDIF     \ENDIF


title: Manual bibliography

text: I need to create a manual bibliography, in order to follow very precise layout guidelines. Here's what I'm doing:               \begin{thebibliography}{111}     \raggedright          \bibitem{} Anscombe, E. 1981/1971. ``Causality and Determination,'' in        \emph{Metaphysics and the Philosophy of Mind: Collected Philosophical Papers of          G.E.M. Anscombe}. Minneapolis: University of Minnesota Press. 133--47.           \end{thebibliography}      However, this gives me square brackets with itemized numbers for each entry. I don't want this. I want flush left for first line, not itemization, and hanging lines indented, like a regular academic bibliography. That is what I'm required to do, at any rate. Advice?


title: Change color of itemize in beamer alertblock

text: How can I change the color of bullets in an `itemize` list within an `alertblock` in beamer? I use                 \setbeamercolor{itemize item}{<color>}      to set the color of the bullets throughout the document. But I want a different color when the bullets are inside an `alertblock` environment. I've tried               \setbeamercolor{block itemize item alerted}{<color>}      and               \setbeamercolor{block alerted itemize item}{<color>}      but neither seems to do anything. **Update:** This is not the same question as Custom beamer blocks. I want to modify the alertblock environment. I don't want to create a new environment.


title: How do I suppress the whitespace above an equation block at the page top?

text: How do I suppress the whitespace above the equation block at the page top ? It is added to the top margin, and I don't want that to happen. I know that `\abovedisplayshortskip` controls this for the whole document, but how can I change this for this particular equation block and NOT for any others ? Negative `vspace` doesn't work.               \documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}     \usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}             \usepackage{babel}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{empheq}          \begin{document}          \abovedisplayskip=6pt     \abovedisplayshortskip=3pt % This should NOT be changed     \belowdisplayskip=6pt     \belowdisplayshortskip=3pt          \begin{equation*}     \left.\begin{array}{r}     a_{31}'=a_{11}\cdot a_{31}-a_{31}\cdot a_{11}=0\\     a_{32}'=a_{11}\cdot a_{32}-a_{31}\cdot a_{12}\\     a_{33}'=a_{11}\cdot a_{33}-a_{31}\cdot a_{13}\\     a_{34}'=a_{11}\cdot a_{34}-a_{31}\cdot a_{14}\\     b_{3}'=a_{11}\cdot b_{3}-a_{31}\cdot b_{1}     \end{array}\!\!\right\}     \Longrightarrow\;     \begin{matrix*}[l]     \text{Pseudo-code :}\\     a_{11}\cdot b_{3}-a_{31}\cdot b_{1}\mapsto b_{3}\text{.}\\     \forall\;i\in\{4,3,2,1\} : a_{11}\cdot a_{3i}-a_{31}\cdot a_{1i}\mapsto a_{3i}\text{.} \end{matrix*}     \end{equation*}          \end{document}


title: Package ifpdf Error

text: I am trying to use amspset. Here is my minimum code:               \documentclass[12pt,letterpaper]{amspset}     \usepackage[margin=1in]{geometry}     \usepackage{graphicx}          % info for header block in upper right hand corner     \name{}     \class{}     \assignment{}     \duedate{}          \begin{document}     \end{document}      When compiling, there is an error:               ! Package ifpdf Error: Name clash, \ifpdf is already defined.      I was wondering why and how to solve the problem? Thanks!


**What practices are there regarding the use or avoidance of "internal" TeX or LaTeX commands?** (About "command" vs "macro", there is some discussion in this TeX.SX answer, though I don't know whether this is the last word.) The _Guide to LaTeX_ (4th ed.) writes this (D.1.3, pp. 429-430): > [P]rimitive TeX commands [should] be shunned[.] [...] [That] primitive TeX > commands might be removed from a future LaTeX version [...] is not really > the point. [...] In spite of the desirability of employing only official > LaTeX commands, there are many occasions when either the internal LaTeX > commands or the TeX primitives just must be used. The risk of future > incompatibility must be taken in order to have a workable package now. > However, one should not take this risk lightly where a high-level equivalent > is available. In D.1.2 (pp. 427-429) it writes > A question that confronts LaTeX programmers is to what extent the internal > LaTeX commands may be used in class and package files. There is always a > danger that such commands may vanish in later versions, since they have > never been documented in the official books [...]. and also distinguishes between different "levels" of commands: user commands, class and package commands, internal LaTeX commands, low-level TeX commands, internal private commands. (Again, this might not be the last word on the matter.)   * **Which internal TeX commands should be avoided?** For example, people universally agree that `\over` and `\choose` are superseded by `\frac` and `\binom`, respectively, and that `\atop` and `\above` should be equally avoided (use `\genfrac`).   * **Which internal LaTeX commands should be avoided?**   * **Which internal TeX commands can be considered widely used and unavoidable for the non-casual user?**   * **Which internal LaTeX commands can be considered widely used and unavoidable for the non-casual user?** A good description of TeX commands is David Bausum's excellent TeX reference. LaTeX2e is well-documented in `texdoc source2e` and `latex2e-help- texinfo`/`latex2e.pdf`. **What is an "internal" command anyway?** This concept seems to be rough around the edges for (La)TeX, especially with some package documentations encouraging the programmer to redefine "internal" commands for certain purposes. I think that avoidance of "internal" commands is also a matter of programming style (and of how pure and principled one wants to be). One view is that internal commands are those marked by an `@`, though the Guide to LaTeX's typology of commands (mentioned above) is finer-grained. For example, experienced user egreg ## _who has, this very day of 2013-Jul-11 UTC, surpassed the 200k mark for TeX.SX rep_ :-) writes that "in documents" `\nobreak`/`\allowbreak`/`\break` should be avoided whereas "in lower level programming" they're okay. But it's not like every command definition is lower-level programming. Which internals are more widely used, and which are taboo? If people use `\patchcmd` (which violates the programming principle of encapsulation/abstraction as much as is imaginable), it seems like nothing is off-limits.


title: Unwanted vertical space/glue between consecutive custom \section macro calls

text: I am using XeTeX. I need to redefine the \section and \subsection commands in order to use some macros which don't behave well with the `titlesec` and/or `sectsty` packages. I found some code to do this, which comes up repeatedly over the net, and which seems to originate from the `resume.sty` source {link here}. Despite the rather awful decision tree at the beginning, the actual code looks as you'd expect: put some glue, insert the section title, then some more glue, and get on with it, after suggesting where good and bad breaks would be. However, if I follow a `\section{foo}` call immediately by another `\section{bar}` or `\subsection{baz}`, it inserts too much whitespace/glue (the `\vskip-\lastskip` doesn't seem to 'grip'). I have also redefined `\subsection` in precisely the same fashion, but omitted it from the MWE here as the inbuilt command reproduces the behaviour exactly (easy enough to reconstruct if necessary by copy/paste/substitute). It would be wonderful if someone can either see the reason why the code does this, or provide an alternative way to place section headings that can:   * have some defined amount of leading (glue/whitespace) before and after (but remove the 'after' leading in between consecutive section/subsection calls)   * take other macros, which call, eg, `zpos` and `etoolbox`, and behave   * be extended to preserve the functionality of the MWE below (the ' _if starred this then if two args that_ ' tree, counter increments, and TOC updates, can be omitted from solutions, as they're trivial to build, but they are ultimately necessary to include) Apologies for drawn out MWE, but I've commented the code to try to explain what's going on (I've left the full code in, as mutations of it _do_ appear all over, and people with a similar problem might use the long and rather unique macro names, which tend not to change between examples, to winnow down Google results: I did). ## Illustrations The image on the left is what is produced by the MWE code below. The image on the right uses the exact same document content, using the inbuilt `\section` definition, and is the desired behaviour for the redefined command (ignore actual text size, weight, etc, the problem is the leading). ![MWE Image](http://i.stack.imgur.com/0cWpQm.png) ![Fixed image](http://i.stack.imgur.com/eZYL9m.png) ## MWE code               \documentclass{article}          \makeatletter     %We want to take a minimum of one command, with an optional command which holds     %a different title for the TOC; if starred, then don't insert number     %So, numbered or not?     \def\section{\@ifstar\unnumberedsection\numberedsection}     %One or two args?     \def\numberedsection{\@ifnextchar[%]%     \numberedsectionwithtwoarguments\numberedsectionwithoneargument}     \def\unnumberedsection{\@ifnextchar[%]%     \unnumberedsectionwithtwoarguments\unnumberedsectionwithoneargument}     %If one arg, duplicate it to make two, so only one set of commands needs be     %written     \def\numberedsectionwithoneargument#1{\numberedsectionwithtwoarguments[#1]{#1}}     \def\unnumberedsectionwithoneargument#1{\unnumberedsectionwithtwoarguments[#1]{#1}}          % Unstarred case, ie insert number:     \def\numberedsectionwithtwoarguments[#1]#2{%     %Check that previous paragraph ends sanely     \ifhmode\par\fi%     %Remove previous glue, to avoid huge spaces     \vskip-\lastskip%     %Insert some glue to separate heading; here's a good place to break the page     \vskip 3ex\@plus 1ex \@minus 0.5ex\goodbreak%     %Increment section number counter     \refstepcounter{section}%     %Insert formatted heading command here (plus number)     %In my actual usage, it has some other formatting macros, but this MWE reproduces     %the problem, so I know it's not them causing it     \begingroup \parindent=0pt {\Large \bfseries \thesection\  #2}     %We don't want to separate the heading from the text which follows     \nobreak\endgroup%     %Let it breathe a bit!     \vskip 2ex\@plus 0.67ex \@minus 0.5ex%     %No, we still /really/ don't want to separate it; nor indent the para which     %follows     \nobreak\noindent%     %Add it to the TOC     \addcontentsline{toc}{section}{%     \protect\numberline{\thesection}%     #1}%     %For ease of use, disregard whether the text has a blank line following the call     %to '\section'     \ignorespaces}          %Do exactly the same with the unnumbered case, except don't include a number     %This is closer to the original code I found, so can be used to verify it's none     %of my modifications, eg stretch and squeeze on vskips     \def\unnumberedsectionwithtwoarguments[#1]#2{%     \ifhmode\par\fi     \removelastskip     \vskip 3ex\goodbreak     %Insert formatted heading command here without number     \begingroup \parindent=0pt {\Large \bfseries #2}\par%     \nobreak\endgroup%     \vskip 2ex\nobreak\noindent%     \addcontentsline{toc}{section}{%     #1}%     \ignorespaces}     \makeatother          \begin{document}          \section{A new section}     \ldots which behaves as it should.          \subsection{A new subsection}     \ldots which also behaves, but:          \section{A new section}     \subsection{followed immediately by a subsection}     \ldots inserts too much white space.          \section{Two sections}     \section{One after the other}          \section*{Verify unnumbered}     \subsection*{Also a problem}          \section*{And check unnumbered without following subsection}     \noindent\ldots which is fine.  The fact that the subsection -- section     combination works suggests perhaps a problem with the final vskip in the macro?     \end{document}


title: Add phantom section to Beamer TOC

text: In preparing my a presentation for my thesis defense, there is obviously way more material in my thesis than what I can cover in my presentation. Using the toc command,               \tableofcontents[hideallsubsections]      for the main toc, as expected, displays the sections with subsections hidden:   * Motivation   * Attitude Review   * Heading Estimation   * Hover Control   * Conclusions I would like to add a phantom section to just the main toc that doesn't get added to the navigation at the top (I'm using the compress option for the beamer package) and is shaded or set off somehow to show that I've done something on it, but am not going to address it in the presentation, something like   * Motivation   * Attitude Review   * Heading Estimation   * Hover Control   * _Wind Analysis_   * Conclusions This post is similar, but the solution given there doesn't seem to do what I'm looking for. Any ideas?


title: IEEE style giving error in Biblatex

text: I've been have a really hard time getting the IEEE style for `biblatex` to work. If someone could tell me what I'm doing wrong that would be great. I've installed the publishing packages suggest here. I get the error:               !Package biblatex Error: Style 'IEEEtran` not found      Here is what my `.tex` file looks like               \usepackage[stye=IEEEtran}{biblatex}     ...     \bibliography{reference.bib}      and               \usepackage{stye=IEEEtran}{biblatex}     \addbibresource{reference.bib}     ....     \printbibliography      I have also tried `style=ieee`, `style=ieeetr`, etc. Any help would be appreciated. I'm on Ubuntu 12.04 if that helps.


title: Heading of paragraph on left side

text: I want to list something in my document. Each point in the list has a short heading (one word, for example "Usecase"). This word should be on an own column to the left of the text which gets added under this point. The text is rather long. Doing this with a table doesn't work, as tables do not support this if the whole stuff goes multipage. I know longtable, but longtable puts the whole text (the right side) into one row. If I do `\begin{longtable}{l|p{\textwidth}}` or something like that, it kind of sucks, too. (as you can see in the code snippet above, I want to seperate the "heading"/name of the section with a vertical line from the text) Adjusting manually the size of the text on the right doesn't seem to be a nice solution. Anyways, if this works, the text for one item isn't able to be a multipage text either. So, I hope I made clear what my problem is. The point is, I don't even know what to google.


title: How to hide other SubSubsections in sidebar of beamerclass?

text: I make a translation of a 600 pages Book with the beamer class in Latex, so I have lots of Subsections and SubSubsections. I want to show all subsections of the current Section in the sidebar along with all the subsubsections of the CURRENT subsection. I came across a hint and made               \setbeamertemplate{subsubsection in sidebar shaded}     {\vspace*{-\baselineskip}}      But that just hides all subsubsections but the current one. The best solution would be something like               \setbeamertemplate{subsubsection in sidebar shaded}[subsubsectionstyle=show/shaded/hide]      or any other way i can change the subsubsectionstyle. The best idea I had was               \setbeamertemplate{subsubsection in sidebar shaded}     {\tableofcontents[subsubsectionstyle=show/shaded/hide]}      But that just creates over 3000 errors and didn't solved my problem . Is there anybody who has an idea to solve this Problem ? Here is a MWE to show what i mean:                   \documentclass[9pt]{beamer}          \usetheme[hideothersubsections]{Goettingen}          \begin{document}          \section{Section 1}     \begin{frame}     \frametitle{Section 1}     \end{frame}          \subsection{Subsection 1.1}     \subsubsection{SubSubsection1.1.1}     \begin{frame}     bla     \end{frame}     \subsubsection{SubSubsection 1.1.2}     \begin{frame}     bla     \end{frame}          \subsection{Subsection 1.2}     \subsubsection{SubSubsection1.2.1}     \begin{frame}     bla     \end{frame}     \subsubsection{SubSubsection 1.2.2}     \begin{frame}     bla     \end{frame}          \section{Section 2}     \begin{frame}     \frametitle{Section 2}     \end{frame}          \subsection{Subsection 2.1}     \subsubsection{SubSubsection2.1.1}     \begin{frame}     bla     \end{frame}     \subsubsection{SubSubsection 2.1.2}     \begin{frame}     bla     \end{frame}          \subsection{Subsection 2.2}     \subsubsection{SubSubsection2.2.1}     \begin{frame}     bla     \end{frame}     \subsubsection{SubSubsection 2.2.2}     \begin{frame}     bla     \end{frame}     \end{document}      And one page of the output is: ![enter image description here](http://i.stack.imgur.com/ZkSgf.png) As you can see, with the option [hideothersubsections] in \usetheme[hideothersubsections]{Goettingen} subsections outside the current section are not shown in the sidebar. I want the same effect for the subsubsections with regard to subsections. So Subsubsection1.2.1 and SubSubsection1.2.2 should not be seen in the sidebar, because im in subsection 1.1 Therefore it should looks like this: ![enter image description here](http://i.stack.imgur.com/oSskQ.png) And when my slides move on and the subsections changes (from subec 1.1 to subsec 1.2), then the displayed subsubsection shall also change. It then should looks like this: ![enter image description here](http://i.stack.imgur.com/iT8KG.png) Of course the space between subsec 1.1 and subsec 1.2 should disappear.


title: Text across two pages

text: ![example](http://i.stack.imgur.com/AbM3d.jpg) I am making a small book and I want to put a phrase in both pages like the picture above, I want to keep the chapter title and page numbers. Could you give me a hand on this?


title: SQL Markup and CSV Formatting in LaTeX

text: I have had a quick look for similar questions but I couldn't find anything, so apologies if this is a duplicate. Firstly, I am looking for a way to grab information from external source files (i.e. `query1.sql`) which will then be formatted with language-specific highlighting (SQL in this case). Secondly, I would like to grab information from an external csv file and have it formatted into a table. I am using external files so that they can be updated automatically by an Automated Build process so that we have documentation that is always up to date. As an example, I am looking for something like this: Using the below script:               select *     from table;      We receive the output:               1 | 2 | 3     _________     a | b | c     d | e | f


title: chapter heading page numbers

text: I know this has been covered but I can't get any solutions that I've seen to work. Page numbers for my thesis are upper right but the first page of each chapter should have it bottom center. I tried using ERT (in LYX) `\thispagestyle{plain}` and also loading `\usepackage{sectsty}` and then using `\chapterfont{\pagestyle{plain}}` after the chapter heading. I looked at Modifying plain page style and questions on changing position of page number on the first page of every chapter of a book and page number position I'm using the class from CU Boulder EDIT: I don't go to CU but I am trying to use the class for my thesis.


title: How does one detect whether one is in the preamble or not?

text: > In LaTeX, I'd like to know whether a documentclass has been loaded and > whether code is inside a `\begin{document}`. In other words, is there a > **`\ifpreamble`** similar to `\ifvmode` and friends? Partially this is curiosity, partly this is to make it easy to compile a figure as a standalone or included in some larger document. In the past I've made the including document define a macro, and the figure tests for it, but it'd be nice if the figure could figure it out itself. Things that don't work (because they aren't changed by `\documentclass` or `\begin{document}`):   * `\ifvmode` is true immediately   * `\@currenvir` is "document" immediately   * `\normalsize` is defined immediately


title: Free intermediate level documentation

text: Are there any free manuals that are roughly on the level of Lamport, Mittelbach & Goossens, Kopka & Daly, etc.; more in-depth than the Not So Short Introduction to LaTeX, but not as daunting as source2e.pdf?


title: How to prevent extra spaces between two specific words when justification occurs?

text: My document contains many short, justified lines, so the lines often appear with many spaces between words, e.g.:               These    words    have    a    space     so that they can fit nicely into the     available line.      In most situations, this is no problem, however, there are some select situations where I want a group of two or more words to appear together, even if other words in the lines are pulled apart, e.g., with "these words" linked:               These words     have     a     space     so that they can fit nicely into the     available line.      How can this be done? I'm looking for either a ConTeXt or TeX solution.


title: Adding parentheses around subfig references

text: Say I have a figure with two subfloats inserted using the `subfig` package. When I reference them with `\ref{myLabel}` I get this > Figure 3.5a and 3.5b. But what I want is this: > Figure 3.5(a) and 3.5(b). How can I add the parentheses?


title: How to vertically align 3 images with subfigure?

text: This code:               \begin{figure*}[t]     \begin{center}             \begin{subfigure}[a]{0.3\textwidth}                     \label{im:device_front}             \includegraphics[width=\textwidth]{images/bsn_side}             \caption{a) Frontal view of the sensor system}         \end{subfigure}                     \quad             \begin{subfigure}[b]{0.3\textwidth}                     \label{im:device_schuin}             \includegraphics[width=\textwidth]{images/bsn_front}             \caption{b) Perspective view of the sensor system}         \end{subfigure}                  \quad         \begin{subfigure}[b]{0.25\textwidth}                     \label{im:device_side}             \includegraphics[width=\textwidth]{images/bsn_schuin}             \caption{c) Side view of the sensor system}         \end{subfigure}      \caption{Overview of the system as worn by the subjects}     \label{default}     \end{center}     \end{figure*}      produces result: ![enter image description here](http://i.stack.imgur.com/bVAmf.png) But I want them to be horizontally aligned. How can I do this?


title: \includemedia does not play video but remains blank

text: I would like to have a video in my pdf that plays when you click on it. When the video is not playing it should show a figure. When I compile my pdf I do get a figure that I can click on, but it turns blank when I click on it, and no video plays. I don't get any errors either. This is my code:               \usepackage{media9} %this is specified somewhere at the start of the file          \includemedia[label=videofile, width=1.0\textwidth, addresource=./Videos/videofile.mp4,     flashvars={source=./Videos/videofile.mp4}]{\includegraphics[width=1.0\textwidth]     {./Figures/picture}}{VPlayer.swf}


title: Use listings with different languages in same code block

text: My goal is to have a somewhat large verbatim block and use listings to give syntax highlighting to only particular parts. Here's a toy example:               \begin{verbatim}     How to include files in:      C:      #include <stdlib.h>      C++:    #include <iostream>      python: import math, from math import exp      Java:   import java.util.arraylist;     \end{verbatim}      which should become               \begin{lstlistings}[myoptions]     How to include files in:      C:      \lstuselanguage{c}{#include <stdlib.h>}      C++:    \lstuselanguage{c++}{#include <iostream>}      python: \lstuselanguage{python}{import math, from math import exp}      Java:   \lstuselanguage{java}{import java.util.arraylist;}     \end{lstlistings}      where `\lstuselanguage` is some sort of command that does syntax highlighting in the specified language. Is this possible? (In LaTeX, all things are possible, so I guess what I mean is: "how hard is this?")


title: Using Latex in Matplotlib plot title/axis label

text: Sorry if this is a repost; I'm sure this question gets asked often but I couldn't find exactly what I was after in the search. I'm trying to write a scientific plotting program in matplotlib (using python 2.7) and I'm having trouble getting it to recognise LaTeX code the way I expect. On the matplotlib site, there is an example which works perfectly on my machine (Ubuntu 12.04):                   from matplotlib import rc     from numpy import arange, cos, pi     from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \          grid, savefig, show               rc('text', usetex=True)     rc('font', family='serif')     figure(1, figsize=(6,4))     ax = axes([0.1, 0.1, 0.8, 0.7])     t = arange(0.0, 1.0+0.01, 0.01)     s = cos(2*2*pi*t)+2     plot(t, s)          xlabel(r'\textbf{time (s)}')     ylabel(r'\textit{voltage (mV)}',fontsize=16)     title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",           fontsize=16, color='r')     grid(True)     savefig('tex_demo')               show()      But when I try and apply the concepts from this to my existing code, things go awry. My code is reading in values from a text file to use as strings for the titles and axes for a series of subplots. the text file looks like this only one line break per line in the original: > Example \texit{plot title} > > x label > > y label So I'm expecting everything to be ordinary except "plot title", which should be italic. Here is the function that I have written:               from matplotlib import rc          ...     def plot_graphic(formatting_file):         rc('text', usetex=True)         rc('font', family='serif')         formatting = open(formatting_file)         data = formatting.readlines()         title_text = data[0]         sup_title_size = 20         title_size = int(0.75*sup_title_size)         x_axis_label = data[1]         y_axis_label = data[2]         plt.subplot(224)         plt.plot(n.x, o, n.x, s, "r")         plt.title("Original and Smoothed Data", fontsize=title_size)         plt.xlabel(x_axis_label)         plt.ylabel(y_axis_label)         plt.subplot(221)         plt.plot(n.x, o)         plt.title("Original Data", fontsize=title_size)         plt.xlabel(x_axis_label)         plt.ylabel(y_axis_label)         plt.subplot(223)         plt.plot(n.x, s, "r")         plt.title("Smoothed Data", fontsize=title_size)         plt.xlabel(x_axis_label)         plt.ylabel(y_axis_label)         plt.subplot(222)         plt.plot(gx, gy, "k.-")         plt.title("Smoothing Window", fontsize=title_size)         plt.xlabel(x_axis_label)         plt.ylabel("Window Function")         plt.suptitle(title_text, fontsize=sup_title_size)         plt.subplots_adjust(wspace=0.3)         plt.show()         formatting.close()      Where "formatting_file" is a string (path to the file with the above contents), and everything works as expected without the Tex formatting attempt (if I remove the lines starting with rc). When I run this, however, I get a wall of tracebacks ending with:               RuntimeError: LaTeX was not able to process the following string:     ''     Here is the full report generated by LaTeX:           This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)     entering extended mode     (./65d362bbbe189488f3ed27a3ef3526ff.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, loaded.     (/usr/share/texmf-texlive/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf-texlive/tex/latex/base/size10.clo))     (/usr/share/texmf-texlive/tex/latex/type1cm/type1cm.sty)     (/usr/share/texmf-texlive/tex/latex/psnfss/helvet.sty     (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty))     (/usr/share/texmf-texlive/tex/latex/psnfss/courier.sty)     (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty     (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def))     (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty     (/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)          Package geometry Warning: Over-specification in `h'-direction.         `width' (5058.9pt) is ignored.               Package geometry Warning: Over-specification in `v'-direction.         `height' (5058.9pt) is ignored.          ) (./65d362bbbe189488f3ed27a3ef3526ff.aux)     (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd)     (/usr/share/texmf-texlive/tex/latex/psnfss/ot1pnc.fd)     *geometry auto-detecting driver*     *geometry detected driver: dvips*     (./65d362bbbe189488f3ed27a3ef3526ff.aux) )     No pages of output.     Transcript written on 65d362bbbe189488f3ed27a3ef3526ff.log.      It boils down to this: I don't have a lot of experience with LaTeX, but I'm trying to learn, so I don't understand these errors. I don't understand why my code doesn't work when it doesn't seem to be an awful lot different from the example which does. For reference, I have also tried this on an x86 Windows 7 machine with the same result. What am I missing? * * * EDIT: I suppose the code snippet I supplied for my example is excessively long. A shorter, simpler version would be along these lines:               import matplotlib.pyplot as plt     from matplotlib import rc          rc('text', usetex=True)     rc('font', family='serif')          data = ["Example \texit{plot title}\n", "x label", "y label"]     title_text = data[0]     x_axis_label = data[1]     y_axis_label = data[2]          plt.plot([1,2,3,4],[1,2,3,4])     plt.title(title_text)     plt.xlabel(x_axis_label)     plt.ylabel(y_axis_label)     plt.show()


title: pdfx - package leads to non-working hyperref links

text: I want to produce a PDF/A-1b compliant document. I am using pdflatex (MikTex 2.9) and TeXnicCenter. On the web, I've read that the "pdfx" package is the best way to do this. I installed pdfx according to the instruction on the web and it seems to be working. However, as soon as I start to implement "`\usepackage[a-1b]{pdfx}`" into my tex-file, the links in my document do not longer work, i.e. I cannot click on the link to switch to the destination of it, e.g. for referencing sections or citing bibliography entries. Looking at "pdfx.sty" revealed that the "hyperref" package is loaded with the option "draft":               \RequirePackage[draft,pdftex,pdfpagemode=UseNone,bookmarks=false]{hyperref}      I tried to change this option using `\hypersetup{final}`, but this did not work. I also tried changing the corresponding line in "pdfx.sty" directly to               \RequirePackage[final,pdftex,pdfpagemode=UseNone,bookmarks=false]{hyperref}      but this didn't work either (I updated the Miktex file name database before I ran pdflatex). Also, changing the link-appearence, e.g. its color, cannot be manipulated either (see example). Could someone please tell me if it's possible to have working links within a pdf document that has been created with the "`\usepackage[a-1b]{pdfx}`" command? Here's an MWE:               \documentclass{book}          \usepackage[a-1b]{pdfx}     \usepackage{lipsum}          % Appearance of links cannot be manipulated     \hypersetup{linkcolor = {0 0 1}}          % Activating "Final" option does not influence links     \hypersetup{final = true}          \begin{document}          \chapter{Dummy title 1}     \label{label_1}     \lipsum          \chapter{Dummy title 2}     Make reference to chapter \ref{label_1}          \end{document}


title: Splitting TOC into two columns on single frame in beamer

text: I am doing a presentation but my table of content is too long with short titles for a single slide. I was wondering if there was a way such that the table of contents appears on two columns. Related question for too long TOC: Breaking table of contents between frames in beamer