title: TikZ coding style

text: I've got a piece of TikZ code here and since I am only starting to learn how to use it, I wanted to ask whether this code would be regarded to be ok or rather completely unreadable and what I can do to improve it.               \documentclass{scrartcl}          \usepackage{tikz}     \usetikzlibrary{calc}     \usetikzlibrary{patterns}          \tikzset{     every picture/.prefix style={     execute at begin picture=\shorthandoff{"}     }     }          \begin{document}          \begin{tikzpicture}     \newdimen\field     \def\white{white}     \foreach \x in {0, ..., 7}         \foreach \y in {0, ..., 7} {             \pgfmathparse{mod(\x+\y,2) ? "white" : "black"}             \edef\color{\pgfmathresult}             \pgfmathparse{int(round(56+\x-8*\y))}             \edef\field{\pgfmathresult}             \edef\textcolor{\ifx\color\white black\else white\fi}             \path[fill=\color] (\x, \y) rectangle ++ (1, 1) node[color=\textcolor, pos=.5] {                 \Large                 \ifnum \field < 8                     \pgfmathparse{2^(\field)}                     \pgfmathprintnumber\pgfmathresult                 \else                     \dots                 \fi             };         }     \draw (0, 0) -- (0, 8) -- (8, 8) -- (8, 0) -- cycle;     \end{tikzpicture}     \end{document}      The code outputs a demonstration of the Wheat and chessboard problem.


title: Put image at top in Beamer class

