title: How to color numbers in axis?

text: I want to color the numbers 3 in blue and -1 in green as show in the picture below. ![enter image description here](http://i.stack.imgur.com/RXnc0.jpg) My code is this :               \documentclass[12pt,a4paper]{article}      \usepackage[utf8]{inputenc}      \usepackage{amsmath}      \usepackage{amsfonts}      \usepackage{amssymb}      \usepackage{tikz}      \usepackage{tkz-euclide}      \begin{document}      \begin{tikzpicture}      \tkzInit[xmin=-4.5,xmax=4,xstep=1]      \tkzAxeX[label={}]      \coordinate (A) at (3,0);      \coordinate (O) at (0,0);      \coordinate (B) at (-1,0);      \coordinate (C) at (.5,.7);      \coordinate (D) at (4,.7);      \coordinate (E) at (-.5,.7);      \coordinate (F) at (-4,.7);      \tkzDrawSegment[ultra thick, color=blue](O,A)      \tkzDrawSegment[ultra thick, color=green](O,B)      \tkzDrawSegments[dashed](O,C C,D O,E E,F)      \end{tikzpicture}     \end{document}      I use the tkz-euclide package


title: xelatex myriad pro l with apostrophe issue

text: I compile my document with xelatex. I use Myriad pro               \setmainfont[Mapping=tex-text]{Myriad Pro}      My problem is that the "l'a" is looking OK but not the "l'i" the i touches the apostrophes. Can someone tell me how to fix this issue? ![enter image description here](http://i.stack.imgur.com/7D8ko.png)


title: Expand (for PDF ToC) biblatex's citation commands

text: For a research report I want to embed some of the cited papers as PDFs (with `\includepdf`). As all related metadata is available in the bibtex database and also the PDF filenames can be computed out of the bibtex key. So I would like to have an `\IncludePaper{<bibtex key>}` command that (a) creates an entry with the paper's title in the ToC and (b) includes the PDF:               \documentclass{book}          \usepackage{filecontents}     \usepackage[defernums=true, hyperref, backref, refsegment=chapter]{biblatex}     \usepackage{hyperref}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {The Alpha Paper},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {The Bravo Paper},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {The Charlie Paper},     }     \end{filecontents}          % The bibtex database to use (\bibliography{bibliotest} in your case)     \bibliography{\jobname}          \newcommand{\IncludePaper}[1]{%       \phantomsection{}       \addcontentsline{toc}{section}{\citeyear{#1}: \citetitle{#1}}     % \includepdf[pages=-,pagecommand={}]{#1.pdf}     }          \begin{document}               \tableofcontents          \nocite{*}     \printbibliography          \chapter{Papers}       \IncludePaper{A01}       \IncludePaper{B02}     \end{document}      This works relatively well, including nice entries in the ToC. In the _PDF ToC_ (the tree view on the lefthand side of the PDF viewer), however, only the citation keys appear. ![enter image description here](http://i.stack.imgur.com/rXduK.gif) I guess this is caused by the fact that `\citeyear` and `\citetitle` are protected commands that are not expanded when the PDF ToC is created. Is there any way to get just the plain text result of these commands and pass it to `\addcontentsline` in a way, so that the PDF ToC contains the paper's year and title?


title: How does one set document class options (e.g. paper size) for LaTeX output?

text: The `header` option lets you insert TeX code in the preamble after `\documentclass{article}`, but what if I want to change the default paper size or the default font size? For this, I would need to insert text between `\documentclass` and `{article}`, for instance: `\documentclass[a4paper,10pt]{article}`. Update: I forgot to mention that I am using `spin()` to generate the PDF document via LaTeX.


title: biblatex-apa: Author's first name is repeated in brackets

text: I am using the biblatex-apa package together with the latest biber and biblatex versions (... I think). The issue is, that sometimes the author's first name, or its abbreviation, is repeated in square brackets after the author name. I think the reason is some sort of conflict, because it doesn't happen, when there is only a single citation of one article in the file. Let me give you a minimal example. (It is not so minimal, but short enough, I think)               \documentclass{article}          \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[       backend=biber,       style=apa,       apamaxprtauth=7,       doi=true,       isbn=false,       url=false     ]{biblatex}     \DeclareLanguageMapping{american}{american-apa}               \begin{filecontents}{\jobname.bib}     @article{Andersson2002,     author = {Andersson, G. and Str\"{o}mgren, T.},     doi = {10.1097/01.PSY.0000031577.42041.F8},     isbn = {0000031577},     journal = {Psychosomatic Medicine},     pages = {810--816},     title = {{Randomized controlled trial of Internet-based cognitive behavior therapy for distress associated with tinnitus}},     url = {http://www.psychosomaticmedicine.org/content/64/5/810.short},     volume = {64},     year = {2002}     }     @article{Andersson2003a,     author = {Andersson, Gerhard and Carlbring, Per},     doi = {10.1080/16506070310014466},     file = {:Users/Julia/Documents/Psychologie/Diplomarbeit/Literatur/Andersson\_2003.pdf:pdf},     journal = {Cognitive Behaviour Therapy},     number = {3},     pages = {97--99},     title = {{Internet and Cognitive Behaviour Therapy: New opportunities for treatment and assessment}},     url = {http://www.tandfonline.com/doi/abs/10.1080/16506070302315},     volume = {32},     year = {2003}     }     \end{filecontents}     \addbibresource{\jobname.bib}               \begin{document}          This paper is really cool \cite{Andersson2002}\cite{Andersson2003a}      \printbibliography          \end{document}      Compiling it, gives me ![This.](http://i.stack.imgur.com/2zT66.png) What can I do to get rid of the brackets?


title: Aligning multiple authors (with pictures) in a grid

text: Working on a project with 4 members, I'd like to align the authors in an "even" way on the title page. I'm thinking a simple 2 by 2 "grid" would likely look best, but I'm having some issues getting it to work. The current code gives me the three first authors on one line, with the fourth on a separate line. The `titling` package seems like it could be used for what I want by encasing the author part in some kind of table, but even just including it gives me the error `Argument of \reserved@a has an extra }`. As far as I can tell, this error is because of there being images within the `\author` command (Note that due to a requirement of this particular assignment, the images are needed). Any help would be appreciated!               \documentclass[11pt, titlepage, a4paper]{article}     \usepackage{graphicx}          \begin{document}         \title{Project report}         \author{A. Uthor \\YYMMDD-XXXX \\ \includegraphics{photo}         \and A. Uthor \\YYMMDD-XXXX \\ \includegraphics{photo}         \and A. Uthor \\YYMMDD-XXXX \\ \includegraphics{photo}         \and A. Uthor \\YYMMDD-XXXX \\ \includegraphics{photo} }         \maketitle     \end{document}


title: XeLaTex compilation error using bclogo (mps image problem)

text: I am trying to change from LaTeX to XeLaTeX, and I have some problems with the `.mps` images included by the `bclogo` package. Here is a minimal example:               \documentclass{article}     \usepackage{lipsum}      \usepackage[tikz]{bclogo}     \begin{document}       \begin{bclogo}[couleur=blue!30]{Lorem Ipsum}         \lipsum[1]       \end{bclogo}     \end{document}      It compiles fine with both `rubber --pdf` and `pdflatex`, but with `xelatex` I get an error:               ! Unable to load picture or PDF file 'bc-fleur.mps'.      What can I do ? When trying to find a solution to my problem on the web, I found people that are using `bclogo` with `xelatex`, so it seems possible. I am on Ubuntu, and I just installed `texlive-full`, so my `XeTeX` version is:               This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian)


title: Distance between tree levels in Tikz, edges and node centering

text: Level distance does not seem to have any effect on the 1st node's distance from its children in the MWE below (tried adding `level distance` and playing with its values at every level, but it works only for the levelX styles):               \documentclass[10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[landscape,paper=ansibpaper]{geometry}     \usepackage{tikz}     \usetikzlibrary{trees}     \usetikzlibrary{shadings}     \tikzstyle{every node}=[draw=black,thin,anchor=west, minimum height=2.5em]          \begin{document}          \begin{figure}[!htb]     \resizebox{\linewidth}{!}{          \begin{tikzpicture}[         supervisor/.style={%             edge from parent fork down,             level distance=2.5cm,             text centered, text width=5cm},         teammate/.style={%             text centered, text width=3cm,             level distance=2.5cm,             fill=gray!10},         subordinate/.style={%             grow=down, xshift=-1.1cm, % Horizontal position of the child node             text centered, text width=3cm,             edge from parent path={(\tikzparentnode.205) |- (\tikzchildnode.west)}},         level1/.style ={level distance=1.5cm},         level2/.style ={level distance=3cm},         level3/.style ={level distance=4.5cm},         level4/.style ={level distance=6cm},         level5/.style ={level distance=7.5cm},         level 1/.style={sibling distance=4cm}     ]     %   \draw[help lines] (0,0) grid (4,3);              % Supervisor         \node[anchor=south,supervisor]{Supervisor\\Supervisory position\\Location}         [edge from parent fork down]              % Teammate and Subordinates         child{node [teammate] {Teammate1\\Position1\\Location1}             child[subordinate,level1] {node {Subordinate\\Position1\\Location1}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Subordinate3}}             child[subordinate,level4] {node {Subordinate4\\Position4\\Location4}}             child[subordinate,level5] {node {Subordinate5\\Position5\\Location5}}}         %         child{node [teammate] {Teammate2\\Position2\\Location2}             child[subordinate,level1] {node {Subordinate1}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Third\\Teammate}}             child[subordinate,level4] {node {Longtext-\\teammate}}}         %         child{node [teammate] {Teammate3\\Position3\\Location3}             child[subordinate,level1] {node {Subordinate\\two lines}}             child[subordinate,level2] {node {Subordinate2}}                  child[subordinate,level3] {node {Subordinate3}}}         %         child{node [teammate] {Teammate4\\Position4\\Location4}             child[subordinate,level1] {node {Subordinate1}}             child[subordinate,level2] {node {Subordinate2}}}         %         child{node [teammate] {Teammate5\\Position5\\Location5}             child[subordinate,level1] {node {First\\Subordinate}}             child[subordinate,level2] {node {Subordinate2}}             child[subordinate,level3] {node {Third\\Teammate}}             child[subordinate,level4] {node {Longtext-\\teammate}}};          %\shade[shading=Mandelbrot set] (0,0) rectangle (5,5);     \end{tikzpicture}}     \caption{This is an org chart}     \end{figure}          \end{document}      What am I doing wrong? **Bonus question:** Is it possible to center supervisor's box horisontally?


title: centering content of table cell in LATEX

text: > What i am getting using below code ![what i am getting](http://i.stack.imgur.com/g5enT.png) > what i want ![what i want](http://i.stack.imgur.com/Affgb.png) Code               \begin{table}[h]         \caption{GENERAL PARAMETERS FOR THE SIMULATION} % title of Table          \centering % used for centering table          \begin{tabular}{ | m{4cm} | m{4cm} | m{5cm} |} % centered columns (4 columns)          \hline\hline %inserts double horizontal lines          Parameter & Value   & Observations and related works  \\ [0.5ex] % inserts table         %heading          \hline % inserts single horizontal line               Simulation area & 500m x 500m   & Area over which nodes are spread within the NS2 \\         \hline         Number of nodes &   15, 20, 25, 30 and 35   & To determine the performance for different node density \\         \hline         Number of connections & 20,40   & Random connections \\         \hline         Time of simulation &    160 & In seconds \\         \hline         Network Layer protocol  & ACRP, AODV    & ACRP protocol designed for cooperative communication and AODV existing Reactive protocol \\         \hline         Transport Layer Protocol &  Transmission control protocol (TCP) & A connection oriented  protocol \\         \hline         Propagation model & TwoRayGround &  For flat and unobstructed scenarios. \\         \hline         Type of antenna &   Omnidirectional &   Signal are sent in every direction \\ [1ex] % [1ex] adds vertical space          \hline %inserts single line          \end{tabular}          \label{table:nonlin} % is used to refer this table in the text          \end{table}


title: How to include PDF file in LaTex Doc from folder location?

text: I'm using the `\usepackage{pdfpages}` to include PDF files. I'm using the following convention: `\includepdf[pages={1-7}]{myFile.pdf}` My question is, how can you include a link to a folder that contains the PDF? I tried this with no luck: `\includepdf[pages={1-7}]{Resources/myFile.pdf}` My folder "Resources" is in the same folder as my Tex doc and the error I get trying to find the location is this:               Missing $ inserted ../Resources/myFile.pdf}.


title: Changing University Name in gatech-thesis Document Class

text: I am trying the write a thesis using the gatech-thesis document class, but it keeps saying Georgia Institute of Technology in various places across the document. How can I change it to say the name of another university? The class file can be found here.


title: Error using newcommand "\begin{document} ended by end{center}"

text: I've noticed that I'm using a particular code snippet for including and centering a figure with its caption all over the place in my Masters thesis. I decided that for cleanliness and flexibility, I should extract it into a `\newcommand`.               % This command creates a centered figure.      % The first argument is for the filepath, the second for the label,      % and the third is for the caption.     \newcommand{\cfigure}[3]{         \begin{center}         \end{center}         \begin{figure}[ht]         \centering          \includegraphics[width=1.0\textwidth]{#1}           \caption{#3}            \label{#2}         \end{figure}         \end{center}     }      The `\newcommand` statement compiles without error, but when I actually try to use it like so:               \cfigure{images/Redpin_10_point2_with_labels.png}{redpin_heuristic}{Graph depicting Redpin heuristic function over a realistic domain.}      I get hit with the following error:               "\begin{document} ended by \end{center}"      I'm not using it in any particular environment, just the document itself. Any idea what's going on?


title: Document title with Cyrillic and babel

text: I'm writing a document in Russian using `\babel`, and everything in the body of the document seems to work fine. However, when I try to make a Cyrillic title using `\maketitle`, I get errors saying that Russian hasn't been defined, as the title info is placed before the packages are loaded in the preamble. I'm a bit of a novice so I tried just moving the title info around below `\usepackage{babel}`. This doesn't work either. Is there some way around this? (I'm also open to manually creating a reasonable facsimile of the `\maketitle` environment, within the document body just by centring some large text the way `\maketitle` does, but I don't know how to do this either.) Here's an example               \title{\begin{otherlanguage*}{russian}     Текст на русском языке     \end{otherlanguage*}}               \documentclass{article}     \usepackage[T2A,T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[russian,english]{babel}               \begin{document}          \maketitle          \begin{otherlanguage*}{russian}     Текст на русском языке     \end{otherlanguage*}               \end{document}      The title complies, but as nonsense.


title: tikz-timing: is there a straightforward way to add a numbered time axis?

text: Loving tikz-timing for preparing timing diagrams for my teaching. One thing I've not been able to find, though, is how I might add a numbered time axis to a timing diagram. This is useful when showing the basics of testbench design, and wanting to indicate the correspondence in the diagram with a line in the Verilog source. I imagine a TikZ overlay could work, but I'm not that much of a pro, and would prefer something where the numbers are added automatically. I am using the vertical help lines, so somehow adding numbers above or below those would be great.


title: Absolutely position arrow head

text: In my previous question about arrow: Connect vertices of a regular poly by curved arrows I'm trying to now position the very end tip of the arrowhead absolutely. Basically I have want the arrowhead to come in on some specific point on the node(such as the bottom) BUT I want to specify the angle in comes in on(or goes out). If I just specify `[out, in]` it changes the position of the arrow and doesn't work well. I need some way to fix the end points of the arrow so that `[out, in]` do not affect the position. To understand this. Suppose the very tip of the arrowhead is fixed at some point on a node(the bottom, corner, or edge) but suppose the angle which it "enters" the node is wrong(due to it being a curved arrow like my previous question) or you just want to change it. By using `[out, in]` it will change the position and not just the angle.               \draw[-stealth,shorten <=0.2cm,shorten >=0.2cm,thick,red](\source)to[out=180, in=60](\destination);      If you don't understand the question change the line in the code in the link to the above. (simply replace bend right with out=180, in=60) In this case you'll notice that all the arrow heads(and ends) point in the same direction BUT in each case the position relative to the node is different. ![](http://i.stack.imgur.com/AHnCk.png) In the above picture you can see that all the arrowheads point in the same direction but touch the node at different positions. The top one is north, the top left is northwest, etc... I want them all to be north, for example, or all be at the bottom of the node(assume each node's top points away from the center of the circle).


title: How to get Arial Narrow typeface in section header in pdflatex

text: I am new to LaTeX, so I hope this is not obvious, but have searched for straightforward documentation on how to do this and can't find it. I am creating a chapter for a book that has very specific formatting:   * The normal paragraph must be in 10pt Bookman old Style   * The chapter title must be 20pt Verdana bold without a chapter number.   * The section header must be 12 pt Arial Narrow Small-Caps with 6pts extra space above, and no extra space below.   * The subsection header must be 10Pt Bookman Old Style Bold Italic, no extra space above or below I am using `pdflatex` to produce the PDF output, and `scrbook` class:               \documentclass[11pt,executivepaper,headsepline,footsepline]{scrbook}          %Eliminate the chapter numbers from section numbering     \usepackage{chngcntr}     \counterwithout{section}{chapter}          \voffset=0in     \topmargin = 0in     \headheight = 12pt     \headsep = 25pt     \textheight = 8.5in     \footskip = 30pt          \hoffset=0in     \marginparwidth = 0pt     \marginparsep = 0pt     \textwidth = 5.25in     \oddsidemargin = 0pt     \marginparpush = 0pt          \begin{document}      I found that there is a command for setting the font of a element: `\setkomafont{element}{commands}` but I have not figured out how to specify Arial Narrow typface. The KOMA -Script bundle documentation says 'just about any command will work' which is not really helping me at this moment. Is there a way to get the desired typfaces in use for my section headers in `scrbook` with `pdflatex`?


title: How to change edge of pages in Beamer

text: I'm using long math formulas and need to get smaller edges in Beamer presentation. I mean how I can get all environments such as definition, theorems, proofs starting at the same position as frametitle?


title: Macron in pandoc markdown. (Mh\={a}v\={\i}ra)

text: I'm using `pandoc` markdown to generate PDF, and I cannot get it to accept my special characters. For example, I want to include `Mah\={a}v\={\i}ra` in my document to place macrons over the appropriate letters. When I publish:               pandoc -o mydoc.pdf mydoc.md      I my document contains `Mah={a}v={i}ra`. The dot has been stripped from the `i`, as I requested by using `\i`, but the `\=` was just converted to `=`. A few tests with similar accent characters is revealing the same problem. How can I get macron accents into my document?


title: Un-indent all paragraphs and increase the space between paragraphs

text: How could I un-indent all paragraphs and increase the space between paragraphs, avoiding - at the same time - unwanted changes? Package `parskip` works partially fine for me (it causes some unwanted changes). What would you recommend to me? The template of the project I am working on is here.


title: How to define a new RPN operator with \pstVerb to convert pt to the active unit?

text: I want to do a vector addition with different units as follows,               (1+2pt,3+4pt) % of course this point format will not work for the current PSTricks      My solution is to write the point in PostScript notation. However a problem occurs: I need a new operator to convert `pt` to the active unit. The operation I want to do in PostScript looks like the following,               (!1 2 Pt2AU add 3 4 Pt2AU add)      And how to define `Pt2AU`? Note that the default active unit in PSTricks is 1 centimeter. But we can change it. The MWE you can use is given as follows,               \documentclass[pstricks,border=12pt]{standalone}     \SpecialCoor          \pstVerb{/Pt2AU {72.27 div 2.54 mul} bind def}% needs correction to accommodate all possible active unit     \psset{unit=1cm}          \begin{document}     \begin{pspicture}[showgrid](4,4)         \psline(1,3)(!1 2 Pt2AU add 3 4 Pt2AU add)     \end{pspicture}     \end{document}


title: Compilation fails with "! Missing \endcsname inserted."

text: Hi I've got a strange problem. I've defined a new command to print Linux commands line in the document:               \documentclass[12pt,a4paper]{article}     \usepackage{listings}     \newcommand{\shellcmd}[1]     {       \begin{lstlisting}         {#1}       \end{lstlisting}     }          \begin{document}     \shellcmd{gdb \textit{program core}}     \end{document}      If I don't use my own defined command but use `\begin...\end` then it compiles. If I however use the command then I get:               ! Missing \endcsname inserted.     <to be read again>                         \protect      l.11 \shellcmd{gdb \textit{program core}}      Not sure how to resolve this. I haven't seen a similar problem online.


title: Referring to one's own examples

text: I have created numbered examples to illustrate concepts in my project. I have used this               \newtheorem{exmp}{Example}[section]      thus far. Is there a way I can refer to them so they appear as **{Ex 2.1}** and LaTeX to keep track of the numbering? Refer me to a similar question if one is available but I am almost certain there isn't.


title: Appendix without heading, only TOC entry

text: I'd like to add an appendix to the TOC without showing its headline over the continuous text. Minimal Example:               \documentclass{scrartcl}     \begin{document}         \tableofcontents              \section{A Section}         Lorem ipsum.              \appendix         \section{Appendix with Headline}         This section has a headline.              \section{Appendix without Headline}         This section should not have a headline.     \end{document}      An idea would be using `\addcontentsline` instead of `\section` but then I lose the foregoing "B.":               \addcontentsline{toc}{section}{Appendix without Headline}


title: Drawing aligned boxes with shaded section

text: I would like to draw several boxes with vertical line split but so far have not been very successful. Here's the code I attempted so far               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,shadows,arrows}     \usepackage{framed,graphicx,xcolor}     \begin{document}     \definecolor{shadecolor}{gray}{0.9}          \tikzstyle{block} = [draw, rectangle,color=gray, fill=gray!50, minimum height=4mm]     \tikzstyle{block1} = [draw, rectangle,minimum height=4mm, minimum width=40mm]     \tikzstyle{block2} = [draw, rectangle,minimum height=4mm, minimum width=45mm]     \begin{tikzpicture}     \node [block, minimum width=5mm] (11) {};     \node [block2, minimum width=45mm, right of =11,xshift=10mm] (12) {};          \node [block1, minimum width=5mm, below of =11] (21) {};     \node [block, minimum width=5mm, right of =21,xshift=-5mm] (22) {};     \node [block1, minimum width=40mm, right of =21,xshift=17.5mm] (20) {};          \node [block1, minimum width=10mm, below of =21] (31) {};     \node [block, minimum width=5mm, right of =31,xshift=-5mm] (32) {};     \node [block1, minimum width=35mm, right of =31, xshift=15mm] (30) {};          \node [block1, minimum width=15mm, below of =31] (41) {};     \node [block, minimum width=5mm, right of =41,xshift=-5mm] (42) {};     \node [block1, minimum width=30mm, right of =41, xshift=12.5mm] (40) {};          \node [block1, minimum width=20mm, below of =41] (51) {};     \node [block, minimum width=5mm, right of =51,xshift=2mm] (52) {};     \node [block1, minimum width=25mm, right of =51, xshift=17mm] (50) {};               \end{tikzpicture}     \end{document}      The attached figure is what I hope to achieve as the result ! ![enter image description here](http://i.stack.imgur.com/GfaSL.png) Is there anyone who can help me with this? Or is there a better way to doing it? Many thanks in advance. [Edited] I have updated the image to clarify some details. Perhaps figure itself is not clearly shown that all the boxes should be of the same length with same alignment to each other. The shaded small portion in each of the bar (box) should be position in such a way that it seems to be sliding from one slot to another without space in between or overlapping. I would like to show that the shaded portion is continuously sliding across them in the following bars with the same small steps. Thanks!


title: Why am I getting an extra, blank, citation in my bibliography?

text: I'm having a problem with my LaTeX bibliography. I'm using bibtexmng, and I'm working with thirty-six (36) citations. But, when I compile my LaTeX document to a PDF, the resulting bibliography has _thirty-seven_ (37) citations, but the first citation is simply a blank space. ![Screenshot of the issue](http://i.stack.imgur.com/sFi1L.png) c So, how do I remove that first citation so that my bibliography has only the 36 citations I've specified? * * * UPDATE!! Here is my .BIB file                \documentclass[a4paper,12pt,oneside,makeidx]{skripsi}           \usepackage{amssymb}      \usepackage{amsthm}      \usepackage{tabularx}      \usepackage{mathtools}      \usepackage{amsmath}      \usepackage{array}       \usepackage{booktabs}       \newcounter{myrow}       \newcommand\RaiseImage[2][scale=1]{%       \raisebox{-0.5\totalheight}{\includegraphics[#1]{#2}}}        \usepackage{graphicx}        %\usepackage{graphicx}% delete the demo option in your actual code        %\usepackage{enumitem}        %\usepackage{booktabs}        \usepackage[bahasa]{}        \usepackage[T1]{fontenc}        \usepackage[latin1]{inputenc}         %\usepackage{textcomp}         \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3}         \usepackage{array}        \usepackage{enumerate}         %\usepackage{enumitem}        \usepackage{subfigure}        \usepackage{longtable}        \usepackage{rotating}        \usepackage{graphicx}         \usepackage{setspace}         \usepackage{textcomp}         \usepackage{multirow}        \usepackage{pdflscape}        \usepackage{lscape}        \usepackage{lmodern}        \usepackage{url}        \urlstyle{same}        \usepackage{listings}        \usepackage{etex}        \reserveinserts{18}        \usepackage{morefloats}        \usepackage{float}        %\makeindex{subject}                  \usepackage{fancyvrb}        \usepackage{setspace}        \onehalfspacing        \newenvironment{CVerbatim}        {\singlespacing\center\BVerbatim}        {\endBVerbatim\endcenter}              \centerchapter         \makeatletter         \doublespacing         \makeatother         \parindent 3.0em         %===================================================================        \setlength{\textwidth}{15.0cm}        \setlength{\evensidemargin}{2.5cm} % outer/right margin        %\setlength{\topmargin}{0.3cm}      % top margin        \setlength{\footskip}{2.5cm}         % distance between text and foot        \setlength{\textheight}{\paperheight}         \addtolength{\textheight}{-\topmargin}         \addtolength{\textheight}{-\headheight}         \addtolength{\textheight}{-\headsep}         \addtolength{\textheight}{-\footskip}        \addtolength{\textheight}{-4cm}   % bottom margin         %======================================================================        \begin{document}        \nocite{*}        %#start bagian administrasi #==================================================        % bagian muka sebelum isi, umumnya halaman administrasi, kalau tidak digunakan        % dapat diberikan tanda % didepannya             %cover       \pagestyle{empty}        \pagenumbering{roman}        \setcounter{page}{1}       \include{cover}                   %halaman lembar pengesahan, abstraksi, kata pengantar         \pagestyle{plain}         \pagenumbering{roman}         \setcounter{page}{2} %nilai halaman utk awal dari abstrak s/d ucapan terimakasih dlm                romawi          %\include{lembarpengesahan}% menggabungkan file lembar pengesahan          \include{abstraksi}% menggabungkan file abstraksi                %menggabungkan file CV atau riwayat hidup ringkas            %\include{cv}            % \include{katapengantar}% mengabungkan file kata pengantar                 %# akhir bagian administrasi # ==========================================                 % #mulai membuat daftar isi, daftar gambar dan  daftar tabel # ==========            %\setcounter{page}{8} %set nilai halaman sesuai urutannya                 % membuat daftar isi            \addcontentsline{toc}{chapter}{Contents}            \tableofcontents{}                 %membuat daftar gambar            \listoffigures            \addcontentsline{toc}{chapter}{List Of Figures}%masih masalah                  %% membuat daftar tabel             \listoftables \addcontentsline{toc}{chapter}{List of Tables}                   %\include{daftarlampiran}                    % #akhir membuat daftar isi, daftar gambar dan  daftar tabel # ==========                   % # mulai bagian isi # ==================================================                 \newpage            \pagestyle{headings}            \pagenumbering{arabic} % jenis huruf arabic            \setcounter{page}{1} %mulai dari halaman 1                      \input{Chapter1/chapter1.tex} %Bab 1                 \input{Chapter2/chapter2.tex} %Bab 2                 %\input{Chapter3/chapter3.tex} %Bab3                 %\input{Chapter4/chapter4.tex} %Bab 4                 %\input{Chapter5/chapter5.tex} %Bab 5                 % diatas menunjukkan SubDir/nama file tex, bisa ditambah/dikurang sesuai                      kebutuhan                  % # akhir bagian isi # ==================================================                 % # mulai bagian Daftar Pustaka # ============================================             %\newpage\emph{}            \addcontentsline{toc}{chapter}{BIBLIOGRAPHY} %memasukkan daftar pustaka di daftar                isi            \bibliographystyle{IEEEtranS}             \bibliography{MainTamplateSkripsi} %file menyimpan bibtex                 % # akhir bagian referensi # ============================================                  \newpage             \pagestyle{plain}            %\include{appendix}            %\printindex{subject}{INDEKS}                 \end{document}            %% Finish----------------


title: scanning definition\LT@i error

text: > > > (\\ksshome02\users02\mips\gianreto.kleger\wprg\Desktop\diplomarbeit\diplomarbei >     t.text\Diplomarbeit.aux) >     Runaway definition? >     -> >     ! File ended while scanning definition of \LT@i. >     <inserted text> >                     } >     l.13 \begin{document} >   Can somebody help me with this error?


title: Forest: different growing directions for branches on the same level

text: # Problem In TikZ, one can control the growing direction of a branch (and its sub- branches) by using the `grow=<direction>` key. In `forest`, however, the `grow` key only controls the growing direction of the _sub-branches_ but not their parent branch. **How do I make branches on the same level in a`forest` tree grow in different directions?** In the following MWE, for instance, how can I get `child 2` to extend horizontally from `root` in it does in the TikZ tree? # MWE               \documentclass{article}     \usepackage{tikz,forest}          \begin{document}     \texttt{grow} used in a Ti\textit{k}Z tree          \begin{tikzpicture}       \node{root}         child{node{child 1}}         child[grow=east]{node{child 2}           child child child         }       ;     \end{tikzpicture}          \vskip20pt     \texttt{grow} used in a Forest tree          \begin{forest}       [root         [child 1]         [child 2,grow=east           [][][]         ]       ]     \end{forest}     \end{document}      ![enter image description here](http://i.stack.imgur.com/njTAL.png)


title: Very long table with 25 columns

text: How can I make a table with 25 columns and 30 lines in one page or more? Result is ![screenshot](http://i.stack.imgur.com/tTQpf.png) Thank you


title: Vertically Aligning text at top in tabular* - [t] is ignored

text: I am setting a small tabular environment using `tabular*` (note the asterisk!), which is supposed to be used as a list item. My problem is that the `[t]` option I am passing to `tabular*` is getting ignored and the text in the second column stays center-aligned in the vertical direction. Here is the result --- note for the second item in the second column the text “also short” is centered with respect to the text in the left column, but I want it aligned at the top: ![Center-aligned second column](http://i.stack.imgur.com/N5qNX.png) My minimal code sample can be seen below. The relevant command is `\mytab` I have taken the definitions for the column types from this tex.stackexchange answer.               \documentclass[a4paper,11pt]{article}     \usepackage[empty]{fullpage}          \setlength{\tabcolsep}{0pt}          \setlength{\marginparwidth}{0pt}          % Adjust margins --- this is really ugly     \addtolength{\oddsidemargin}{-0.5in}     \addtolength{\evensidemargin}{-0.5in}     \addtolength{\textwidth}{1.0in}     \addtolength{\topmargin}{-0.5in}     \addtolength{\textheight}{1.0in}          \newlength{\mytablen}     \setlength{\mytablen}{\textwidth}     %\addtolength{\ressubheadingwidth}{-0.7em}               \usepackage{array}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}          %-----------------------------------------------------------     \newcommand{\mytab}[4]{       \begin{tabular*}{\mytablen}[t]{L{13cm}@{\extracolsep{\fill}}R{5cm}}         \hline         \textbf{#1} & #2 \\         \hline         \textit{#3} & \textit{#4}\\         \hline       \end{tabular*}     }          \begin{document}          \begin{list}{}{\setlength{\leftmargin}{0.6em}\setlength{\topsep}{0.0em}\setlength{\itemsep}{-0.2em}}     \item       \mytab{Just a single line --- nothing fancy}{Short}       {A short name --- with some text}{20xx}     \item       \mytab{Significantly longer title --- will have to be broken into the second line and happily continue there}{Also short}       {A short name --- with some text}{20xx}     \item       \mytab{Significantly longer title --- will have to be broken into the second line and (un?)happily continue there}{A pretty long title or name, which will be split.}       {Here are, going to be, lots and lots, of names}{20xx}     \end{list} %}}}          \end{document}


I want to do so called texture mapping which is to attach an image to a curved surface. How to attach a 2D rectangular image to a 3D curved surface with TikZ or PSTricks? For the sake of simplicity, let the curved surface be `z=f(x,y)=asin(bx+cy)+d`.


title: How to change the behavior of a package via the class options?

text: I'm writing a document class based on the `book` class. In this class I have some code as below:               \RequirePackage[total={10cm,18cm},paperwidth=16cm, paperheight=23cm]{geometry}     \RequirePackage[cross,center,noinfo,a4]{crop}      I want to define an option for my class, say, `nocrop` so that when I use it, the above code change into the code below:               \RequirePackage[total={10cm,18cm}]{geometry}     %\RequirePackage[cross,center,noinfo,a4]{crop}        In other words, I want the `crop` package to be exempted from being run and the `paperwidth=16cm, paperheight=23cm` to be deleted. **Is this possible? if yes, how?**   Here is my MWE:               \RequirePackage{filecontents}     % my class file     \begin{filecontents}{myclass.cls}     \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{myclass}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}     \ProcessOptions     \LoadClass{book}     \RequirePackage[total={10cm,18cm},paperwidth=16cm, paperheight=23cm]{geometry}      \RequirePackage[cross,center,noinfo,a4]{crop}     \endinput     \end{filecontents}     \documentclass{myclass}      \usepackage{lipsum}     \begin{document}     \lipsum[1]     \end{document}      (I'm using XeLaTeX on a Windows machine, if it helps.)


title: Chemfig: length and angle of bonds

text: I've just tried using `chemfig` for the first time to try and recreate a figure (below). ![enter image description here](http://i.stack.imgur.com/6xNEe.gif) I had a quick look through the manual so see if there was an example that I could adapt to my needs, and this is what I've managed code-wise and in terms of output.               \documentclass{article}     \usepackage{chemfig}     \begin{document}     \chemfig{P(=[2]O)(-[7]C_{5}H_{11})(-[5]C_{5}H_{11}O)(-[3]C_{5}H_{11}O)}     \end{document}      ![enter image description here](http://i.stack.imgur.com/SalMW.png) Now whilst, this looks to be correct, I think that the bond lengths are a little bit too long, and also the angles of the bonds are too steep. How would I go about changing this? Also, the method that I've used to set the angles of the bonds doesn't seem to be that flexible, as I only seem to be able to set the bonds at 45 degree intervals, is there another way to do this where I can specify custom angles?


title: TikZ picture overlaps with text (not wanted)

text: I am new to TikZ and I can't explain the following behavior when I compile this (with pdflatex or lualatex):               \documentclass[         fontsize=12pt,          DIV=calc,          %draft,         %parskip=half,         headings=normal,          captions=tableheading,         %final,         version=last,         open=right,         chapterprefix=true,         %headsepline=true     ]{scrreprt}          \usepackage{tikz}     \usepackage{lipsum}          \begin{document}     \lipsum[1]          \begin{tikzpicture}     \tikz \shade[                  inner color=black,                  outer color=yellow             ]  circle (2.5cm);     \end{tikzpicture}          \lipsum[1]               \end{document}      ![enter image description here](http://i.stack.imgur.com/qwwLj.png) The generated circle clearly overlaps with the "lipsum" paragraph above it. I have read (TikZ/PGF manual) that I can set a bounding box. Setting one solves the problem but this is not clean : if I add something to the picture, I have to manually resize the bounding box... Furthermore, this is not needed in other TikZ code. Can you explain this behavior? Do you have an idea to solve this problem automatically? Thanks in advance!


title: How can I use \foreach in an axis environment of pgfplots?

text: I'm having a pretty weird issue with TikZ and pgfplots. I want to have a legend driven by a `\foreach` variable, but TikZ won't let me do that. I tried a couple of different stuff and realized that `\foreach` doesn't seem to work inside the `axis` environment. For instance the following code compiles                   \documentclass{article}         \usepackage{tikz}         \usepackage{pgfplots}         \begin{document}              \begin{tikzpicture}         \foreach \x/\y in {1/A,2/C,3/D}      {     \draw (\x,-4pt) -- (\x,4pt) node [below,yshift=-2ex] {\y};     }         \begin{axis}         \addplot   {sin(deg(x))};         \addlegendentry{2}         \end{axis}         \end{tikzpicture}              \end{document}      And this code doesn't                \documentclass{article}         \usepackage{tikz}         \usepackage{pgfplots}         \begin{document}              \begin{tikzpicture}         \begin{axis}         \foreach \x/\y in {1/A,2/C,3/D}      {     \draw (\x,-4pt) -- (\x,4pt) node [below,yshift=-2ex] {\y};     }         \addplot   {sin(deg(x))};         \addlegendentry{2}         \end{axis}         \end{tikzpicture}              \end{document}


title: Inserting text inside an arrow in Tikz

text: I want to draw an arrow between two nodes (a) and (b), and write text inside the arrow. How can I modify this command to control the size of the arrow head and insert the text?               \draw[->, >=latex, blue!20!white, line width=15pt]   (a) to (b) ;


title: memoir: sidecaption: ragged against the text block not working

text: I want to use the `sidecaption` environment in a figure with memoir and have the caption text be ragged against the text block. But when the figure is moved to the next page, the caption is on the correct side but the raggedness is wrong. I have created the following MWE according to the memoir manual but even with `\strictpagecheck` it does not work, no matter how many luatex runs I do:               \documentclass[a4paper,twoside,draft]{memoir}          \usepackage{fixltx2e}     \usepackage{calc}          \usepackage{luatextra}     \usepackage{lipsum}     \usepackage{ragged2e}               \marginparmargin{outer}     \setmpjustification{\RaggedLeft}{\RaggedRight}          % margin figure and caption typeset ragged against text block     \setfloatadjustment{marginfigure}{\mpjustification}     \setmarginfloatcaptionadjustment{figure}{\captionstyle{\mpjustification}}               \sidecapmargin{outer}     \setsidecappos{t}     \setsidecaps{\marginparsep}{\marginparwidth}                    \setlength{\fboxsep}{0pt}          \begin{document}          \lipsum[1]     \begin{figure}[p]         \strictpagecheck         \begin{sidecaption}{This is an example text. It should be ragged on the page                             border, not on the side of the figure.}             \fbox{\parbox[t][\textheight - 4pt][c]{\linewidth - 3pt}{test}}         \end{sidecaption}     \end{figure}     \lipsum          \end{document}


title: How to switch large document from units-package to siunitx?

text: For historical reasons, I've been using the `units` package in my thesis to typeset numbers with units or units with `\usepackage[tight]{units}` For formatting numbers in table columns I'm already using the `siunitx` package and I'd also like to use it for the numbers with units and units. However in the large document (>300 pages) I can not replace all (>500) occurences of the `\unit[]{}`command by hand. What is a good strategy for replacing the old commands with new ones? I assume it is not sufficient to replace `\unit[` by `\SI[` or is the "syntax" of optional arguments and arguments "compatible" for both commands?


title: Author's name article dropped with \citename

text: I am having a problem with `\citename` dropping a name article, e.g. printing "Foerster" instead of "Von Foerster" in the following example:               \documentclass{article}          \usepackage{biblatex}     \usepackage{filecontents}          \DeclareNameFormat{idem}{%       \usebibmacro{name:last}{#1}{#3}{#5}{#7}%       \usebibmacro{name:andothers}}          \newcommand*{\person}[2]{%       \citename{#1}[#2]{author}%     }          \begin{filecontents}{\jobname.bib}     @incollection{foerster1979cybernetics,         AUTHOR = "von Foerster, Heinz"     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \person{foerster1979cybernetics}{idem} described this as a shift from...     \end{document}      How can I change this to properly print "Von Foerster described this as a shift from..." (it should automatically capitalise the 'v' as the macro appears at the beginning of a sentence).


title: What combinations of mode and \currentgrouptype exist?

text: I am trying to predict in any given situation what TeX does if a closing brace reaches its stomach (apart from reverting local assignments). For instance, `\vbox{\tracingall H}` shows that if it is in horizontal mode when closing a vbox, then TeX first cuts the current paragraph into lines before leaving the vbox group. One way to determine what TeX does is to list all possible combinations of group type and mode which can occur, and the corresponding action to be taken. **Is that a reasonable approach? If so, what is that list? Any better method?** For reference, I put below the list of modes and group types. TeX knows of six modes (see Chapter 13 of the TeXbook):   * Vertical mode.   * Internal vertical mode.   * Horizontal mode.   * Restricted horizontal mode.   * Display math mode.   * Math mode. According the the eTeX manual, TeX knows 17 group types, and we can access that information through `\currentgrouptype`:   * bottom level (no group) (0)   * simple group (1)   * hbox group (2)   * adjusted hbox group (3)   * vbox group (4)   * vtop group (5)   * align group (6)   * no align group (7)   * output group (8)   * math group (9)   * disc group (10)   * insert group (11)   * vcenter group (12)   * math choice group (13)   * semi simple group (14)   * math shift group (15)   * math left group (16)


title: Automating the usage of \vspace{\abovedisplayshortskip} and \vspace{\abovedisplayskip}

text: I'm trying to replicate the space above the `equation` environment. Currently, I have to manually alternate between               \vspace{\abovedisplayskip}      and               \vspace{\abovedisplayshortskip}      depending on the length of the line above. (If it's long enough, I use the first one. If it's short enough, I use the second one.) How can I automate this into one simple command?


title: \citenum with square brackets

text: I am using the superscript citation style and sometimes in the text I need to print the citation number is square brackets like `[6]`. I read I could use `\citenum` but `[\citenum{myref}]` leaves some big space before the number `[ 6]`. Is there anyway I can achive this nicely? EDIT. These are my `natbib` options:                \usepackage[square, comma, sort&compress,authoryear]{natbib}      \bibpunct{[}{]}{,}{s}{}{;}


title: Automatically add prefix to references from another document?

text: I'm using `xr` to reference equations in supplemental material to a paper. I'd like equations from the supplement referenced in the paper to automatically be prefixed with "S", so that `Eq.~\ref{eqn:first}` appears in the text as `Eq. S1`. Ideally this would be true in the supplemental document as well. How do I do this?


title: Adding slide numbers in the footer of beamer documents

text: I am using the Dresden theme, which by default it gives me two lines at the bottom of the every slide, the first one containing the author name on the left and the institute name on the right, the second one containing the title of the presentation on the left and nothing else. Is it possible to include the slide number on the right of this second line, without using `\setoutertheme{infolines}`?


title: List of custom float type in Memoir is misformatted

text: I am writing a document with `memoir`, and am having a formatting problem with my List of Listings. I am setting up the Listing type as follows:               \newfloat[chapter]{listing}{lol}{Listing}     \newcommand{\listlistingname}{List of Listings}     \newlistof{listoflistings}{lol}{\listlistingname}      My `\listoflistings` invocation, however, is producing the following result: ![enter image description here](http://i.stack.imgur.com/tend7.png) The built-in lists (`\listoffigures`, `\listoftables`) are working properly. I have also examined the contents of the `.lol` file, and it is indistinguishable form the `lot` and `lof` files. I do not have `listing`, `lstlistings`, or `listings` loaded. How might I debug this problem and get my list of listings to behave correctly?


title: Distribute LaTeX Package with Document

text: ## TLDR Is there a way to distribute a LaTeX package with a document and to use it during compilation? ## Situation At our university, we're writing a lot of lecture summaries with LaTeX. Sometimes those summaries need non-standard packages, or sometimes there are version incompatibilities between packages between different LaTeX distributions / operating systems. As an example, https://github.com/HSR-Stud/CN1 uses the `siunitx` package, which changed the name of an option between Texlive 2009 and 2011. Therefore, the document compiles on either Texlive 2009 or 2011 depending on the option name used, but not on both. There are also cases of packages that are distributed with MikTeX, but not with Texlive (an example would be Picins). ## Goal Is it possible to distribute LaTeX packages along with a document and use them during compilation? As a sidenote, in all our documents Makefiles are used to build the PDF using `latexmk`, which is included both in Texlive and MikTeX, so custom compile/build options could be passed to the used tools and environment variables could be set. That could be of help.


title: Bold math in Context

text: I am not able to get bold math symbols using context. Details: I am using Tex-live 2012 distribution. Compiled using `context main.tex` which means I am using `context mkiv`. Log file shows the version as ConTeXt ver: 2012.05.30. UPDATE: Following MWE works with `texexec` i.e. `context mkii`. **MWE**               %As suggested at contextgarden.net for getting bold math.     \definetypeface [boldmath] [mm] [boldmath] [latin-modern] [default]          \starttext     \startformula     \boldsymbol{\alpha} = \alpha     \stopformula     \stoptext


title: Macro to suppress name in citation if already mentioned in sentence

text: I am trying to reduce the number of citation commands I use throughout my documents. Ideally I would like to use only one: `\autocites`. There is any ready to use macro that will suppress the author name from citation produced with `\autocite` or `\autocites` if the same name is already mentioned in the sentence preceding the citation? (Something which is accepted in the APA style) Please have a look at the MWE for few examples               \RequirePackage{filecontents}          \begin{filecontents*}{mybib.bib}       @book{abraham,         address = {New {York}, {NY}},         title = {Computational social networks: {Tools}, perspectives and applications},         shorttitle = {Computational social networks},         publisher = {Springer},         author = {Abraham, Ajith},         year = {2012}       }       @book{minsky,         address = {New {York}, {NY}},         title = {The emotion machine: {Commonsense} thinking, artificial intelligence, and the future of the human mind},         shorttitle = {The emotion machine},         publisher = {Simon \& {Schuster}},         author = {Minsky, Marvin Lee},         year = {2006}       }       @article{lyall,         title = {Explaining {Support} for {Combatants} during {Wartime}: {A} {Survey} {Experiment} in {Afghanistan}},         volume = {107},         number = {04},         journal = {American {Political} {Science} {Review}},         author = {Lyall, Jason and Blair, Graeme and Imai, Kosuke},         month = nov,         year = {2013},         pages = {679--705}       }     \end{filecontents*}          \documentclass[a4paper]{article}               % Set the values for the bibliography     \usepackage[     style=apa,     backend=biber,     isbn=false,     url=false,     doi=false,     eprint=false,     backref=false,     firstinits=false,     ]{biblatex}          % Recommended by biblatex     \usepackage[utf8]{inputenc}     \usepackage{csquotes}     \usepackage{xpatch}          % Set language     \usepackage[british]{babel}     \DeclareLanguageMapping{british}{british-apa}          \addbibresource{mybib.bib}          \begin{document}          \begin{enumerate}     \item Abraham wrote \autocite{abraham} but not \autocites{lyall, minsky}       \begin{itemize}       \item Suppress name in first citation to get as result \textbf{(\citeyear{abraham})}       \end{itemize}          \item Ajith Abraham wrote \autocite{abraham} but not \autocites{lyall, minsky}       \begin{itemize}       \item Suppress name in first citation to get as result \textbf{(\citeyear{abraham})}       \end{itemize}          \item Ajith Abraham wrote \autocites{abraham}[see also][]{minsky, abraham} but not \autocites{lyall, minsky}       \begin{itemize}       \item Suppress name in first citation to get as result \textbf{(\citeyear{abraham}; see also \cites{minsky, abraham})}       \end{itemize}          \item Kosuke wrote \autocite{lyall} but not \autocites{minsky, abraham}       \begin{itemize}       \item Do not suppress name in first citation, although Kosuke is among authors       \end{itemize}          \item Lyall wrote \autocite{lyall} but not \autocites{minsky, abraham}       \begin{itemize}       \item Do not suppress name in first citation, although Lyall is among authors       \end{itemize}          \item Lyall et al. wrote \autocite{lyall} but not \autocites{minsky, abraham}       \begin{itemize}       \item Suppress name in first citation       \end{itemize}          \end{enumerate}          \printbibliography     \end{document}


title: Replace the "AND" between authors' names in citations and references with its equivalent in another language, e.g., Spanish

text: I have been using the `achicago` package and the `babel` package for spanish language. When I employ the two, references with multiple authors are shown in the citations like (Mukange **and** Manamela) but it should (Mukange **y** Manamela) with a "Y", because the thesis is in Spanish. The same happens when the authors are listed in the bibliography. Is there a way to change the "and" when authors are listed in a citation and in the bibliography for its equivalent in other languages?


title: metapost pictures in pdflatex

text: To include metapost pictures in a latex file compiled by pdflatex I usually do something like               \usepackage[pdftex]{graphicx}     ...     \includegraphics{filename-without-mps}      but this requires all metapost output to have extension `.mps` (which is _usually_ fine — one can just add the line `filenametemplate "%j-%c.mps";` into .mp source). Is there a way to include mps pictures with their usual filenames (`smth.1`, `smth.2` etc)? _Upd._ I usually need it to recompile some old files with pdflatex — so I need some recipe that adds couple of lines in the preamble but not requires to changes _everything_. * * * I tried to invent some hack (for Windows, to be compiled with `pdflatex -enable-write18`):               \usepackage[pdftex]{graphics}     \DeclareGraphicsRule{.1}{pdf}{.1.pdf}{`copy #1 #1.eps && epstopdf #1.eps}     ...     \includegraphics{smth.1}      which indeed generates `smth.1.pdf` but fails with the error               ! Package pdftex.def Error: File `smth-1-converted-to.1.pdf' not found.      _Upd2._ The question was answered. But maybe someone knows how to make this hack work?


title: Longtable issue

text: I have a long table spread over multiple pages that I code using the package `longtable` package. A sample of my code is this:               \documentclass[a4paper]{article}     \usepackage{longtable}          \begin{document}          \begin{longtable}{cccccccp{5cm}}   \hline      Row & GO term & P-value & OR & Exp Count & Count & Size       \\  \hline     1 & GO:0009987 & 0.00 & 1.65 & 1811.17 & 2078 & 11765 & cellular process \\      2 & GO:0050794 & 0.00 & 1.57 & 648.88 & 857 & 4215 & regulation of cellular process \\      3 & GO:0080090 & 0.00 & 1.67 & 376.24 & 536 & 2444 & regulation of primary metabolic process \\      4 & GO:0009889 & 0.00 & 1.69 & 344.84 & 497 & 2240 & regulation of biosynthetic process \\      5 & GO:0051252 & 0.00 & 1.72 & 308.20 & 453 & 2002 & regulation of RNA metabolic process \\      6 & GO:0006355 & 0.00 & 1.71 & 306.35 & 449 & 1990 & regulation of transcription, DNA-dependent \\      7 & GO:2001141 & 0.00 & 1.71 & 306.35 & 449 & 1990 & regulation of RNA biosynthetic process \\      8 & GO:0031323 & 0.00 & 1.63 & 378.24 & 531 & 2457 & regulation of cellular metabolic process \\      9 & GO:0051171 & 0.00 & 1.66 & 332.52 & 476 & 2160 & regulation of nitrogen compound metabolic process \\      10 & GO:0019219 & 0.00 & 1.66 & 328.52 & 469 & 2134 & regulation of nucleobase-containing compound metabolic process \\         \hline     \end{longtable}     \end{document}      However, the printed table is shifted to the right, which bothers me. How can I fix this? I tried adding `\begin{center}` and `centering` but this did not work.


title: Alignment when writing complicated linear systems of equations

text: I have the following code which can generate pdf as the figure shows. However, it lacks some alignments I want. I knew there is systeme package which may be useful, yet I found it didn't work for this case. So how to get what I want as the red pen shows? ![enter image description here](http://i.stack.imgur.com/2YrRR.png)               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{amsmath}     \usepackage{babel}     \usepackage{pdflscape}     \usepackage{systeme}          \begin{document}     \begin{landscape}     \begin{align}\label{eq:laplace-qem}         (L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{11} & 0\\0 & 0 \end{array}\right])\mathbf{v}_{er,x}         +\left[\begin{array}{cc}q_{12} & 0\\0 & 0 \end{array}\right]\mathbf{v}_{er,y}         +\left[\begin{array}{cc}q_{13} & 0\\0 & 0 \end{array}\right]\mathbf{v}_{er,z}         +\left[\begin{array}{c}v_{e,g}q_{14}+q_{15}\\0\end{array}\right]         +L_{ijr}^{T}b_{x} = 0 \\         \left[\begin{array}{cc}q_{12} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,x}         +(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{22} & 0\\0 & 0\end{array}\right])\mathbf{v}_{er,y}         +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,z}         +\left[\begin{array}{c}v_{e,g}q_{24}+q_{25}\\0\end{array}\right]         +L_{ijr}^{T}b_{y} = 0 \\         \left[\begin{array}{cc}q_{13} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,x}         +\left[\begin{array}{cc}q_{23} & 0\\0 & 0\end{array}\right]\mathbf{v}_{er,y}         +(L_{ijr}^{T}L_{ijr}+\left[\begin{array}{cc}q_{33} & 0\\0 & 0\end{array}\right])\mathbf{v}_{er,z}         +\left[\begin{array}{c}v_{e,g}q_{34}+q_{35}\\0\end{array}\right]         +L_{ijr}^{T}b_{z} = 0 \\         \left[\begin{array}{cc}q_{14} & 0\end{array}\right]\mathbf{v}_{er,x}         +\left[\begin{array}{cc}q_{24} & 0\end{array}\right]\mathbf{v}_{er,y}         +\left[\begin{array}{cc}q_{34} & 0\end{array}\right]\mathbf{v}_{er,z}         +q_{44}v_{e,g}         +q_{45} = 0     \end{align}     \end{landscape}          \end{document}


title: \lstinline & \colorbox

text: Why the command below don't work? How can I fix it?               \documentclass[11pt]{book}          \usepackage[dvipsnames]{xcolor}          \usepackage{listings}          \lstset{language=[LaTeX]Tex,         basicstyle=\normalfont\ttfamily,         stringstyle=\rmfamily,         numbers=left,         numberstyle=\scriptsize,         stepnumber=1,         numbersep=8pt,         showstringspaces=false,         breaklines=true,         frameround=ftff,         frame=lines,         morekeywords={RequirePackage,ProvidesPackage,NeedsTeXFormat},         backgroundcolor=\color{background}     }          \definecolor{background}{HTML}{EEEEEE}          \newcommand*{\inlinecode}[1]{%                                 \colorbox{background}%                                 {%                                 \lstinline!#1!%                                 }                                 }          \begin{document}          ipsum dolor sit amet \inlinecode{%\@#&\newcommand=_^*} ipsum dolor sit amet          \end{document}


title: How can I set a list inside a definition in latex?

text: I need to write a definition that has a list of items.                   What is science : Lorem ipsum dolor sit amet, consectetur adipiscing elit.                           - List item 1                           - List item 2                           - List item 3                                Another lorem ipsum dolor sit amet, consectetur adipiscing elit.      I have this but it doesn't do what's above:               \paragraph{What is science}     Lorem ipsum dolor sit amet, consectetur adipiscing elit.          \begin{itemize}       \item List item 1       \item List item 2       \item List item 3     \end{itemize}      Here is the output:                   What is science : Lorem ipsum dolor sit amet, consectetur adipiscing elit.         - List item 1         - List item 2         - List item 3


title: Bibliography appears as an appendix in ToC in LyX

text: I want to place the Bibliography after the appendices. So in LyX I mark "Start Appendix Here", insert the appendices, and after that the Bibliography. Now, all appendices appear in the Table of Contents like "Appendix A. ...", or "Appendix B. ...". The problem is that the Bibliography also appears like "Appendix. Bibliography", which obviously isn't what I want. How do I fix this? **Instructions to reproduce issue:**   1. Create new Lyx document with Document Class: `book (AMS)`.   2. Add a TOC (Insert -> List / TOC -> Table of Contents).   3. With the cursor placed after the Table of Contents, start the appendix (Document -> Start Appendix Here)   4. Below the _Appendix_ red line, insert a Bibliography (Insert -> List / TOC -> BibTeX Bibliography).   5. Compile.   6. Tell me what happens.


title: Typeset R character vectors

text: I have two vectors in `R` that I want to typeset. The first vector includes the titles and the second the body texts. Please consider the following MWE               \documentclass{article}          \begin{document}          <<data>>=     title <- c("1","2","3","4")     body <- c("one","two","three","four")     @          % Expected result in TeX     %      % 1     % one     %     % 2     % two     %      % 3     % three     %     % 4     % four               \end{document}      This task requires a loop but I am not sure whether I should prepare the `TeX` markdowns directly in the `R` chunk with the option `results=asis` or whether I should use a combination of `\forloop` and `\rinline{x}` directly in `TeX`.


title: Why is my regular font garbled but \emph and \textbf fine?

text: I'm trying to format a document following my organization's style guide. I'm using `XeLaTeX` for the font flexibility. I made a minimal document               \documentclass{article}         \usepackage{xltxtra} %% For XeTeX font commands     \setmainfont[Ligatures=TeX]{Frutiger LT Std 45 Light}     \usepackage[includeheadfoot, margin = 0.5in]{geometry}          \begin{document}     Main font, no styling, \emph{with emphasis}, \textbf{and bolded}.     \end{document}      and the `\emph{}` and `\textbf{}` text comes out just fine, but the rest is garbled: ![garbled](http://i.stack.imgur.com/FEpeA.png) ### The part where it's probably my fault I needed to use this font in some graphs generated in R. I have several fonts in the Frutiger family installed on my (Windows) machine, and they're OTF fonts. To get the font to work in R, I need to use the `extrafont` package, which only works with TTF fonts. So I fed `Frutiger LT Std 45 Light` into an online OTF to TTF converter, and reinstalled the TTF version. It works great for my R figures, but maybe that has something to do with my `XeTeX` font problems. If I run the above example with `\setmainfont{Frutiger LT Std 55 Roman}` instead of using the TTF-converted light face, nothing is garbled, it's just too heavy. My compilation report for the example above says 0 Errors, 0 Warnings; the `.log` file reports               .................................................     . fontspec info: "defining-font"     .      . Font family 'FrutigerLTStd45Light(0)' created for font 'Frutiger LT Std 45     . Light' with options [].     .      . This font family consists of the following shapes:     .      . * 'normal' with NFSS spec.:     . <->"Frutiger LT Std 45 Light/ICU:script=latn;language=DFLT;"     .      . * 'bold' with NFSS spec.:     . <->"Frutiger LT Std 45 Light/B/ICU:script=latn;language=DFLT;"     .      . * 'italic' with NFSS spec.:     . <->"Frutiger LT Std 45 Light/I/ICU:script=latn;language=DFLT;"     .      . * 'bold italic' with NFSS spec.:     . <->"Frutiger LT Std 45 Light/BI/ICU:script=latn;language=DFLT;"     .................................................      Any help/pointers?


title: How to draw tangent to two touching circles and marking the points

text: This question may seem repetitive to many, but as I am very new to Latex, even after reading many posts, could not get to draw what I wanted, so asking. I want to draw as the following. ![enter image description here](http://i.stack.imgur.com/7xOeT.png) I have written the following code, Please help further.               \documentclass[11pt, oneside]{article}     \usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.     \geometry{letterpaper}                          % ... or a4paper or a5paper or ...      \geometry{landscape}       \usepackage{tikz}   % TeX will automatically convert eps --> pdf in pdflatex         \usepackage{amssymb}     \usepackage{textcomp}     \usepackage{gensymb}     \usepackage{tkz-euclide}     \usetikzlibrary{shapes.geometric}     \usetikzlibrary{calc}     \usepackage{graphicx}     \usetikzlibrary{plotmarks}       \title{}     \author{}          \begin{document}     \begin{tikzpicture}          \draw (0,0) circle(2) node [left] {P};     \draw (3.5,0) circle(1.5) node [below] {Q};     \draw (0,0) -- (14,0) node [right] {O};          \newcommand*{\Radius}{2cm}%        \coordinate (Origin) at (0,0);        \coordinate (O) at (14,0);% External point          \tkzDrawCircle[R](Origin,\Radius)        \tkzTangent[from with R= O](Origin,\Radius)  \tkzGetPoints{R}{I}              \tkzDrawSegments[ultra thick](O,R)% First tangent        \tkzDrawSegments[ultra thick](O,I)% Second tangent     \end{tikzpicture}     \end{document}


title: SyncTeX points to a wrong location in source or preview document

text: I have the following pretty simple document:               \documentclass[11pt]{article}     \usepackage{xltxtra}     \usepackage{fontspec}     \usepackage{amsmath}     \usepackage{polyglossia}     \setmainlanguage{russian}     \setotherlanguage{english}     \setmainfont[Mapping=tex-text]{Linux Libertine}          \begin{document}          \section{Выражения}          \subsection{Числовые выражения}          Решим задачу: ``Туристы в течение двух часов ехали на велосипеде по шоссе     со скоростью 16~км/ч, а затем шли лесом еще 7~км. Какова длина всего     маршрута?''          \end{document}      I use TeXworks. When I compile the document with XeLaTeX and then Ctrl + click on either the source or preview it highlights the corresponding line incorrectly. What can be wrong here? Also I tried the same in Texmaker and it also synchronizes preview with source incorrectly.


title: Special footnotes for URL

text: I've made one command so as to not polluate text with web links. I would like to improve my command so as to do the following things.   1. I would like that the footnotes used for URL have their own behavior, their own counter, and also one special formatting for the number of the footnotes.   2. The other kinds of footnotes must keep there usual behavior. Is it possible ? Here is my code.               \documentclass[10pt]{article}         \usepackage{hyperref}         \usepackage{xcolor}              \newcounter{UrlCounter}         \setcounter{UrlCounter}{1}         \newcommand{\myUrl}[1]{%             \textcolor{blue}{\url{http://link/\#\theUrlCounter/}} \footnote{\url{#1}} %             \addtocounter{UrlCounter}{1}%         }              \usepackage{lipsum}               \begin{document}          Let's try to indicate one URL \myUrl{http://www.google.fr/}     and another \myUrl{http://tex.stackexchange.com/}.     I would like to indicate something \footnote{... but here !}.          \lipsum          Let's try to indicate one URL \myUrl{http://www.google.fr/}     and another \myUrl{http://tex.stackexchange.com/}.     I would like to indicate something \footnote{... but here !}.          \end{document}      * * * ## ONE SOLUTION Thanks to the following answer, here is one functional code. I've used another tricky command so as to use `\texttt` with automatic back return because I cannot use `\url` for the not poluatting URLS in the text which are not real URLS.               % Sources :      %   * http://tex.stackexchange.com/questions/35095/special-footnotes-for-url/35097#35097     %   * http://forum.mathematex.net/latex-f6/forcer-le-retour-a-la-ligne-dans-texttt-t13246.html#p127511     %   * http://tex.stackexchange.com/questions/33465/changing-the-catcode-of-in-one-command          \documentclass[10pt]{article}         \usepackage[svgnames]{xcolor}         \usepackage{manyfoot}         \usepackage{hyperref}         \hypersetup{urlcolor=blue}          % Beakable texttt command.         \makeatletter             \newcommand\breakabletexttt[1]{%                 \begingroup\ttfamily                 \scantokens{\catcode`\_12\makeatletter\breakable@texttt#1\@nil}%                 \endgroup%             }             \def\@gobble@fi#1\fi{\fi#1}             \def\breakable@texttt#1#2\@nil{%                 #1\hspace{0pt plus 0.1pt minus 0.1pt}%                 \ifx\relax#2\relax                 \else                     \@gobble@fi\breakable@texttt#2\@nil                 \fi             }         \makeatother          % Special footnote         \newfootnote{Url}              \newcounter{footnoteUrl}         \newcommand{\footnoteUrl}{%     %       \renewcommand\thefootnoteUrl{\Alph{footnoteUrl}}             \stepcounter{footnoteUrl}%             \Footnotemark{\textcolor{DarkRed}{\textbf{\#\thefootnoteUrl}}}\FootnotetextUrl{}%         }          % Special url         \newcommand{\myUrl}[1]{%             \textcolor{DarkRed}{\textbf{\breakabletexttt{http://link/}}}\footnoteUrl{\, \url{#1}}%         }              \usepackage{lipsum}               \begin{document}          Let's try to indicate one URL \myUrl{http://www.google.fr/}     and another \myUrl{http://tex.stackexchange.com/}.     Let's try to indicate one URL \myUrl{http://www.google.fr/}     and one more \myUrl{http://tex.stackexchange.com/}.     I would like to indicate something \footnote{... but here !}.          \lipsum          Let's try to indicate one URL \myUrl{http://www.google.fr/}     and another \myUrl{http://tex.stackexchange.com/}.     Let's try to indicate one URL \myUrl{http://www.google.fr/}     and one more \myUrl{http://tex.stackexchange.com/}.     I would like to indicate something \footnote{... but here !}.          \end{document}


title: Move footer up for more text

text: I need to move the footer up because the text is pretty long and doesn't fit to it. And I have no idea how to do it. Any suggestions?


title: Changing the \autoref name for Chapter

text: I'm trying to change the name the function `\autoref` (from the hyperref package) uses for chapters. By default it outputs "chapter X" (lower case c) but I want it to output "Chapter X" (upper case c). In my document I can successfully redefine the `\chapterautorefname` function to something else without generating warnings or errors, but the value I assign to it seems to be ignored. I've also tried normally defining it (which nicely gives an already defined error) and redefining `\Chapterautorefname` (which generated a nice, not yet defined error). Minimal working example               \documentclass[12pt, a4paper, openany]{report}     \usepackage[english]{babel}              \usepackage[utf8]{inputenc}              \usepackage{hyperref}                         \renewcommand{\chapterautorefname}{Something}          % Document     \begin{document}     \chapter{One}     In \autoref{chap:two}...          \chapter{Two}     \label{chap:two}          \end{document}      Generated output: ![Output](http://i.stack.imgur.com/9534Q.png)


title: Add an equation at the bottom of a two-column article

text: How can I place a two-column equation (a large equation that does not fit in one column) at the bottom of a page?


title: How to arrange image and text to appear side by side?

text: I want to place an image on my document and have it appear, say, on the right part of the page with text flowing on the right. How can I do that with LaTeX? Just like one would do with HTML and images “floating” to the right (or left). (when searching I found some similar questions which, however, were closed. I'm actually asking the question because I think it is a good question and should have a good answer on the site. Btw, assume I'm not using beamer nor anything fancy.)


title: Fast, Cheap, WYSIWYG program

text: (This is close to some previous questions, but I wasn't able to find a question that directly covers it.) I want a program that allows me to quickly type a snippet of LaTeX code in and will immediately give me feedback (an image) of the typeset output produced by the code. If the program takes too long to start up or needs secondary programs to assess the results (image viewer or pdf reader), it frustrates use as a quick check of code. An implementation of what I want is the Math Overflow question section. If I type LaTeX code, I see the results of the code immediately. The purpose might be to quickly verify my LaTeX. I wouldn't want this to write a whole article just a few lines of code or text. Thanks for any advice. Edit: I am on Windows. Sorry for the crucial omission.


title: Auto convert LaTeX escape codes to UTF-8 characters?

text: How do I—e.g., with AucTeX—automatically convert escaped characters like `\~n` to `ñ` for use with `\usepackage[utf8]{inputenc}`? I could do something like this:               sed         \      -e "s/\\'a/á/"     \      -e "s/\\'e/é/"     \      -e "s/\\'i/í/"     \      -e "s/\\'o/ó/"     \      -e "s/\\'u/ú/"     \      -e "s/\\'A/Á/"     \      -e "s/\\'E/É/"     \      -e "s/\\'I/Í/"     \      -e "s/\\'O/Ó/"     \      -e "s/\\'U/Ú/"     \      -e "s/\\'{\\a}/á/" \      -e "s/\\'{\\e}/é/" \      -e "s/\\'{\\i}/í/" \      -e "s/\\'{\\o}/ó/" \      -e "s/\\'{\\u}/ú/" \      -e "s/\\'{\\A}/Á/" \      -e "s/\\'{\\E}/É/" \      -e "s/\\'{\\I}/Í/" \      -e "s/\\'{\\O}/Ó/" \      -e "s/\\'{\\U}/Ú/" filename.tex > out.tex      But unfortunately out.tex isn't UTF-8 and the special characters are replaced by codes in Emacs.


title: Line break in siunitx product numbers

text: I was wondering if there is a way to allow for line breaks within product lists of the siunitx package:               \documentclass{article}          \usepackage{showframe}     \usepackage{siunitx}          \begin{document}     This is a very long line and with a long list of numbers like this \SI[product-units=brackets-power]{128 x 256 x 512 x 1024}{\mm}.          This is a very long line and with a long list of numbers like this \SI[product-units=repeat]{128 x 256 x 512 x 1024}{\mm}.          This is a very long line and with a long list of numbers like this $(128 \times 256 \times 512 \times 1024)\,\si{\mm\tothe4}$.     \end{document}      ![MWP result](http://i.stack.imgur.com/cvAaz.png) The third option does the right thing but I would really like to keep the possibility to globally define the layout of product lists in the preamble (e.g. `\sisetup{product-units=brackets-power}`) across the whole document. The `allow-number-unit-breaks` option in siunitx does not really help as I would need a way to "allow-output-product-breaks". Any ideas how to do this? Thanks.


Just installed the latest siunitx and it says that expl3 is too old. I looked on the miktex package update manager and I appear to have the latest version of everything. The package that now contains the expl3.sty file is l3kernel and it says that it was packaged on 2011-07-11 and installed on 2011-07-20. Not sure what to do. I need to compile and submit my thesis in a couple of days.


title: Including a Table in a Figure Environment

text: In order to close the vertical space between this figure and table, I'd like to place the table inside the figure environment. Is that possible?               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[12pt,twoside]{article}          % PACKAGES          \usepackage[a4paper,showframe]{geometry}     \usepackage{graphicx} % Allows pdf, jpg, png, & tif.     \usepackage{fontspec}     \usepackage[no-sscript]{xltxtra}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont[Mapping=tex-text]{Linux Libertine O}     \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Linux Biolinum O}     \setmonofont[Scale=MatchLowercase]{Linux Libertine Mono O}     \usepackage{fancyhdr} % Fancy Header package.     \usepackage{xcolor}          % PAGE GEOMETRY          \setlength{\columnsep}{8 mm}     \textwidth = 6.8 in     \textheight = 9 in     \oddsidemargin = 0 mm     \evensidemargin = -15 mm          % CHANGE COLOR OF SHOWFRAME (PAGE GUIDES)          \colorlet{showframe}{cyan}     \makeatletter     \let\org@Gm@pageframes\Gm@pageframes     \renewcommand*{\Gm@pageframes}{%       \begingroup         \color{showframe}%         \org@Gm@pageframes       \endgroup     }     \makeatother          % HEADER / FOOTER          \pagestyle{fancy}     \lhead{\bf AS332 F1/M1/B1 Flight Manual} %     \chead{} %     \rhead{\bf 1 June 2014} %     \lfoot{} %     \cfoot{\thepage} %     \rfoot{} %          % BEGIN          \begin{document} % ==============================================================          % RUNTIME TWEAKS          \renewcommand{\headrulewidth}{0pt} % Removes rule below header.          % FULL PAGE FIGURE:  INSTRUMENT SUBPANEL (F1-1)          \begin{figure}[t]     \begin{center}     \includegraphics[width=0.8\textwidth]{instrument_subpanel_f1-1.png}     \caption{Instrument Subpanel (F1-1)}     \label{fig:instsubf11}     \end{center}     \end{figure}          \begin{table}\small\sf     \begin{center}     \begin{tabular}{rl}     1 & windscreen washing pushbuttons\\     2 & emergency battery monitoring and control panel\\     3 & LH windscreen and LH pitot de-icing control switches and indicator lights\\     4 & aural warning control switches\\     5 & windscreen wiper control switch\\     6 & engine 1 monitoring panel and engine vent switch\\     7 & overspeed test pushbutton and associated lights\\     8 & engine 2 monitoring panel and engine vent switch\\     9 & RH windscreen and RH pitot de-icing control switches and indicator lights\\     10 & power calculator test button     \end{tabular}     \end{center}     \end{table}          \clearpage\newpage          \end{document}      ![MWE](http://i.stack.imgur.com/dchbj.jpg)


title: Adding new parameter in lyx

text: In texmaker, I create document_setting.tex for input some document attribution like the author, publisher, some attribution in acknowledgements. And then input document_setting in master document report.tex. Here is a command for a new variable, in gayaan.sty I write:               \newcommand{\var}[2]{\newcommand{#1}{#2}}     \newcommand{\Var}[2]{\newcommand{#1}{\uppercase{#2}}}       In document_setting.tex :               \Var{\titling}{Analisis dan Penghitungan Tingkat Kemiskinan}     \var{\subdir}{Subdirectorate of Constraction Statistics}     \var{\nopublication}{05340.1002}      In report.tex :               \documentclass{memoir}     \usepackage{gayaan}     \usepackage{lipsum}          \input{document_setting}          \begin{document}          \textbf{\Large{\titling}}     \subdir      \nopublication          \chapter{Introduction}     \lipsum[5]     \section{example}     \lipsum[5]          \end{document}      And the result is success, but I can't do this in Lyx. Does anyone know how to do it in lyx? Create something like document-setting.tex?


title: Controlling the decimal position of the uncertainty while using multi-part-units in siunitx

text: How can I write the following without `\pm`? > (66 ± 4.4) s I can achieve the same result with `\SI[separate-uncertainty=true]{66 \pm 4.4}{\second}`, but I thought the plus-minus symbol could be inserted automatically by using `multi-part-units`. Here's what I tried:               \SI[separate-uncertainty=true,multi-part-units=brackets]{66(4.4)}{\second}     \SI[separate-uncertainty=true,multi-part-units=brackets]{66(44e-1)}{\second}     \SI[separate-uncertainty=true,multi-part-units=brackets]{66(44)}{\second}     \SI[separate-uncertainty=true,multi-part-units=brackets]{66.0(4.4)}{\second}      The problem seems to be getting the decimal in there. I can't seem to find the relevant information in the siunitx documentation.


title: Circuitikz: Dashed lines and arrows

text: How can I add a dashed line and an arrow? I would like to have an arrow after the resistor pointing right and a dashed line from B to the junction. Additionally, the book as a symbol that mimics a ground but only has two lines like capacitance. Can this be done as well? ![enter image description here](http://i.stack.imgur.com/BbSpm.png) The books diagram ![enter image description here](http://i.stack.imgur.com/sYbZs.png) My code:               \documentclass[convert = false]{standalone}          \usepackage[utf8]{inputenx}%  http://ctan.org/pkg/inputenx     % Euler for math | Palatino for rm | Helvetica for ss | Courier for tt     \renewcommand{\rmdefault}{ppl}% rm     \linespread{1.05}% Palatino needs more leading     \usepackage[scaled]{helvet}% ss //  http://ctan.org/pkg/helvet     \usepackage{courier}% tt // http://ctan.org/pkg/courier     \usepackage{eulervm}  %  http://ctan.org/pkg/eulervm     % a better implementation of the euler package (not in gwTeX)     \normalfont%     \usepackage[T1]{fontenc}%  http://ctan.org/pkg/fontenc     \usepackage{textcomp}%  http://ctan.org/pkg/textcomp          \usepackage[american, cuteinductors]{circuitikz}     \usepackage{siunitx}          \begin{document}     \begin{circuitikz}[scale = 2]       \draw                                     (0, 0)             to[C, l^ = \(v_2\), -*]             (0, 1)             node[anchor = east] {\(B\)}             to[short]                           (.5, 1.25)              to[short]                           (.5, 2)             to[R, l^ = ${R = \SI{1}{\ohm}}$]    (3, 2)             to[short]                           (4, 2)             to[L, l^ = ${L = \SI{1}{\henry}}$]  (4, 0)             to[short]                           (0, 0);       \draw                                     (1, 0)             to[C, l_ = \(v_1\), -*]             (1, 1)             node[anchor = west] {\(A\)}             to[short]                           (.5, 1.25);            \node at (.1, .65) {\(+\)};       \node at (1.1, .65) {\(+\)};     \end{circuitikz}     \end{document}


title: Is there a "contradiction" symbol in some font, somewhere?

text: Before anyone slates me for this, I _have_ checked detexify _and_ `texdoc symbols`. Indeed, the latter led me to the following phrase (3rd paragraph of Section 3): > Although there have been many requests on `comp.text.tex` for a > contradiction symbol, the ensuing discussion invariably reveals innummerable > ways to represent contradiction in a proof ... Because of the lack of > notational consensus, it is probably better to spell out "Contradiction!" > than to use a symbol for this purpose. Normally, I'd agree with this sage advice. Two things prevent me from doing so:   1. In a _presentation_ , brevity is the soul of comprehension. That is to say, it is better still to have a funny symbol and to **say** "Thus we have a contradiction" than to have the long word "Contradiction!" and still say "Thus we have a contradiction".   2. The ellipsis in the above quote lists various symbols that the discussion on `comp.text.tex` presumably discussed. None of them is correct. The correct contradiction symbol is (something like):              \ \/ /      \/\/      /\/\     / /\ \      That is, four diagonal lines, two in each direction. It should also be a bit larger than a "regular" symbol, perhaps more like a `\prod` or `\sum`. So, my question: is there a font with this symbol?


title: How to split text around pages?

text: I have one input which has text and image. Here text is quite lengthy which may occupy 2-3 pages. I want output like   1. some text on 1st page    2. then image on 2nd page   3. then rest of text on 3rd page. Is it possible to do this automatically?


title: Strange number in the footnote before the reference

text: I am writing a report and when I use the basic footnote command I get a strange 9 before the footnote number and the text. This happens for all the footnotes. I attach the picture in the link. ![enter image description here](http://i.stack.imgur.com/z30ii.png) I just use `\footnotemark` and `\footnotetext`, but the same happens with `\footnote`. Any ideas?               \documentclass{sig-alternate-10pt}          \usepackage{graphicx}     \usepackage{subfig}     \usepackage{cite}     \usepackage{multirow}     \usepackage{array}     \usepackage{amsmath}     \usepackage{setspace}     \usepackage{latexsym}     \usepackage{amssymb}     \usepackage{algorithm}     \usepackage{algorithmic}               \begin{document}          \title{asdfasdf}          \author{     \alignauthor asdfasdf\\        \affaddr{asdfasdf}\\        \affaddr{asdfasdf}\\        \email{\{asdfasdf}     }     \maketitle          \begin{abstract}     \end{abstract}     \section{Section}     \subsection{Subsec}     text\footnotemark.     \footnotetext[1]{footnote text \cite{asd} asdf.}     \end{document}      I realised that after removing the `\usepackage{setspace}` works again. Files: https://www.dropbox.com/s/grhmhp0phznco34/trial.zip


title: Publications not showing up using moderncv

text: I'm new to LaTeX, so I might be making a very simple mistake, but I can't seem to get my publications to show up on my CV. I'm using the `moderncv` and `multibib` packages and MiKTeX. Here's a simplifi: The references are in a file called `publication.bib`:               @article{article1,       title={Article 1},       author={Doe, J.},       year={2012},       journal={Journal}     }     @book{book1,       title={Book 1},       author={Doe, J.},       year={2012},       publisher={Publisher}     }      And the `CV.tex` file looks like this:               \documentclass[11pt,letterpaper,sans]{moderncv}       \moderncvstyle{banking}                             \usepackage{apacite}     \usepackage[scale=0.75]{geometry}          \firstname{John}     \familyname{Doe}     \address{somewhere}{}              \usepackage{multibib}     \newcites{article,book}{{Articles},{Books}}     %----------------------------------------------------------------------------------     %            content     %----------------------------------------------------------------------------------     \begin{document}     \makecvtitle          % Publications from a BibTeX file using the multibib package     \section{Publications}     \nocitebook{book1}     \bibliographystylebook{plain}     \bibliographybook{publication.bib}           \nocitearticle{article1}     \bibliographystylearticle{apacite}     \bibliographyarticle{publication.bib}          \clearpage          \end{document}      When I typeset it, the header, etc. all come out right, but the Publications section is empty. What am I doing wrong?


title: Keyval Error with \includegraphics: options undefined

text: I'm trying to make a class file to help me draft bylaws for clubs, but I'm running into a problem with `\includegraphics`. I want to be able to define a club logo using a `\logo` command (see class file), with the option of passing options to `\includegraphics`, but it doesn't want to work. Class file:               \ProvidesClass{bylaws_min}[2012/10/27 version 0.01 "alpha" Bylaws]     \NeedsTeXFormat{LaTeX2e}          \RequirePackage[margin=1in]{geometry}% Sets page margins     \RequirePackage{graphicx}% Allows adding images to documents          \newcommand{\logo}[2][\@empty]{\def\@logoopts{#1}\def\@logoimage{#2}}          \renewcommand{\maketitle}{%     \begin{center}     \ifx\@empty\@logoopts\includegraphics{\@logoimage}\else\includegraphics[\@logoopts]{\@logoimage}\fi     \end{center}%     }      Document file:               \documentclass{bylaws_min}          \logo[scale=2]{imagefile.jpg}          \begin{document}          \maketitle          \end{document}      I've tried both `\logo[scale=2]{imagefile.jpg}` (or some other option other than `scale=2`), or just `\logo{imagefile.jpg}`, and I get variations on this error:               Package keyval Error: scale=2 undefined.     See the keyval package documentation for explanation.     Type H <return> for immediate help.      ...          1.7 \maketitle      I've played around with this for a while, and it seems that there are two problems. First, `\ifx` never sees `\@logoopts` as `\@empty` (in other words, the comparison always fails, and the `\else` statement always happens). Second, if I explicitly create an image like `\includegrahpics[scale=2]{imagefile.jpg}` in `\maketitle`, everything works, but if I try to pass it the options with `\@logoopts` it fails. But passing it the image file name with `\@logoimage` always works.


title: Force \displaystyle throughout document (including subscripts and fractions)

text: How do I force `\displaystyle` to all instances inside fractions, superscripts, and subscripts throughout the entire document (including intext)? Basically I am looking for something that effects               \frac{1}{\displaystyle \Big[1-\frac{q^{\displaystyle{2}}}{0.71}\Big]^{\displaystyle{2}}}      but without having to insert `\displaystyle` all over the code. Is it also possible to retain `\textstyle` `\subscriptstyle` functionality to force the smaller type on certain occasions?


title: Can we define a multiedge command using tikz?

text: I usually need to draw graphs with multiple edges. I would really appreciate if someone can tell me how to write a multiple edge command which will allow me to write one line instead of repeatedly many. Say the name of my edge command is `\myedge[m]` meaning that I will draw m edges between two nodes. I want to use something like the following whenever I need to draw a multiple edge (multiplicity is 5 in the following)               \draw (a) \myedge[5] (b);       Here is my actual code example... It is troublesome to keep using it in graphs where I have to keep drawing edges.               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{center}          \begin{tikzpicture}     \node[circle,fill=black,inner sep=1.5pt,draw] (a) at (180:1cm) {};     \node[circle,fill=black,inner sep=1.5pt,draw] (b) at (0:1cm) {};     \draw[thick] (a) -- (b);     \end{tikzpicture}          \begin{tikzpicture}     \node[circle,fill=black,inner sep=1.5pt,draw] (a) at (180:1cm) {};     \node[circle,fill=black,inner sep=1.5pt,draw] (b) at (0:1cm) {};     \draw[thick] (a) edge[bend left=5] (b);     \draw[thick] (a) edge[bend right=5] (b);     \end{tikzpicture}          \begin{tikzpicture}     \node[circle,fill=black,inner sep=1.5pt,draw] (a) at (180:1cm) {};     \node[circle,fill=black,inner sep=1.5pt,draw] (b) at (0:1cm) {};     \draw[thick] (a) edge[bend left] (b);     \draw[thick] (a) edge (b);     \draw[thick] (a) edge[bend right] (b);     \end{tikzpicture}          \begin{tikzpicture}     \node[circle,fill=black,inner sep=1.5pt,draw] (a) at (180:1cm) {};     \node[circle,fill=black,inner sep=1.5pt,draw] (b) at (0:1cm) {};     \draw[thick] (a) edge[bend left=15] (b);     \draw[thick] (a) edge[bend left=5] (b);     \draw[thick] (a) edge[bend right=5] (b);     \draw[thick] (a) edge[bend right=15] (b);     \end{tikzpicture}          \begin{tikzpicture}     \node[circle,fill=black,inner sep=1.5pt,draw] (a) at (180:1cm) {};     \node[circle,fill=black,inner sep=1.5pt,draw] (b) at (0:1cm) {};     \draw[thick] (a) edge[bend left=16] (b);     \draw[thick] (a) edge[bend left=8] (b);     \draw[thick] (a) edge[bend right=8] (b);     \draw[thick] (a) edge[bend right=16] (b);     \draw[thick] (a) -- (b);     \end{tikzpicture}     \end{center}     \end{document}      Output: ![Multi edge paths](http://i.stack.imgur.com/t0OvF.png) **SITUATION:** Here is what exactly I want to do in this new definition: Say, I would like to bend perpendicular to the line connecting two nodes `(u)` and `(v)` with coordinates `(a,b)` and `(c,d)`. This gives me the chance to use `((c-a)*0.2*\i,(d-b)*0.2*\i)` instead of `$(0,0.2*\i)$` and it is most general. However, I can see that the bigger trouble here is that in defining `edge[me=<number>]` you actually do not account the ends of the edge. Can we do that? This would certainly prevent the curly edges when edges are not on a horizontal line (it is worst when they are vertical actually). On the other hand, depending on how big is `r=\sqrt{(c-a)^2+(d-b)^2}` is, we might need to replace `0.2` with a much smaller/larger number. Maybe it is a good idea even to replace `0.2` with `\frac{0.2}{r}`.


title: Why does this Tex refuse to compile?

text: The following won't compile under pdfLaTeX, I'm thinking due to some sort of infinite loop error:               Comparing these spectral radiuses, we can say that the Gauss-Seidel method will converge     approximately $\log_{0.6978}0.3647 = 2.803$ times faster than the Jacobi method, and     that the Successive Over-Relaxation method will converge about $\log_{0.6978}0.2642 =      3.699$ times as fast as the Jacobi method, and about $\log_{0.3647}0.2642 = 1.3196$     times faster than the Gauss-Seidel method.      This seems a little bit bizarre, why won't it compile? I get the following error:               Package tocbibind Note: Using section or other style headings.          ) ("C:\Program Files\MiKTeX 2.9\tex\latex\tocloft\tocloft.sty")     (C:\Users\Pete\Desktop\untitled-1.aux)     *geometry* driver: auto-detecting     *geometry* detected driver: pdftex     ("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"     [Loading MPS to PDF converter (version 2006.09.02).]     ) ("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd")     ("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsb.fd") [1{C:/ProgramData/Mi     KTeX/2.9/pdftex/config/pdftex.map}] [2])     *      Except it's not really an error, it just freezes there.


title: Underline my own name in the publication list created with bibentry

text: I create my list of publications using `\bibentry`. As in some of the publications I'm only the fifth author (or there around) I would like to highlight my name by underlining it. I found solutions doing this in the complete bibliography e.g. here or here. Is there a possibility to apply the underlining just locally for the "chapter" where I create the publication list using `\bibentry`? I'm also open to alternatives to `\bibentry` however I would prefer not to make the list completely by hand. I'm using BibTeX and the bibliographystyle statto.


title: Create link to the top of a page which contains a certain labelled object

text: I want to create a clickable link from which I can jump to the top of the page which contains a certain labelled object. I tried `\pageref` but then clicking on the corresponding link results in a jump to the _exact site_ of the labelled object [formula `(1)` in the MWE below]. Instead, I want to jump to the top of the corresponding page [top of page 2 in the MWE below]. Is that possible?               \documentclass{article}     \usepackage{lipsum}     \usepackage{hyperref}     \begin{document}     \lipsum     \begin{equation}\label{a}       a:=b     \end{equation}     \lipsum     Note that $a$ is defined in (\ref{a}) on page \pageref{a}.     \end{document}


title: Some text lines are longer than the rest of the column

text: Some text lines are not wrapped correctly and they are longer than the rest of the column. How to solve this? Here a MWE:               \documentclass{acm_proc_article-sp}     \begin{document}     PTX source modules have a three-argument assembly language style     syntax with instruction operation codes and operands.          Contrary to popular belief, Lorem Popo is not simply random text.      Ippp available, but the majority have suffered alteration in some for     Contrary to popular belief, Lorem Popo is not simply random text.      Ippp available, but the majority have suffered alteration in some for     \end{document}      I do not want to re-phrase the text. What are my options?