title: Remove bibliography title indentation in ClassicThesis with multibib

text: I use the `multibib` package to manage multiple bibliographies within a document adopting the `classicthesis` style. I would like to remove the indentation that is automatically placed before each bibliography title, so that the title results aligned with the list of references. Any idea how do I do that? Here follows a `MWE`:               \documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,                 footinclude=true,cleardoublepage=empty,%                 BCOR=5mm,paper=a4,fontsize=11pt,%                 ngerman,american,%                 ]{scrreprt}          \input{classicthesis-config}          \usepackage{lipsum}          \usepackage[labeled,resetlabels]{multibib}     \newcites{B}{Books}     \newcites{J}{Journals}     \newcites{S}{Standards}          \begin{document}     \selectlanguage{american}     \pagenumbering{roman}     \pagestyle{plain}               \pdfbookmark[1]{Publications}{Publications}     \chapter*{Publications}          \bigskip          \noindent          \begingroup     \renewcommand*{\chapter}[2]{\spacedlowsmallcaps{\bibname}}          \nociteJ{Akyildiz2002}     \bibliographystyleJ{IEEEtran}     \bibliographyJ{IEEEabrv,Bibliography}          \bigskip          \nociteB{Gibson96}     \bibliographystyleB{IEEEtran}     \bibliographyB{IEEEabrv,Bibliography}          \bigskip          \nociteS{IEEESTD1588}     \bibliographystyleS{IEEEtran}     \bibliographyS{IEEEabrv,Bibliography}          \endgroup          \pagestyle{scrheadings}     \cleardoublepage          \pagenumbering{arabic}          \chapter{Some Stuff}     \lipsum[1-2]          \section{Section}     \lipsum[3-4]          \chapter{Some Other Stuff}     \label{ch:introduction}     \lipsum[4-10]          \section{Section}     \lipsum[3-4]          \subsection{Subsection}     \lipsum[33]          \cleardoublepage          \manualmark     \markboth{\spacedlowsmallcaps{\bibname}}{\spacedlowsmallcaps{\bibname}}      \refstepcounter{dummy}     \addtocontents{toc}{\protect\vspace{\beforebibskip}}     \addcontentsline{toc}{chapter}{\tocEntry{\bibname}}     \bibliographystyle{IEEEtran}     \label{app:bibliography}     \nocite{Akyildiz2002,Bulusu2000,Krach2008,Kwak2010}      \bibliography{Bibliography}          \end{document}      The `Bibliography.bib` file used to test the above MWE contains the following records:                   % This file was created with JabRef 2.8.1.         % Encoding: UTF8              @ARTICLE{Akyildiz2002,           author = {Akyildiz, I. F. and Weilian Su and Sankarasubramaniam, Y. and Cayirci,             E.},           title = {{A} {S}urvey on {S}ensor {N}etworks},           journal = IEEE_M_COM,           year = {2002},           volume = {40},           pages = {102--114},           number = {8},           month = aug,           doi = {10.1109/MCOM.2002.1024422},           issn = {0163-6804},           keywords = { protocols, radio networks, sensors CSMA, carrier sense multiple access,             data processing, health, home applications, hybrid TDMA/FDMA-Based,             low-cost sensor networks, military applications, multifunctional             sensor nodes, protocol stack layer, research, sensor networks, wireless             communications, wireless electronics},           timestamp = {2012.10.05}         }              @ARTICLE{Bulusu2000,           author = {Bulusu, N. and Heidemann, J. and Estrin, D.},           title = {{GPS}-less {L}ow-{C}ost {O}utdoor {L}ocalization for {V}ery {S}mall             {D}evices},           journal = IEEE_M_PCOM,           year = {2000},           volume = {7},           pages = {28--34},           number = {5},           month = oct,           doi = {10.1109/98.878533},           issn = {1070-9916},           keywords = {geophysical equipment, geophysical techniques, microsensors, radio             direction-finding, radio networksGPS-less low-cost outdoor localization,             RF communications, connectivity metric method, cost, environmental             monitoring, experimental results, form factor, localization techniques,             microsensors, network nodes, periodic beacon signals transmission,             power constraints, separation distance, soil monitoring, transmission             range, very small devices, water monitoring, wireless networks, wireless             sensor nodes},           timestamp = {2012.10.05}         }              @ARTICLE{Dardari2009,           author = {Dardari, D. and Conti, A. and Ferner, U. and Giorgetti, A. and Win,             M. Z.},           title = {{R}anging {W}ith {U}ltrawide {B}andwidth {S}ignals in {M}ultipath             {E}nvironments},           journal = IEEE_J_PROC,           year = {2009},           volume = {97},           pages = {404--426},           number = {2},           month = feb,           doi = {10.1109/JPROC.2008.2008846},           issn = {0018-9219},           timestamp = {2012.10.05}         }              @BOOK{Gibson96,           title = {{T}he {M}obile {C}ommunication {H}andbook},           publisher = {CRC Press},           year = {1996},           author = {Gibson, J. D.},           address = {New York},           edition = {1st},           month = feb,           timestamp = {2012.10.05}         }              @INPROCEEDINGS{Krach2008,           author = {Krach, B. and Robertson, P.},           title = {{I}ntegration of {F}oot-mounted {I}nertial {S}ensors into a {B}ayesian             {L}ocation {E}stimation {F}ramework},           booktitle = {{P}roc.\ 5th {W}orkshop on {P}ositioning, {N}avigation and {C}ommunication             ({WPNC} 2008)},           year = {2008},           pages = {55--61},           address = {Hannover, Germany},           month = mar,           timestamp = {2012.10.05}         }              @INPROCEEDINGS{Kwak2010,           author = {Myungkyun Kwak and Jongwha Chong},           title = {{A} new {D}ouble {T}wo-{W}ay {R}anging {A}lgorithm for {R}anging             {S}ystem},           booktitle = {{P}roc.\ 2nd {IEEE} {I}nternational {C}onference on {N}etwork {I}nfrastructure             and {D}igital {C}ontent ({IC}-{NIDC} 2010)},           year = {2010},           pages = {470--473},           address = {Beijing, China},           month = sep,           timestamp = {2012.10.05}         }              @BOOK{Rappaport1996,           title = {{W}ireless {C}ommunications -- {P}rinciples and {P}ractice},           publisher = {Prentice Hall PTR},           year = {2001},           author = {Rappaport, T. S.},           address = {Upper Saddle River, NJ},           edition = {2nd},           month = dec,           timestamp = {2012.10.05}         }              @STANDARD{IEEESTD1588,           title = {{IEEE} {S}tandard for a {P}recision {C}lock {S}ynchronization {P}rotocol             for {N}etworked {M}easurement and {C}ontrol {S}ystems},           organization = {IEEE},           institution = {IEEE},           month = jul,           year = {2008},           __markedentry = {[paolo:]},           doi = {10.1109/IEEESTD.2008.4579760},           journal = {{IEEE} {S}tandard 1588-2008 ({R}evision of {IEEE} {S}tandard 1588-2002)},           pages = {1--269},           timestamp = {2012.10.05}         }


title: Access defined Lua global variables in TeX macros

text: I am a newbie in LuaTeX, but it is very interesting. Sometimes, I need process some macro arguments by Lua code, so it will be useful that if we can access the variables defined in Lua. An example:               \def\foo#1{%       \directlua{var = [[#1]] .. " " .. system}       % other part of this macro       ...}          \foo{typesetting}          \bye      how can I access the `var` defined in the `\directlua`? Say, after `\foo{typesetting}`, I can get `typesetting system` by only using the `var`. * * * Another question is that `how can I access the TeX command in \directlua environment`?


title: Style same type of element throughout document

text: I am new to Latex and am wondering if there exists anything like a `class` in HTML. I have been writing a bunch of documents lately and all my `\item`s have needed to be _italized_ , is there some way to indicate at the beginning of the file how to style `\item`s without have to do:               \item \texit{.........................}      \item \texit{.........................}      \item \texit{.........................}      \item \texit{.........................}      \item \texit{.........................}      \item \texit{.........................}       over and over again?


title: pgfplots: Read expression from file

text: For my lab reports I often have to do complex fitting and transformations to my data (like fitting cauchy distributions or FFT). Fitting with `gnuplot` sometimes fails and including it directly in the `\addplot`-command is a real pain. For example I can't set different linetypes for different plots in               \addplot gnuplot[raw gnuplot] {       plot sin(x), cos(x);     }      They will both have the same linetype. So if I do complex fitting, I can't do it within one `\addplot` command, which forces me to repeat all variables and stuff. That's why I want to fall back to external fitting. Therefore it would be very useful, if one was able to read a mathematical expression from a file, e.g.               \addplot expression[from file] {math.dat}      where `math.dat` yields the expression in the expected format. Is that possible with the current versions of `pgfplots`?


title: fit tikzpicture to page width or height (using macros)