text: I am using the `Beamer` class with `columns` environment. I am able to start the text from top by using `\documentclass[t]{beamer}` but the image always appears at the center of the column which is giving a bad look. **Problem:** How can i bring the image at the top? ![image](http://i.imgur.com/bfgiLAZm.png) **my code is following:**               \documentclass[t]{beamer}              \begin{document}             \section{Getjag}             \subsection{Getjag}              %slide - 1                 \begin{frame}                     \frametitle{External ports in Getjag}                            \input{slide_1}                                                  \end{frame}      **The code for`\input{slide_1}` is following:**               \begin{columns}     \column{0.5\textwidth}         \begin{itemize}         \item Best in class Manipulation title winner team used simulation for their tail operated robot.         \item Simulation displays the exact orientation of flipers, manipulator arm etc.          \end{itemize}          \column{0.5\textwidth}     %\centering         \begin{figure}         \includegraphics[width=5.5cm,height=5cm]{simulation}         \caption{Tail operated robot team.}         \end{figure}     \end{columns}


title: remove boldface from chapter titles, section and subsection names

text: How is it possible to remove the boldface from chapter titles, section and subsection names? I have found the following code for sections, but I can't find a way for chapters and subsections.               \makeatletter      \renewcommand\section{\@startsection {section}{1}{\z@}%      {-3.5ex \@plus -1ex \@minus -.2ex}%      {2.3ex \@plus.2ex}%      {\normalfont\Large}}      \makeatother      **EDIT** : Be sure to check the answer I provided in addition to Tobi's and Werner's answers.


title: Get access to beamer palette for tikzpictures

text: I can't get the solution proposed here to work: Accessing colors defined by a beamer color theme for a standalone tikzpicture               \documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress]{beamer}     \usetheme{Boadilla}     \usepackage{tikz}%Mind map     \usetikzlibrary{mindmap,trees} %Mind map     \usepackage{media9,multimedia,comment,booktabs,datetime}          \begin{document}     \begin{frame}     \frametitle{Literature Review}     %\tikzset{every node/.append style={scale=2}}     \resizebox{0.9\textwidth}{!}{     \hspace{50pt}\begin{tikzpicture}      %\tikzstyle{every node}=[font=\Large,level distance=8cm]         \path[mindmap,concept color=DeepSkyBlue4,text=white,font=\sf\bf,text width=5cm,             level 1/.append style={level distance=6cm,sibling angle=60},             level 2/.append style={level distance=4cm},]                  node[concept] {Learning}[clockwise from=0]             child[concept color=DeepSkyBlue4] {                 node[concept] {practical}[clockwise from=90]                 child { node[concept] {algorithms} [clockwise from=40]                 child { node[concept] {databases} }                 child { node[concept] {WWW} }}                 child { node[concept] {data structures} }             }               child[concept color=red,text=black] {                 node[concept] {applied}[clockwise from=360]                 child { node[concept,level distance=16cm,sibling angle=60] {databases} }             }             child[concept color=red,text=black] {                  node[concept] {technical}              }             child[concept color=red,text=black] {                  node[concept,text width=2cm] {theoretical}              };     \end{tikzpicture}}     \end{frame}          \end{document}      How can I replace `red` above with whatever is set by the selected theme (or customized with `\setbeamercolor*{palette tertiary}{fg=black,bg=black!10}`? I want to do this for various tikzpicture, pgfplots etc.


title: Write to logfile

text: I want to write some things to the log file. What is the best practice for this? Is it `\message{}` or `\typeout{}` or what?


title: Lyx: Quick way to insert Dirac bra-ket

text: In LyX, what is a quick way to insert mismatched delimiters in math environment? I tried typing `\left|\right>`, but it is not interpreted automatically.


title: Hyperlinks from a TikZ tree

text: I am trying to combine this answer on how to create hyperlinks with a tree hierarchy taken from the filesystem tree example. While the basic hyperlinking works, I get an error message as soon as I introduce the link style into the tree nodes. The error message is               ! Package pgf Error: No shape named  is known.      How can I combine the two partial solutions? The example I use is               \documentclass{article}     \usepackage[hidelinks]{hyperref}     \usepackage{tikz}     \usetikzlibrary{trees,calc}     \begin{document}     \tikzset{         hyperlink node/.style={             alias=sourcenode,             append after command={                 let     \p1 = (sourcenode.north west),                     \p2=(sourcenode.south east),                     \n1={\x2-\x1},                     \n2={\y1-\y2} in                 node [inner sep=0pt, outer sep=0pt,anchor=north west,at=(\p1)] {\hyperref[#1]{\phantom{\rule{\n1}{\n2}}}}             }         }     }          \tikzstyle{every node}=[draw=black,thick,anchor=west]          % simple drawing - works     \begin{tikzpicture}       \node [draw, inner sep=2ex,hyperlink node=sec:foo] {Go to Page Two};     \end{tikzpicture}          % tree without link - works      \begin{tikzpicture}[%       grow via three points={one child at (0.5,-0.7) and       two children at (0.5,-0.7) and (0.5,-1.4)},       edge from parent path={([xshift=2ex]\tikzparentnode.south west) |- (\tikzchildnode.west)},       growth parent anchor=west]       \node {Root Beer Rag}         child { node {Go to Page Two}};     \end{tikzpicture}          % tree with link - error     \begin{tikzpicture}[%       grow via three points={one child at (0.5,-0.7) and       two children at (0.5,-0.7) and (0.5,-1.4)},       edge from parent path={([xshift=2ex]\tikzparentnode.south west) |- (\tikzchildnode.west)},       growth parent anchor=west]       \node [hyperlink node=sec:foo] {Root Beer Rag}         child { node {Go to Page Two}};     \end{tikzpicture}          \clearpage     \section{Target}      \label{sec:foo}          \end{document}


title: Failure of \text within theorem environment

text: I have an equation within the statement of one of my theorems. Within this equation, I have some text to name a function. However, when this equation appears within the theorem environment, the output treats each letter of my function name as though it were a variable. How can I fix this?               \documentclass[11pt]{article}     \usepackage{amsmath}     \newtheorem{theorem}{Theorem}          \begin{document}          $\text{Function}(x) = 1$          \begin{theorem}     $\text{Function}(x) = 1$     \end{theorem}          \end{document}      ![output](http://i.stack.imgur.com/AZMR5.png)


title: Shading a strip between two intersection points of the curve with the axis

text: I wish to shade a small strip along the x-axis where the graph of a curve intersects the axis. I have used the following code               \documentclass[12pt]{standalone}          \usepackage{pgfplots}     \usetikzlibrary{patterns,intersections,calc}          \begin{document}     \begin{tikzpicture}       \begin{axis}[axis x line = middle, axis y line = center, ymin=-3,         xmin=-7, xmax=7,         xtick=\empty, ytick = \empty]         \addplot[smooth, name path=parabola] {x^2-2};         \path[name path=axis] (axis cs:-7,0) -- (axis cs:7,0);         \fill [name intersections={of=parabola and axis,by={a,b}}] (a)         circle (2pt)(b) circle (2pt);        \fill[pattern=north west lines] (a) -- (b) -- ++ (axis direction         cs:0,-0.4) -- cycle;        \fill[pattern=north west lines] (b) -- (a) -- ++ (axis direction         cs:0,-0.4) -- cycle;       \end{axis}     \end{tikzpicture}     \end{document}      The reason why I have used two fill statements is that in the first statement I am unable to figure how to specify the axis direction cs vector in the negative direction from b to a. Is there a way to do it?


title: Drawing intersecting 3D surface plots

text: I'm attempting to draw six semi-transparent intersecting spheres of different colors---two on each axis x, y, z and all joining at the origin---as shown in the figure below. Note how all the spheres intersect. ![\(Roughly\) intended result](http://i.stack.imgur.com/jU7kI.png) Seeing as this figure is created in `Matlab`, I tried converting the figure to `pgfplots` code, using `matlab2tikz`, but this did not work. Below is the `Matlab` code for the figure.               Theta=linspace(0,2*pi,200);     Phi=linspace(-pi/2,pi/2,200);     [theta,phi]=meshgrid(Theta,Phi);          rho1=cos(theta).*cos(phi);     rho2=-cos(theta).*cos(phi);     rho3=sin(theta).*cos(phi);     rho4=-sin(theta).*cos(phi);     rho5=sin(phi);     rho6=-sin(phi);          [x1,y1,z1]=sph2cart(theta,phi,rho1);     [x2,y2,z2]=sph2cart(theta,phi,rho2);     [x3,y3,z3]=sph2cart(theta,phi,rho3);     [x4,y4,z4]=sph2cart(theta,phi,rho4);     [x5,y5,z5]=sph2cart(theta,phi,rho5);     [x6,y6,z6]=sph2cart(theta,phi,rho6);          surf(x1,y1,z1,'FaceColor','red','EdgeColor','none')     hold on     surf(x2,y2,z2,'FaceColor','red','EdgeColor','none')     surf(x3,y3,z3,'FaceColor','blue','EdgeColor','none')     surf(x4,y4,z4,'FaceColor','blue','EdgeColor','none')     surf(x5,y5,z5,'FaceColor','green','EdgeColor','none')     surf(x6,y6,z6,'FaceColor','green','EdgeColor','none')          alpha(0.6)     camlight left     lighting flat      Next I tried drawing the figure in `tikz-3dplot` and `pst-solides3d`. With both of these methods, I had the problem that the surfaces didn't intersect. Instead, 2-dimensional projections of the spheres were drawn separately on the canvas, one on top of the other, as shown in the figures below. The first figure is the output from `tikz-3dplot`, and the second figure is the output from `pst-solides3d`. ![Attempt with tikz-3dplot](http://i.stack.imgur.com/HJusu.png) ![Attempt with pst-solides3d](http://i.stack.imgur.com/SLBj8.png) With `tikz-3dplot`, I also had an issue with certain axes appearing to be on top of the spheres, when they should rather appear to be inside them (ref. the negative half of the y axis). Below are the codes for the above figures, in the same order.               \documentclass[11pt]{standalone}     \usepackage[utf8]{inputenc}     \usepackage{tikz,tikz-3dplot}         \usetikzlibrary{arrows}          \begin{document}          \tdplotsetmaincoords{70}{135}          \begin{tikzpicture}[tdplot_main_coords,fill  opacity=.5,>=latex]     \pgfsetlinewidth{.1pt}          \tdplotsphericalsurfaceplot{72}{36}{4*abs(cos(\tdplotphi)*sin(\tdplottheta))}{black!85!white}{blue}     {\draw[color=black,thick,->]  (-6,0,0) --  (6,0,0)  node[anchor=north  east]{\textbf{x}};}     {\draw[color=black,thick,->]  (0,-6,0) --  (0,6,0)  node[anchor=north  west]{\textbf{y}};}     {\draw[color=black,thick,->]  (0,0,-6) --  (0,0,6)  node[anchor=south]{\textbf{z}};}          \tdplotsphericalsurfaceplot{72}{36}{4*abs(cos(\tdplottheta))}{black!85!white}{green}     {\draw[color=black,ultra thin,->]  (-6,0,0) --  (6,0,0)  node[anchor=north  east]{};}     {\draw[color=black,ultra thin,->]  (0,-6,0) --  (0,6,0)  node[anchor=north  west]{};}     {\draw[color=black,ultra thin,->]  (0,0,-6) --  (0,0,6)  node[anchor=south]{};}          \tdplotsphericalsurfaceplot{72}{36}{4*abs(sin(\tdplotphi)*sin(\tdplottheta))}{black!85!white}{red}     {\draw[color=black,ultra thin,->]  (-6,0,0) --  (6,0,0)  node[anchor=north  east]{};}     {\draw[color=black,ultra thin,->]  (0,-6,0) --  (0,6,0)  node[anchor=north  west]{};}     {\draw[color=black,ultra thin,->]  (0,0,-6) --  (0,0,6)  node[anchor=south]{};}          \end{tikzpicture}          \end{document}      * * *               \documentclass[11pt]{standalone}     \usepackage[utf8]{inputenc}     \usepackage{pstricks,pst-solides3d}          \begin{document}          \begin{pspicture}(-6,-6)(6,6)          \psset{viewpoint=100  100  100,Decran=150}     \axesIIID[showOrigin=true,mathLabel=false,axisemph=\textbf,labelsep=8pt](-7,-7,-7)(7,7,7)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=green,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=green2](0,0,-2)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=blue,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=blue2](-2,0,0)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=red,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=red2](0,-2,0)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=green,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=green1](0,0,2)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=red,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=red1](0,2,0)     \psSolid[object=sphere,r=2,action=draw*,fillcolor=blue,linecolor=black!85!white,linewidth=0.5pt,opacity=0.6,ngrid=15 24,name=blue1](2,0,0)          \end{pspicture}          \end{document}      How can I obtain the intended result and make the spheres actually intersect as shown in the first figure? Is there anything I can add to my methods above to make the spheres intersect? If not, are there other methods I can use to obtain the intended result? The output must be vector graphics and use the same font as the main document.


title: Adding several labels (year/month) to a graph in pgfplots

text: I would like to add several labels to a plot in `pgfplots`: one label for the month and one for the year, just like in this graph: ![enter image description here](http://i.stack.imgur.com/2ER9V.png) I tried to use the `extra tick label`, but I don't know how it is possible to change its format from month to year, so the extra and normal x label have the same format. Also I could not figure out how to get the ticks shifted so that they are left and right of the month label instead of centered. ## MWE               \documentclass{article}          \usepackage{pgfplots}     \usepgfplotslibrary{dateplot}           \begin{document}          \begin{tikzpicture}     \begin{axis}[     date coordinates in=x,     xtick=data,     extra x ticks={2009-10-01, 2010-02-01},     extra x tick style={yshift=-20pt},     %extra xticklabel=\year, % does not work     xticklabel style={anchor=near xticklabel},     xticklabel=\month,     date ZERO=2009-08-01,% <- improves precision!     ]     \addplot coordinates {     (2009-08-01, 050)     (2009-09-01, 100)     (2009-10-01, 100)     (2009-11-01, 100)     (2009-12-01, 040)     (2010-01-01, 020)     (2010-02-01, 000)     (2010-03-01, 035)     };     \end{axis}     \end{tikzpicture}          \end{document}      ## EDIT In order to get vertical lines between the different months labels, I tried to use Jakes approach and tried to name the nodes `\year\month`, e.g. 20102 (2010 Feb). The problem with that is that the months `(\month)` contain leading zeros and the parser parses them as octal numbers. So when I try to calculate `\month-1` to get the node before the current one, I receive a parser error. In order to solve that I tried to use the methods provided here, but none of them worked so far. ## MWE2               \documentclass[border=5mm]{standalone}          \usepackage{pgfplots}     \usepgfplotslibrary{dateplot}      \usetikzlibrary{calc}          \makeatletter     \long\def\ifnodedefined#1#2#3{%         \@ifundefined{pgf@sh@ns@#1}{#3}{#2}%     }     \makeatother          \begin{document}          \def\monthnames{{1,2,3,4,5,6,7,8,9,10,11,12}}          \begin{tikzpicture}     \begin{axis}[     date coordinates in=x,     xtick=data,     xticklabel style={         anchor=near xticklabel,                  % Approach 1: Does not work missing endcsname error         %name=\ifnodedefined{start\year{\pgfcalendar{tickcal}{\tick}{\tick}{\pgfcalendarshorthand{m}{-}}}}              %{end\year}  % Then this could be the last month             %{start\year}, % Otherwise, start the year                   % Approach 2: Does not work missing endcsname error         %name=\ifnodedefined{start\year\pgfmathparse{\monthnames[Mod(\tick-1,12)]}\pgfmathresult} % Does not work missing endcsname error             %{end\year}  % Then this could be the last month             %{start\year}, % Otherwise, start the year           },     xticklabel=\month,     date ZERO=2009-08-01,% <- improves precision!     ]     \addplot coordinates {     (2009-08-01, 050)     (2009-09-01, 100)     (2009-10-01, 100)     (2009-11-01, 100)     (2009-12-01, 040)     (2010-01-01, 020)     (2010-02-01, 000)     (2010-03-01, 035)     };     \end{axis}     \end{tikzpicture}          \end{document}


title: Spacing problem between equation and surrounding text

text: I want to insert formula in text and I used `equation` as shown:               \documentclass{article}     \usepackage{amsmath}          \begin{document}          So, $\rho : G \rightarrow GL(n,\mathbb{F})$ is representation if and only if          \begin{equation*}     \forall g,h \in G) \hspace{2mm} \rho(gh)=\rho(g)\rho(h).     \end{equation*}           \end{document}      My problem is too big vertical spacing before and after formula.


title: Check for empty macro argument

text: There is a description on how to check whether the argument of a macro is empty in What does \ifx\\#1\\ stand for? Unfortunately, I can't get any of the examples there to work. Among others, I have used the following code:               \documentclass{article}     \def\test#1.#2\\{%       \ifx\\#2\\          <no extension #2 is empty, because \\=\\>       \else         <extension is #2>       \fi%     }     \begin{document}     \test myfile.tex     \test myfile     \end{document}      What is wrong with my code? What is the problem with my usage of the snippets? Thanks in advance for your help.


title: BibLaTeX doesn't seem to work with MacTex 2010

text: I've read good things about biblatex so I want to use it for my paper. I use MacTex 2010 on OS X 10.6.6 with Textmate. So far I've been happy with MacTex but I just can' get `biblatex` to run. I did a `tlmgr update --all` and I've also tried `texhash` but no matter what, I can't even use the built-in styles. I tried to test `biblatex` by using "biblatex-apa": `\usepackage[bibstyle=apa.bbx]{biblatex}` but all I get is this error message:                Latex Error: /usr/local/texlive/2010/texmf-dist/tex/latex/biblatex/biblatex.sty:9654      Package biblatex Error: Style 'apa.bbx' not found.      The web hasn't been able to provide any help so far, maybe you guys can. Thanks.


title: Fixing punctuation after a field in biblatex

text: Customising a biblatex style, I want to ensure that after the title of books only a space is used. If you take a look at one of the standard drivers:               \DeclareBibliographyDriver{book}{%       \usebibmacro{bibindex}%       \usebibmacro{begentry}%       \usebibmacro{author/editor+others/translator+others}%       \setunit{\labelnamepunct}\newblock       \usebibmacro{maintitle+title}%       \newunit       \printlist{language}%       \newunit\newblock       \usebibmacro{byauthor}%       \newunit\newblock       \usebibmacro{byeditor+others}%       \newunit\newblock       \printfield{edition}%       \newunit       \iffieldundef{maintitle}         {\printfield{volume}%          \printfield{part}}         {}%       \newunit       \printfield{volumes}%       \newunit\newblock       \usebibmacro{series+number}%       \newunit\newblock       \printfield{note}%       \newunit\newblock       \usebibmacro{publisher+location+date}%       \newunit\newblock       \usebibmacro{chapter+pages}%       \newunit       \printfield{pagetotal}%       \newunit\newblock       \iftoggle{bbx:isbn}         {\printfield{isbn}}         {}%       \newunit\newblock       \usebibmacro{doi+eprint+url}%       \newunit\newblock       \usebibmacro{addendum+pubstate}%       \setunit{\bibpagerefpunct}\newblock       \usebibmacro{pageref}%       \usebibmacro{finentry}}      changing the part about the book title to read                 \usebibmacro{maintitle+title}%       \setunit{\addspace}%      does not work as the various `\newunit` instructions seem to over-ride it even if no additional fields are printed. What's the correct way to say 'the next punctuation must always be just a space'?


title: How to check invalid \cite{ENTRY} entries?

text: When I reference to non exiting bibliography entry               See \cite{NON EXISTING}      Instead of error, I result in document with               See [?]      How to do `\cite{}` checking ? I'd like to prevent citing non-exiting entries.


title: (Author, year, abbr. journal name) as citation style

text: I'm using `bibtex` and `natbib` in `beamer` (by defining the `newblock` command). I would like to have citations in the slides in the format (Author, year, abbr. journal name) instead of just (Author, year), without resorting to using `\citep[abbr. journal name]{Authoryear}`. An example: > (Campbell and Cochrane, 1999, JPE) instead of the regular (Campbell and > Cochrane, 1999). I use abbreviations in the `bibtex` file (`@STRING{JPE = "Journal of Political Economy"}`). Does anyone here know whether this is possible?


title: Proper margins in custom enumeration/itemize environements

text: I am using two custom list environments (`itemize-compact` and `descriptionhang`), which work fine on their own, but not when I nest them. Please consider this MWE:               \documentclass[a4paper]{article}          \usepackage{letltxmacro}     \usepackage{xargs}     \usepackage{xifthen}     \usepackage{enumitem}          \usepackage{geometry}     \geometry{left=27.5mm,right=27.5mm,bottom=27.5mm,top=27.5mm}          %Line spacing     \usepackage{setspace}     \setstretch{1.115}          %Paragraph indentation & spacing     \usepackage{parskip}     \setlength{\parskip}{2.75ex plus 0.5ex minus 0.2ex}          %Itemize with less spacing     \newenvironment{itemize-compact}     {\vspace{-1.5ex plus 0.2ex}     \begin{itemize}       \setlength{\itemsep}{-1.5ex plus 0.2ex}}     {\end{itemize}}          %Description environment with newlines and bit of spacing after the item titles     \newenvironment{descriptionhang}{%       \begin{description}[labelsep=0pt]%         \LetLtxMacro{\olditem}{\item}%         \renewcommandx\item[2][1,2]{\olditem\ifthenelse{\isempty{##1}}{}{\hspace{13.5pt}\textbf{##1}}\ifthenelse{\isempty{##2}}{}{\ ##2}\hfill\\[3pt plus 0.75pt minus 1.75pt]}}%       {\end{description}}          \usepackage{lipsum}          \begin{document}     Itemize-compact non-nested:     \begin{itemize-compact}     \item Blah     \item Bleh     \item \lipsum[2]     \end{itemize-compact}          Itemize-compact nested in a descriptionhang:     \begin{descriptionhang}     \item[Hello world]     \lipsum[2]          \begin{itemize-compact}     \item Blah     \item Bleh     \item \lipsum[2]     \end{itemize-compact}          \item[Foobar]     \lipsum[2]     \end{descriptionhang}          \end{document} This produces:![MWE result](http://i.stack.imgur.com/goWZc.png) Notice that the `itemize-compact` environment which is nested in the `descriptionhang` produces an incorrect result. The bullets are in the right spot but the text is not. Does anyone know how to fix this?


title: Bibtex - authors with titles i.e. military rank

text: Is there support for including an author's title in citations, i.e. their military rank or other title? Examples include: `(Blackadder 1917)` in-text and `Blackadder, Captain E. (1917)` in the bibliography. `(Blackadder 1648)` in -text and `Blackadder, Sir E. (1648)` in the bibliography. The problem I currently have is that completing the Author field in Bibtex as `Sir Edmund Blackadder` results in: `Blackadder, S. E. (1648)` in the biblio. I'm using BibDesk 1.6.2 Edit: Request for MWE. Not sure how to, as it's Bibtex, but just insert this into the Author field:               {Sir} Edmund Blackadder      Or any positioning of the braces. BibDesk gives previews that are replicated in my real file.


title: Wrong kerning after \beta on printout

text: The following minimal example looks fine on my system:               \documentclass[]{report}     \pagestyle{empty}     \begin{document}     \Huge Test $\alpha, \beta, \gamma$ Test     \end{document}      The PDF looks like this: ![enter image description here](http://i.stack.imgur.com/vwtkh.png) But when I print it out, the text looks like this! ![Printout](http://i.stack.imgur.com/Fol8q.jpg) What happened to my `\beta`?


title: Remove space before chapter title - with KOMA script (scrbook)

text: I am using the KOMA script document class `scrbook`. Is there any way to make the chapter headings appear exactly at the top of the page body just by using KOMA (without using `titlesec`, `fancyhdr`, `fncychap`, ... for they would mess up other things in my documents)? Is there any way to change the space between section heading and the following text?


title: texlive font installation - what am I doing wrong

text: I'm trying to install Source Sans Pro from CTAN [1] on a TeX Live system. My OS/TeX system is ubuntu 12.04 "precise" and TeXLive 2009-15. I don't have root rights so I can't switch to a newer version or add an extra repository, so it'll have to be a manual installation in `~/texmf'. I'm following all the usual steps and I've spent half a day trying to find out what I'm doing wrong (including reading StackExchange) so I thought I'd ask here in case someone immediately spots what I've missed.   * $TEXMFHOME => $HOME/texmf   * unzip the file from [1] and place all files in their correct directory, so tfms are in `~/texmf/fonts/tfm/sourcesanspro` etc. - this is the same directory layout as my `/usr/share/texmf` for the packages installed with the package manager   * run `mktexlsr`/`texhash`, it correctly finds my `~/texmf` directory.   * run `updmap --enable Map=SourceSansPro.map` and `updmap`   * `texhash` again Here's my test document:               \documentclass{article}     \usepackage[default]{sourcesanspro}     \begin{document}     This is a test.     \end{document}      And I get (I manually replaced my homedir with `~`):               (~/texmf/tex/latex/mweights/mweights.sty))     (./font.aux) (/usr/share/texmf-texlive/tex/latex/ly1/ly1ptm.fd)     (~/texmf/tex/latex/sourcesanspro/T1SourceSansPro-LF.f     d) [1{~/.texmf-var/fonts/map/pdftex/updmap/pdftex.map     }] (./font.aux)     kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 SourceSansPro-Regular-lf-t1--base     mktexpk: don't know how to create bitmap font for SourceSansPro-Regular-lf-t1--base.     kpathsea: Appending font creation commands to missfont.log.     )     !pdfTeX error: pdflatex (file SourceSansPro-Regular-lf-t1--base): Font SourceSansPro-Regular-lf-t1--base at 600 not found     ==> Fatal error occurred, no output PDF file produced!      Ok, let's check for the file:               $ find ~/texmf -name 'SourceSansPro-Regular-lf-t1--base*'     ~/texmf/fonts/tfm/sourcesanspro/SourceSansPro-Regular-lf-t1--base.tfm      What can I try next? [1] http://www.ctan.org/tex-archive/fonts/sourcesanspro


title: How to get listings that both feature line breaking of long identifiers and keywords highlighting?

text: I'm currently writing a book chapter in bioinformatics, and I would like to provide my readers some useful command lines to invoke recent software. To that purpose, I'm using the listings package to format minimal python scripts, whose execution would produce the figures in the chapter.   The package works great in general, but I'm having difficulties getting it to break-lines properly on long strings, as shown by the following MWA, in which the string is simply not broken.               \documentclass{minimal}     \usepackage{listings}     \lstloadlanguages{Python}     \lstset{         language=Python,         basicstyle=\ttfamily,         morekeywords={rna},         breaklines=true,         keywordstyle={\bfseries\color{purple}},     }     \begin{document}       \begin{lstlisting}[caption={No line breaking}]         rna = "ACUUGUAUAACCUCAAUAAUAUGGUUUGAGGGUGUCUACCAGGAACCGUAAAAUGGUGAUUACAAAAUUUGUUUAUGACAUUUUUUGUAAUCAGGAUUUUUUUU"       \end{lstlisting}     \end{document}      In Listings package does not break, a Tex hack was given, to take the 'letter' status away from every character, thus allowing the listings package to treat long ids/strings as sequences of 'atomic tokens'. The new MWA would read:               \documentclass{minimal}     \usepackage{listings}     \lstloadlanguages{Python}     \lstset{         language=Python,         basicstyle=\ttfamily,         morekeywords={rna},         breaklines=true,         keywordstyle={\bfseries\color{purple}},     }     \begin{document}       \makeatletter         \def\lst@lettertrue{\let\lst@ifletter\iffalse}       \makeatother       \begin{lstlisting}[caption={No line breaking}]         rna = "ACUUGUAUAACCUCAAUAAUAUGGUUUGAGGGUGUCUACCAGGAACCGUAAAAUGGUGAUUACAAAAUUUGUUUAUGACAUUUUUUGUAAUCAGGAUUUUUUUU"       \end{lstlisting}     \end{document}      However, compiling the above code no longer provides any syntax highlighting, as shown in the following picture (red line represents the edge of the margin): ![Minimal \(non\)-working example for line-breaking vs highlighting problem in listings package](http://i.stack.imgur.com/EVDn5.png) Can one get, at the same time, line-breaking of long ids/strings without losing syntax highlighting?


title: Author formatting of multiline quotes in margin

text: I use my own command to typeset quotes in the margin of my document using pdflatex and memoir, see the MWE below. Each quote consists of the actual quote itself and its author. The problem I have is that the author is always typeset on a new line, even if there is enough space to have it appear, with appropriate spacing, after the end of the quote on the same line. In the MWE below, it seems to me that the author of the second quote should not be typeset on a new line, but on the same line. Is there a way in which the following could be achieved automatically:   1. If the quote fits onto a single line, the author follows on a new line. (First quote in MWE.)   2. If the quote does not fit onto a single line, but there is enough space after the end of the quote (not clear what "enough" is, I admit), then the author should be listed on the same line at the end of the quote. (This is what I would like to get in the second quote in MWE, but don't at the moment.)   3. If the quote does not fit onto a single line, and there is not enough space after the end of the quote, then the author is listed on a new line. (Third quote in MWE.) MWE:               \documentclass[a4paper,10pt,draft]{memoir}     \usepackage{lipsum}     %%% formatting     \setstocksize{29.7cm}{21.0cm} % A4 stock     \settrimmedsize{27.94cm}{21.0cm}{*} % 27.94cm = 11in     \setlength{\trimtop}{0.0cm}     \setlength{\trimedge}{\stockwidth}     \addtolength{\trimedge}{-\paperwidth}     \settypeblocksize{23.94cm}{12.3cm}{*}     \setlrmargins{2.0cm}{*}{*}     \setulmargins{2.0cm}{*}{*}     \setmarginnotes{\onelineskip}{5.28cm}{\onelineskip}     %%% side notes     \marginparmargin{outer}     \newcommand{\mysidenote}[1]{\strictpagecheck\marginpar{\footnotesize #1}%     }     %%% side quotes - building on mysidenote     \newcommand{\mysidequote}[2]{\strictpagecheck       \marginpar{%         \raggedright\footnotesize\textsl{#1}%         \newline\hspace*{\fill} ---{#2}%       }     }     \checkandfixthelayout     \begin{document}     \lipsum[1]     \mysidequote{I don't like being quoted in the margins.}{A. N. Other}     \lipsum[2]     \mysidequote{Some quotes are too long to fit onto a single line.}{Y. A. N. Other}     \lipsum[3]     \mysidequote{Some quotes are too long to fit onto a single line and need two     full lines.}{Y. A. N. Other}     \end{document}


title: Re-color alphabets in mathmode

text: In user700902's answer to this thread, the following code is suggested to color alphabets A-Z green:               \makeatletter     \def\colorizemath #1#2{%         \expandafter\mathchardef\csname orig:math:#1\endcsname\mathcode`#1         \mathcode`#1="8000         \toks@\expandafter{\csname orig:math:#1\endcsname}%         \begingroup            \lccode`~=`#1            \lowercase{%         \endgroup            \edef~{{\noexpand\color{#2}\the\toks@}}}%        }     \@for\@tempa:=A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z\do{%         \expandafter\colorizemath\@tempa{green}}     \makeatother      If an alphabet somewhere in the document is supposed to be red, is there a way to override the green command? The normal `$\textcolor{red}{Q}$` does not work. I mean, say I have a text `$PQRST$`, and I want just the letter `$Q$` to be red. What can I do in that case?


title: Displaying text from current page on the next page

text: I am trying to place text in the footer of the next page. That is i have a question environment which defines the question and its solution but i want the solution to be displayed at the end of the next page. Either in the footer or just after the paragraphs of that text. Any help.               \documentclass{myclass}     \usepackage{blindtext}          \begin{document}     \begin{questions}       \question{What is the earth age}       \answer{14 billion} % the answer should be displayed at the         %end of the next page     \end{questions}     \end{document}


title: Writing a book using memoir - different language than English

text: I'd like to write a book using the memoir class - is it possible to change the main language of the document to something else than English, e.g. German?


title: hyperlinks in nested list

text: Say I have the following nested list:               \begin{enumerate}[label=\normalfont({\alph*})]     \item\label{itm:a}      \item\label{itm:b}      \begin{enumerate}[label=\normalfont({\roman*})]     \item\label{itm:i}     \item\label{itm:ii}     \item\label{itm:iii}     \end{enumerate}     \end{enumerate}      When I create this I get separate hyperlinks for b and i or ii or iii. How can I get it such that for example b(i) comes under one hyperlink?


title: Appendices at section level in TOC

text: I would like my appendices to appear in TOC at section level instead of at chapter level. Like this:                   Appendices             A  My appendix 1 . . . . . . .             B  My appendix 2 . . . . . . .      I've tried with `\settocdepth` but it does not work. My code:                   \documentclass[11pt,a4paper]{report}         \usepackage[english]{babel}     % english language         \usepackage[latin1]{inputenc}   % accents in source         \usepackage[T1]{fontenc}        % accents in DVI         \usepackage{color}              % add color to the text         \definecolor{bluekeywords}{rgb}{0.13,0.13,1}         \definecolor{greencomments}{rgb}{0,0.5,0}         \definecolor{redstrings}{rgb}{0.9,0,0}              \usepackage{graphicx}           % images in the document         \usepackage{float}              % containers         \usepackage{wrapfig}            % wrap text around figure              \usepackage{vmargin}            % redefine the margins         \setmarginsrb{2.5cm}{1.5cm}{2.5cm}{1cm}{0cm}{0cm}{0cm}{1cm}              \usepackage[         hyperindex=true, % add links in the index         bookmarks=true,  % show bookmarks bar when displaying the document}{hyperref}         ]{hyperref}         \hypersetup{         colorlinks=true, % colored links         breaklinks=true, % allows return line in too long links         urlcolor= blue,  % links color         linkcolor= blue, % internal links color         citecolor= blue, % green by defaut, color of citation links (bibliography)         bookmarksopen=true,         pdftitle={Cloud 3D Teapot},         pdfauthor={Jos\'{e} L\'{o}pez C\'{i}vico},         pdfsubject={Cloud Latency}         }              \usepackage{listings}         \lstset{         basicstyle=\footnotesize,       % code font size         numbers=left,                   % place of numbers         numberstyle=\normalsize,        % numbers font size         numbersep=7pt,                  % distance between code and its numeration         backgroundcolor=\color{white},  % background color         }              \lstdefinestyle{CSharp}{           language=[Sharp]C,           showspaces=false,           showtabs=false,           breaklines=true,           showstringspaces=false,           breakatwhitespace=true,           escapeinside={(*@}{@*)},           commentstyle=\color{greencomments},           keywordstyle=\color{bluekeywords},           stringstyle=\color{redstrings},           basicstyle=\ttfamily         }              \lstdefinestyle{XMLc}{           language=XML,           showspaces=false,           showtabs=false,           breaklines=true,           showstringspaces=false,           breakatwhitespace=true,           stringstyle=\color{bluekeywords},           keywordstyle=\color{redstrings},           morekeywords={name, connectionString, providerName},           commentstyle=\color{greencomments},           basicstyle=\ttfamily         }              \usepackage{titlepic}         \usepackage{appendix}              \usepackage{makeidx}         \usepackage{lmodern}         \usepackage{kpfonts}              \begin{document}              \tableofcontents         \newpage              \listoffigures         \newpage              \chapter{Test Chapter}         \section{A Regular Section}          \appendix     \clearpage % or \cleardoublepage     \appendixpage     \addappheadtotoc     % code to show appendices at section level in TOC     \begin{appendices}         \chapter{Installation requirements}     \chapter{Acronyms}     \end{appendices}              \end{document}


title: How to obtain verbatim text in a footnote?

text: I want to employ a `\verb` command in a footnote. But, when I run `pdflatex` on               \documentclass{article}          \begin{document}          I want this.\footnote{\verb|But, it does not work!|}          \end{document}      I get this:               ! LaTeX Error: \verb illegal in command argument.      How can I do what I am after? (I know that I could just use `\footnote{\texttt{But, I lose the semantic mark-up.}}`)


I get a strange error with a `\Verb` escape in a footnote:               \documentclass{article}      \usepackage{fancyvrb}     \begin{document}     Works inline \Verb!S#Var! but doesn't in footnote.     % \footnote{No really, it doesn't \Verb!S#Var! you see.}     \end{document}      When I uncomment the footnote line, the complaint is:               You can't use `macro parameter character #' in restricted horizontal mode.


title: Expand macro immediately in \pagenote

text: I'm trying to use the contents of a macro in a `\pagenote`, using the `memoir` class:               \documentclass{memoir}     \makepagenote          \def\myvar{Good morning.}          \begin{document}          In the morning\pagenote{\myvar}          \def\myvar{Good night.}          At night\pagenote{\myvar}          \printpagenotes     \end{document}      However, `\myvar` is written into the `.ent` file verbatim and unexpanded. As a result, the page notes show up in the final PDF as >   1. Good night. >   2. Good night. > Instead of the expected >   1. Good morning. >   2. Good night. > Is there anyway I can expand macros in `\pagenote`?


title: Simple tabular too wide

text: I'm trying to write quite a simple document here but I'm having a frustrating problem with my tabular. Here's my code:               \documentclass[a4paper,10pt]{article}     %\documentclass[a4paper,10pt]{scrartcl}     \begin{document}     \begin{itemize}     \item[a)]\mbox{}\\%using this to go to the next line       \begin{tabular}{|l|c|c|}       \hline       & \textbf{A1 Configuration Série} & \textbf{A2 Configuration Parallèle} \\ \hline       \(\Delta\)V de la source : & 210V & 120V \\ \hline       I fourni par la source : & 10A & 20A \\ \hline       P dissipé par dans le radiateur : & 2000W & 2000W \\ \hline       Temps de fonctionnement : & 100s & 100s \\ \hline       Énergie livrée au radiateur : & 200 kJ & 200kJ \\ \hline       Énergie fournie par la source: & 210kJ & 240kJ \\ \hline       \end{tabular}     Text here should be indented as if there was no table.     \end{itemize}          \end{document}      The problem is that it gives mme this error :               Overfull \hbox (92.27675pt too wide) in paragraph at lines 5--16      What I understand from this error is that my tabular is too wide. I've tried to resize the comlums with `p{2.5cm}` but it did raise me another error. I think the problem is caused by the indentation of the item I use. If I could set the table out of the indent, but keep the rest inside of it, that would be great. I've heard talking about `\makebox` but it doesn't seem to be supported in my environment, I use Kile on linux, or if it requires a special package. **UPDATE** I got a second question here, and I just ask for explanation, because I suppose this is something fairly easy to fix. If I use this table, after that paragraph I get the same overfull warning :               \item[c)]       En regardant le tableau d'efficacité ci-dessous, on observe que le \%       d'efficacité diminue lorsque l'on passe d'une configuration en série       vers une configuration en parallèle.             \begin{table}[h]       \begin{tabular}{|l|c|c|c|c|}       \hline           & \textbf{A1} & \textbf{A2} & \textbf{B1} & \textbf{B2} \\ \hline           \textbf{\% d' efficacité :} & 95.24\% & 83.33\% & 95.24\% & 83.33\% \\ \hline       \end{tabular}       \end{table}               \end{itemize}      Gives me this warning :               Overfull \hbox (10.11162pt too wide) in paragraph at lines 138--141      I don't think the problem is the table here, because if I get rid of it, there's still a warning. Why can't TeX render a simple paragraph like this without considering it is tool large? I'm quite new to LaTeX and I don't get this. The render is ok in my PDF.


title: Glossaries package and hyphenated (dashed) acronym fail to break across lines

text: With respect to using the `glossaries` package, if I have an acronym with a long hyphenated word, it often result in sentences that runs into margins. For example:               \newacronym[sort=WH]{WH}{Wh}{Wiener-Hammerstein}      results in: ![Line-breakring does not occur at dashes](http://i.stack.imgur.com/tDj9p.png) I have also tried               \newacronym[sort=WH]{WH}{Wh}{Wiener\-Hammerstein}      But that fails as well, it just produces `WienerHammerstein`. How do I get round this problem and allow the hyphenated ord to break across the hyphen, but always write the hyphen in normal situations?


title: Wrap figure in theorem-environment

text: I'd like to wrap a figure around a theorem-environment but when I use the wrapfig or \parpic environment the text overlaps the figure. Plain text automatically wraps around a \parpic figure but the itemize/enumerate environment doesn't. Therefore I came up with a work-around:               \documentclass[a4paper,11pt]{article}     \usepackage{graphicx,picins}%+any other needed packages..     \newcommand{\items}{\hspace{1.25em} \textbullet \hspace{0.55em}} %tried to replicate the alignment of the itemize environment.          \begin{document}     \parpic[r]{     \includegraphics[width=0.3\textwidth]{image.jpg}     }     \items this long text would have overlapped the picture if it would have been an 'itemize' environment     \items and so on..     \end{document}      This works but now I'd like to indent each new line after the bullet so it is right below the upper one (like the itemize environment). sth like `\items{long text}`


title: ShareLaTeX Bibliography in ApJ format

text: I am trying to use ShareLaTex to compile my bibliography in the Astrophysical Journal (ApJ) format. The document compiles in ApJ format just fine, but the bibliography is compiled in some generic format and `\cite{}` and `\citep{}` do not work as expected, with my references replaced by the usual question marks. Here is my preamble:               \documentclass[apj]{emulateapj}          \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{amsmath}          \usepackage{natbib}     \usepackage[backend=bibtex]{biblatex}     \bibliographystyle{apj}     \bibliography{P1640_AGES}          \begin{document}          ...          \printbibliography     \end{document}


title: How can I enable non-standard characters such as blanks or german Umlaute (ä,ö,ü) for hyperref labels?

text: I am trying to write a small package that (as a minor sub-feature) incorporates some usage of hyperref to get internal cross-references. To be precise, I want to do provide functionality like the following:               \mytarget{Äö üß} % prints "Äö üß" in a section-like style          some text goes here          \mylink{Äö üß} % clickable reference to the above      It is important that the user need not specify a label, this should be handled automagically. This is an minimal (non)-working example of what I'm thinking about so far:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{hyperref}          \makeatletter     \newcounter{@hash@id}     \newcommand\hashstring[1]{%       \ifcsname #1\endcsname%       \typeout{#1 already defined}%       \else         \expandafter\xdef\csname #1\endcsname{\the@hash@id}%         \stepcounter{@hash@id}%         \typeout{defining #1 now}%         \fi       \csname #1\endcsname%     }     \makeatother          \newcommand\mytarget[1]{\hypertarget{\hashstring{#1}}{\section{#1}}}     \newcommand\mylink[1]{\hyperlink{\hashstring{#1}}{\textit{#1}}}          \begin{document}     \mytarget{Äö üß}     some text goes here     \newpage     \mylink{Äö üß}     \end{document}      As you can see, I am trying to auto-generate a label simply by enumerating the distinct "targets" in a global counter, the resulting number being the label. This might not be the most clever way to do it, but I hoped it would be simple to implement. (In the final version, I would of course add some package- specific prefix to the label in order to not interfere with user-defined labels). However, it doesnt work due to a "missing \endcsname" error, which I do not fully understand - but from browsing the documentation, I can guess that it has something to do with the expansion order of the arguments for hyperlink and hypertarget. Any help and/or suggestions how to achieve this functionality by other means would be appreciated.


title: is there a package to draw graphical models?

text: I would like to draw a few graphical models in latex. Is there a package that does that well? I found the following package: http://www.mpi-inf.mpg.de/~dietz/probabilistic-models-tikz.zip but the .tex file does not compile for me, it gives me errors such as:               ! Package PGF Math Error: The function `add' already exists.          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.23 }          ?       I was also hoping for something in which I can draw more "fancy" graphical models (perhaps with shading of the variables or the plates). If this package worked though, it would be a good start.


title: Some styles work in Lyx's BibTeX Generated Bibliography, others don't

text: Some styles work correctly for Lyx's BibTeX Generated Bibliography, others give errors. For example, if I set the style to IEEEtran, then all is well. However, if I set it to apsrev, I get output like:               Runaway argument?     {{72} (\bibinfo {year}{{2012}}), ISSN \bibinfo {issn}{{0002-9505}}. \par \ETC.     ! File ended while scanning use of \@firstofone.     <inserted text>                      \par      l.397 ...Interference-Diffraction_Project_AJP_bib}          I suspect you have forgotten a `}', causing me     to read past where you wanted me to stop.     I'll try to recover; but if the error is serious,     you'd better type `E' or `X' now and fix your file.               Class revtex4 Warning: Endnote numbers changed: rerun LaTeX.               ! LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{document}.               See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.399 \end{document}          Your command was ignored.     Type  I <command> <return>  to replace it with another command,     or  <return>  to continue without it.      Any thoughts on what I should do? Thanks. EDIT: Here's a minimal lyx file with the problems. Plain works but the one it's set as doesn't. I'm using the latest version of MacTex; I downloaded it yesterday. bib file lyx file


title: How to modify apalike.bst to have a colon (:) instead of period (.) after "author (year)"?

text: I already modified `apalike.bst` to some of my needs, but I can't find this one -- which part do I have to change to have it include a colon after "author (year)" instead of a period `.`? (I am using `bibtex` but not `biblatex`.)


title: Creating a new environment with referencing

text: I'm trying to create a referenceable "system" environment that basically displays an equation with a custom counter. Then I want to reference the environment with `autoref`, so as to have "System (S1)" as output when I reference it.               \newcounter{system}\setcounter{system}{0}          \newenvironment{system}{\refstepcounter{system}\begin{equation*}}{\hfill(S\arabic{system})     \end{equation*}}          \hyperref[system]{System~\ref{system}}     \def\systemautorefname{System}          \begin{system}      \dot x=u(x),     \label{s1}     \end{system}      However, when I do               \autoref{s1}      I get an error saying that the reference `s1` is undefined. What am I missing?


title: how to get the current month in two languages?

text: from time to time, a current month value has to be updated. it is a din a4 page, which includes german and english text. at the end of the page, only the month and year (without a day) is given. For instance `Jänner / January 2014` (right now) which LaTeX command / trick can be used to avoid manual month modifications? (when using pdflatex, the 2 month values and the year should be up to date without a modification but in german and english --- as stated in the example above)


title: Parsing file name into document

text: I have a group of tex files named according to the following convention: xxx_yyy_zzz.tex I would like to use the components (xxx, yyy, zzz) of the file name as inputs in the document, n particular when creating the title / header. For example, I would like to be able to set the title of the document to be `Learning about yyy'' and the author to be`zzz'' with a footer that says xxx. I have so far found some code that lets me remove the end of a file name: http://tex.stackexchange.com/a/21808 I have also tried using \StrBetween from the xstring package to process \currfilename from the currfile package, but this doesn't work.               \documentclass{article}     \usepackage{currfile}     \usepackage{xstring}          \begin{document}          \makeatletter     \filename@parse{\currfilename}     \StrBetween{\filename@base}{_}{_}     \makeatother          \end{document}      Actually I think I'm using \StrBetween wrong, but even if I do something like               \StrBetween{\filename@base}{xxx}{zzz}      it doesn't print out yyy, but if I do               \StrBetween{a \filename@base b}{a}{b}      then it will print xxx_yyy_zzz. Are there any suggestions as to how I can take a file named xxx_yyy_zzz.tex and include the text components xxx, yyy, and zzz to be used later in the file, e.g., in the header or title?


title: Expandable string substitution

text: I am trying to define a macro               \formatstr{\mystring}{(string empty)}{the string is: #1}      which expands to `(string empty)` when `\mystring` is empty (as judged, e.g. by etoolbox's `\csdefempty`) and expands to `the string is: \mystring` otherwise. I could write, for example,               \newcommand*\formatstr[3]{%       \def\fmt##1{#3}%       \ifdefempty#1{#2}{\fmt{#1}}%     }      which works as I want, except for the fact that `\formatstr` itself is not expandable because of the `\def` assignment. Is there any other way in which I could substitute the `#1` in the third argument of `\formatstr` with `\mystring` in an expandable way? **Edit: Let me try to more clearly explain what I'm trying to do** Using `etoolbox` I can type things such as               \ifdefempty{\mystring}{(empty string)}{the string \mystring\ is funny}      But this gets tedious if I have to write               \ifdefempty{\mystringwithaverylongname}{(empty string)}{the string \mystringwithaverylongname\ is long}      So what I would like to be able to write is               \formatstr{\mystringwithaverylongname}{(empty string)}{some string #1 is nice}      Or perhaps               \formatstr{\mystringwithaverylongname}{(empty string)}{i've heard that :str is interesting}      What I want to know if is it possible to substitute the `#1` (or `:str`) in the third argument with the contents coming from the first?


title: Ignore badness 10000 in \ttfamily

text: Due to zero stretch in `\ttfamily` the lines get `Underfull \hbox (badness 10000)` often. I would like to ignore these, still being informed about other badnesses in the same paragraph. See the example:               \documentclass[twocolumn,draft]{article}          \usepackage[latin]{babel} % latin hyphenation          % this allows description label to spread multiple lines     \usepackage{enumitem}\setlist[description]{style=unboxed}          % change column width to show the issue     \textwidth16.5cm     \columnsep0.5cm          \hbadness1750 % we allow a bit larger \hbadness in the twocolumn mode          % my macro to print TeX code snippets     \gdef\printTeX#1{%       \begingroup\ttfamily       \def\\{\char92\relax}%       \def\{{\char123\relax}%       \def\}{\char125\relax}%       \def\'{\allowbreak}%       #1%       \endgroup     }          \begin{document}          \begin{description}          \item[\printTeX{\\newcommand\'\{<command>\}\'[<num args>]\'[<opt arg default>]\{<expansion>\}}] ---      In accumsan egestas est, vestibulum gravida nibh adipiscing in.     Maecenas fringilla porta dolor quis bibendum.     Nulla arcu libero, pharetra nec semper et, tempus a purus.     Nullam non mi sed nulla accumsan varius.     Nulla sit amet mi urna, eu cursus nunc.     Nunc et justo eros, sed vehicula felis.     Nulla aliquet turpis accumsan leo auctor facilisis aliquam lectus sagittis.           \end{description}          Plus text \ldots          \end{document}      It produces three "badness", **I would like the first to be ignored (i.e. not even mentioned in the log) but the following two still shown.**               Underfull \hbox (badness 10000) in paragraph at lines 27--35          \OT1/cmtt/m/n/10 \newcommand{<command>}[<num-args>][<opt-          Underfull \hbox (badness 10000) in paragraph at lines 27--35     \OT1/cmtt/m/n/10 arg-default>]{<expansion>} \OT1/cmr/m/n/10 --- In ac-cu-          Underfull \hbox (badness 1783) in paragraph at lines 27--35     \OT1/cmr/m/n/10 m-san ege-stas est, ve-sti-bu-lum gra-vi-da ni-bh


title: How to place chapter titles in the header only on the first page of each chapter in ConTeXt?

text: How can I place the chapter titles in the header, but only on the first page of that chapter? This is the opposite of the question, How to prevent chapter titles from appearing in the header on the first page of each chapter in ConTeXt?, in other words, the header only displays the title on the first page, not on the other pages.


title: width of beamercolorbox in background

text: How can I make a `beamercolorbox` in the `background` template take the whole width of the slide? The following doesn't work correctly (but it works for some other templates such as `headline`):               \documentclass{beamer}          \setbeamercolor{banner}{bg=green}          \setbeamertemplate{background}{       \begin{beamercolorbox}[wd=\paperwidth,ht=2cm]{banner}       \end{beamercolorbox}     }     \begin{document}     \begin{frame}       \frametitle{AA}       BB     \end{frame}     \end{document}


title: Pgfplots label get repeated by tikz spy library

text: My question is very similar to this question. I label a certain curve in my plot and magnify a part of that. The `\spy` command repeats the `\label` which causes `multiply defined` label warnings which are annoying. The solution presented in the linked question does not apply to my example as I have no way of naming a node I can refer to later. How can I stop `\spy` from repeating the label in a `pgfplot`?                \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}          \usetikzlibrary{spy}          \begin{document}               \begin{tikzpicture}[spy using outlines={circle, magnification=2, size=1cm,     connect spies}]      \begin{axis}       \addplot{x^2 - x +4};\label{plot:curve}      \end{axis}     \begin{scope}        \spy[green!30!black,size=1cm] on (3,.85) in node [fill=white] at (4,2);     \end{scope}     \end{tikzpicture}           \ref{plot:curve}     \end{document}


title: Text in footer on first page, but no page numbers

text: For a `documentclass{article}` document, I would like to print a word on the right edge of my footer on the first page, otherwise I would like all headers and footers to be empty (no page numbers). I assume I can use `fancyhdr` to accomplish this, but the documentation is a little beyond me (it contains a few examples, but it doesn't explain what all the different options are or what they do).


title: Separating two types of articles from bibtex using \printbibliography

text: I am not an expert on LaTeX/TeX but know very basic of it only. I have a `.bib` file where I put all my "articles" like this in the `.bib`:               @article{,           author         = "Authors1",           title          = "{Ttile of articles}",           collaboration  = "Collaboration",           year           = "2012",           ...           ..     }          @article{,           author         = "Authors2",           title          = "{Ttile of articles}",           collaboration  = "Collaboration",           year           = "2011",           ...           journal        = "Phys.Lett.",             ..     }      The first one is un-published but it's available on the arXiv while the 2nd one is published in a journal ... the difference is the line "journal" above. I want to create two categories of published and unpublished to list the two types separately in an automated way. How could I achieve this using `\printbibliography`? It will help me every time I update the list (usually quite large) as things will be taken care in an automated way. For the moment I am using a `.sty` file which uses this to define `bib` categories:               % Bibliography categories                                    \def\makebibcategory#1#2{\DeclareBibliographyCategory{#1}\defbibheading{#1}{\section*{#2}}}     \makebibcategory{books}{Books}                               \makebibcategory{papers}{Refereed Research Papers}           \makebibcategory{chapters}{Book chapters}                    \makebibcategory{conferences}{Papers in Conference Proceedings}     \makebibcategory{techreports}{Unpublished working papers}     \makebibcategory{bookreviews}{Book reviews}                  \makebibcategory{editorials}{Editorials}                     \makebibcategory{phd}{PhD Thesis}                            \makebibcategory{subpapers}{Submitted Papers to Journals and arXiv}     \makebibcategory{curpapers}{Current projects}                     \setlength{\bibitemsep}{2.65pt}                              \setlength{\bibhang}{.8cm}                                   \renewcommand{\bibfont}{\small}                                   \renewcommand*{\bibitem}{\addtocounter{papers}{1}\item \mbox{}\hskip-0.85cm\hbox to 0.85cm{\hfill\arabic{papers}.~~}}     \defbibenvironment{bibliography}                             {\list{}                                                       {\setlength{\leftmargin}{\bibhang}%                           \setlength{\itemsep}{\bibitemsep}%                           \setlength{\parsep}{\bibparsep}}}                         {\endlist}                                                   {\bibitem}                                                        \newenvironment{publications}{\section{\LARGE Publications}\label{papersstart}\vspace*{0.2cm}\small     \titlespacing{\section}{0pt}{1.5ex}{1ex}\itemsep=0.00cm      }{\label{papersend}\addtocounter{sumpapers}{-1}\refstepcounter{sumpapers}\label{sumpapers}}          \def\printbib#1{\printbibliography[category=#1,heading=#1]\lastref{sumpapers}}       A working example would be of great help. Thanks a lot in advance.


title: Using \label with amsmath nested environments

text: First of all, I'm not sure these environments are supposed to be nested, but the fact is the alignment comes out exactly how I wanted, and no errors are issued.               \documentclass[a5paper]{article}     \usepackage{amsmath}          \begin{document}          \begin{gather}     \begin{align}     a &= b + c \notag \\     %\label{important}     b - a &= -c \\     c - a &= -b     \end{align} \\     a - (b-a) - (c-a) = 2a     \end{gather}          \end{document}      ![enter image description here](http://i.stack.imgur.com/lApDh.png) The problem appears when I uncomment the `\label`, then compilation is interrupted with:               ! Package amsmath Error: Multiple \label's: label 'important' will be lost.      The result is still OK, and I wouldn't mind too much if I didn't have to press enter every time I compile... I could bypass `amsmath`'s redefinition of `\label` as shown here, but is there another possible fix? Or am I doing something fundamentally wrong?


title: 2-col floats and citation order problem

text: I am writing a document using _IEEEtran_ class. And I am dealing with typical problem with 2-col floats (in my case a table). I am aware of issue that a table has to be declared one page before than I would like to show it. That is OK, however, if I would like to use **numerical bibliography** (standard for IEEE) and put **citation inside the caption of the float** the numbers will be according to the declaration in the code and not according to the order in the document. That is of course undesirable. Is there any possible way how to fix it? INFO and MWE: using MiKTeX 2.9 (Version 0.4.3 r.857)               \documentclass[journal,a4paper]{IEEEtran}     \usepackage{cite}          \ifCLASSINFOpdf     \usepackage[pdftex]{graphicx}     \graphicspath{{Pictures/}}     \DeclareGraphicsExtensions{.pdf,.jpeg,.png}     \else     \fi     \usepackage[cmex10]{amsmath}     \interdisplaylinepenalty=2500     \usepackage{array}     \usepackage{mdwmath}     \usepackage{mdwtab}     \usepackage[caption=false,font=footnotesize]{subfig}     \usepackage{fixltx2e}     \usepackage{url}     \usepackage{booktabs}     \usepackage{lipsum}          \hyphenation{op-tical net-works semi-conduc-tor}          \begin{document}     \title{TITLE}     \author{Author     \thanks{Author is with the Department     of Electrical Engineering and Computing, University of Zagreb, Croatia, e-mail:(author@mail.com).}}          \markboth{journa;, August~2012}%     {Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}          \maketitle     \begin{abstract}     \lipsum[2]     \end{abstract}          \begin{IEEEkeywords}     Stars, space, time.     \end{IEEEkeywords}     \IEEEpeerreviewmaketitle                \section{Introduction}      \IEEEPARstart{E}{very} \lipsum[2-6]          \begin{table*}[!t]     \renewcommand{\arraystretch}{1.3}     \caption{Properties of systems, data are obtain from \cite{TheU.S.government-TheDepartmentofDefense2008} and \cite{EuropeanUnion2010} and valid for 25th July     }     \label{tab:stat}     \centering     \begin{tabular}{@{}lrrrrr@{}}\toprule[1.5pt]      GNSS & satellites [\#] & altitude [km] & orbit period [$^{\circ}$] & inclination [$^{\circ}]$ & used frequencies [MHz] \\ \midrule      GPS & 32(+3) & 20 185  & 11h58m & 55 &  1575.42 \& 1227.6\\      GLONASS & 22(+4) & 19 100  & 11h16m & 65 & 1597-1606 \& 1238-1250\\      Galileo& 0(+1) & 23 222  & 14h & 56 & 1575.42 \& 1278.75 \& 1191.795\\      Beidou & 13 & 21 500 & 12h & 55 & 1610-1626.5 \& 2483.5-2500\\      \bottomrule[1.5pt]      \end{tabular}      \end{table*}           \section{Positioning principle of GNSS}       \IEEEPARstart{A}{propo} \cite{IEEEhowto:kopka} \lipsum[7-10]           \section{Conclusion}      \lipsum[8]      \ifCLASSOPTIONcaptionsoff      \newpage      \fi           \begin{thebibliography}{9}                \bibitem{TheU.S.government-TheDepartmentofDefense2008}      The U.S. government - The Department of Defense, \emph{GLOBAL POSITIONING SYSTEM        STANDARD POSITIONING SERVICE},'' \relax no.~September, 2008.           \bibitem{EuropeanUnion2010}      European Union, ``\emph{European GNSS ( Galileo ) Open Service - Signal In Space        Interface Control Document},'' \relax no.~September, 2008.           \bibitem{IEEEhowto:kopka}       H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus        0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.           \end{thebibliography}      \end{document}      As you can see, the table is placed well, but the citation has lower number than the citation on the first page. ( **! NOTE !** ) the bibliography is created automatically! in other case I would manually write the order as I would like to of course! **Question is: Is there any solution or I have to avoid writing citations in floats captions?** THX for any feedback!


title: How to get the curly caligraphic font for sigma algebras?

text: The title pretty much says it all. Note that I am aware of the caligraphic font (cal, mathcal) which is actually what wikipedia uses too but books on the measure theory usually contain a much fancier font with many loops and I'd like to use it too if possible.


title: Photo on the lowest side of the header

text: I am trying to add a photo on the header. I thought of using `wallpaper` package. My simple code is               \documentclass{article}     \usepackage{lipsum}% http://ctan.org/pkg/lipsum     \usepackage{wallpaper}     \usepackage[margin=2.8cm]{geometry}     \begin{document}%\vspace{1cm}     \ULCornerWallPaper{0.2}{headerPhoto}     \lipsum[1-3]     \end{document}      and the output is ![enter image description here](http://i.stack.imgur.com/IL9R2.png) As you can see the photo is placed **exactly** at the upper left corner. I believe it would be more fancy to look like that ![enter image description here](http://i.stack.imgur.com/NxiEp.png) righter and lower, that is. I tried to use `hspace{}` and `\vspace{}` but it doesn't seem to work. Any idea on that?


title: Multiple Authors with common affiliations in IEEEtran conference template

text: I have a paper where I have 4 different authors with a common affiliation. I would like to mention there names and then a single affiliation followed by individual mail addresses. I have included the code I have and the format snapshot I would like to have. I am using TexStudio and am new to LaTeX. Please help me and tell me the correct use of \author for this.               \documentclass[conference]{IEEEtran}     \begin{document}          \title{CNFET-Based 0.1 V to 0.6 V DC/DC Converter}               % author names and affiliations     % use a multiple column layout for up to three different     % affiliations     \author{\IEEEauthorblockN{Aditya Tyagi}     \IEEEauthorblockA{School of Electrical and\\Computer Engineering\\     Georgia Institute of Technology\\     Atlanta, Georgia 30332--0250\\     Email: http://www.michaelshell.org/contact.html}     \and     \IEEEauthorblockN{Homer Simpson}     \IEEEauthorblockA{Twentieth Century Fox\\     Springfield, USA\\     Email: homer@thesimpsons.com}     \and     \IEEEauthorblockN{James Kirk\\ and Montgomery Scott}     \IEEEauthorblockA{Starfleet Academy\\     San Francisco, California 96678-2391\\     Telephone: (800) 555--1212\\     Fax: (888) 555--1212}}     \end{document}      ![This is how I would like to have it.](http://i.stack.imgur.com/CunnB.jpg)


title: Probability tree using TikZ for Bernoulli experiments?

text: Consider the tree below. Is there an easy way to label every left edge q, every right edge p, every left node f and every right node r, without doing it manually for every level? Second question: Is there a nice way to generalize this Bernoulli process tree example for n-levels?               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}     \begin{document}     \pagestyle{empty}                    \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=6cm]     \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=3cm]     \tikzstyle{level 3}=[level distance=3.5cm, sibling distance=2cm]               \tikzstyle{bag} = [text centered,circle,draw,inner sep=0.3em]     \tikzstyle{head} = [inner sep=0pt]          \begin{tikzpicture} %        \node[head] {} %        child { %          node[bag] {} %          child{ %            node[bag]{}            child { %              node[bag, label=below: %              {$a$}] {} %            } %            child { %              node[bag, label=below: %              {$b$}] {} %            } %          }%      child{ %            node[bag]{}            child { %              node[bag, label=below: %              {$c$}] {} %            } %            child { %              node[bag, label=below: %              {$d$}] {} %            } %          }%        }        child { %          node[bag] {} %          child{ %            node[bag]{}            child { %              node[bag, label=below: %              {$e$}] {} %            } %            child { %              node[bag, label=below: %              {$f$}] {} %            } %          }%      child{ %            node[bag]{}            child { %              node[bag, label=below: %              {$g$}] {} %            } %            child { %              node[bag, label=below: %              {$h$}] {} %            } %          }%        }; %             %              \end{tikzpicture}                \end{document}


title: Trying to insert a picture but when using graphicx package footer moves to the bottom of the page

text: When i put that i am using graphicx, my fancyhdr footer moves to the very bottom of the page? How can i stop it from doing this?


title: Ligatures: why "fi", but not "fj" as well?

text: My university name is "FJFI", with e-mail/web addresses containing lowercase "fjfi". Then "fi" gets ligatured whereas "fj" does not, and the result looks a bit strange. My question is, which possibility would you choose:   1. Leave it as is.   2. Forbid ligature for "fi".   3. Generate/define a ligature for "fj". **(With an extra question: how?)**   4. Some other solution? Below you see the shapes in _Computer Modern_ and _New Century Schoolbook_ , the second one is with forbidden ligature (for comparison). !["fjfi" in different fonts](http://i.stack.imgur.com/b5ub4.png)


title: How to know the status of a style? defined? empty?

text: `mystyle/.style= {...}` is perhaps used ? I would like to know how to verify if the style is really defined and in this case, I would like to know if the style is empty ? Is it possible to use `\pgfkeysifdefined` to get the first result ?


title: Compiling a LaTeX document manually

text: I've created LaTeX documents before using 'nice IDEs' such as TeXnicCenter and have a little experience in general with TeX, however, now I'm wondering about creating one "manually". By that, I mean doing something such as writing the tex document in a very simple editor (such as VIM) and then compiling it myself with pdflatex via the command prompt. Has anyone ever done this and if so, I really just need to know how I'd go about it? What's the process to doing it? While the IDE is nice, I'd really like to be able to create LaTeX documents 'on my own'. Thanks for any information you can provide!


title: biblatex: displaying all authors of multi-author works in the bibliography

text: I'm using the `biblatex` package to add citations and a bibliography to my LaTeX document. I've noticed that only the first author plus "et al." is displayed for works with more than three authors. That's fine with me for in- text-citations, but I'd rather have the complete author information in the bibliography. How can I do that?


title: Two questions about Classic Thesis

text: The first is that, although I like the fact that long citations are in the form J. Doe et al. in the chapters, I don't want it in the actual bibliography ; how can I do that? The second is that the pages seems "inverted" ; when I print my thesis, pages that should be on the right are even-numbered for some reason.. and therefore the alignment and the margins are not on the correct side, how can I change it?


title: citations using biblatex?

text: The following one is working for restricting maximum number of authors for both citations and bibliography but how do we restrict to only citations.               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=authoryear,maxnames=2]{biblatex}          \renewcommand*{\finalnamedelim}{\addspace\&\space}          \addbibresource{biblatex-examples.bib}          \begin{document}     Filler text \parencite{bertram,companion,jaffe,moraux}.     \printbibliography     \end{document}


title: How to add the MacTeX subpackage Latin-Modern-Fonts to a BasicTeX installation

text: I've installed the current BasicTeX, a subset of MacTeX 2013. This includes the Latin Modern fonts, presumably in the TeX Live directory tree, which isn't a place that OSX looks for fonts. The full MacTeX distribution has a subpackage called Latin-Modern-Fonts. This is supposed to install Latin Modern as a normal OSX font, that all programs can use. MacTeX also includes 2 GB of stuff I don't want. My question: is it possible to install the union of BasicTeX and Latin-Modern- Fonts, ideally without downloading the full MacTeX distribution? If not, is there a simple way to install the fonts by hand?


title: Is there an editor with code block folding, one click dvi-ps-pdf compilation, etc?

text: I am a Windows user and using TeXnicCenter now. But I want to change to another one because TeXnicCenter does not provide us with a code block folding. The new editor I want to use:   * runs on Windows.   * provides me with a code block folding.   * provides me with one click button to do "latex->dvips->ps2pdf". Other optional things I need:   * Support Subversion.   * Free of charge.   * Support syntax highlighting.


title: Tikz-Place a rectangle in specific angle

text: I am trying to place a rectangle on top of an imaginary circle of certain radius, whose center lies in the middle of another rectangle. What I've tried so far is the following               \documentclass{article}          \usepackage{kerkis}     \usepackage{tikz}          \begin{document}      \begin{tikzpicture}       % Incident Beam       \draw[->, thick] (0,0) -- (2,0);       % Target : Boron + Au --- The center of the imaginary circle is in the center of these rectangles       \draw[gray!30,fill=gray!30] (6,1) rectangle (6.5,-1);       \draw[gray!70,fill=gray!70] (6.5,1) rectangle (8.5,-1);       % Scattering Chamber - The imaginary circle       %\draw[thick,red,->,dashed] ([shift=(-120:5cm)]7.25,0) arc (0:100:-1cm);       %\draw[dashed, gray!50] (7.25,0) circle (7cm);       % Telescopes --- I want to place this rectangle on 170 degrees on top of the imaginary circle       \draw[black!70, fill=black!70, rotate=30] (2,-2) rectangle (2.5, -2.5);       \end{tikzpicture}     \end{document}      My output is ![enter image description here](http://i.stack.imgur.com/wO76G.png) How to place this black rectangle, on a certain angle on top of the dashed circle?


title: writing comment in c++ with latex

text: I write my comments in c++ with latex, but i don't want the delimiter be appeared when converting to pdf. here is one of them:               /*{\ {\color{blue}\subsection{Class Link}     \verb|Link| is a \verb|Link| with \verb|Value|, \verb|Prev|,     and \verb|Succ| in it. }}*/      please help me.


title: How to set section numbering in [svmult]?

text: In my book I have automatically-numbered chapters and sections but when I type               \chapter{CHAP 1}     \section{SEC 1}     \subsection{SUBSEC 1}     \subsection{SUBSEC 2}      I recieve a chapter with number 1, section with number 1, and subsections with numbers 1.1 and 1.2 but I'd like to have chapter numbered 1, section numbered 1.1 and subsetions with numbers 1.1.1 and 1.1.2. Please, can any1 can help me ? My code is below:               \documentclass[envcountresetchap]{svmult}     \usepackage{polski}          \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{courier}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage{multicol}     \usepackage{footmisc}     \usepackage{subeqnarray}     \usepackage[T1]{fontenc}     \usepackage[latin2]{inputenc}      \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{rotating}     \usepackage{tikz}     \usepackage{float} %pakiet do obsługi obrazków     \usepackage{graphicx} %pakiet do dodawania obrazków     \usepackage{tabularx}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{tikz}     \usepackage{float}     \usepackage{hyperref}      \hypersetup{colorlinks=true,             linkcolor=blue,             citecolor=blue,             urlcolor=blue}               \title*{Title}               \begin{document}     \frontmatter     \maketitle          \preface     \lipsum          \tableofcontents          \mainmatter     \chapter{CHAP 1}     \section{SEC 1}          \subsection{SUBSEC 1}     \subsection{SUBSEC 2}          \end{document}


title: bidi's undefined environments in (my) LuaLaTeX system

text: I typeset Arabic text with `LuaLaTeX`. I am using the following definitions and it works nicely:               \newcommand{\arabtext}[1]       % Arabic inside LTR         {\bgroup\luatextextdir TRT\arabicfont #1\egroup}      (More expanded version here.) A while ago, though, I've been told through a comment that "[my] definition ... is wrong" and that I might have a look at the `bidi`-package. Indeed I looked at it several times but never got it to work on my system. In fact, I can not even compile an example taken from the `bidi`-documentation itself:               % !TEX TS-program = lualatex     \documentclass{article}     \usepackage{fontspec}     \newfontfamily\Parsifont[Script=Arabic]{Arabic Typesetting}     \usepackage{bidi}     \begin{document}     \begin{RTL}     Anyone who reads Old and Middle English \LRE{Short LTR text} literary texts will be familiar with the mid-brown volumes of the EETS, with the symbol of Alfred's jewel embossed on the front cover.     \begin{LTR}     Anyone who reads Old and Middle English \RLE{Short RTL text} literary texts will be familiar with the mid-brown volumes of the EETS, with the symbol of Alfred's jewel embossed on the front cover.     \end{LTR}     \end{RTL}     \end{document}      The only result is `LaTeX Error: Environment RTL undefined`. Why is that so? is `bidi` incompatible with LuaLaTeX? I am asking, because I do believe that bidi could be a better solution than mine offered above (because, e.g., `bidi` has many other feature such as RTL footnotes etc.) and would like to try and to use it.


title: Issues centering table headers

text: I already asked how to best align header rows in a table especially in a `tabu` environment. Align (center) header row in table The two identical solutions worked great for one table but I am having issues with another table now. Using exactly the same technique I cannot get the headers aligned properly. Here is my example plus a screenshot of the table below:               \documentclass[10pt,DIV=12,a4paper,numbers=noenddot]{scrreprt}          \usepackage{tabu}     \usepackage{multicol}     \usepackage{multirow}     \usepackage{longtable}     \usepackage{caption}     \usepackage{booktabs}          \usepackage{etoolbox}     \makeatletter     \newcommand{\changefont}[3]{\usefont{\f@encoding}{#1}{#2}{#3}}     \patchcmd{\LT@makecaption}{\hss}{\hss\normalfont\normalsize}{}{}     \makeatother     \newenvironment{myfont}[6][1.2] % 1.2 is the default for the baselinestretch       {\par\linespread{#1}\fontsize{#5}{#6}\changefont{#2}{#3}{#4}}       {\par}          \linespread{1.2}          \begin{document}          \begin{table}          \begin{myfont}{phv}{m}{n}{6}{9}          \begin{tabu}{l@{\hspace*{43pt}}r@{\hspace*{43pt}}r@{\hspace*{15pt}}r@{\hspace*{42pt}}rr@{\hspace*{42pt}}rr}          \multicolumn{1}{c}{column1} & \multicolumn{1}{c}{CC} & \multicolumn{1}{c}{column2} &     \multicolumn{1}{l}{column3} & \multicolumn{2}{c}{column4} &      \multicolumn{2}{c}{{\hspace*{12pt}}column5} \\          % \multicolumn{2}{c@{\hspace*{12pt}}}{column5} \\     % \multicolumn{1}{l}{column3{\hspace*{10pt}}}              &   &   &   & AA & BB & AA & BB \\          \midrule     AAAAAAAAAAAA & BBBBBBB & BBBBBBB & BBBBBBB & BBBBBBB  & BBBBBBB  & BBBBBBB  & BBBBBBB \\     AAAAAAAAAAAA & BBBBBBB & BBBBBBB & BBBBBBB & BBBBBBB  & BBBBBBB  & BBBBBBB  & BBBBBBB \\     AAAAAAAAAAAA & BBBBBBB & BBBBBBB & BBBBBBB & BBBBBBB  & BBBBBBB  & BBBBBBB  & BBBBBBB \\     \end{tabu}      \end{myfont}     \end{table}          \end{document}      ![enter image description here](http://i.stack.imgur.com/PhWGH.png) From the screenshot one can clearly see that all the centred `{c}` columns are not in line with the rest of the column. I used the `\hspace` approach from my previous question to center column 5 again using `\multicolumn{2}{c}{{\hspace*{12pt}}column5}`. However, this seemed to have an effect only when the `\hspace` is inside the curly brackets of `column5` and not within the `{c}` column unlike in my previous question. I commented out this approach after the column definitions to show you how I tried to do it. I did not forget to add the `@` sign when I put it within the `{c}` column. Then I tried to center column 3. I aligned it left because even when it was aligned left it was already too far to the right hand side. So I added some `\hspace` after the column name `column3` to shift it back to the left. See commented line: `% \multicolumn{1}{l}{column3{\hspace*{10pt}}}`. However, nothing happened until I added 40 or more pt's. Then suddenly, instead of moving the column header latex shifted all columns from column 3 onwards to the right leaving the headers where they were before. The same happened to the other columns. Sometimes the header did not move. Sometimes they moved but sometimes just the rest of the column got shifted. I think I was just lucky with my previous example that it worked there. It seems so arbitrary how latex handles that spacing or does it only look arbitrary to me? Can anyone help to properly align these header rows, please?


title: Horizontal alignment of multiple glossaries

text: I utilize the `glossaries`package with `acronym` option as well as an self- defined symbols list. Unfortunately, each glossary aligns different horizontally. Is it possible to make them aligned? Otherwise, it looks distracting to me. ![vertical glossaries alignment](http://i.stack.imgur.com/3TuVW.png) Code:                 \documentclass[8pt]{scrartcl}            % LuaLaTeX       \usepackage{luatextra}            \usepackage[xindy,style=long,numberline,savewrites=true,acronym,nomain]{glossaries}       % new group for symbols       \newglossary[slg]{symbolslist}{syi}{syg}{Symbols}       \makeglossaries            % SYMBOLS:       \newglossaryentry{sy:te}{name=$\text{T}_\text{E}$, description={echo time}, sort=sy-echotime, type=symbolslist}       \newglossaryentry{sy:tr}{name=$\text{T}_\text{R}$, description={repetition time}, sort=sy-repetitiontime, type=symbolslist}       % ACRONYMS:       \newacronym{adc}{ADC}{anlog-to-digital converter}       \newacronym{peg}{PEG}{polyethylene glycol}            \begin{document}       \printglossaries       Text Text  Text Text Text Text Text Text        Text Text Text Text Text Text Text Text.       .... \gls{peg} .... \gls{adc}       .... \gls{sy:tr} .... \gls{sy:te}            \end{document}


title: How to use tikzexternal?

text: I use some huge file to plot and for this I changed the tex conf file to increase memory that works. But I would like use instead external memory for this I try to use tikzexternal. But I fail. ## MWE               \documentclass[table]{beamer}          \usepackage{etex}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize[shell escape=-enable-write18, mode=list and make] %, prefix=figures/     \tikzset{external/force remake}     \usepackage{pgfplots, xstring}     \usepackage{pgfplotstable}     \usepackage{xcolor}     \usepackage{listings}     \usepackage{textcomp}     \usepackage[utf8]{inputenc}     \usepackage[american]{babel}          \usetheme{CambridgeUS}               \newenvironment{footnotetabular}{\footnotesize\tabular}{\endtabular}     \newenvironment{smalltabular}{\small\tabular}{\endtabular}     \newenvironment{tinytabular}{\tiny\tabular}{\endtabular}               \definecolor{rougeClair}{RGB}{191,0,0}     \definecolor{blanc}{RGB}{255,255,255}     \tikzexternalize[mode=list and make]     \tikzset{         % Defines a custom style which generates BOTH, .pdf and .png export         png export/.style={             external/system call/.add={}%             {; convert -density 300 -transparent white "\image.pdf" "\image.png"}         }     }     \pgfplotsset{       compat        = newest,  % <-- moves axis labels near ticklabels (respects tick label widths)       table/col sep = comma     }          \hypersetup{ urlcolor=blanc }          \title{blah}               \begin{document}     \pgfplotstableread{f1.txt} \tableA               %\pgfkeys{/pgf/number format/fixed,/pgf/number format/1000 sep = \thinspace}          \begin{frame}       \titlepage blah     \end{frame}               \begin{frame}       \frametitle{Plan}       \tableofcontents     \end{frame}               \begin{frame}       \frametitle{}       \begin{tikzpicture}[scale=0.8]         \centering         \begin{axis}[             xlabel                  = X,             ylabel                  = Y,             height                  = 10cm,             width                   = 10cm,             enlarge x limits        = false,             xmin                    = 10,             xmax                    = 80,             x tick label style      = {font=\footnotesize},             y tick label style      = {font=\footnotesize}           ]           \addplot [only marks, mark size = 0.5,  scatter, scatter src=y] table [ x=X, y=Y ] from \tableA;         \end{axis}       \end{tikzpicture}     \end{frame}               \end{document}      ## Result               $ pdflatex test.tex          $ make -f test.makefile          pdflatex -halt-on-error -interaction=batchmode -jobname "test-figure0" "\def\tikzexternalrealjob{test}\input{test}"     ...     This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)     %&-line parsing enabled.     entering extended mode     make: *** [test-figure0.pdf] Erreur 1          $ tail test-figure0.log     Here is how much of TeX's memory you used:      25606 strings out of 256216      576400 string characters out of 1917072      1500001 words of memory out of 1500000      28286 multiletter control sequences out of 10000+200000      8657 words of font info for 32 fonts, out of 1200000 for 2000      645 hyphenation exceptions out of 8191      56i,17n,74p,770b,1345s stack positions out of 5000i,500n,6000p,200000b,15000s      ## Whith document class same result               \documentclass{article}          \usepackage{etex}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize[shell escape=-enable-write18, mode=list and make] %, prefix=figures/     \tikzset{external/force remake}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \usepackage{pgfplotstable}     \usepackage{xcolor}     \usepackage[utf8]{inputenc}               \tikzexternalize[mode=list and make]     \tikzset{         % Defines a custom style which generates BOTH, .pdf and .png export         png export/.style={             external/system call/.add={}%             {; convert -density 300 -transparent white "\image.pdf" "\image.png"}         }     }     \pgfplotsset{       compat        = newest,  % <-- moves axis labels near ticklabels (respects tick label widths)       table/col sep = comma     }               \begin{document}     \pgfplotstableread{f1.txt} \tableA            \begin{tikzpicture}[scale=0.8]         \centering         \begin{axis}[             xlabel                  = X,             ylabel                  = Y,             height                  = 10cm,             width                   = 10cm,             enlarge x limits        = false,             xmin                    = 10,             xmax                    = 80,             x tick label style      = {font=\footnotesize},             y tick label style      = {font=\footnotesize}           ]           \addplot [only marks, mark size = 0.5,  scatter, scatter src=y] table [ x=X, y=Y ] from \tableA;         \end{axis}       \end{tikzpicture}          \end{document}      **Edit:** same error with 10 lines from the huge file ## Input file file: f1.txt               i,X,Y     214,55.44,10.4825     3879,66.29,9.2017     215,65.71,340.529     3971,45.59,351.606     3970,44.16,342.988     3973,61.64,13.2072     3972,64.92,8.65114     3975,59.09,7.90864     2264,40.32,406.593


title: Using CJK (Chinese/kanji) characters in math using unicode-math on lualatex

text: I'm trying to persuade the unicode-math package to let me insert CJK characters (Chinese ideograms) in math formulæ. Here's a sample input (the first few lines are merely to check that basic functionalities and fonts are present:                \documentclass[a4paper]{article}      \usepackage{fontspec}      \usepackage{unicode-math}      \setmainfont{Linux Libertine O}      \newfontfamily\cjkfont[Script=CJK]{Kochi Mincho}      \setmathfont{XITS Math}      \setmathfont[range={"4E00-"9FFF},Script=CJK]{Kochi Mincho}      \begin{document}      Hello, world!  Здравствуй, мир!  Unicode est vraiment \emph{épatant} !           \cjkfont{漢字}           $\mathbf{Δ} = (Δ_ι)_{ι∈I}$           $無 = ∅$      \end{document}      The "Linux Libertine O" and "Kochi Mincho" fonts are present on my system, respectively as `LinLibertine_R.otf` and `kochi-mincho-subst.ttf`. I'm using `lualatex` from TeXlive 2012, and the `fontspec` and `unicode-math` packages it contains. Everything works fine except the last formula, in which the character 無 simply does not appear. Now the line                \setmathfont[range={"4E00-"9FFF},Script=CJK]{Kochi Mincho}      was _supposed_ to mean "for all Unicode characters in the range from U+4E00 to U+9FFF (i.e., the main CJK block), use the Kochi Mincho font". The only clue I have is this warning:               *************************************************     * fontspec warning: "script-not-exist"     *      * Font 'KochiMincho' does not contain script 'CJK'.     *************************************************      But first of all I can't imagine what it means (the font in question is a CJK font, so _obviously_ it does contain the CJK script, and, indeed, in text mode it works fine); and besides, using the `\cjkfont` command I defined produces the same warning but still works, so this warning alone cannot be fatal.


title: Bullet and equations or itemize and equation

text: I am using the following command.               \documentclass{12 pt}{article}          \begin{document}          $\bullet$  $A = B$             \end{document}       Here, I need to show the both bullet and equation by the number like A = B ....(1) on the same line. Is there anyway we can do this?