text: I have a new environment defined that fits tikzpicture to the page width, but when tikzpicture is long in height the bottom part of the tikzpicture is cut and extra blank page appears because of the jump of the tikzpicture to the next page. ![enter image description here](http://i.stack.imgur.com/Ege6y.jpg) I want to find _scalewidth_ and _scaleheight_ parameters (a scale ration to fit page width and a scale ration to fit page height, respectively) and choose the smaller one for scaling in order to guarantee full appearance of tikzpicture. Could you tell me how to modify the `scaletikzpicturetowidth` environment to achieve this?                 \NewEnviron{scaletikzpicturetowidth}[1]{%       \def\tikz@width{#1}     % what does this do?       \def\tikzscale{1}   %declares tikzscale parameter        \begin{lrbox}{\measure@tikzpicture}    % BODY is saved in measure@tikzpicture           \BODY       \end{lrbox}%       \pgfmathparse{#1/\wd\measure@tikzpicture}    % a scale ratio = page_width/tikzpic_width       \edef\tikzscale{\pgfmathresult}  % tikzscale = a scale ration        \BODY     }      So, the environmet will take two arguments: `#1 = \textwidth` and `#2 = \textheight`, then it calculates `widthscale = #1/\wd\measure@tikzpicture` and `heightsacle = #2/\ht\measure@tikzpicture`, and `\tikzscale = min(widthscale, heightsacle)`               \documentclass[landscape]{article}     \setlength\textwidth{10in}     \setlength\textheight{8.5in}     \setlength\oddsidemargin{-.5in}     \setlength\evensidemargin{-.5in}     \setlength\topmargin{-.7in}     \setlength\headsep{0in}     \setlength\headheight{0in}     \setlength\topskip{0in}     \usepackage{tikz-qtree-compat}     \usepackage{environ}     \makeatletter     \newsavebox{\measure@tikzpicture}     \NewEnviron{scaletikzpicturetowidth}[1]{%       \def\tikz@width{#1}%       \def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%       \BODY       \end{lrbox}%       \pgfmathparse{#1/\wd\measure@tikzpicture}%       \edef\tikzscale{\pgfmathresult}%       \BODY     }     \makeatother     \begin{document}       \begin{scaletikzpicturetowidth}{\textwidth}       \begin{tikzpicture}[scale=\tikzscale, baseline=0pt, grow=down]         \tikzset{level distance = 25pt, sibling distance = -5pt}         \tikzset{every tree node/.style={align=center,anchor=north}}         \Tree           [. \node{ $s$};             [. \node{\begin{tabular}{c}                     \texttt{run}\\                     \textbf{run}\\                     \normalsize{na}\\                     \scriptsize{na}\\                     \scriptsize{na}\\                     \end{tabular} }; ]             [. \node{\begin{tabular}{c}                  \textbf{$X_{3109}$}\\                \end{tabular} };             ]           ]       \end{tikzpicture}       \end{scaletikzpicturetowidth}       \clearpage       \begin{scaletikzpicturetowidth}{\textwidth}       \begin{tikzpicture}[scale=\tikzscale, baseline=0pt, grow=down]         \tikzset{level distance = 25pt, sibling distance = -5pt}         \tikzset{every tree node/.style={align=center,anchor=north}}         \Tree           [. \node{ $np$};             [. \node{\begin{tabular}{c}                     \texttt{some}\\                     \textbf{some}\\                     \normalsize{na}\\                     \scriptsize{na}\\                     \scriptsize{na}\\                     \end{tabular} }; ]             [. \node{\begin{tabular}{c}                     \texttt{girl}\\                     \textbf{girl}\\                     \normalsize{na}\\                     \scriptsize{na}\\                     \scriptsize{na}\\                     \end{tabular} }; ]           ]       \end{tikzpicture}       \end{scaletikzpicturetowidth}       \clearpage     \end{document}


title: circuitikz: error: cannot use all symbols

text: I cannot use all symbols for examble I want to use an thR resistor. In the old version of circuit there was no thR, but in Version 0.3.0 there is one. But I allways get an error when compiling. Somebody knows how to solve this problem? Or must a special library for tikz loaded, if I use circuitikz My MWE:               \documentclass{article}     \usepackage[]{circuitikz}     \usepackage{tikz}     \usepackage{verbatim}     \begin{document}     \begin{circuitikz} \draw     (0,0) to [thR, o-o] (2,0)     ;\end{circuitikz}     \end{document}


title: Read single numbers from data file (LuaLaTeX)

text: Is it possible to read a number from data files? How to read a file with luatex I found the example above but I don't need the whole line at once. I need somthing like:               read(file)     get(A)     get(B)     X=A+B     print(X)      Sorry for my bad English. :) * * * Here is my example but it doesnt work :/               \documentclass{scrartcl}     \usepackage{luatextra}     \usepackage{filecontents}           \begin{luacode}       function addplot()       filename = "testdata.dat"       tex.print('\\addplot coordinates {')       for line in io.lines(filename) do       local tab = string.explode(line)       x=tab[1]       y=math.log10(tab[2])       tex.print('('..x..','..y..')')      end      tex.print('};')      end     \end{luacode}          \begin{document}     \begin{tikzpicture}     \begin{axis}          \directlua{addplot()}          \end{axis}     \end{tikzpicture}     \end{document}      Removing the `\\` doesnt work.


title: How to not have widows and orphans without using raggedbottom

text: I know I can set `\clubpenalty` and `\widowpenalty` to 10 000 to make them “really bad”, but then TeX sees it equally bad to cut the page short when there is no vertical stretch (i.e. `\parskip=0pt`), and so I’m left with underfull pages often. The question is: Would it somehow be possible in those cases to instruct TeX to re-do the whole page, for example, trying to get it one line shorter or longer? (Not the page as in `\vsize`, but the typeset texts space requirements) Maybe this could be possible with LuaTeX? Or some clever output routine? ## Update OK so now, as per comments, I've played with the eTeX `\club-`/`\widowpenalties`. But either I don't understand how they work, or they do not help with the problem:               \font\bodyfont=cmr10 at 11bp \bodyfont          \frenchspacing     \parskip=0pt     \baselineskip=15bp     \topskip=15bp     \parindent=1em     \hsize=27pc     \vsize=525bp % 525 / 15 = 35, the number of lines          \clubpenalties=2 10000 0     \widowpenalties=2 10000 0     \looseness=1          \input a_novel     \bye      The pages are cut short when there would be a widow/orphan. ## References Jonathan Fines “Line breaking and page breaking” hints at a possible global optimisation via multiple passes. David Salomon writes in his book “The Advanced TeXbook” about “A global page- break algorithm”, but I cannot find the reference (Ref. 37).


title: Randomly color paragraphs in LaTeX document

text: I usually type up my notes for school in LaTeX, and I find it easier to focus on text where the color changes between paragraphs, which is easy to do with old fashioned pen and paper. On LaTeX, however, is there a way where the compiler can automatically do this while rendering my pdf changing the color of random paragraphs?


title: Pgfplotstable: format all cells but header row and header column

text: I found some code to asign colors to table values with PGFplotstable, but unfortunately it is only designed for tables where the topmost row is a head row (which is ignored by postproc). I also need the first column to be ignored by postproc - probably realtively simple but I just cant find how to do it. This is the code:               \pgfplotstableset{         color cells/.style={             col sep=comma,             string type,             postproc cell content/.code={%                     \pgfkeysalso{@cell content=\rule{0cm}{2.4ex}%                     \pgfmathsetmacro\y{min(100,max(0,abs(round(##1 * 0.5))))}%                     \ifnum##1<0\edef\temp{\noexpand\cellcolor{blue!\y}}\temp\fi%                     \ifnum##1>0\edef\temp{\noexpand\cellcolor{red!\y}}\temp\fi%                     \pgfmathtruncatemacro\x\y%                     \ifnum\x>50 \color{white}\fi%                     ##1}%                     }         }     }          \begin{table}\caption{Correlation or something}     \centering     \pgfplotstabletypeset[color cells]{     a,b,c,d     x,-300,-200,-100     y,0,100,200     z,300,40,800     }     \end{table}      (original source is: Drawing heatmaps using TikZ) The code does not work, as the values in the first column are not numbers - i just want to ignore them, leaving those cells as they are.


title: Add whitespace after header and remove page number

text: I am writing a short document which I need to fit all on 1 page. I am trying to squeeze everything on there, and because I'm short of space, I wanted my name and title just to be a header right at the top. I have used:               \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{\footnotesize \parbox{11cm}{Title of Document} }     \rhead{\footnotesize {My Name} }     \renewcommand\headheight{14pt}      to do this. This, however, has introduced a page number at the bottom of the page that I don't want. I have used:               \usepackage{nopageno}      but it doesn't seem to help. Finally, My text begins immediately under the header, but I would like a blank line of two. I have tried               \newline      and also               \vspace      but neither seems to work. Any help would be appreciated.


title: Is there some kind of LaTeX software for desktop notes?

text: I use atnotes to put sticky notes on my desktop, is there something like that with support to LaTeX?


title: Table too wide, first column too big?

text: I have the following table:                  \documentclass[a4paper,  % Seitenformat                 12pt,                                                bibliography=totoc,                      index=totoc,                     abstracton,                      headsepline,                     %footnosepline,                  ]{scrreprt}          \usepackage{booktabs}     \begin{document}     \begin{table}[h]     \centering      \begin{tabular}{llllllll}     \toprule     Test& test &test&test tes t&test test &test test &tes tes t&test test \\     \midrule     test& -0,0000615 & 0,0145 &  0,02783&&\\     &(0.000895) &(0.000633) &&& \\     test& -0,0004447 & 0,0152  & 0,0294&&\\      &(0.00094)&(0.000664) & &&\\     test&-0,000107 & 0,0234  &  0.04584&&\\     &(0.001445) &(0.00102)&&&\\     test& -0.00075 & 0,01285 &  0.0244&&\\     &(0.000792) &(0.00056)&&&\\     \bottomrule     \begin{footnotesize}std. errors in parentheses\end{footnotesize}     \end{tabular}     \caption{VaR$_{0,975}$ values using formula \ref{variancenormal}}     \label{vartvalues}     \end{table}          \end{document}        Which gives the following picture ![enter image description here](http://i.stack.imgur.com/iWtta.png)   1. The first column is clearly too big, why? How can I change this?   2. How can I make the table to fit in? So it is too wide now, it is in the right margin, what I don't want, so how can I make the table fit?


title: Problem with table

text: I'm trying to create a table for my thesis. I'm quite noob in LaTeX so I will request some charity help I already done the table in but in other format. See the attachment. ![table_ex](http://s4.postimg.org/648l6d4vh/tab_ex.png) Regards                \documentclass{article}      \usepackage{booktabs,multirow}      \begin{document}           \begin{table}[htbp]       \centering       \caption{Add caption}              \begin{tabular}{ccccccccc}         \toprule         \multirow{2}[4]{*}{\textbf{Nível na albufeira (m)}} & \multirow{2}[4]{*}{\textbf{QM.FÍSICO (m3/s)}} & \multirow{2}[4]{*}{\textbf{QDIM. (m3/s)}} & \multicolumn{3}{c}{\textbf{1st order Mom. Adv}} & \multicolumn{3}{c}{\textbf{2nd order Mom. Adv}} \\         \midrule               &       &       & \textbf{QCFD (m3/s)} & \multicolumn{2}{c}{\textbf{Erro (\%)}} & \textbf{QCFD (m3/s)} & \multicolumn{2}{c}{\textbf{Erro (\%)}} \\         \textbf{260,4} & \textbf{100} & \textbf{88,3} & \textbf{81,9} & \textbf{-18.1} & \textbf{-7.3} & \textbf{83,3} & \textbf{-16.7} & \textbf{-5.7} \\         \textbf{262,5} & \textbf{250} & \textbf{233,1} & \textbf{223,1} & \textbf{-10.8} & \textbf{-4.3} & \textbf{224,9} & \textbf{-10} & \textbf{-3.5} \\         \textbf{267,0} & \textbf{750,0} & \textbf{708,9} & \textbf{690,3} & \textbf{-8} & \textbf{-2.6} & \textbf{696,9} & \textbf{-7.1} & \textbf{-1.7} \\         \bottomrule         \end{tabular}%       \label{tab:niveis}     \end{table}%     \end{document}      Im not getting the same output like the image attached. Any ideas?


title: Define a command for vectors, boldface letters, but not numbers

text: The purpose for this would be to leave scripts out of the equation. For example,               \renewcommand{\vec}[1]{\ensuremath{\mathbf{#1}}}     ...     \vec{x_0}      would print the 0 as boldface, too. I know I can probably write               \renewcommand{\vec}[2][]{\ensuremath{\mathbf{#2}_{#1}}}     ...     \vec[0]{x}      But that would mean I have to reformat my whole paper, which defeats the basic purpose of defining a command. Edit: It would be awesome to keep all scripts as original, but leave all others as-is. This would be preferable.


title: Small caps in fontspec on XeLaTeX

text: I'm trying to typeset my document with Times with XeLaTeX. Because Times does not include small caps, I want to use TeX Gyre Termes only for small caps. I tried this method, but it didn't work. A warning is issued and the output is not small caps. The question:   * What is wrong?   * How can I do this? Here's a MWE:               \documentclass{article}     \usepackage{fontspec}     \setmainfont[       SmallCapsFont={TeX Gyre Termes},       SmallCapsFeatures={Letters=SmallCaps},     ]{Times}     \begin{document}     Hello!     \textsc{Hello!}     \end{document}      and the warning:               *************************************************     * fontspec warning: "aat-feature-not-exist-in-font"     *      * AAT feature 'Letters=SmallCaps' (3,3) not available in font 'TeX Gyre     * Termes'.     *************************************************      What I've tried:   * I tried typesetting with LuaLaTeX and the result was fine with no warnings.   * I replaced `Times` with `Times New Roman` and there was no problem.   * I added `Renderer=ICU` and the warning changed to `icu-feature-not-exist-in-font`. It seems that fontspec can use `.dfont` with ICU?   * I replaced `Times` with another `.dfont` font `Helvetica Neue` and the problem disappeared. Thus not all `.dfont` font cause the problem.... I'm using MacTeX 2013 on OS X Mountain Lion. **Update** Following a suggestion from @KhaledHosny, I tried adding `\the\XeTeXfonttype\font` before and after `\textsc{`, and both returned `1` (AAT font). With `Render=ICU` they returned `2` (OpenType font), but I got no small caps. It seems that XeTeX can treat Times as OpenType, but even then `SmallCapsFeatures` doesn't work.


title: Summation of a list of numbers

text: The next code gives : `1 1.2 3` But `1 2.2 5.2` is expected. What is wrong ?               \documentclass[tikz]{standalone}          \begin{document}          \xdef\Sum{0}     \foreach \i in {1,1.2,3} {         \pgfmathsetmacro\Sum{\Sum+\i}         \Sum\ }          \end{document}


title: PGFplots and table with different number of elements in columns

text: I am trying to plot a table where I have different number of elements in the columns. In the MWE, the pairs (x1,y1),...,(x4,y4) all have different number of elements, can I use PGFplots in such situation, ithout having to manually arrange the table or spit it in 4 different tables?               \documentclass{standalone}          \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableread{     x1 y1  x2 y2   x3 y3  x4 y4     1  0.5 1  0.2  1  0.1 1  0.3     2  0.7 2  0.4  2  0.2 2  0.5     3  0.3 3  0.6  3  0.4 3  0.6     4  0.1 4  0.3  4  0.4            5  0.2  5  0.2                    6  0.2                     7  0.1     }\mytable          \pgfplotsset{%         compat=1.8,         compat/show suggested version=false,     }          \begin{document}     \begin{tikzpicture}     \begin{axis}[xlabel={x-axis},ylabel={y-axis}]         \addplot table[x=x1,y=y1] {\mytable};         \addplot table[x=x2,y=y2] {\mytable};         \addplot table[x=x3,y=y3] {\mytable};         \addplot table[x=x4,y=y4] {\mytable};         \legend{1,2,3,4}     \end{axis}     \end{tikzpicture}     \end{document}


title: Calc and \settocdepth break \tikzexternalize

text: This might well be the strangest TeX behaviour I've ever seen and that's saying a lot. The following really is a MWE as far as the header is concerned:               \documentclass{memoir}     \settocdepth{subsection}     \usepackage{calc}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzexternalize     \begin{document}     \begin{center}     \begin{tikzpicture}         \begin{axis}[view={45}{45}]         \addplot3[surf,samples=20,domain=-1:1,domain y=-1:1]             {1-exp(-x^2-y^2)};         \end{axis}     \end{tikzpicture}     \end{center}     \end{document}      Take away either package `calc` or the `\settocdepth` definition and everything will be fine. When both are present, though, `pdflatex -shell- escape` will stop and the following will be in the output log:               ! Undefined control sequence. \@calc@post@scan ...st@scan \else \def \calc@next                                                                                {\calc@error #1}\fi \fi \f...     l.14 \end{tikzpicture}      If I wanted to file a bug report, I wouldn't even know where :/ Does anybody else see this behaviour and can you tell what's causing it?


title: Formula with text, good design?

text: I have the following text in my align environment, but it does not look good. So what should I change in order to get a better design/output?               \documentclass[a4paper,                  12pt,                                            ]{scrreprt}     \usepackage{amsmath}     \begin{document}     \begin{align}     R_ {t+1}^{simple}=\frac{\text{(asset price at t+1) $ - $ (asset price at t)}}{\text{asset price at t}} \hspace*{0.5cm}r_{t+1}^{log}=ln \left( \frac{\text{asset price at t+1}} {\text{asset price at t}}\right) \hspace*{0.2cm}     \end{align}     \end{document}


title: longtable captions in marginpar

text: I used `floatrow` to put all my captions (figure, table, listing) into the margin. The only captions left that i'm unable to put there belong to the `longtable` environment. Is there a way to put the caption which currently resides ontop of longtable also into the margin? See the example for a figure (with margincaption) and longtable (with caption ontop that i would also like to place in the margin). ![caption of longtable](http://i.stack.imgur.com/znlRZ.png) Code:                 \documentclass[8pt]{scrartcl}            \usepackage[a4paper,       text={380pt,500pt},       marginparwidth=112pt,       marginparsep=10pt,       inner=0.8in,       asymmetric]{geometry}       \usepackage{floatrow}            \usepackage{booktabs}       \usepackage{longtable}                 \begin{document}                 %% CAPTION IN MARGIN       \thisfloatsetup{%       floatwidth=\linewidth,       capposition=beside,       capbesideposition={top,outside},       capbesideframe=yes,       capbesidewidth=\marginparwidth,       capbesidesep=quad,       floatrowsep=qquad}       %% FIGURE       \begin{figure}[h]       \rule{4in}{0.5in}       \caption{Test.}       \end{figure}            %% LONGTABLE       \begin{longtable}{lll}       \caption{Caption Table Test.Caption Table Test.Caption Table Test.Caption Table Test.Caption Table Test.} \\       \toprule        \multicolumn{1}{c}{time} & \multicolumn{1}{c}{triple} & \multicolumn{1}{c}{trip}  \\       \midrule       \endfirsthead       %       \caption[]{Further table data\emph{(continued)}} \\       \toprule        \multicolumn{1}{c}{time} & \multicolumn{1}{c}{triple} & \multicolumn{1}{c}{trip}  \\       \midrule       \endhead       %       \bottomrule \multicolumn{3}{r}{\emph{Continued on next page}} \\       \endfoot       \bottomrule       \endlastfoot       %       0 & (1, 11, 13725) & (1, 12, 10980), (1, 13, 8235), (2, 2, 0), (3, 1, 0) \\       2745 & (1, 12, 10980) & (1, 13, 8235), (2, 2, 0), (2, 3, 0), (3, 1, 0) \\       5490 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       8235 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       10980 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       13725 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       16470 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       19215 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       21960 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       24705 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       27450 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       30195 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       32940 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       35685 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       38430 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       41175 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       43920 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       46665 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       49410 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       52155 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       54900 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       57645 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       60390 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       63135 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       65880 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       68625 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       71370 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       74115 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       76860 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       79605 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       82350 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       85095 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       87840 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       90585 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       93330 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       96075 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       98820 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       101565 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       104310 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       107055 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       109800 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       112545 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       115290 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       118035 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       120780 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       123525 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       126270 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       129015 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       131760 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       134505 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       137250 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       139995 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       142740 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       145485 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       148230 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\       150975 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       153720 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       156465 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       159210 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       161955 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       164700 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\       \end{longtable}                 \end{document}      Source: Tabledata


title: Headrule length in fancyhdr

text: ![Latex Page](http://i.stack.imgur.com/xFHJF.png)Using the `fancyhdr` package, is it possible to change(increase or decrease) the headrule length without changing the header length? In the picture related, one can see that the headrule rectangle(in red) does not have the same size length as header. This is exactly what I want. Actually, I would like headrule and textwidth with the same length, but header should be bigger than both. By using, for example:               \fancyheadoffset{1 cm}       I can make the header bigger than textwidth. But the headrule grows as well, and both header and headrule have the same length. In this other example that I am adding, one can see the expanded header, with the logo, and the headrule with the same size as the header. What if I want to make the headrule with the same size as the footrule (or with whatever size/align I want), keeping the header unchanged? ![Another Example](http://i.stack.imgur.com/DVp98.png)


title: Beamer, fix-cm math mode, - no asterisk?

text: I'm using `beamer` to make a presentation. In order to fit a large table onto a slide, I'm using `fix-cm` and `\fontsize` to customize the font size and spacing. The table is produced by `estout`, which uses asterisk in math mode. Oddly though, the asterisks in math mode don't appear in the compiled PDF when I use `beamer` and `\fontsize`. It works when I don't use `beamer`, and when I don't use `\fontsize`. Other numbers work in math mode. Any ideas?               \RequirePackage{fix-cm}     \documentclass{beamer}[10]          \begin{document}          \begin{frame}     \fontsize{.5}{6}\selectfont     \begin{table}     \begin{tabular}{c}     1$^{5}$\\     2***\\     3$^{*}$\\     $*$\\     \end{tabular}     \end{table}          \end{frame}     \end{document}


title: Typesetting old fashioned factorials

text: I would like to typeset an old fashioned factorial symbol and was wondering whether there was an elegant way of doing this that scales with font size. Ideally what I would like is to invoke `\oldfact{\frac{1}{2}n(n+1)}` in mathematics mode and get as an output the contents surrounded by a box frame with only two sides, the left and the bottom. The output would look something like `|__` with the contents nestling inside the L-shaped corner. ![enter image description here](http://i.stack.imgur.com/I0iY0.png) I've looked through different packages but couldn't find anything appropriate. So I've solved the problem for the time being with basic underlines and rules with appropriate spaces but my solution doesn't scale all that well and is certainly quite ugly code!


title: Imported PDF figure special character problem

text: I am importing a PDF figure using `\includegraphics`. This PDF figure contains a greek sigma and a greek Delta capital. In my PDF output, the sigma is output correctly, however instead of a capital delta, an ø is shown. This is both the case when using `pdflatex` and `xetex`. How can this be fixed?


title: How to avoid showing the filename when using graphicx?

text: I am writing a LaTeX document with the `apacite` and `graphicx` package. The issue is when I include an image either using `figure` with an enclosed `\includegraphics` or `\includegraphics` by itself it shows the image with the file name to the side. For example:                           --------------                 |             |                 |    BOX 1    |                   ---------------     Error1.jpg      I do not want it to write Error1.jpg. Would show the image but it seems I do not have enough rep. This is an example tex file to show the error (with Windows XP, using Miktex 2.8).               \documentclass[man]{apa}     \usepackage{apacite}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \begin{document}           \includegraphics{Example Error1.jpg}     \begin{figure}[htb]     \includegraphics{Example Error1.jpg}     \caption{This is the caption of the figure.}     \label{fig:fig2}     \end{figure}     \end{document}


title: How do I insert pdf image into LaTeX without showing the file location?

text: This is the code I'm using and the image comes up but with the file location next to it               \begin{figure}               \begin{center}         \includegraphics[scale=0.8]{C:/Users/Lauren/Google Drive/japan_all_6.pdf}}         \caption{Plotted data showing a quadractic trend for Japan over $6.0$ $1900-1980$}         \end{center}     \end{figure}


title: How to exploit externalized images runtime-wise?

text: Thanks to the valiant efforts of @zeroth, I got TikZ' externalization running with `todonotes`, TikZ images pieced together by environments and macros and my homebrew compilation script. In particular, I do not use `-shell-escape` but run the external jobs "by hand" (better for output stream collection). In my preamble, I have               \usepackage{tikz, pgfplots}     \usetikzlibrary{external}     \tikzexternalize     \tikzset{external/mode=list and make}%     \tikzset{external/export=false}%      and `external/export` is turned on for individual images. There are no other explicit (global) TikZ settings, not counting style definitions. The results have been sobering, though: build-time about _doubled_! Apparently, translating the images on their own is _way_ more expensive than just translating them as part of the main file. Of course, `pdflatex` calls two to n (five, in my case) are way faster but that does not seem to offset the overhead. The document this was observed with contains about forty images, the majority plots (`pgfplots` \+ `gnuplot` \+ data files). I could live with that if only the first build took that long. However, `tikz/external` does apparently not check whether an image has changed since the last build; it always creates a complete `.figlist` and I (that is my conservative script) have to rebuild all of them. Of course I could check for each figure wether the fitting PDF is there and not rebuild if it is. However, that would cause changes to the image to be ignored until rebuild is forced somehow. I can see no helpful auxiliary outputs that I (my script) could use to check whether an image has changed. Therefore my question: > Is there a way > >   * force TikZ to check for still valid externalization results or >   * to detect from the outside whether it is necessary to rerun TikZ > externalization jobs? >


title: Working with templates

text: I have just read the wonderful article LaTeX templates and realized that I have tried to practice this approach but there is one technical aspect which I don't know how to tackle. I am talking about how to actually _use_ these pre- prepared templates. The main issue is how to easily load them, when one starts writing a new document. The simplest approach would be to have one local central repository of templates (and maybe their revisions as Stefan Kottwitz suggested in his post), and when ever `template.tex` is needed _copy_ it to a new directory dedicated to the new document. However, this misses some of the modularity of LaTeX, isn't it?. When working with a document personalized class file, which is stored somewhere where TeX can find, the user simply has to specify the class' name and it is at his disposal, regardless of where the class is stored for example. This is not the case with templates. So my question is essentially the following: _What is the best way to use LaTeX templates?_ How should I store them? Where should I store them? How should I use them at the end of the day? Shouldn't a template be "exported" into a class file? If so, the what is the easiest way to achieve this?


title: How to get a dash between the item and its description

text: I have this:               \documentclass{article}          \usepackage{enumitem}          \begin{document}          \begin{description}     \item[foo] Bar baz     \end{description}          \end{document}      and I want a dash (say, `--`) between "foo" and "Bar baz". What do I do? (I didn't find a way to do it in `enumitem`'s docs, but I included it here, since I use it elsewhere for `enumerate`'s, and I don't want the solution to be incompatible with it.


title: \part doesn't appear  in TOC

text: I use the `article` document class and I created a TOC. It works fine and uses the `\section` to write the header, but the problem is that the first page after my TOC is the introduction and there I used `\part` without any `\section`. This is not recognized and so on the introduction page in the header it says "Contents" and not "Introduction". Can anyone help?               \tableofcontents     \newpage     \setcounter{page}{1}     \input{Chapter1}      %\newpage     \input{Chapter2}      etc. and the chapters are like:               \part{Chapter1}      \part{Chapter2}      \section     \section      But the problem is, Chapter 1 has no `\section` and is not recognized.


title: Theorem style similar to equation

text: I was trying to treat theorems and lemmas as in the book Visual complex analysis which in my opinion has a very nice format for informal reading. I would like to have equations and propositions numbered in a single enumeration, both with the enumerator right justified in the right of the page as in the following examples taken from the book: Example 1: you can have equations (or other constructs like enumerations) inside the propositions ![enter image description here](http://i.stack.imgur.com/aPobm.png) Example 2: Propositions are justified while equations are centered. ![enter image description here](http://i.stack.imgur.com/pvOxM.png) I haven't arrived very far in my trials, my best so far only handles one line propositions as in:               \documentclass{article}     \usepackage[fleqn]{amsmath}     \setlength{\mathindent}{1cm}     \begin{document}       \noindent Some text       \begin{equation}          \text{\itshape One line proposition of text and math $f(x) = \sin x$.}       \end{equation}       some more text       \begin{equation}          f(x) = \sin x        \end{equation}       some more text       \begin{equation}         \text{\itshape Long proposition of text don't fit in the page and continue past the                         right margin.}       \end{equation}       some more text      \end{document}      But this has a lot of problems: it doesn't handle multiline propositions, and it doesn't center equations to begin with. Could you give me some clue on how to obtain the style used in the book?


title: Is it possible to interact with TeX mid-process?

text: Quoting from an answer to Typesetting the entire Song That Never Ends > I ran this code once, and aborted the process after it reported producing > something like 47,000 pages (in a very short amount of time). Unfortunately, > my computer complained that the resulting pdf file was "damaged" and could > not be opened. A better (perhaps impossible?) answer would produce a file > such that the output could actually be viewed once the process was killed > (or died). This got me curious (and it is merely a curiosity). Can TeX die gracefully? Since its output is a PDF, presumably it needs to do some non-trivial stuff at the end to ensure that the PDF is valid so merely killing TeX is too abrupt. A more graceful method would be for TeX to ask at each shipout "Shall I continue?", but that suffers from the other extreme: it is too intrusive as the user needs to keep giving commands to keep TeX going. Off the top of my head, the only way I can think of to communicate with a running process in a non-blocking way is via a file. At each shipout (or other), TeX can check for the existence of a file and continue if it doesn't exist, and if it does then read the file and carry out whatever actions said file contains (thus allowing for more refined communication). Is there a better way?


title: Newline in adjustbox caption

text: Is it possible to have a paragraph break or a newline in the caption of an adjustbox? `\\` `\newline` and `\tabularnewline` don't seem to work. Thanks               \documentclass{article}     \usepackage{adjustbox}          \begin{document}          \begin{adjustbox}{width=\textwidth,totalheight=\textheight,keepaspectratio,rotate=0,caption={blah \\ blah},float=table}     BLAH BLAH BLAH         \end{adjustbox}          \end{document}


title: Using 'caption' package with 'thesis' class - undefined control sequence

text: I am trying to compile my PhD thesis. It worked a while ago (a few months or so) but something has somehow changes since then because I get an               undefined control sequence      error relating to the `caption` package. I have stripped it all down to a minimal example. I've kept all the package declarations in the preamble though.               \documentclass[a4paper,oneside]{thesis}     \usepackage[left=35mm,right=17mm,top=17mm,bottom=25mm,includehead,includefoot]{geometry}          \usepackage[pdftex]{graphicx}     \usepackage{epstopdf}     \newcommand{\ANGLE}{180}     \usepackage[usenames,dvipsnames]{color}          \usepackage[normal]{subfigure}     \setlength{\abovecaptionskip}{15pt}      \usepackage{flafter}     \usepackage[section]{placeins}      \usepackage[hang,small]{caption}     \usepackage{rotating}     \usepackage{enumerate}     \usepackage{array}     \usepackage{times}     \usepackage{amsmath,amsfonts,mathrsfs}     \usepackage{textcomp}     \usepackage{multirow}     \usepackage[round]{natbib}     \usepackage{hyperref}     \usepackage[version=3]{/home/qq002439/.tex/mhchem}               \begin{document}          \begin{figure}     \caption{figure}     \end{figure}          \end{document}      That's the code I'm trying to compile using pdfLaTeX. Here is the output log:               This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/openSUSE)      entering extended mode          (./test.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, ar     abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc     h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono     greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, ku     rmanji, latin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, po     lish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, span     ish, swedish, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.     (/home/qq002439/.tex/thesis.cls     Document Class: thesis 2006/06/02 v0.1 User-refined LaTeX document class     (/usr/share/texmf/tex/latex/base/bk11.clo))     (/usr/share/texmf/tex/latex/geometry/geometry.sty     (/usr/share/texmf/tex/latex/graphics/keyval.sty)     (/usr/share/texmf/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texmf/tex/generic/oberdiek/ifvtex.sty))     (/usr/share/texmf/tex/latex/graphics/graphicx.sty     (/usr/share/texmf/tex/latex/graphics/graphics.sty     (/usr/share/texmf/tex/latex/graphics/trig.sty)     (/usr/share/texmf/tex/latex/latexconfig/graphics.cfg)     (/usr/share/texmf/tex/latex/pdftex-def/pdftex.def)))     (/usr/share/texmf/tex/latex/oberdiek/epstopdf.sty     (/usr/share/texmf/tex/latex/oberdiek/epstopdf-base.sty     (/usr/share/texmf/tex/generic/oberdiek/infwarerr.sty)     (/usr/share/texmf/tex/latex/oberdiek/grfext.sty)     (/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty     (/usr/share/texmf/tex/generic/oberdiek/kvsetkeys.sty     (/usr/share/texmf/tex/generic/oberdiek/etexcmds.sty)))     (/usr/share/texmf/tex/generic/oberdiek/pdftexcmds.sty     (/usr/share/texmf/tex/generic/oberdiek/ifluatex.sty)     (/usr/share/texmf/tex/generic/oberdiek/ltxcmds.sty))          Package epstopdf Warning: Shell escape feature is not enabled.          (/usr/share/texmf/tex/latex/latexconfig/epstopdf-sys.cfg)))     (/usr/share/texmf/tex/latex/graphics/color.sty     (/usr/share/texmf/tex/latex/latexconfig/color.cfg)     (/usr/share/texmf/tex/latex/graphics/dvipsnam.def))     (/usr/share/texmf/tex/latex/subfigure/subfigure.sty     ****************************************     * Local config file subfigure.cfg used *     ****************************************     (/usr/share/texmf/tex/latex/subfigure/subfigure.cfg))     (/usr/share/texmf/tex/latex/base/flafter.sty)     (/usr/share/texmf/tex/latex/placeins/placeins.sty)     (/usr/share/texmf/tex/latex/caption/caption.sty     (/usr/share/texmf/tex/latex/caption/caption3.sty))     (/usr/share/texmf/tex/latex/rotating/rotating.sty     (/usr/share/texmf/tex/latex/base/ifthen.sty))     (/usr/share/texmf/tex/latex/tools/enumerate.sty)     (/usr/share/texmf/tex/latex/tools/array.sty)     (/usr/share/texmf/tex/latex/psnfss/times.sty)     (/usr/share/texmf/tex/latex/amsmath/amsmath.sty     For additional information on amsmath, use the `?' option.     (/usr/share/texmf/tex/latex/amsmath/amstext.sty     (/usr/share/texmf/tex/latex/amsmath/amsgen.sty))     (/usr/share/texmf/tex/latex/amsmath/amsbsy.sty)     (/usr/share/texmf/tex/latex/amsmath/amsopn.sty))     (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty)     (/usr/share/texmf/tex/latex/jknapltx/mathrsfs.sty)     (/usr/share/texmf/tex/latex/base/textcomp.sty     (/usr/share/texmf/tex/latex/base/ts1enc.def))     (/usr/share/texmf/tex/latex/multirow/multirow.sty)     (/usr/share/texmf/tex/latex/natbib/natbib.sty)     (/usr/share/texmf/tex/latex/hyperref/hyperref.sty     (/usr/share/texmf/tex/generic/ifxetex/ifxetex.sty)     (/usr/share/texmf/tex/latex/oberdiek/hycolor.sty     (/usr/share/texmf/tex/latex/oberdiek/xcolor-patch.sty))     (/usr/share/texmf/tex/latex/hyperref/pd1enc.def)     (/usr/share/texmf/tex/latex/latexconfig/hyperref.cfg)     Implicit mode ON; LaTeX internals redefined     (/usr/share/texmf/tex/latex/ltxmisc/url.sty)     (/usr/share/texmf/tex/generic/oberdiek/bitset.sty     (/usr/share/texmf/tex/generic/oberdiek/intcalc.sty)     (/usr/share/texmf/tex/generic/oberdiek/bigintcalc.sty))     (/usr/share/texmf/tex/generic/oberdiek/atbegshi.sty))     *hyperref using default driver hpdftex*     (/usr/share/texmf/tex/latex/hyperref/hpdftex.def)     (/home/qq002439/.tex/mhchem.sty          LaTeX Warning: You have requested package `/home/qq002439/.tex/mhchem',                    but the package provides `mhchem'.          (/usr/share/texmf/tex/latex/tools/calc.sty)     (/usr/share/texmf/tex/latex/oberdiek/twoopt.sty)) (./test.aux)     (/usr/share/texmf/tex/latex/base/ts1cmr.fd)     (/usr/share/texmf/tex/latex/psnfss/ot1ptm.fd)     *geometry* driver: auto-detecting     *geometry* detected driver: pdftex     (/usr/share/texmf/tex/latex/hyperref/nameref.sty     (/usr/share/texmf/tex/latex/oberdiek/refcount.sty)) (./test.out) (./test.out)     ! Undefined control sequence.     \captionlabelfont@default ->\cph@font           l.30 \caption{figure}          ? ! Undefined control sequence.     \captionlabelfont@default ->\cph@font           l.30 \caption{figure}          ? ! Undefined control sequence.     \captiontextfont@default ->\cpb@font           l.30 \caption{figure}          ? ! Undefined control sequence.     \captionlabelfont@default ->\cph@font           l.30 \caption{figure}          ? ! Undefined control sequence.     \captionlabelfont@default ->\cph@font           l.30 \caption{figure}          ? ! Undefined control sequence.     \captiontextfont@default ->\cpb@font           l.30 \caption{figure}          ? ! Undefined control sequence.     <argument> ...ngth {\baselineskip }{0pt}\@chapapp                                                        \ \thechapter \hspace {\st...     l.33 \end{document}          ? [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) ){/usr/shar     e/texmf/fonts/enc/dvips/base/8r.enc}</usr/share/texmf/fonts/type1/urw/times/utm     r8a.pfb></usr/share/texmf/fonts/type1/urw/times/utmr8a.pfb>     Output written on test.pdf (1 page, 19428 bytes).     Transcript written on test.log.      As you can see, it actually writes out a `.pdf` file which looks okay, but it messes up my thesis compilation completely. Does anyone have any suggestions about how a LaTeX newbie could go about solving this?


title: Handle currencies correctly depending on language conventions

text: Is there a standard way of handling currencies? Example:   * in American, you'd say "$2 a piece"   * in French, you'd say "2$ pièce" I'd like to be able to write `\somecommand{dollars}{2}`, that would interface with `babel` or something like that so that my value is displayed correctly. Is there an already existing package for that? (I quite often have troubles finding this kind of information about LaTeX on the web)


title: 3 Algorithms in the same column with algorithmic

text: I have 3 algorithms that I want to be displayed in the same column of a 2-column document. They are all slight variations of each other, so it is important that they be displayed right next to each other for easy comparison. The problem is that I can't figure out a way to place all three in the column. I've tried putting them inside a figure environment, but then I get the error "Not in outer par mode." Using another algorithm package is not an option for me.


title: Table of Contents numbering in decimals?

text: I have created my first LaTeX document, its very small and have 4 sections. The problem is the numbering is in decimals and looks a little odd, I have searched every where, I'm sure its a simple fix. Current form:               0.1 introduction     0.2 aims     0.3 Objectives     0.4 summary      How can I change it to normal numbering, like 1, 2, 3, ...? Here is my basic code:               \documentclass[12pt]{report}     \usepackage[parfill]{parskip}     \usepackage[round]{natbib}     \renewcommand\bibname{References}          \begin{document}     \maketitle          \renewcommand\thepage{}     \pagenumbering{roman}     \tableofcontents     \newpage     \renewcommand\thepage{\arabic{page}}           \newpage          \section{Introduction}     The text starts here


title: Arial font is not produced with lithuanian language

text: How can I get Arial font with my native language? My unsuccessful try:               \documentclass{article}          \usepackage[utf8x]{inputenc}      \usepackage[L7x]{fontenc}     \usepackage[lithuanian]{babel}          \usepackage{helvet}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}              Hello, World!          \end{document}


title: Non-ascii characters are not displayed in hyperref's pdftitle: bug in the 'unicode' option?

text: I'm trying to make `pdflatex` display non-ascii (cyrillic) characters in PDF metadata using `hyperref`'s `pdftitle` and `pdfauthor` options. Here is my document:               \documentclass{article}          \usepackage[russian]{babel}     \usepackage[utf8]{inputenc}     % \usepackage[T2A]{fontenc} % if uncomment, pdf search stops working     \usepackage{longtable}     \usepackage{fancyhdr, doc, textcomp}     \usepackage{ifpdf}     \usepackage{cmap} % to activate pdf search          \usepackage{hyperref}     \hypersetup {         pdftitle={Название документа},         pdfauthor={Автор документа},     }          \begin{document}     Hello, world! Привет, мир!     \end{document}      This does not work, cyrillic characters are just omitted. If I replace `\usepackage{hyperref}` to `\usepackage[unicode]{hyperref}`, it starts working as expected. But what surprised me is that if I set `unicode=true` option in `\hypersetup` (and remove `unicode` from `\usepackage[unicode]{hyperref}`), it does not work. Is it a bug or am I missing something?


title: A line parallel to an edge in a TikZ picture

text: I have a graph in TikZ built using code like the following               \node[...] (1) at (0,0) {1};          \node[...] (2) at (1,1) {2}        edge (1);      I would like to add a short line (with an arrow) parallel to the edge between 1 and 2, at some distance from the edge (and attach a label to the short line). Is there an easy way of doing it, without calculating coordinates?


title: lstlisting: how to set code color and frame color

text: I am using `lstlisting` to show some code in my PDF. The problem is that when I use:                 basicstyle=\fontfamily{pcr}\selectfont\footnotesize\color{red},      to change the code color (not only the language keywords), the frame color changes too. What I want to achive is to have the source code all red and the frame black. Here my `lstset`:               \lstset{          language=C++, % choose the language of the code         basicstyle=\fontfamily{pcr}\selectfont\footnotesize\color{red},         keywordstyle=\color{black}\bfseries, % style for keywords         numbers=none, % where to put the line-numbers         numberstyle=\tiny, % the size of the fonts that are used for the line-numbers              backgroundcolor=\color{darkgray},         showspaces=false, % show spaces adding particular underscores         showstringspaces=false, % underline spaces within strings         showtabs=false, % show tabs within strings adding particular underscores         frame=single, % adds a frame around the code         tabsize=2, % sets default tabsize to 2 spaces         rulesepcolor=\color{gray}         captionpos=b, % sets the caption-position to bottom         breaklines=true, % sets automatic line breaking         breakatwhitespace=false,      }


title: Control font size \part

text: I used a former question on TeX.SE to find the command `\part*{}`. I like everything about it but the font for it is huge. How can I tone down the size of the font for this command.               \documentclass{article}     \begin{document}          \part*{Min}     new     \section{a}     new2     \section{b}     new3          \end{document}


title: how to align texts in equation cases

text: I need to make an equation case with text following it. That text should be displayed in the middle of the two cases. This is my code:                \begin{eqnarray}\label{eq13}       a_k =       \begin{cases}       1 & \text{if $f_i$ has a value $v_k$}, \\       0 & \text{otherwise}       \end{cases}       \text{$f_i$ is a non-binary feature, \\$k=1,...,n$}      \end{eqnarray}      It wouldn't work, I want to begin a new line with `$k=1,...,n$`, since it sticks out of the page. I am using ACM format. How can I solve the problem?


title: A basic question about raw pdf file output by pdftex

text: Consider the following simple `tex` file, to be compiled with `pdflatex`.               \pdfcompresslevel=0     \documentclass{standalone}     \begin{document}     \hrulefill     \end{document}      Thanks to `\pdfcompresslevel=0`, the resulting `pdf` file is human readable. One can find the following lines:               4 0 obj <<     /Type /ObjStm     /N 4     /First 22     /Length 257            >>     stream     2 0 1 105 5 139 6 191     % 2 0 obj     <<     /Type /Page     /Contents 3 0 R     /Resources 1 0 R     /MediaBox [0 0 343.711 0.398]     /Parent 5 0 R     >>     % 1 0 obj     <<     /ProcSet [ /PDF ]     >>     % 5 0 obj     <<     /Type /Pages     /Count 1     /Kids [2 0 R]     >>     % 6 0 obj     <<     /Type /Catalog     /Pages 5 0 R     >>     endstream     endobj      As far as I understand, a call like `5 0 R` refers to the object defined by `5 0 obj`. Such an object seems indeed to be defined but with a leading `%` that is supposed to be the comment char in pdf format. So two questions.   1. Is my analysis right?   2. Why does `pdftex` output such comments (I mean why does it output `% 2 0 obj`)?


title: Why \shorthandon and \shorthandoff cannot be embedded in other macros?

text: Surrounding `\title` macro with `\shorthandon{;:!?}` and `\shorthandoff{;:!?}` gives the expected result with `babel`'s `french` language (space added before the '?', '!', ':' and ';'):               \documentclass[french]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{babel}     %     \shorthandon{;:!?}%     \title{La crise? Quelle crise?}     \shorthandoff{;:!?}%     %     \begin{document}     \maketitle     \end{document}      But this doesn't work if `\shorthandon` and `\shorthandoff` are embedded in (a redefinition of) the `\title` macro:               \documentclass[french]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{babel}     %     \let\titleORI\title     \renewcommand{\title}[1]{%       \shorthandon{;:!?}%       \titleORI{#1}%       \shorthandoff{;:!?}%     }     %     \title{La crise? Quelle crise?}     \author{Un auteur? Deux auteurs!}     %     \begin{document}     \maketitle     \end{document}      What is the reason of this? Is there a workaround?


title: Is there a LaTeX style that mirrors Practical Typography's suggestions for research paper layout?

text: Matthew Butterick of _Practical Typography_ says that his preferred format (and, co-incidentally, the one I have to use for my technical writing class final paper) is one where >   1. Page margins [are] larger; line length [is] shorter (about 65 > characters per line). >   2. Point size [is] smaller. >   3. Line spacing [is] reduced. >   4. Better fonts [are used] (Equity and Concourse) >   5. [There is only] one space between sentences. >   6. Hyphenation [is] turned on [and] >   7. [There is] no underlining. > **Sample PDF** ![The sample research paper](http://i.stack.imgur.com/lPQ0k.jpg) **Links**   * Description ofthe research paper formatting/layout   * Sample PDF of research paper (1 page) Is there some predefined documentclass or style that meets the criteria above? If not, how would I implement such a style myself?


title: How to format the references heading when using multiple bibliographies

text: I have what I hope is a simple question. I finally figured out how to get the multiple bibliographies to work (mostly) like I want it. The one additional formatting thing I would like is to make the "References" heading centered upon the page. What I am getting now is the heading "References" flush left. Here is my code:               {\documentclass[a4paper,12pt]{article}      \usepackage[backend=biber,natbib=true,citestyle=numeric-comp,bibstyle=authoryear,sorting=none,doi=false,url=false,isbn=false]{biblatex}     \addbibresource{simple_example.bib}          \title{Here is the title.}     \author{ John S. Doe }          \begin{document}     \maketitle          \include{Chapter01}     \printbibliography[section=1,heading=References]     \include{Chapter02}     \printbibliography[section=2,heading=References]     \end{document}      Code for Chapter01.tex               \chapter{This is Chapter 01}     \begin{refsection}     Blah, blah, blah, ba-blah \cite{goossens93}.     Blah, blah, blah, ba-blah \cite{knuth79}.     \end{refsection}'      Code for Chapter02.tex               \chapter{This is Chapter 02}     \begin{refsection}      Blah, blah, blah, ba-blah \cite{knuth79}.       Blah, blah, blah, ba-blah \cite{greenwade93,knuth79}.         \end{refsection}      And code for the bib file:               % This file was created with JabRef 2.6.     % Encoding: ISO8859_1     @book{goossens93,     author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",     title = "The Latex Companion A",     year = "1993",     publisher = "Addison-Wesley",     address = "Reading, Massachusetts"     }          @article{greenwade93,     author = "George D. Greenwade",     title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",     year = "1993",     journal = "TUGBoat",     volume = "14",     number = "3",     pages = "342--351",     url=" www.ctan.org"     }          @book{knuth79,     author = "Donald E. Knuth",     title = "Tex and Metafont, New Directions in Typesetting",     year = "1979",     publisher = "American Mathematical Society and Digital Press",     address = "Stanford"     }


title: LyX enlarging inserted images

text: I have a problem with inserting images in my thesis that I write with LyX. Images in exported pdf are always larger than they actually are. Here is what it looks like in the editor, that's the real size of the image: ![enter image description here](http://i.stack.imgur.com/fCEK2.png) However in the pdf the image is larger and you can see the pixelation: (It isn't zoomed in the pdf reader, it's 100% size). ![enter image description here](http://i.stack.imgur.com/57bOK.png) I've tried checking the checkbox and setting 100% size in the image's properties but that didn't help. What do I need to do to have images in my thesis appear exactly the same size as they actually are?


title: Special theorem command

text: My aim in the last few questions was to define a very flexible command allowing the definition of theorems of various kinds. The reason for that was to have a single command basically for all kinds of theorems, both already used and never used before, to avoid both to have to define many kinds of theorems including some which I would use once in my life and never again, and to have to put the name of a special theorem in brackets as `[name=foo]`, which yields (foo). Another useful thing about this command the way I've defined it is that it allows flexibility in the counter display, allowing theorems of the same "kind" (i.e. Theorems, Definitions, etc.) to be numbered sometimes as `[section]`, sometimes as `[subsection]`, sometimes as `[chapter]`, depending on the subdivision of the theorem's location, thus avoiding zeroes in `[subsection]` where there is no subsection division, and to have to define it as `[section]` when sometimes I'd like it defined as `[subsection]` because there IS such a subdivision. For the moment the command is as in the minimal code below:               \documentclass[a4paper]{report}     \usepackage{amsmath,amssymb,amsfonts,xparse,amsthm,mathptmx}     \makeatletter     \newtheorem*{@thmattr}{\theorem@attr}     \NewDocumentEnvironment{thmattr}{moO{x}oo}     {\IfNoValueTF{#2}           {\def\theorem@attr{#1}}           {\@ifundefined{c@#2}                 {\newcounter{#2} \setcounter{#2}{1}}                 {\addtocounter{#2}{+1}}           \def\counters{\if #3c                 \arabic{chapter}.\arabic{#2}                 \else{                       \if #3s                       \arabic{chapter}.\arabic{section}.\arabic{#2}                       \else{                             \if#3x                             \arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{#2}                             \else                             \errmessage{Illegal argument in counter definition}                             \errhelp{The third argument must be either c, s or x, for chapter, section and subsection respectively}                             \fi}                       \fi}                 \fi}\def\theorem@attr{#1\ \counters}}     \IfNoValueTF{#4}           {\begin{@thmattr}}           {\IfNoValueTF{#5}                 {\begin{@thmattr}[\textbf{#4}]}                 {\begin{@thmattr}[\textbf{#4}\label{#5}]}}}     {\end{@thmattr}}     \makeatother          \begin{document}     \begin{thmattr}{Teorema della Palla Pelosa}     \end{thmattr}     \begin{thmattr}{Teorema}[teor][x]     \end{thmattr}     \begin{thmattr}{Esercizio Imperiano}[eseese][c]     \end{thmattr}     \begin{thmattr}{Definizione}[defi][s][Estensione algebrica][thm:defi:EstAlg]     \end{thmattr}     \begin{thmattr}{Sorrata}[mu][c][Estensione algebrica]     \end{thmattr}     \end{document}      which typesets to: ![the code above typesetted](http://i.stack.imgur.com/0e7yA.png) My problems are: 1) If I use `thmtools`, I get an error `undefined control sequence: \thmt@thmname->\theorem@attr` (or the likes), but without it, as in the code above, the brackets around the name are not bold, and the name is forced to be bold, whereas with `thmtools` I'd get both automatically bold; is there a way to get the bold without `thmtools` or to solve the error `thmtools` gives? And if the error of `thmtools` can't be solved, is there a way to make a `\listoftheorems` without that package? 2) Using `\if` to compare the arguments causes trouble when the argument is a string; I'd like to send an error message if the argument is a string rather than a single character, so that if my hand slips on the keyboard and instead of c I type e.g. cv, I get an error and correct that; how do I do that? NB that was half of the question at Special conditionals (TeX). 3) A theorem with counter but without label (Esercizio Imperiano in the typesetted code) has a rather ugly space between the counter and the dot; how do I remove that? Alternately, how do I remove the dot, if possible? And why does the space between theorem name and counters, as well as that between counters and dot, seem to vary in length depending on the number of counters? **Update:** As mentioned in a comment, problem one is solved. The solution, however, turns the dot into an even worse-looking colon, and creates the problem of brackets around the names in the List of Theorems. How do I solve those? The same set of theorems, plus something typed in the first one, with the following code:               \makeatletter     \declaretheoremstyle[     spaceabove=\topsep, spacebelow=\topsep,     headfont=\normalfont\bfseries,     notefont=\bfseries, notebraces={}{},     bodyfont=\normalfont\itshape,     postheadspace=0.5em,     name={\ignorespaces},     numbered=no,     headpunct=:]     {mystyle}     \declaretheorem[style=mystyle]{@thmattr}     \NewDocumentEnvironment{thmattr}{moO{x}oo}     {\IfNoValueTF{#2}           {\def\theorem@attr{#1}}           {\@ifundefined{c@#2}                 {\newcounter{#2} \setcounter{#2}{1}}                 {\addtocounter{#2}{+1}}           \def\counters{\if #3c                 \arabic{chapter}.\arabic{#2}                 \else{                       \if #3s                       \arabic{chapter}.\arabic{section}.\arabic{#2}                       \else{                             \if#3x                             \arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{#2}                             \else                             \errmessage{Illegal argument in counter definition}                             \errhelp{The third argument must be either c, s or x, for chapter, section and subsection respectively}                             \fi}                       \fi}                 \fi}\def\theorem@attr{#1\counters}}     \IfNoValueTF{#4}           {\begin{@thmattr}[\theorem@attr]}           {\IfNoValueTF{#5}                 {\begin{@thmattr}[\theorem@attr (#4)]}                 {\begin{@thmattr}[\theorem@attr (#4)\label{#5}]}}}     {\end{@thmattr}}     \renewcommand\thmt@listnumwidth{-1.5em}     \makeatother      produces: ![Theorems](http://i.stack.imgur.com/LwyVi.png) ![List of Theorems](http://i.stack.imgur.com/gQCbZ.png)


title: how to use special character in DTLloaddb keys

text: \DTLsetseparator{,}     \DTLloaddb[noheader,keys={Method, Accuracy, F-Measure(\%), No. of iterations}]{table2}{GDSGD_2.csv}      Hi, I want to include special character in my column header, i am using datatool and DTLloaddb does not seem to work even if escape the special char. (here %) The document wont compile and it throws lot of errors like Missing: \endcsname inserted.


I have already seen the related page macros - What is the difference between \let and \edef?, but I'm afraid it still doesn't expain to me the following MWE:               \documentclass{minimal}          \begin{document}          \let\tmpa=Hello     \edef\tmpb{A\tmpa}     \tmpb           % typesets "ello AH"     \typeout{\tmpa} % writes "\tmpa" in terminal     \typeout{\tmpb} % writes "A\tmpa" in terminal     \end{document}      This is how I understand it:   * `\let\tmpa=` sees first character of `Hello`, `H` \- it sees it as a single token and gets assigned to it (that is, `\let\tmpa=H`)   * The remaining characters ("ello") from `\let\tmpa=H`ello`` "fall through" and get typeset ( _the "ello" in "ello AH"_ )   * `\edef\tmpb{A\tmpa}` runs => since `\tmpa=H`, then `\tmpb` should expand to "AH"   * `\tmpb` runs => as expected, "AH" is typesed after the previous "ello" And the confusion comes from \typeout{\tmpa} - from the typeset output, I'm pretty sure `\tmpa=H`; so I expect `\typeout{\tmpa}` to result with `H`, _but it doesn't_ \- and instead it writes again `\tmpa`! Same thing if I try to expand it via `\edef` and throw it in another command (`\tmpb`), and then I try to `\typeout` that command. Why does `\typeout` in this case not show the "expanded" value of `\tmpa`? How can I get `\typeout` to show the expanded value of `\tmpa`? * * * Ah well, I asked this question; then I asked myself for it to be closed, given that Showing expanded `\let` command with `\typeout` generally provides an answer; in the meantime I came up with an answer I wanted to document - but now I cannot anymore, because it's closed `:/` So I posted the answer in macros - How do I ‘expand’ a control sequence `\let` to a character?; but that answer simply doesn't belong there. Then finally I realized I can edit my question post, even if it is closed (I just cannot add an answer) - so better to delete the answer from the other question, and move it here I guess (although now that it is here, it would have been better it's an answer `:/` Ah nevermind). So, not to nag the mods to reopen and reclose again, I'll post that answer here: Basically, to `\typeout` the contents of that example:   * Use `\meaning` to convert `\tmpa` to "The letter H"   * Use a "parser" macro, to extract the third word from a set of three words So finally we have the corrected MWE, that can print the content of `\tmpa` (given here we explicitly expect it to be one letter) to terminal:               \documentclass{minimal}          \begin{document}          \def\wordIIIofIII #1 #2 #3{#3}          \let\tmpa=Hello     \edef\tmpb{A\tmpa}     \tmpb           % typesets "ello AH"     \typeout{\tmpa} % writes "\tmpa" in terminal     \typeout{\tmpb} % writes "A\tmpa" in terminal          \edef\tmpc{\meaning\tmpa}     \typeout{\tmpc}         % writes "the letter H" in terminal     \edef\tmpd{\expandafter\wordIIIofIII\tmpc}     \typeout{\tmpd}         % writes "H" in terminal          \typeout{\the\catcode`H}                  % 11     % \typeout{\the\catcode`\tmpd} % "! Improper alphabetic constant."     \typeout{\the\catcode\expandafter`\tmpd}  %11          \end{document}


title: Change linestyle within a plot to add dashed trendline?

text: I'd like to add a dashed line to the end of a plot to indicate a future projection as opposed to real data. I can do this by adding a second plot, as in the example below. However this isn't really neat - its repeated code and doesn't lend itself to doing this with data pulled in using pgfplotstableread for example. Is there a way of changing linestyle for a selected section of a plot? ie saying that for the last segment of each plot should be in a different style?               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}          \usepackage {tikz}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[width=\textwidth,     ymin=0,     ymax=16,     ytick={0,4,...,16},     xmin=0,     xmax=12,     no markers,     xtick={0,4,...,12},     xticklabels={Ancient history,The past,Now,The Future}     ]     \addplot+ [color=blue] coordinates     {(0,2)     (4,4)     (8,9)     };     \addplot+ [color=blue,style=dashed] coordinates     {(8,9)     (12,16)};     \end{axis}      \end{tikzpicture}           \end{document}


title: \twocolumn[{\begin{@twocolumnfalse} explained

text: I'm typesetting a document in the `[twocolumn]` format. I found (Googled) that a way how to place some material spread over both columns is as in the following code:               \documentclass[twocolumn]{article}          \usepackage{lipsum}          \begin{document}          \twocolumn[\begin{@twocolumnfalse}       \centerline{\Large\bfseries This is my manually set ``wide'' title}       \vspace{3ex}     \end{@twocolumnfalse}]          \lipsum          \end{document}      I would like to:   1. Understand what does the code really do.   2. Ask whether there is a better way how to do that.   3. Get some good documentation with `[twocolumn]` explained.


title: Color and rules in tables with multirow

text: I have a problem with colors and lines in tables. I have this code:               \usepackage{multirow}     \usepackage{colortbl}             \begin{tabular}{ll|c|c|c|c|c|c|}  \cline{3-8} \cline{3-8}              & & \multicolumn{3}{c|}{\cellcolor{gray!25} Cramér von Mises} & \multicolumn{3}{c|}{\cellcolor{gray!25} Anderson-Darling} \\  \cline{3-8} \cline{3-8}              & & \cellcolor{gray!25}$\alpha=$0.1 & \cellcolor{gray!25}$\alpha=$0.05  & \cellcolor{gray!25}$\alpha=$0.01 & \cellcolor{gray!25}$\alpha=$0.1 & \cellcolor{gray!25}$\alpha=$0.05 & \cellcolor{gray!25}$\alpha=$0.01 \\ \hline             \multicolumn{1}{|c}{} & \cellcolor{gray!25}n=25 & 0.106 & 0.063 & 0.015 & 0.107 & 0.052 & 0.012 \\              \multicolumn{1}{|c}{} & \cellcolor{gray!25}n=50 & 0.107 & 0.043 & 0.010 & 0.103 & 0.054 & 0.010 \\              \multicolumn{1}{|c}{\multirow{3}{0.3cm}[7mm]{\begin{sideways}$\qquad$ $Exp(1)$ \end{sideways}}}&\cellcolor{gray!25} n=100 & 0.104 & 0.065 & 0.017 & 0.110 & 0.055 & 0.015 \\ \hline             \multicolumn{1}{|c}{} & \cellcolor{gray!25}n=25 & 0.113 & 0.055 & 0.014 & 0.097 & 0.058 & 0.016 \\               \multicolumn{1}{|c}{} & \cellcolor{gray!25}n=50 & 0.109 & 0.058 & 0.014 & 0.098 & 0.056 & 0.018 \\               \multicolumn{1}{|c}{ \multirow{3}{0.3cm}[7mm]{\begin{sideways}$\qquad$ $Exp(2)$ \end{sideways}}} & \cellcolor{gray!25}n=100 & 0.110 & 0.048 & 0.011 & 0.108 & 0.044 & 0.009  \\ \hline               \end{tabular}      I need to color the multirow cell and the only thing I could arise was to color the lower part of it. My other problem is when I coloured the cells, I cant see properly the rules of the table. I hope someone can help me. Thanks!!!!


title: Typesetting time

text: I want to typeset time so it looks beautiful. Here's my first attempt:               \documentclass[a5paper,11pt,landscape,parskip]{scrartcl}     \usepackage[top=1cm, bottom=1cm, left=1cm, right=1cm]{geometry}     \usepackage{fixltx2e}          \pagestyle{empty}     \usepackage[T1]{fontenc}          \usepackage{calligra}     \setlength{\parindent}{0mm}     \setlength{\parskip}{10mm}     \begin{document}         \calligra\Huge         \begin{flushleft}             18\kern 0.2em \textsuperscript{\small{\underline{00}}}         \end{flushleft}          \end{document}      Is there a better or more correct way to do it? It looks decent but perhaps not perfect.


title: LaTeX, dvipng and pipes

text: I am trying to create PNG images for each page in a LaTeX document on the fly. Since the startup time of LaTeX is the limiting factor for speed I tried the following approach using names pipes: Bash 1 (listening):               mknod test.dvi p # create named pipe 'test.dvi'     dvipng test.dvi  # let dvipng wait for input on that named pipe      Bash 2 (sending):               echo "\\documentclass{article}\\pagestyle{empty}\\begin{document}text\\end{document}" \          | latex -jobname=test # typeset small LaTeX document into test.dvi      The LaTeX run finishes successfully. But dvipng quits with the following error:               dvipng: Fatal error, POST occurs within page      Surprisingly, dvipng works as expected when I redirect the `test.dvi` to a regular file using               cat test.dvi > test2.dvi     dvipng test2.dvi # results in test21.png      on Bash 1. Hopefully, I can sent continuous data to LaTeX so that dvipng outputs a `.png` each time `latex` outputs a page to `test.dvi`. If you have better approaches than the one above please let me know! Note that I also precompiled the preamble of the LaTeX document. But this is still not fast enough.


title: Extracting the basename from a filepath argument

text: I have a function which takes a _filepath_ as an argument. How can I extract the _basename_ (`file.c` in the example below) from the argument?               \mycommand{path/to/file.c}          ...          \def\@mycommand#1{       ...       \section{\basename{#1})}       ...     }


title: Adding condition to \DTLplot (dataplot package)

text: I'm working with the package `datatool` for a while now, and I'd like to make graphs of my created databases. But I do not want to plot all rows in my database so I'd like to use the condition. This is an extract from the manual from the `datatool`-package:               \DTLplot[<condition>]{<db list>}{<settings>}      > This command creates a plot (inside a tikzpicture environment) of all the > data given in the databases listed in `<db list>`, which should be a comma > separated list of database names. The optional argument `<condition>` is the > same as that for `\DTLforeach`. The `<settings>` argument is a comma > separated list of `<setting>=<value>` pairs. There are two settings that > must be specified `x` and `y`. The other settings are optional. In the next part I'm going to explain how datatool works for those who are unfamiliar with the package. If you already know how it works skip to the next title. **Introduction to datatool** I'll give an example for `\DTLforeach`. Create the file score.txt with contents:               FirstName,Surname,StudentNo,Score     John,Smith,102689,68     Jane,Brown,102647,75     Andy,Brown,103569,42     Zoe,Adams,105987,52     Roger,Brady,106872,58     Clare,Verdon,104356,45      The code to load and print the database:               \documentclass{article}     \usepackage{datatool}     \DTLloaddb{score}{score.txt}  % create the database score          \begin{document}       \DTLdisplaydb{score}  % prints the database     \end{document}      The text in bold are called keys, headers or identifiers. Those can be used to assign data to a command. I'll explain with the command `\DTLforeach`: The command `\DTLforeach[<condition>]{<db name>}{<assign list>}{<text>}` iterates through each row of the database and executes `<text>` when `<condition>` is met. E.g. when I want to count how many students have a score greater than 60 I could write this:               \documentclass{article}     \usepackage{datatool}     \DTLloaddb{score}{score.txt}          \begin{document}       \newcounter{nostudents}       \DTLforeach[\DTLisgt{\Score}{60}]{score}{\Score=Score}{\stepcounter{nostudents}}       A total of \arabic{nostudents}\ have a score higher than 60.     \end{document}      The assign list works like this: `<cmd>=<key>`, where for each row the value in the column `Score` is stored in `\Score`. The command `\DTLisgt` simply checks if arguments 2 is greater than argument 1. **My actual question** I'll use the same file as in the previous section and I now want to make a (useless) graph (in this case) of the students with score greater than 60 vs their Student Number. To make a graph of everyone is simple: `\DTLplot{score}{x=StudentNo, y=Score}` will do the job. But with conditions I need an `<assign list>` which is not available for `\DTLplot` it seems. So writing               \DTLplot[\DTLisgt{\Score}{60}]{score}{x=StudentNo, y=Score}      will result in an error because he does not know the command `\Score`. Adding \Score=Score to the last argument will result in the same error. If you could just react if you know a solution or not that will be great. If I don't get any answer I'll contact the package maintainer. I don't like to disturb him too much with lousy questions `:)`


title: Compilation error with media9 package

text: While using `media9` package, I'm getting the following error :               Argument of \bool_if:nTF has an extra }      I'm unable to figure out where does the error come from. Here is the minimal example:               \documentclass{beamer}      \mode<presentation>     \usepackage{media9}     \usetheme{Darmstadt}     \setbeamercovered{transparent}          \begin{document}     \begin{frame}     \includemedia[         activate=pageopen,         width=200pt,height=150pt,         addresource=c4.mp4,         flashvars={%                 source=c4.mp4         }       ]{}{VLC.app}%{VPlayer.swf}     \end{frame}     \end{document}


title: Define a custom align, and align* environment

text: I would like to redefine both the `align` and `\align*` environments such that the first line is shifted up to line up with the list identifier. I attempted to adapt the solution provided at Starred equivalent in newenvironment, along with `\NewDocumentEnvironment` from `xparse` but am unable to get the `Ealign*` environment to work. Commenting out the last `\item` in the list yields: **LaTeX Error: Environment Ealign* undefined.**.               \documentclass{article}     \usepackage[fleqn]{amsmath}     \usepackage[shortlabels]{enumitem}     \usepackage{xparse}          \NewDocumentEnvironment{Ealign}{s}{%         \IfBooleanTF {#1}{%             \csname align*\endcsname\\[-8.6ex]%         }{%             \csname align\endcsname\notag\\[-8.6ex]%         }%     }{%         \IfBooleanTF {#1}{%             \csname endalign*\endcsname%         }{%             \csname endalign\endcsname%         }%     }%               \begin{document}     \begin{enumerate}[(a)]     \item     \begin{align}         a &= b\\         c &= d     \end{align}     %     \item     \begin{Ealign}         a &= b\\         c &= d     \end{Ealign}     \hrule%--------------------------     \item     \begin{align*}         a &= b\\         c &= d     \end{align*}     % Following yields: ! LaTeX Error: Environment Ealign* undefined.     %\item     %\begin{Ealign*}     %    a &= b\\     %    c &= d     %\end{Ealign*}     \end{enumerate}     \end{document}      As an aside not, this question about Vertical alignment of align* in enumerate is directly related to the issue I am trying to solve here. While that one provides what seems to be a pretty complicated, but automated method of correcting the alignment, it does not address defining a new enviroment for both the `\align*` and `\align`. I will probably try to incorporate this into the `Ealign` environment and eliminate my hackish solution of using `\\[-8.6ex]`, which does not work when the `align` contains things such as fractions (so would require manually specifying the space value).


title: How is TikZ on Windows different with TiKZ on Linux?

text: This code snippet compiles fine on Windows 7. However, when I ran it on Linux, the compiler complained that it couldn't find the key `/tikz/align`. Obviously, get rid of the option `align=flush center` solved the compiler errors, but the consequence was I don't get my expected display. Am I missing some other packages here? or there are several differences between TeXLive and MikTeX?               \documentclass[10pt,letterpaper]{article}          \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}      \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{ntheorem}     \usepackage{polynomial}     \usepackage{layouts}     \usepackage{enumerate}     \usepackage{mdwtab}               \usepackage[version=0.96]{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,automata,backgrounds,petri,positioning}     \usetikzlibrary{decorations.pathmorphing}     \usetikzlibrary{decorations.shapes}     \usetikzlibrary{decorations.text}     \usetikzlibrary{decorations.fractals}     \usetikzlibrary{decorations.footprints}     \usetikzlibrary{shadows}          \setcounter{tocdepth}{3}     \setcounter{secnumdepth}{3}     \usepackage[bookmarksopen,bookmarksdepth=3]{hyperref}     \usepackage{titlesec}     \usepackage{xcolor}          %define new colors     \definecolor{dark-red}{rgb}{0.4,0.15,0.15}     \definecolor{dark-blue}{rgb}{0.15,0.15,0.4}     \definecolor{medium-blue}{rgb}{0,0,0.5}          %set up color for table of contents     \hypersetup{         colorlinks, linkcolor={medium-blue},         citecolor={dark-blue}, urlcolor={medium-blue}     }          \usepackage{tocloft}          %preven linebreak between subsection header and its content     \usepackage{titlesec}     \titleformat{\subsection}[runin]{\normalfont\bfseries}{\thesubsection.}{3pt}{}     \titleformat{\section}[runin]{\normalfont\bfseries}{\thesection.}{3pt}{}     %title     \title{\textbf{Solution for Chapter 1}}          \begin{document}              \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]             \node[state,initial]    (q_1)                           {$q_1$};              \node[state,accepting]  (q_2)   [right=of q_1]          {$q_2$};              \node[state]            (q_3)   [below right=of q_1]    {$q_3$};                   \path[->]             (q_1) edge  [bend left]     node {a}            (q_2)             (q_1) edge  [loop above]    node {b}            (q_1)             (q_2) edge  [bend left]     node {a,b}          (q_3)             (q_3) edge  [bend left]     node {a}            (q_2)             (q_3) edge  [bend left]     node {b}            (q_1);                  \node [below=1cm, align=flush center,text width=8cm] at (q_3)             {                 $M_1$             };         \end{tikzpicture}     \end{document}


title: How to resolve the conflict between TikZ and syntax packages?

text: If I add `syntax` package, the compiler will generate errors: **Minimal Example**               \documentclass[10pt,letterpaper]{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage{tikz}     \usetikzlibrary{arrows,shapes,automata,backgrounds,petri,positioning}          \usepackage{syntax}          \begin{document}              \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]             \node[state,initial]    (q_1)                           {$q_1$};              \node[state,accepting]  (q_2)   [right=of q_1]          {$q_2$};              \node[state]            (q_3)   [below right=of q_1]    {$q_3$};                   \path[->]             (q_1) edge  [bend left]     node {a}            (q_2)             (q_1) edge  [loop above]    node {b}            (q_1)             (q_2) edge  [bend left]     node {a,b}          (q_3)             (q_3) edge  [bend left]     node {a}            (q_2)             (q_3) edge  [bend left]     node {b}            (q_1);                  \node [below=1cm, align=flush center,text width=8cm] at (q_3)             {                 $M_1$             };         \end{tikzpicture}     \end{document}      But if I delete `\usepackage{syntax}`, it compiles successfully. I wonder is there a way to get around this issue? Thank you.


title: TeXstudio: images in tooltips

text: TeXstudio (I am using v.2.6.6 on Win 7) shows small image tool tips for PDF files as in                  \includegraphics[width=2.7in]{figs/logos.pdf}%      when you hover over the filename. This works very well for pdfs. In my tests, png images show in the tool tips, but not scaled in a small box. When I hover over a png the tool tip image can fill my entire screen (depending on the resolution on the png). Jpeg's do not seem to show at all in the tool tips. I have not been able to find any documentation on this potentially useful feature. If it worked consistently with jpegs as well as pdf's, it would certainly help in the preparation of Beamer presentations. Does anyone know how this feature is supposed to work and what the constraints are? Thanks!


title: Bold one cell in table using CSV reader

text: Is it possible to bold a single desired cell (or number of cells) using csvreader (besides the head)? Here is an example of making the table.               \documentclass{article}     \usepackage{csvsimple}          % Make csv in question     \begin{filecontents*}{scientists2.csv}     name,surname,     Albert,Einstein,     Marie,Curie,     Thomas,Edison     \end{filecontents*}          \begin{document}          \begin{center}     \csvreader[tabular=|l|l|,         table head=\hline \textbf{ First Name} & \textbf{Last Nmae} \\\hline,         late after line = \\\hline]%     {scientists2.csv}{name=\name,surname=\surname}%     {\name & \surname}%          \end{center}               \end{document}       I tried to use a filter to apply different rules, but was unsuccessful. Thanks,


title: Moving to LaTeX3 for package authors

text: I would like to write a package using as much of LaTeX3 stuff as possible (in particular `expl3`, `xparse` and `xtemplate`). What should I read to learn these? In particular: I know that there are good introductions to `expl3` and `xparse`. I remember having read something very nice on `xtemplate` (with examples etc.), but could not find it (I googled the LaTeX3 project site, CTAN, the TUGboat and PracTeX journal). Can anyone help me finding that?


title: suppress lot/lof entry in memoir

text: Using the caption package, one can suppress lot/lof entry with an empty optional argument for \caption. But the caption package is incompatible with memoir. How can I suppress lot/lof entries in memoir?


title: Clash between bibentry and hyperref with bibstyle elsart-harv

text: I'm using the `bibentry` package for inserting my bibitems into a CV without printing the bibliography. This works just fine until I load `hyperref`. Then I get the error message `Lonely \item--perhaps a missing list environment`. There is supposed to be a workaround (see here), which I included as deactivated in the code below. When using it, I still get the error message. Is there another solution (no biblatex please) or am I not using the workaround correctly?               \begin{filecontents}{\jobname.bib}     @Book{elvis,         author = "Elvis Presley",         title = "Turn Me One More Time",         publisher = "Jail House Books",         year = 1963,     }     \end{filecontents}     \documentclass{article}     %\makeatletter     %\let\saved@bibitem\@bibitem     %\makeatother     \usepackage{bibentry}     \nobibliography*     \usepackage{hyperref}     \begin{document}     \bibentry{elvis}     %\bibliographystyle{plain}           % works fine     \bibliographystyle{elsart-harv}     % gives an error     \nobibliography{\jobname}       % comment out when using the workaround     %\begingroup     %\makeatletter     %\let\@bibitem\saved@bibitem     %\nobibliography{\jobname}     %\endgroup     \end{document}      * * * EDIT: Turns out, the problem is not just about `bibentry` and `hyperref`. For your convenience I replaced my actual bib-style elsart-harv with `plain`. It didn't come to my mind that the style could be the crux of this matter, but it obviously is.