title: different proportions for tikz between ktikz and latex

text: I am developing a figure in (k)tikz. Here's the code:               \begin{tikzpicture}[every node/.style={draw,rounded corners, minimum height=18, right}]          \node[text width=3.5cm] at (-3,-3) {      $\quad\, d(start_1 - end_0 - 1)$ \\       $=d(1-0-1)$ \\      $=d(0)$     };     \end{tikzpicture}      `text width=3.5cm` is used as a hack, since `\\\`, doesn't seem to have any effect. ( **Update** : percusse has an answer for that) In ktikz(left) it looks just fine, but when I include it in my latex document via "\input{file}", the node gets narrower and the text is broken too early. ![](http://i.stack.imgur.com/dVleH.jpg) ![](http://i.stack.imgur.com/sbj80.jpg) This is very annoying, because the real time preview of ktikz makes the development comfortable, but I want to know how it will look in latex of course. **Progress** : Paul Gessler first pointed out that the fonts are different. So I tried to determine the font used in my document, planning to set it in ktikz. So I included `\encodingdefault`, `\familydefault`, `\seriesdefault` and `\shapedefault` in the latex document and pasted the values as `\usefont{T1}{aer}{m}{n}` in the ktikz preamble. This did change the normal font (yet an extra non-math line abcd..tuv still takes more space in the latex document) but not the math font. Today, I found my error! `\usepackage{mathptmx}` in the ktikz template caused the different font. Commenting it out solved the issue.


title: How to use tikz to draw an angle with the same degree of an existing one?

text: \begin{tikzpicture}         \tikzset{mypoints/.style={fill=white,draw=black}}         \tikzstyle{help lines}+=[very thin]                   \coordinate[label={[label distance=0.5em]180:$A$}]             (A) at (120:5);         \coordinate[label={[label distance=0.5em]180:$B$}]             (B) at (210:5);         \coordinate[label={[label distance=0.5em]  0:$C$}]             (C) at (335:5);         \coordinate[label={[label distance=0.5em]  0:$D$}]             (D) at ( 40:5);         \coordinate[label={[label distance=0.5em]-90:$M$}]             (M) at (intersection of A--C and B--D);              \draw (A) -- (B) -- (C) -- (D) -- (A);         \draw (A) -- (C) (B) -- (D);     \end{tikzpicture}      In the example above, how to construct a point E on AC so that ∠ADE = ∠BDC?


title: Error: LaTeX Xy-pic error: <turn> cannot be half or full... What does it mean?

text: I'm attempting to use `xy` to make an arrow bend a specific way. When I try it, this error pops up: > LaTeX Xy-pic error: < turn > cannot be half or full. What does this mean? For more context, I am attempting to make this:               \xymatrix@!R@!C     {     &   &   &   & \bullet & &   &   &   \\         \\     \bullet &   &   &   & \bullet & &   &   & \bullet \\         \\         &   & \bullet & &   &   &   &   &   \\         \\         &   &   & \bullet & & \bullet & & \bullet & \\         \\         & \bullet \ar@{-}@/^1pc/ [uuuuuul] \ar@{-} `u[uuuu][uuuur] &    & \bullet \ar@{-}     `l[ul][uuuul] \ar@{-}@/_/ [uuuuuur] & & \bullet & &   &   \\         \\         &   &   &   &   &   & \bullet \ar@{-}@/^3pc/[uuuulll] \ar@{-    }@/_1pc/[uuuul] \ar@{-} `^u [r] [uuuur] &   &   \\         \\     \bullet \ar@{-} `u [uuuuuu][uuuuuurrr] \ar@{-}[uuuur] \ar@{-}[uuuurrr] \ar@{-}    [uuuurrrrr] & &   &   & \bullet \ar@{-} @/^1pc/[uuuuuur] \ar@{-}[uuuur] & &       &   & \bullet \ar@{-}@/^3pc/ [uuuulll] \ar@{-}@/_/ [uuuuuul] \\         \\         &   &   &   & \bullet \ar@{-}[uullll] \ar@{-}[uu] \ar@{-}[uuuurr]     \ar@{-}[uurrrr] & &   &   &   \\     }$$      This has 8 rows in it. If you look at the 5th row from the top, there are three bullets (oriented kind of to the left). The middle bullet needs to go out to the left 1 space, turn to the right then go up 4 spaces. However, this never works and I keep getting this error. Oddly enough, if I type in other variations, it DOES work. It just doesn't look like the diagram I need to make. For example, I can go               \ar@{-} '^u[uuuu][uuuul]      and it will go up first and THEN curve to the left or I can go               \ar@{-} 'r[r][uuuul]      and it will also work but be completely wrong. It seems to only fail _when I go to the left_. Why?? I assume the error code could help me understand this further. EDIT: Now when I attempt to compile this, I get the error message: > Xy-pic error: in entry "9,4": No [ul] (is "8,3") from here.


title: sketching semicirles and horizontal lines

text: I want to sketch this parallel lines and semicircles between them sth like the attached figure![propagation of wave in to the layers of earth](http://i.stack.imgur.com/7o11m.png)... would you plz help me?


title: tikzpicture in node of another tikzpicture: how to screen of from inheriting style?

text: I wish to create tikzpicture environments inside a node of another tikzpicture. The problem I encouter is that styles are inherited by the inner tikzpicture. How can I screen of the inner tikzpicture form the outer one? Or is this impossible? The following minimal example illustrates the problem:               \documentclass{minimal}     \usepackage{tikz}       \usetikzlibrary{positioning}     \begin{document}          % wanted: square centered on line     \begin{tikzpicture}       \draw (0,0) -- (0,1);       \node[fill] at (0,.5) {};     \end{tikzpicture}          % got: square to the right of line     \begin{tikzpicture}[red]       \node[fill] (O) {};       \node[right=of O] {% <- this 'right of' is inherited; how to avoid?       \begin{tikzpicture}         \draw (0,0) -- (0,1);         \node[fill] at (0,.5) {};       \end{tikzpicture}       };     \end{tikzpicture}          \end{document}


title: How to convert characters to LaTeX code?

text: How to convert characters of type `á ê õ ção` to `\'a \^e \~o \c{c} \~a` automatically?


title: Beamer - Identify Slides That, with a Conditional, Go To a Separate Set of Slides

text: I teach the same topics for two levels of the same class. For the more technical class, I'd like to have the technical material in the slides. For the more basic class, I'd like to kick all of the technical stuff to a different set of "supplemental" slides. Is there a way I can identify slides that should be moved to a different set of slides if I identify the notes for the basic class, yet I compile the .TeX file the same as usual (I just get either one set of slides or two sets (if basic class)).   Thanks for any thoughts! Ken


title: Minipage not finding width argument

text: The following code is producing an error:               \begin{figure}[htbp!]     \subfloat{         \begin{minipage}[c][Structured Mesh]{0.5\textwidth}             \centering             \includegraphics[scale=0.4]{ch-SmallStrain/Graphics/Structured}         \end{minipage}}     \subfloat{         \begin{minipage}[c][Unstructured Mesh]{0.5\textwidth}             \centering             \includegraphics[scale=0.4]{ch-SmallStrain/Graphics/Unstructured}         \end{minipage}}     \\     \subfloat{         \begin{minipage}[c][Structured Mesh, zoomed to red box shown above]{0.5\textwidth}             \centering             \includegraphics[scale=0.2]{ch-SmallStrain/Graphics/StructuredCloseup}         \end{minipage}}     \subfloat{         \begin{minipage}[c][Unstructured Mesh, zoomed to red box shown above]{0.5\textwidth}             \centering             \includegraphics[scale=0.2]{ch-SmallStrain/Graphics/UnstructuredCloseup}         \end{minipage}}         \caption{Meshes for the Shearing example\label{fig:Meshes-for-the}}     \end{figure}      The error is: > ! Missing number, treated as zero. S l.634 \end{minipage}} which occurs at each `\end{minipage}`. This seems to me like the width arguments `{0.5\textwidth}` are not being recognized, and indeed the error goes away if I remove the optional arguments in the `[]`. Is there a way to fix this error while keeping the optional arguments? Edit: I forgot to mention that I am using the subfig package and the second optional argument is supposed to be the caption of the subfigure.


title: Dynamically change language for datetime

text: I am building a fairly complex letter template as `article`-extending class, which needs to be able to understand two languages (English and German). This is implemented via `babel` (with both `ngerman` and `english` as package options) and `\DeclareOption`, which uses `\selectlanguage` to determine which one. Currently, I use `datetime` and `\today` to set the date, but that requires to load `babel` BEFORE `datetime` (source). What is the correct way to do this? I could imagine the following, but don't know how to do any of these:   * reload `babel` so that it updates the dateformat AFTER language option has been processed   * specifiy the language for `datetime` (or use another package that supports this)   * do it manually via `ifthenelse` (I can do that, but there has to be a more elegant way?) Thanks for your input! Minimal Non-Working Example:               \usepackage[english, ngerman]{babel}     \usepackage{datetime}          \DeclareOption{E}{         \selectlanguage{english}     }     \ProcessOptions\relax     % date formatting magic here please %     \today


title: How to combine simultaneously the fragile- and the label-command for a frame?

text: I am currently facing the following problem in the beamer-class for LaTeX: I would like to label a frame and simultaneously use a verbatim-environment. Most likely the solution is very easy but I do not figure out how to address this issue correctly. Next you find a MWE:               \documentclass[12pt,english,hideothersubsections]{beamer}     \usepackage{verbatimbox}     \begin{document}     \begin{frame}[label=supplemental][fragile]     \begin{verbbox}     TEXT     \end{verbbox}     \resizebox{0.95\textwidth}{!}{\theverbbox}     \end{frame}     \end{document}      The problem is that the pdf-output displays the "[fragile]"-element, too. However, if I simply combine both commands in one single bracket, i.e., the label- and the fragile-command, I get an error-message. If I delete either the first or the second []-command the results are not as I want them. How can I fix this? Does anyone has an idea? Thanks a lot in advance.


title: pictograms, Iconography, scalable shapes, custom nodes, shapes

text: Hy, I'm building up my own iconography, a set of pictograms that represent ideas so that i can connect them to illustrate more complex systems. I would like some suggestions of which is the best manner to do that. How can I do a library of pictograms? how shall i add them to my schemes? which is best and easiest way to draw blocks like the ones shown in the example image (i.e. the protractor and the ruler)? would they scale properly? I looked at the pigs example but is quite non-intuitive. Any reading suggestions? Thanks for the guidance. ![enter image description here](http://i.stack.imgur.com/zNRKY.png)


title: Drawing generic cumulative distributions

text: It might be trivially easy to learn but this is a bit urgent for me. So if anyone has some sample codes in latex to share with or document easily explain how to obtain something like http://en.wikipedia.org/wiki/File:Discrete_probability_distribution_illustration.svg it would be great. Many thanks!


title: How to "count" some table cells and print the result?

text: Thanks to an answer from David Carlisle found on this site I managed to code this:               \documentclass[a4paper,10pt]{article}     \usepackage{colortbl}     \usepackage{xcolor}               \newcommand{\acell}[1]{\gdef\acontent{#1}#1}     \newcommand{\bcell}[1]{\gdef\bcontent{#1}#1}          \def\atest{A}     \def\btest{B}     \def\ctest{C}     \def\dtest{D}     \def\etest{E}     \def\ntest{-}          \newcommand{\zcell}{%     \ifx\acontent\ntest\cellcolor{yellow}0     \else      \ifx\acontent\atest\ifx\bcontent\atest\cellcolor{green}1.5%                         \else\cellcolor{red}-0.4%                         \fi     \else     \ifx\acontent\btest\ifx\bcontent\btest\cellcolor{green}1.5%                         \else\cellcolor{red}-0.4%                         \fi     \else     \ifx\acontent\ctest\ifx\bcontent\ctest\cellcolor{green}1.5%                         \else\cellcolor{red}-0.4%                         \fi     \else     \ifx\acontent\dtest\ifx\bcontent\dtest\cellcolor{green}1.5%                         \else\cellcolor{red}-0.4%                         \fi     \else     \ifx\acontent\etest\ifx\bcontent\etest\cellcolor{green}1.5%                         \else\cellcolor{red}-0.4%                         \fi     \fi\fi\fi\fi\fi\fi}               \begin{document}           \section*{Student name}          \begin{tabular}{c c c c c c c c c}        Question & Answer               & Correct answer   & Points      &  & Question    &        Answer         & Correct Answer   & Points \\\hline      \textbf{1} & \acell{A}             & \bcell{E}        & \zcell      &  & \textbf{31} &  \acell{}            &  \bcell{A}       & \zcell  \\      \textbf{2} & \acell{E}             & \bcell{E}        & \zcell      &  & \textbf{32} &  \acell{}            &  \bcell{B}       & \zcell  \\        \textbf{3} & \acell{-}             & \bcell{E}        & \zcell      &  & \textbf{33} &  \acell{}            &  \bcell{D}       & \zcell  \\                 &                      &                  &             &   &             &                      & \textbf{Score}  & \textbf{} \\         \end{tabular}            Correct answers = ?           Wrong answers = ?           Null answers = ?          \end{document}      Basically a table where the given answers are compared to the correct answers and a nice colored cell is printed depending on the answer being correct, wrong or null. What I want to ask is if there is a way to let LaTeX count the yellow, green and red cells and print the numbers somewhere in the document. Is this possible?


title: How do I print out more than 200 citations in \begin{thebibliography} ... \end{thebibliography}

text: I have more than 200 citations in a simple               \begin{thebibliography}{99}     \bibitem{stuff}Citation ......     \bibitem{ etc ....     200 times     \end{thebibliography}      when I compile it, it won't give me all of the citations. Any ideas? I can't put the citations into BibTeX format. I am constrained by time.


title: Errors with moderncv

text: I'm using to make my CV with the `moderncv` package for the first time. I'm working with TeXnicCenter and MiKTeX 2.9 on Window 7. I've downloaded the new `moderncv` from CTAN ... but got into problems. I don't know how to fix them.               \documentclass[12pt,a4paper,naustrian]{moderncv}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{color}     \usepackage{babel}     \usepackage[scale=0.75]{geometry}     \moderncvtheme[grey]{classic}     \firstname{My} \familyname{Name}      \title{CV}      \address{Street}{somewhere\protect\[0.1em] country\protect\[0.2em]}      %\mobile{+1231231231323} %\email{}     \begin{document}     \maketitle      %\section{Section} %\cvitem{something}{something} %\cvitem{something}{something} Testtext.      \end{document}       **Edit** Thanks for your responses. I have just compiled your example, but not working yet. Here you can find some lines from .log file :               ! LaTeX Error: Missing \begin{document}.          l.2 < !-- saved from url=(0078)http://mirrors.med.harvard.edu/ctan/macros/lat...          You're in trouble here. Try typing to proceed. If that doesn't work, type X to quit.          Overfull \hbox (28.55835pt too wide) in paragraph at lines 2--4 []\OT1/cmr/m/n/10.95          Overfull \hbox (22.23462pt too wide) in paragraph at lines 2--4 \OT1/cmr/m/n/10.95 from []          Overfull \hbox (447.5515pt too wide) in paragraph at lines 2--4 \OT1/cmr/m/n/10.95 url=(0078)http://mirrors.med.harvard.edu/ctan/macros/latex/c ontrib/etoolbox/etoolbox.sty [] }      * * * Thanks for your responses. I have just compiled your example, but not working yet. Here you can find some lines from .log file :               {This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2013.4.16)  16 APR 2013 14:34     entering extended mode     **LaTeX2.tex     (C:\Users\iman\Desktop\moderncv\LaTeX2.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,      croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat     vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm     an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,      romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis     sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u     senglishmax, welsh, loaded.     (C:\Users\iman\Desktop\moderncv\moderncv.cls     Document Class: moderncv 2013/02/09 v1.3.0 modern curriculum vitae and letter d     ocument class     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size11.clo"     File: size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\etoolbox\etoolbox.sty"          ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.2 <          !-- saved from url=(0078)http://mirrors.med.harvard.edu/ctan/macros/lat...          You're in trouble here.  Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.               Overfull \hbox (28.55835pt too wide) in paragraph at lines 2--4     []\OT1/cmr/m/n/10.95 <!--     Overfull \hbox (25.91501pt too wide) in paragraph at lines 2--4     \OT1/cmr/m/n/10.95 saved      []               Overfull \hbox (22.23462pt too wide) in paragraph at lines 2--4     \OT1/cmr/m/n/10.95 from      []               Overfull \hbox (447.5515pt too wide) in paragraph at lines 2--4     \OT1/cmr/m/n/10.95 url=(0078)http://mirrors.med.harvard.edu/ctan/macros/latex/c     ontrib/etoolbox/etoolbox.sty      []      }


title: Problem with "semilogyaxis" in TikZ

text: I've some trouble using the following code. I'm using MiKTeX 2.9 x64 with (in this case) QTikZ and got this code by the `matlab2tikz` function, and the following example simply just don't work in QTikZ. I'm almost sure that the error occurs, because of the combination of the log- scale and the "distance" from 0.1 to 100000. I got this impression, because of other cases which I could get work when excluding the "1". For those other plots I'd liked to plot a bit-error-rate (BER) so starting with 0.99 instead of 1 was a compromise I could live with, but here I need the range from 0.1 to 100000. I would be really thankful, if anyone could give me any hint to get my plot drawn in log-scale. Hope everybody could understand me, although of my bad language skills. ;-) And here the not yet working code:               % This file was created by matlab2tikz v0.1.3.     % Copyright (c) 2008--2011, Nico Schloemer <nico.schloemer@gmail.com>     % All rights reserved.     %      % The latest updates can be retrieved from     %   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz     % where you can also make suggestions and rate matlab2tikz.     %      \begin{tikzpicture}          \begin{semilogyaxis}[%     scale only axis,     width=4.52083in,     height=3.56562in,     xmin=1, xmax=9,     ymin=0.1, ymax=100000,     title={$\text{Test-Figure N}= 8$},     axis on top]     \addplot [     color=blue,     solid,     mark=o,     mark options={solid}     ]     coordinates{      (1,10531.1)(2,2150.19)(3,258.407)(4,21.2681)(5,16.0093)(6,11.8044)(7,4.96487)(8,1.39658)(9,0)      };          \addplot [     color=red,     solid,     mark=x,     mark options={solid}     ]     coordinates{      (1,11050.1)(2,39.3339)(3,7.92449)(4,2.50753)(5,0.906895)(6,0)      };          \end{semilogyaxis}     \end{tikzpicture}


title: Print either parenthesized year or bracketed number depending on biblatex style?

text: How can one cite either the parenthesized year or bracketed number, depending on whether `authoryear` or `numeric` styles are used? For instance, I would like to have one unified piece of code that prints "Knuth's work (1984) ..." if `authoryear` is used, and that prints "Knuth's work [1] ..." if `numeric` is used.               \documentclass{article}     \usepackage[style=authoryear]{biblatex}     % \usepackage[style=numeric]{biblatex}     \addbibresource{biblatex-examples.bib}          \begin{document}     % Works for authoryear style, but not numeric style     \Citeauthor{knuth:ct:a}'s work \parentext{\citeyear{knuth:ct:a}}          % Works for numeric style, but not authoryear style     \Citeauthor{knuth:ct:a}'s work \autocite{knuth:ct:a}          \printbibliography     \end{document}


title: Comic strip in TeX

text: I am creating figures using Stykz. Every frame (should have customisable resolution) consists of   1. stick figure   2. 2 or more text boxes   3. Frame![enter image description here](http://i.stack.imgur.com/R9xPW.png) outline (will be best if looks handdrawn) I want to fit exactly 4 such frames on next to each other one page of the pdf, and next 4 on next page and so on... something like this ![enter image description here](http://i.stack.imgur.com/cBnwL.png) How can I do this in TeX?


title: Double subscript error using tensor package

text: I have been attempting to typeset tensors using the tensor package and have come across an error when attempting to create subscripts on the subscripts of my tensors. An example of this would be the following:               \documentclass{report}     \usepackage{mathtools}     \usepackage{tensor}          \begin{document}          \begin{equation} \label{tensor-symmetrize}     T\indices{_{(\mu_1 \mu_2 \cdots \mu_n)}_\rho^\sigma} = \frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}}_{\cdots}_{\mu_n}_\rho^\sigma      + \text{sum over permutations of indices}) .     \end{equation}          \end{document}      On compiling this document I get an error saying               ! Double subscript.     l.8 ...frac{1}{n!} (T \indices{_{\mu_1}_{\mu_2}}_                                                   {\cdots}_{\mu_n}_\rho^\sig...


title: Trouble with my first latex document

text: Just downloaded Protex, downloaded TexStudio, and i'm trying to create a document, and i have               \documentclass{article}     \begin[12pt]{document}     \section{Executive Summary}          \end{document}      and its giving me 3 errors on the last line about it can't find the file. did i save in the wrong folder? does this work like matlab where it needs to be in a set directory first?


title: Tranparent items (not visible!) on a beamer presentation, inside a column and with overlays

text: My purpose is to make a frame with 2 columns: on the left, a series of items, and on the right, figures (with one exception). The items are meant to appear one at a time, with different figures (or text) on the right column, which are related to the text on the items. That exception (slide 3 in the example below) is what is giving me trouble (see the gif animation below). At the 3rd slide on the right there should be an itemized. The list is there actually, but transparent. This only happens when I put the list on a middle slide. If I change the order so that the list appears at the end, then everything is OK. If I eliminate the `alertblock` and the `itemize` environments (i.e.: make it just normal text), then the problem disappears. Any of those environments alone (i.e.: just the `alertblock` or just the `itemize`) seem to trigger the problem again. The figure below explains (I hope) what the problem is: ![example gif](http://i.stack.imgur.com/Vhcpi.gif) This is a toy example source code:               \documentclass{beamer}     \mode<presentation>     {       \usecolortheme{default}       \setbeamercovered{transparent}     }          \usepackage{lmodern}          \begin{document}          \begin{frame}[t]{some title}       \begin{columns}[T]         \column{.5\textwidth}           \begin{itemize}             \item<1-| alert@1>               item 1             \item<2-| alert@2>               item 2             \item<3-| alert@3>               item 3 %%% THE PROBLEM APPEARS IN THIS SLIDE             \item<4-| alert@4>               item 4             \item<5-| alert@5->               item 5           \end{itemize}           \onslide<6->           \footnotesize final words...         \column{.5\textwidth}           \only<1>{ figure 1 }           \only<2>{ figure 2 }                %% AND NOW, THE PROBLEMATIC PART:           \only<3>{             \begin{alertblock}               \small % if I comment this line it doesn't compile.                \begin{itemize}                 \item                   more items 1                 \item                   more items 2               \end{itemize}             \end{alertblock}           }           %% END OF TROUBLEMAKER                \only<4>{ figure 3 }           \only<5->{ figure 4 (last) }       \end{columns}     \end{frame}          \end{document}      And there's another weird behavior: if I comment out the `\small` command, the document doesn't even compile, giving me this error message:               ! TeX capacity exceeded, sorry [input stack size=5000].     \end #1->\csname end#1                           \endcsname \@checkend {#1}\expandafter \endgroup \if@e...     l.50 \end{frame}          !  ==> Fatal error occurred, no output PDF file produced!      Any help is much appreciated!


title: Setting up `Ubuntu Monospace` font for a specific listing

text: * My OS : Ubuntu 13.10   * Latex version used : Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) In my report, I am using the following listing :               \lstdefinestyle{BashInputStyle}{       language=bash,       basicstyle=\small\sffamily,       numbers=left,       numberstyle=\tiny,       numbersep=3pt,       frame=tb,       framerule=0pt,       columns=fullflexible     }      I would like to know if it is possible to configure the font style of this listing (and this listing only!), setting up`basicstyle`, I assume. I would like to configure this font style as `Ubuntu Monospace` (known by my OS). Is there a simple way for doing it please ?


title: Two different letter style in inline equation

text: In the following inline equation I am getting x of two different styles. How can I fix that ?               $A_{x}B_{1-x}$      Following is the image of the generated output ![enter image description here](http://i.stack.imgur.com/nEJcS.png) I use org-mode to do pdf latex export. To create a minimal example, I wrote just A_{x}B_{1-x} in an org-mode file and exported it to pdf. Following is the content of the generated .tex file. There was no error.               % Created 2013-04-16 Tue 22:51     \documentclass[11pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{fixltx2e}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage{float}     \usepackage{wrapfig}     \usepackage{soul}     \usepackage{textcomp}     \usepackage{marvosym}     \usepackage{wasysym}     \usepackage{latexsym}     \usepackage{amssymb}     \usepackage{hyperref}     \tolerance=1000     \providecommand{\alert}[1]{\textbf{#1}}          \title{A$_{x}$B$_{\mathrm{1-x}}$}     \author{ME}     \date{\today}     \hypersetup{       pdfkeywords={},       pdfsubject={},       pdfcreator={Emacs Org-mode version 7.9.3f}}          \begin{document}          \maketitle          \setcounter{tocdepth}{3}     \tableofcontents     \vspace*{1cm}          \end{document}


title: Decrement macro, subtract 1 in side equation

text: While doing general math inside a math macro is not very feasible. I feel like a mecro that does, only for single digits should be possible, with default for other inputs `\dec{1}` to `0`   `\dec{2}` to `1`   `\dec{3}` to `2`   ...   `\dec{8}` to `7`   `\dec{9}` to `8`   `\dec{i}` to `i-1`   `\dec{10}` to `10-1`   How can this be done? some kind of switch/case? **Use case:** I am describing the mathematically model of a neural net, each layer h(i-1), can be derived by taking the sigmoid matrix w(i,i-1) multiplied by h(i) I have named w(i,i-1), as such because I had been forgetting which number layer it was from vs which layer it was to. But I want to define a macro to so that for small numbers (The nural net will never have more than 9 layers), I have a macro so i can say `\w{5}` to get output equiv to `\mathbb{w}^{5,4)}`. However I also want to beable to speek about layers in general, so to say `\w{i}` to get `\mathbb{w}^{(i,i-1)}` ![enter image description here](http://i.stack.imgur.com/DlDAF.png)


title: fontspec option "Renderer=Basic" - what does it mean?

text: Since a few days I've been using the `fontspec` option `\setmainfont[Renderer=Basic] ...` in order to use the `microtype` option `tracking=true` with `LuaLaTeX`. I have a simple question on this: why does using `Renderer=Basic` make computing my pdf sooooo much slower. It takes virtually hours now to complete on single run with `lualatexmk` -- and several (10+) minutes of high-fan- activity computing with the normal `lualatex` engine. So, again: what does `Renderer=Basic` mean? And what is the difference to the default?


title: LaTeX font error with TeX Live 2013

text: I use MacTeX and I recently changed my hard drive and upgraded to TeX Live 2013. I have a style file that I need to use for my thesis. It used to typeset fine, and when I upgraded, it stopped compiling and produces the following error:               Hi     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)      restricted \write18 enabled.     entering extended mode     (./thesis.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 78 languages loaded.     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/report.cls     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class     (/usr/local/texlive/2013/texmf-dist/tex/latex/base/size12.clo))     (./smu_thesis.sty     kpathsea: Running mktextfm rpcrr     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input rpcrr     This is METAFONT, Version 2.718281 (TeX Live 2013)          kpathsea: Running mktexmf rpcrr          ! I can't find file `rpcrr'.     <*> ...e:=ljfour; mag:=1; nonstopmode; input rpcrr          Please type another input file name     ! Emergency stop.     <*> ...e:=ljfour; mag:=1; nonstopmode; input rpcrr          Transcript written on mfput.log.     grep: rpcrr.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input rpcrr' failed to make rpcrr.tfm.     kpathsea: Appending font creation commands to missfont.log.               ./smu_thesis.sty:948: Font \pf=rpcrr at 11.0pt not loadable: Metric (TFM) file      not found.     l.948 \font\pf=rpcrr at 11pt          ?      Process aborted      I know it has to do with a missing font and I checked for the location of the file `rpcrr*` in the old system and made sure it's present in the new system in following locations:               /usr/local/texlive/2013/texmf-dist/fonts/tfm/cspsfonts-adobe/courier/rpcrro.tfm     /usr/local/texlive/2013/texmf-dist/fonts/tfm/cspsfonts-adobe/courier/rpcrr.tfm     /usr/local/texlive/2013/texmf-dist/fonts/tfm/courier/rpcrro.tfm     /usr/local/texlive/2013/texmf-dist/fonts/tfm/courier/rpcrr.tfm     /usr/local/texlive/2013/texmf-dist/tex4ht/ht-fonts/alias/adobe/courier/rpcrro.htf     /usr/local/texlive/2013/texmf-dist/tex4ht/ht-fonts/alias/adobe/courier/rpcrr.htf      Still, the thesis just won't typeset. Any help would be greatly appreciated.


title: Where can I report typographical errors for LaTeX3 documentation?

text: Following up on What can *I* do to help the LaTeX3 Project, there doesn't seem to be a definitive place to report a typo in any of the LaTeX3 documentation (e.g. `texdoc interface3`). Where can I report such errors?


title: Using boxes with two rows in a TikZ tree

text: I am trying to alter the code I made for a family tree using TikZ, by inserting birthdays in a row below a name. Here is the initial code, without the birthday rows, which has a nice output (if someone knows how to post output here, please do so and delete this parenthetical request):                 \documentclass{article}       \usepackage{tikz}       \usepackage[active,tightpage]{preview}       \PreviewEnvironment{tikzpicture}       \setlength\PreviewBorder{5pt}            \usetikzlibrary{trees}       \usetikzlibrary{shapes}                 \begin{document}                 \begin{tikzpicture}        [-,thick,         every node/.style={shape=rectangle,inner sep=3pt,draw,thick}]         \footnotesize     \node {Parent} [edge from parent fork down]     [sibling distance=2cm]     child {node {Child}     [sibling distance=2.2cm]       child {node {Grandchild 1}}       child {node {Grandchild 2}}       child {node {Grandchild 3}}       }       ;     \end{tikzpicture}            \end{document}      I tried to add some second rows with birthdays using the following code between the `\begin{document}` and `\end{document}`, but the output looks bad. Connecting lines change or disappear or show up in the wrong place. (If you can post output for the code below, please do so and delete this parenthetical request.)                 \begin{tikzpicture}        [-,thick,         every node/.style={shape=rectangle,inner sep=3pt,draw,thick}]         \footnotesize     \node {Parent} [edge from parent fork down]     [sibling distance=2cm]         child{node [name=block2, rectangle split, rectangle split parts=2]           {Child \nodepart{second}1/15/59}     [sibling distance=2.2cm]      child{node [name=block2, rectangle split, rectangle split parts=2]           {Grandchild 1\nodepart{second}10/20/80}}       child{node [name=block2, rectangle split, rectangle split parts=2]            {Grandchild 2\nodepart{second}2/5/84}}       child{node [name=block2, rectangle split, rectangle split parts=2]           {Grandchild 3\nodepart{second}8/9/89}}     }      ;      \end{tikzpicture}      Can someone advise how to include the second birthday rows without altering the tree structure from the original code?


title: Forcing bibliography order

text: I've a bibliography which include websites. I want to have an alphabetical sort. Thus I use the plain style which do the job great. The problem is websites are less important than others references and I would like to put them at last. Is it possible to force that? Here is a part of the BibTex file :               @Misc{wikianglais,     title = {\url{http://www.wikipedia.org/wiki/Blackjack}},     month = {mai},     year = {2013}     }          @Book{Thorp,     author = {Edward O. Thorp},     ALTeditor = {},     title = {Beat the dealer},     publisher = {Vintage Books Edition},     year = {1966},     month = {février}     }          @Book{Braun,     author = {Julian H. Braun},     ALTeditor = {•},     title = {How to play winning Blackjack},     publisher = {Data House Pub. Co},     year = {1980}     }      I would like to get : Braun, Thorp and then the Wikipedia reference but the actual order is : the Wikipedia reference, Braun, Thorp.


title: Know the width of the widest section label in memoir

text: I'm using `memoir` class to write my master's thesis, and my university asks to align all section labels to the left. I say section, but I really mean all levels, as chapters, sections, subsecs and so on. So far, I've managed that. The real problem is that they ask to align all the section titles based on the widest section label. I know that I can always guess what this length would be, but I was looking for an automatic way of getting this value from latex, so it would be easier when others wrote their thesis based on my source code (I'm kinda the pioneer on standardizing the text using latex...). ![Incorrect TOC](http://i.stack.imgur.com/Ff62L.png) This is how it looks right now. I wanted a way to know that my widest label is the label 2.2.4, so I could tell memoir its length. And then, if I added a subsubsection there, the new widest would be 2.2.4.1 and, again, its length would be automatically passed to memoir. * * * **Edit** : Since the contents of my document are really a lot, I split it, putting each chapter in a different `.tex`, including everything in the "master document". Also, I'm using `pdflatex` from the standard `texlive` that comes with Ubuntu 13.04. * * * **Edit** : Here is a MWE based on one of the answers: **File** : `main.tex`               \documentclass{memoir}     \usepackage[T1]{fontenc}          \setsecnumdepth{subsubsection}     \settocdepth{subsubsection}          \maxsecnumdepth{subsubsection}     \maxtocdepth{subsubsection}          \begin{document}     \frontmatter     \tableofcontents          \mainmatter          \include{chap1}     \include{chap2}          \end{document}      **File** : `chap1.tex`               \chapter{First Chapter}          \section{First Section}     \subsection{Subsection}     \subsection{Subsection}     \subsubsection{Subsubsection}     \subsubsection{Subsubsection}          \section{Second Section}     \subsection{Subsection}     \subsection{Subsection}     \subsubsection{Subsubsection}     \subsubsection{Subsubsection}      **File** : `chap2.tex`               \chapter{Second Chapter}          \section{First Section}     \subsection{Subsection}     \subsection{Subsection}     \subsubsection{Subsubsection}     \subsubsection{Subsubsection}      And I intend the TOC to output like this: ![Correct TOC](http://i.stack.imgur.com/kxofq.png)


title: pgfplots exponent in ylabel instead of yticklabel

text: I know there are already a lot of questions answered about the exponents of the ticklabels and how to get rid of them, but in my extensive search I was not able to find an answer to my specific question.   Take the following example:               \documentclass[crop,10pt]{standalone}     \usepackage[english]{babel}     \usepackage{pgfplots}          \usepackage[space-before-unit,range-units = repeat]{siunitx}          \begin{document}%         \setlength{\linewidth}{246pt}%                  \begin{tikzpicture}             \begin{axis}[             width=\linewidth,             ytick pos = left,             xtick pos = left,             enlargelimits=false,             clip=false,             axis on top,             tick align = outside,             yticklabel style={%             /pgf/number format/fixed,             /pgf/number format/precision=1,             /pgf/number format/fixed zerofill         },             xlabel={length (\si{\meter})},             ylabel={length (\si{\meter})},     ]             \addplot             coordinates             {(1,0.0005) (2,0.001)   (3,0.0015)};             \end{axis}             \end{tikzpicture}     \end{document}      The graph and the ticklabels look the way I want them to. The only thing I want to do now, is to get rid of the " *10^{-3} " above the y axis and (manualy) change the ylabel to milimeters. When I use the `scaled ticks=false` option, this will change the ticklabels again and I would have to display them as 0.0005, 0.0010 and 0.0015 instead of 0.5, 1.0 and 1.5 which looks ugly. So the question is: Is there a way to get rid of the exponent (not displaying it) without the ticklabels getting changed? (Of course any other solution would also be appreciated)   Thank you for your help,   John


title: Tikz arrowhead size in tree using decorations?

text: Tikz is weird when in comes to decorating tree edges. I'd like to draw a tree with a snakey line with an arrow in the middle. What sounds simple is somewhat tricky but I found a solution with a further draw action in the `postaction`. However the default arrowhead size is too small for my liking. Unfortunately tikz seems to ignores the `scale` option when drawing tree edges, the `line width` option however does work but it doesn't achieve what I want. Here is my code together with an image depicting the problem. The upper arrow from the `\draw` command is how I'd like it to look.               \documentclass[a4paper,12pt]{article}     \usepackage{tikz}     \usetikzlibrary{decorations,decorations.pathmorphing,decorations.markings,trees,arrows}     \begin{document}          \tikzset{         con/.style={draw opacity=0,thick,                     decoration={markings,mark=at position .6 with {\arrow[blue!50!black,draw opacity=1,line width=0.5pt,scale=2]{angle 90}}},                     postaction={decorate},                     postaction={draw=blue!50!black,draw opacity=1,decoration={snake,amplitude=1pt, segment length=8pt},decorate}                    }     }          \begin{tikzpicture}[scale=2]         \draw [con] (0,0.3) -- (1.5,0.3);         \coordinate             child[grow=east] {                 edge from parent [con]             };     \end{tikzpicture}          \end{document}      ![The arrow on the tree edge is too small.](http://i.stack.imgur.com/38Nwp.png) Any idea how to make the lower arrow look like the upper one?


title: Changing top, bottom, left & right margins on the fly

text: I’m trying to find a way of being able to modify all of the margins of a page whenever I want to and as many times as I want to on a single page in order to be able to put text very easily where I want on a page. I have thought of using the geometry package and using                \newgeometry{left=6.75cm, right=1cm, top=1cm, bottom=1cm}      %…      \restoregeometry      but unfortunately this only works for whole pages, so I can only change the margins once per page (and then they are valid for the whole page without having the possibility of changing them again). I found the following script on the internet which enables users to change margins on the fly, just as I want to. The code below works fine and enables me to change the left and right margins of my page as many times as I want to, but unfortunately, it doesn’t give me the option of changing the top and bottom margins.               % placed before \begin{document}          \newenvironment{changemargin}[2]{%     \begin{list}{}{%     \setlength{\leftmargin}{#1}%     \setlength{\rightmargin}{#2}%     }%     \item[]}     {\end{list}}          % And then inside the document, whenever I want to use     % the command to change the margins on the current page          \begin{changemargin}{1.9875cm}{-3.7625cm}     % this means the left margin increases by 1.9875cm compared     % to the default left margin (4.7625cm) (so left margin=6.75cm here)     % and the right margin decreases by 3.7625cm (so right margin=1cm)          % ... (text or pictures in new environment)          \end{changemargin}      For this reason, I tried to adapt the code above and came up with the code below:               % placed before \begin{document}     \newenvironment{changemargin}[3]{%     \begin{list}{}{%     \setlength{\leftmargin}{#1}%     \setlength{\rightmargin}{#2}%     \setlength{\topmargin}{#3}%     }%     \item[]}     {\end{list}}          % And then to use the command:     \begin{changemargin}{1.9875cm}{-3.7625cm}{1cm}     % ...     \end{changemargin}      It compiles and still changes the left and right margins but the top margin remains unchanged. (I haven’t yet tried to change the bottom margin). Can anyone help me get this code to work completely, and enable me to modify the left, right, top and bottom margins of a page? Thanks.


title: Bibliography style?

text: I'm looking for the bibliography style where "references should be numbered in order of citation and cited in the text by numbers in square brackets. They should be listed in the reference list in the form prescribed in the Uniform Requirements (giving the names and initials of all authors, unless there are more than six, when the first three should be given, followed by et al.)". Any ideas? Thank you.


title: how to create a template or document class for latex?

text: I need to write a document class or template, as for an article, letter, etc. Is there software for this? How do I set it up so that anyone can use my class just like `\documentclass{article}`?


title: Why doesn't PStricks put nodes where I want?

text: I was surprised when I saw this result! I want to put, starting from my lower left corner, a pink, a red, and a blue node, BUT I was surprised when I saw that the three nodes started from the upper right corner! I solved the problem by changing -0.25 to 0 BUT, WHY does PStricks do this?               \documentclass[12pt,a4paper]{standalone}     \usepackage{setspace} % para que no afecte el interlineado a las notas de pié de página     \setstretch{1.5}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \usepackage{amsmath,amsfonts,amssymb,latexsym}     \usepackage{eurosym}     \usepackage{graphicx}     \usepackage{verbatim}     \usepackage{hyperref}     \hypersetup{colorlinks=true, urlcolor=blue}     \usepackage{xcolor}     \usepackage{mathpazo}       % Fuente MathPazo     \usepackage{datetime}       % paquete para configurar formato de fecha y hora     \settimeformat{ampmtime}     \renewcommand*{\noon}{\pmname}          \spanishdecimal{.}     % ----------------------  PSTRICKS ---------------     \usepackage{pstricks}     \usepackage{pst-plot,pst-3dplot,pst-node,pst-tree,pst-grad,pst-coil,pst-text,pst-3d,pst-eps,pst-fill,pstricks-add,multido}     % -------- Paquetes de pst-all \usepackage{pst-all}   paquete pstricks para las figuras en postcript     \usepackage{pst-node}     \usepackage{pst-eps}     \usepackage{pstricks-add}     % ---- Fin Paquetes de pst-all     \begin{document}     \begin{pspicture}(-0.25,-0.25)(14.50,10.20) %\malla     \psset{xunit=1cm,yunit=1cm}     \psframe[fillcolor=lightgray,fillstyle=solid,linestyle=none](-0.25,-0.25)(14.50,10.20)          \cnode[fillstyle=solid,fillcolor=pink](1,1){0.15}{Current}     \cnode[fillstyle=solid,fillcolor=red](4,1){0.15}{Current}     \cnode[fillstyle=solid,fillcolor=blue](8,1){0.15}{Current}           \end{pspicture}          \end{document}       Try substituting -0.25 with 0 in `pspicture` and in `psframe`. It solves the problem!


title: minted custom numbering

text: Is it possible to define custom numbers to each source code line, like:               1 string title = "This is a Unicode π in the sky"     22 /*     23 Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter     24 of an $n$-sided regular polygon circumscribing a     25 circle of diameter $d$.     26 */     30-40 ...     162 const double pi = 3.1415926535


How I can cite references in the text by superscript numbers and listed at the end of the paper in the order in which they appear in the text e.g   1. Engel KH, Heidlas J, Tressl R. Food is wonderful, I can't get enough. In Food Flavours Part C. The Flavour of Fruit, Morton ID, MacLeod AJ (eds). Elsevier: Amsterdam, 1990; 195.  Is there any natbib and apalike combined style?


title: LaTeX Document class for department technical reports

text: Can anyone recommend a LaTeX document class that I could modify for use as our department technical report series? Something in the vein of document classes from publishers (Springer, Elsevier etc) where there are commands for inserting author and other document information. But at the same time easy to customize with our logo, front page etc.


title: Difficulty placing a dynamic fill command within a "\path let ..." TikZ structure

text: I wanted to create a sequence of images that show a rhombus being folded. I'm able to do what I want, but the code is not very elegant. I wind up (needlessly?) repeating chunks of code to get the effect that I want. Here's the code:               \documentclass{article}     \usepackage[svgnames]{xcolor}     \usepackage[margin=0.35in]{geometry}     \usepackage{tikz}     \usepackage{tkz-euclide}     \usetikzlibrary{calc}     \usetikzlibrary{decorations}     \tikzset{rhombus fill/.style={fill=blue!\number\numexpr30+#1\relax},              my arrow/.style={decorate,decoration={markings,mark=at position 1 with {\arrow[scale=2.25]{stealth};}}}}     \def\mystep{6}     \edef\myangle{0}     \def\stepmyangle#1{\xdef\myangle{\number\numexpr\myangle+#1\relax}}     \pagestyle{empty}     \setlength{\parindent}{0pt}     \begin{document}               %-@-(4)------------------------------------------------------------------------------------     \newcounter{currentstep}     \foreach \x/\y in {0/0,10/30,12/60,14/0,10/0,9/0}       {\stepmyangle{\x}%%        \begin{tikzpicture}           \coordinate (W) at (0,2in);           \coordinate (Y) at (0,-2in);           \coordinate (X) at (1.14in,0);           \coordinate (Z) at (-1.14in,0);                \fill[rhombus fill=0] (W) -- (Z) -- (Y);                \ifnum\x>0\relax             \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in                   coordinate (A) at ($(W)+(\n3-\myangle:\n2)$);             \fill[rhombus fill=\y] (W) -- (A) -- (Y);             \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in                   coordinate (A) at ($(W)+(\n3-\myangle:\n2)$)                   %% Here results in an error message:  "Missing \endcsname insert"                   %%[fill,rhombus fill=\y] (W) -- (A) -- (Y)                   [draw,postaction={my arrow}] (A) arc (\n3-\myangle:\n1:\n2)                   ;           \else             \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in                   coordinate (A) at ($(W)+(\n3:\n2)$)                   ;           \fi           %% Here doesn't work because it blocks the arrows.           %%[fill,rhombus fill=\y] (W) -- (A) -- (Y)                \draw[gray!20] (W) -- (X) -- (Y);                \draw (W)             \foreach \x in {A,Y,Z} { -- (\x) } -- cycle;           \draw[dashed] (W) -- (Y);              \ifnum\thecurrentstep>2\relax\draw[black,fill=black!20] (W) -- (A) -- (Y) -- cycle;\fi              \end{tikzpicture}%%         \ifnum\thecurrentstep=2\relax           \vspace{2ex}\par         \else           \ifnum\thecurrentstep<5\relax             \hspace*{\fill}%%           \fi         \fi         \global\stepcounter{currentstep}%%       }           \end{document}      which produces: ![enter image description here](http://i.stack.imgur.com/fzUqf.png) The **first** problem is that I'm repeating a block of code:                       \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in ...;      It would be nice if I could set these values once and call on them later, from outside the path, when I need them. I've tried something like                       \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in \edef\myarclength{\n2};      But that resulted in an error. The **second** problem is that I can't seem to just write                       \path let                     \p1=($(Y)-(X)$),                     \n1={atan2(\y1,\x1)},                     \n2={veclen(\y1,\x1)},                     \p2=($(Y)-(Z)$),                     \n3={atan2(\y2,\x2)}                   in                   coordinate (A) at ($(W)+(\n3-\myangle:\n2)$)                   [fill,rhombus fill=\y] (W) -- (A) -- (Y)                   [draw,postaction={my arrow}] (A) arc (\n3-\myangle:\n1:\n2)                   ;      and save myself repasting the code. The last example results in an               Missing \endcsname insert      error message.


title: Paragraph indentation in a list

text: I'm trying to use LaTeX to produce my homework assignments. They're in the form of answering a question sheet, so the answers are formatted in a similar way to the questions, i.e.   1. (a) foo   (b) foo   (c) foo   2. foo I've been answering my questions using enumerative lists. Each \item has a fair number of paragraphs. My problem is that the paragraphs aren't indenting in the usual way by separating them with a blank line. They end up looking like: Foobar.   Foobar.   Foobar. I ideally want the first paragraph to have no indentation at the beginning but the subsequent paragraphs to have the first line indented by a standard width. Is there a way to do what I want? If not, is there an easier method for doing my assignments where my answers match the format that the questions are laid out in? Thanks :-)


title: Using \MarginFigure command

text: Someone wrote a command called `\MarginFigure` for putting figures in the page margins. Unfortunately, I haven't been able to get the `\includegraphics` to work. Specifically, I have figures that I've created using `\newcommand` and then drawing a `tikzpicture`. When I attempt to replace the example image with my new image, it doesn't work. Here is a minimal working example to show you what I'm talking about:               \documentclass[oneside]{amsart}     \usepackage{amsmath,amssymb}     \usepackage[T1]{fontenc}     \usepackage{concmath}     \usepackage[rmargin=3cm,textwidth=11cm,marginparwidth=6cm]{geometry}     \usepackage{graphicx}     \usepackage{marginnote}     \usepackage{caption}     \usepackage{tikz}     \usepgflibrary{shapes}     \usepackage{pgfplots}     \usepackage{lipsum}          \newcommand\MarginFigure[4][width=4cm]{     \marginnote{     \begin{minipage}{\linewidth}         \centering         \includegraphics[#1]{#2}         \captionof{figure}{#3}         \label{#4}     \end{minipage}}}     \reversemarginpar          \pgfmathsetmacro{\ex}{0}     \pgfmathsetmacro{\ey}{0}          \newcommand{\figureone}[1]{     \begin{tikzpicture}[#1]             \draw [fill = lightgray] (0,0) circle [radius = 1.25 cm];         \draw (0,0) -- (0.8838834765,0.8838834765);         \node [above left] at (0.5,0.5) {$r$};             \node [above left] at (-1.0,0.575) {$C$};         \draw [->] (\ex,\ey) ++(135:1.5cm) arc (135:85:1.5cm);         \draw [->] (\ex,\ey) ++(160:1.5cm) arc (160:210:1.5cm);         \end{tikzpicture}     }          \begin{document}     \lipsum[1-2]{}     \MarginFigure{example-image-a}{The Area of a Disk}{fig:testa}     \end{document}      It works perfectly the way it is, but when I replace `example-image-a` with `\figureone`, it won't compile. I'm not sure why. Thanks for your help.


title: Ways to force LaTeX structure?

text: Some types of publications like for instance module documentation have a clear structure (for instance first one has an introduction section, at the end source code is provided,...) I was wondering if it LaTeX or some package can force a user to obey a given structure. If the user fails to write a document according to the specified structure, at least an warning should be printed.


title: Why do I fail to plot (x-1)^{-2/3} using the tikz package?

text: Here is my code:               \documentclass{article}     \usepackage{tikz}      \begin{document}     \begin{tikzpicture}[x=1cm,y=1cm]     \draw[->,color=black] (-0.5,0) -- (3.5,0);     \draw[->,color=black] (0,-.5) -- (0,5);     \draw[very thick, smooth,samples=100,domain=0:3] plot(\x,{1/(\x-1)^(2/3)});     \end{tikzpicture}     \end{document}      which gives               ! Package PGF Math Error: I cannot calculate the logarithm of `-1.0' (in '{1/(0     -1)^(2/3)}').          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7 ...s=100,domain=0:3] plot(\x,{1/(\x-1)^(2/3)})                                                       ;     ?       **Edit**   I want something similar to the graph below (the shaded area isn't necessary):   ![enter image description here](http://i.stack.imgur.com/qGnQK.png)


title: Scanned PDF inclusion problem with XeTeX driver

text: I have this specific problem about inclusion of my scanned PDF pages with existing LaTeX document. I use an iPad application Scanner Pro to scan and create PDF copies of my hand-written notes. Then I would use `pdfpages` package to merge these PDFs with my LaTeX document. So I added something like this in my `.tex` file:               \usepackage{pdfpages}     ...     \includepdf[pages=-]{scanned_file.pdf}      By several attempts, I discovered this oddity that   * if the `.tex` file was ran through `xelatex`, the scanned pdf file refused to be inserted, instead it simply left with as many blank pages as the original scanned file;   * if the `.tex` file was ran through `pdflatex`, the scanned pdf file would be inserted as expected. Furthermore, I think that this is a problem relating to `graphicx` or `graphics` package, because the same behavior has been found when I tried to use `\includegraphics` command instead of `pdfpages` package to insert these stubborn PDF files. I also tried explicitly setting driver option of `graphicx` to be `xetex` with no luck. Here is (one of) my stubborn scanned PDF file, (It's on Dropbox, and it's written in Chinese...) providing for your test. Thanks in advance.


title: Start table number in whole digits for each chapter seprately

text: I want to show table number starting from 1 to so on seprately on each chapter. I am trying to use setcounter, but its not giving the desired results.               \documentclass[english]{book}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{array}     \usepackage{enumitem}          \makeatletter     \providecommand{\tabularnewline}{\\}     \makeatother          \usepackage{babel}          \begin{document}     \setcounter{table}{4}          \chapter{One}          \begin{table}[htbp]     \centering          \caption{I want to give number Table-1}          \begin{tabular}{l>{\raggedleft}p{50pt}r}     \hline      \textbf{Province} & \textbf{Import }\textbf{\scriptsize{}('000' USD)} &      \textbf{Percent}\tabularnewline     \hline      Punjab &  393.8  & 21.35\tabularnewline     Sindh &  521.4  & 72.53\tabularnewline     \hline      \textbf{Grand Total} & \textbf{ 321.2 } & \textbf{ 100.00 }\tabularnewline     \hline      \end{tabular}          \end{table}          \begin{table}[htbp]     \centering          \caption{I want to give number Table-2}          \begin{tabular}{l>{\raggedleft}p{50pt}r}     \hline      \textbf{Province} & \textbf{Import }\textbf{\scriptsize{}('000' USD)} &      \textbf{Percent}\tabularnewline     \hline      Punjab &  393.8  & 21.35\tabularnewline     Sindh &  521.4  & 72.53\tabularnewline     \hline      \textbf{Grand Total} & \textbf{ 321.2 } & \textbf{ 100.00 }\tabularnewline     \hline      \end{tabular}          \end{table}          \chapter{Two}          \begin{table}[htbp]     \centering          \caption{I want to give number Table-1}          \begin{tabular}{l>{\raggedleft}p{50pt}r}     \hline      \textbf{Province} & \textbf{Import }\textbf{\scriptsize{}('000' USD)} &      \textbf{Percent}\tabularnewline     \hline      Azad Jammu \& Kashmir &  2.1  & 0.03\tabularnewline     Balochistan &  1.6  & 0.08\tabularnewline     EPZ &  9.7  & 0.41\tabularnewline     \hline      \textbf{Grand Total} & \textbf{ 321.2 } & \textbf{ 100.00 }\tabularnewline     \hline      \end{tabular}          \end{table}          \end{document}


title: How can I change the margins of quote environment?

text: I am writing a text with `LyX` in the `KOMA` Script document class and have set the following margins under Document->Settings->Page Margins               top: 2.5cm     bottom: 2.5cm     inner: 2.5cm     outer: 3cm      As I am bound to `MLA` (Modern Language Association) formatting rules, I am using biblatex-mla package and have already altered the quote environment to be in a smaller fontsize and singlespaced. You can see that in my preamble:               \usepackage[american]{babel}      \usepackage{csquotes}     \usepackage[style=mla,backend=bibtex]{biblatex}     \addbibresource{<mybib.bib>}     \makeatletter     \g@addto@macro\quote\singlespace     \makeatother     \let\quoteOLD\quote     \def\quote{\quoteOLD\small}      However, the long quotes that I have set to be in `LyX`'s "quote" paragraph environment are indented on the right side, i.e. the right maring is not 2.5cm, but more. How can I change that behavior of the "quote" paragraph environment in `LyX` and have long quotes that are set to the "quote" environment to be set in the same right margins as the rest of the text?


title: Adding a label for an equation array on TeXstudio

text: I need to create a label for an equation group in TeXstudio such as :               \begin{align} \label(myequations)          eq1    \label(myequ1)          eq2    \label(myequ2)          eq3    \label(myequ3)     \end{align}      But, I got error:                Package amsmath Error: Multiple \label's: label 'myequations' will be lost. \end{align}      What I expect is that sometimes, I need to refer to the whole equation array as a group. Sometimes, I need to refer to one of the equations. e.g.                    x + y = 8     (1.1)          5x + 2y = 10  (1.2)       Sometimes, I need to refer to the whole equation group as (1) , sometimes, I need to refer to Equation (1.1). Any help would be appreciated.


title: Problem with TikZ - can't find file 'tikzlibraryquotes.code.tex'

text: I've downloaded all the appropriate packages (tikz/pgf). I tried to compile the following code but I get the message : `I can't find file 'tikzlibraryquotes.code.tex'`               \documentclass{article}     \usepackage{tikz}     \usepackage{amsmath}     \usetikzlibrary{cd}     \usepackage{tikz-cd}          \begin{document}          \begin{tikzcd}       {} & A \arrow{d}{i} \arrow[dashed,swap]{dl}{\exists \tilde{\varphi}} \\       B \arrow{r}{\varphi} & C     \end{tikzcd}          \end{document}      What do you recommend me to do? Edit: Now again I try another code which doesn't seem to work (I have checked marked all the boxes in the update manager):               \documentclass{article}     \usepackage{tikz}     \usepackage{amsmath}     \usetikzlibrary{cd}     \usetikzlibrary{arrows.meta}     \usepackage{tikz-cd}          \begin{document}     $$     \begin{tikzcd}     X \arrow[r, hook, "x \mapsto (x,1)"] \arrow[dr, "f"]     & Cyl f \arrow[d, "(x,t)\mapsto (x,0)"]\\     & Y     \end{tikzcd}     $$     \end{document}      I also tried without the dollars signs but in vein. Can you see what is wrong in my code?


title: Set custom bibtex call in Vim latex suite on windows (to add --include-directory)

text: I would like to use one .bib file for everything and not have to keep a copy in each project's folder. By reading around I see that if I were calling bibtex manually, then I could add the string `\--include-directory` with the path to the .bib file (I plan on keeping the .bib file with my other latex style files). In my _vimrc file I do set some g: variables for latex (like to set latex, pdf viewer, etc), but I can't find anything in the documentation about a g: variable for the bibtex call. Is this possible? Or do I have to specify the full path in my `\bibliography{}` call? Thanks!


title: Beamer error when using '\usepackage{beamerthemeshadow}'

text: I'm testing some examples with Beamer, and when I run this example, I have this error message.               > \ProvidesPackageRCS=macro:     ->\def \pgfrcs@marshal {\ProvidesPackage {\pgf@rcsfile }}\pgfrcs@parserest .     l.1 \show\ProvidesPackageRCS      I just ignore it, and return to get the pdf file anyway. This line causes the problem               \usepackage{beamerthemeshadow}      As replacing with this line, I have no error message at all.               \usetheme{Warsaw}        * What's wrong with this beamerthemeshadow?   * What's the difference between using \usepackage{} and \usetheme{} in Beamer? I use MacTeX 2009.


title: Checking MacTeX version installed on a Mac

text: I can use `latex -v` to check the version of LaTeX. Is there a way to check what version of MacTeX (MacTeX 2008, 2009 or 2010) is installed?


title: Alignment of image within tabular

text: I got a problem with the alignment of an image within the tabular environment. I want to align the image within the table in such a way, that it is located to the very right of the layout and the text to the left of the image. The problem is, that this is a two column table and I am bound to placing the image in a cell. Is it possible to move the image to the right, so that the image does not use the vertical space and is located alongside the text, without altering the table structure itself? Thanks in advance! See MWE below:               \documentclass{article}          \usepackage[a4paper,top=1.27cm,left=1cm,right=1cm,bottom=2cm]{geometry}     \usepackage{ifpdf}     \usepackage[demo]{graphicx}     \usepackage[utf8x]{inputenc}     \usepackage{longtable}          \begin{document}          \begin{tabular}{p{4cm}|p{7cm}}     \textbf{Heading} & \tabularnewline      & \includegraphics[width=3cm,height=5cm]{picture} \tabularnewline     Description & \begin{itemize}  \item Lorem ipsum  \item ...\end{itemize}\tabularnewline     Text & \begin{itemize}  \item Further stuff  \item ...\end{itemize}\tabularnewline     \end{tabular}          \end{document}


title: How to add section number to PDF included with \includepdf?

text: I am inserting PDF documents into my document as an appendix. I am also using the addtotoc option to include a reference in my table of contents. Each PDF is then assigned a letter in the TOC from "A" onwards. I would like that letter to be printed in the top corner of the first page of the included PDF so someone flicking through can see where they are at in the Appendix. It would be good for it to say something like "Appendix A".


title: How to center a listing?

text: I'm trying to get some console output in my homework. I put it in a listings environment but I want it to be centered horizontally on the page. The only thing I get centered is the caption ;-/               \begin{minipage}{1\textwidth}     \begin{center}     \begin{lstlisting}[caption={Ausgabe des C-Programms},label={ggt_c_ausgabe}]     a  |  b  |  q  |  u  |  s  |  v  |  t       ----------------------------------------     78 |  21 |   1 |     |   1 |   1 |  -1      21 |  15 |   3 |   1 |  -3 |  -1 |   4      15 |   6 |   1 |  -3 |   4 |   4 |  -5       6 |   3 |   2 |   4 | -11 |  -5 |  14       3 |     |   2 | -11 |  26 |  14 | -33      ----------------------------------------     \end{lstlisting}     \end{center}     \end{minipage}


title: How to install new packages on Texmaker on Ubuntu?

text: How do I install new packages on Texmaker? I use Ubuntu 10.04 LTS.


title: Default value for \addlinespace from booktabs

text: In the booktabs package documentation the command is described in the following: > Occasionally we want to put an extra space between certain rows of a table; > for example, before the last row, if this is a total. This is simply a > matter of inserting `\addlinespace[width]` after the `\\\` alignment marker. Further the documentation says: > The default space before or after an adjacent rule is replaced by exactly > `\defaultaddspace` or the amount of space speciﬁed in the optional argument. I, however, do not know how to use this command, for instance               \defaultaddspace{10pt}      before or inside the tabular environment results in `\defaultaddspace{10pt}` `Missing number, treated as zero.` _**Followup:_** `\addlinespace` works now, however, I cannot get the desired result:               \begin{tabular}{|c|p{0.66\textwidth}|}     \hline     \textbf{Title} & \textbf{A}\\     \addlinespace     Row & B\\     \hline     \end{tabular}      The borders are broken when I insert `\addlinespace`. The space is added, but in this extra space there are no lined borders on the left and on the right.


title: TikZ: How can I extend a line to match another line (bad title, best I could do)

text: \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc, arrows, intersections}     \begin{document}     \begin{tikzpicture}[line cap = round, line join = round, >=triangle 45,         fixed point arithmetic]         \coordinate (P1) at (-2, 0);         \coordinate (P2) at (2.5, 0);         \coordinate (P3) at (2, 0);              \draw (P1) -- (P2);         \draw[red] (P3) circle (.1cm);         \path[name path = line] (P1) -- (70: 4.5cm and 2.5cm);         \path[name path = arc] (P3) arc (0:70: 4cm and 2cm) coordinate (P4);         \path[name intersections = {of = line and arc, by = P4}];              \begin{scope}           \clip (P4) rectangle (P3);           \draw (P3) arc (0:70: 4cm and 2cm);         \end{scope}              \draw[-latex] (P1) -- (P4) node[above, scale = .75, pos = .5, fill = white,         inner sep = 0cm] {\(\mathbf{r}\)};              \draw[orange] let           \p1 = (P1),           \p3 = (P3),           \p4 = (P4),           \n1 = {atan2(\x3 - \x1, \y3 - \y1)},           \n2 = {atan2(\x4 - \x1, \y4 - \y1)},           \n3 = {.75cm}         in (P1) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node [scale = .75, shift = {(.5cm, -.25cm)}] {\(\nu\)};              \path[name path = aux] (P4) circle [radius = 1bp];              \draw[name intersections = {of = arc and aux}, -latex] (P4) --         ($(intersection-2)!1cm!(intersection-1)$);         \draw[-latex] (P4) -- ($(P4)!1cm!-90:(P1)$);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/UB65b.png) How can I extend the line tangent to the end of the arc to the length of the perpendicular line? I know I could make another perpendicular `\path` at the end of the first perpendicular line, then run a longer tangential `\path`, mark the intersection, and change my tangential line to that new marked intersection. However, there has to be a better way.


title: titles without enumerate

text: I have multiple paragraphs, each with a different title. I'm using letters `(A,B,C,...)` to go along with the titles, for example: A. title-1 (I want this in italic) body text B. title-2 body text and so on...I tried using enumerate as follows:               \begin{enumerate}[{\em A.}]     \item{\em title-1}       body text          \item{\em title-2}     body text     \end{enumerate}      However the indentation of the text is different from the other paragraphs I have just before this part. I'd be grateful if someone can show a better way of doing this.


title: Multicolumn is only using the width of the first column

text: I am using the `multicolumn` command to cover four columns in my table, but for some reason the text within the column is wrapping within a single column width leaving the remainder of the column empty. I can see that the column is still the width I'd like, since the right strut of the cell is where it is supposed to be. I think it may be related to my use of the `tabularx` environment, but I need it to allow the table to shift to fit the different possible cell values.               \documentclass{article}     \usepackage{fullpage}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{tabularx}     \usepackage{graphicx}     \usepackage{helvet}     \renewcommand{\familydefault}{\sfdefault}     \usepackage[none]{hyphenat}     \usepackage{array}     \usepackage{bigstrut}     \begin{document}     \begin{center}     \begin{tabularx}{\textwidth}{|l|X|X|X|X|X|}     \hline     \textbf{Meeting Date:} & 2009/08/01 & \textbf{Type:} & Party & \textbf{Today's date:} & 2014/01/14 \bigstrut \tabularnewline      \hline     \textbf{Meeting Location:} & \multicolumn{4}{X|}{This is the long string of text that I would like to break but when it has filled four columns rather than one.} & \bigstrut \tabularnewline     \hline      \textbf{Current Weather:} & \multicolumn{5}{l|}{Cloudy and sunny} \bigstrut \tabularnewline     \hline      \textbf{Sector:} & \multicolumn{5}{l|}{Food and Produce} \bigstrut \tabularnewline     \hline      \end{tabularx}     \end{center}     \end{document}


title: How can I print a LaTeX document with raster images in halftone?

text: I have a LaTeX document with photos in it, and I would like to print this in high quality halftone on a black and white laser printer. I would like to achieve a better halftone than the one my printer driver does automatically for images sent to the printer. Is there a way to apply a halftone-screen to the images in the pdf when I compile my LaTeX code? Is there some other way to halftone the images in the resulting pdf document before sending it to the printer?


title: Import author list from a txt file in latex

text: I'm trying to import author list to my latex article. But keep getting errors. Here is my code:               \documentclass{article}     \usepackage{verbatim}     \title{\verbatiminput{title.txt}}     \author{\verbatiminput{authors.txt}}     \date{\verbatiminput{date.txt}}     \begin{document}        \maketitle        Hello world!     \end{document}      and the authors.txt               ya zhang      and I got this error:               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7    \maketitle          ?       Can anyone help? Thanks a lot.


title: Changing text font color and views

text: %==============================================================================     %== template for LATEX poster =================================================     %==============================================================================     %     %--A0 beamer slide-------------------------------------------------------------     \documentclass[final]{beamer}     \usepackage[orientation=portrait,size=a0,                 scale=1.25         % font scale factor                ]{beamerposter}          \geometry{       hmargin=2.5cm, % little modification of margins     }          %     \usepackage[utf8]{inputenc}          \linespread{1.15}     %     %==The poster style============================================================     \usetheme{sharelatex}          %==Title, date and authors of the poster=======================================     \title     [Super Conference, 1 - 10 July 2013, New York, USA] % Conference     { % Poster title      {\Large TECHKIDS }     }          \author{ % Authors     Author One\inst{1}, Author Two\inst{2}, Author Three\inst{2,3}     }     \institute     [Very Large University] % General University     {     \inst{1} Very Large University, Neverland\\[0.3ex]     \inst{2} Other University, Neverland\\[0.3ex]     \inst{3} Yet Another University, Neverland     }     \date{\today}                    \begin{document}     \usebackgroundtemplate{%       \includegraphics[width=\paperwidth,height=\paperheight]{somerights}}      \begin{frame}[t]     %==============================================================================     \begin{multicols}{3}     %==============================================================================     %==The poster content==========================================================     %==============================================================================          \section{Introduction}          "there's no agony than bearing an untold story inside you"- maya angelou. is this the feeling of your heart? then, stop being a story bearer, instead be a storyteller! hey, hey, hey! do not forget your poems and other stuffs!               \structure{Your text with scientific results or something...} $\hat H \Psi = E \Psi$       Your text with scientific results or something...                \begin{equation}     H = \sum_{i=1}^{N} h_{D}(i) + \sum_{j>i=1}^{N} C_{ij}     \end{equation}          Your text with scientific results or something...                In Ref.~\cite{ref1}...     In Refs.~\cite{ref1,ref2}...     On webpage~\cite{web}...               \section{Result and discussions}          Your text with scientific results or something...                \vskip1ex     \begin{table}     \centering     \caption{This is a table with scientific results.}     \begin{tabular}{ccccc}     \hline\hline     1 & 2 & 3 & 4 & 5\\     \hline     aaa & bbb & ccc & ddd & eee\\     aaaa & bbbb & cccc & dddd & eeee\\     aaaaa & bbbbb & ccccc & ddddd & eeeee\\     aaaaaa & bbbbbb & cccccc & dddddd & eeeeee\\     1.000 & 2.000 & 3.000 & 4.000 & 5.000\\     \hline\hline     \end{tabular}     \end{table}     \vskip2ex          Your text with scientific results or something...                \subsection{SubSection}          Your text with scientific results or something...                     \vskip1ex     \begin{figure}     \centering     \includegraphics[width=0.99\columnwidth]{logo.png}     \caption{This is a picture with scientific results.}     \end{figure}     \vskip2ex          Your text with scientific results or something...                     \subsection{SubSection, a very very very very very very long title}          Your text with scientific results or something...                \section{Contact Details}      fabinahian@gmail.com  \\  www.facebook.com/techkidsbd \\  www.techworldbd.com          %--End of references-----------------------------------------------------------          \end{multicols}          %==============================================================================     \end{frame}     \end{document}      In the above latex poster The text is not that visible due to the background image.   ![enter image description here](http://i.stack.imgur.com/Uw49I.jpg) > How color how how to make these text more visible? How can I enlarge the > Headline with different color??


title: bibtex: Problem in Reference number Order

text: I am having problem with my bibtex reference number. The number does not increase in order as you can see from the screenshot below. The index goes from 1 to 3, 4, 5, and back to 2. ![enter image description here](http://i.stack.imgur.com/3gIeR.png) Sorry in advance for the lengthy question, I have tried to trim it down. I have attached my simplified latex files below. As you can see from the source files, there are two figures, removal of any of these figures would eliminate the problem (but I need these images). if I comment out the "List of Figure" The problem will also disappear. Again, I still need this section. Please help me to figure out what has gone wrong. The entire source file can be taken from https://www.dropbox.com/s/o6648xgozxnxxfs/BibtexProblem_Question.zip?n=50499474                \documentclass[a4paper, 11pt, oneside]{Thesis}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn     %\documentclass{book}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn          \usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style for the references in the Bibliography     \usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments     \usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style 6     \usepackage{amssymb}                \begin{document}          \lhead{\emph{List of Figures}}  % Set the left side page header to "List if Figures"     \listoffigures  % Write out the List of Figures          \mainmatter   % Begin normal, numeric (1,2,3...) page numbering     \pagestyle{fancy}       %\input{Chapter1} % Introduction          This is the first \cite{Ackermann02}          \begin{figure}[h]      \centering      \includegraphics[width = 0.4\textwidth]{Figure1.jpg}      \caption{Figure1 \cite{Ackermann02}. }      \label{fig:Figure1}     \end{figure}          This is the second \cite{Esteban04, Remondino06, Nguyen12}.          Sixth is this \cite{Olsen09}.           \begin{figure}[h]      \centering      \includegraphics[scale=1.0]{Figure2.eps}          \hspace{ 5.5 mm}\caption{ (taken from \cite{Olsen09}). }     \label{fig:Figure2}     \end{figure}          \label{Bibliography}     \lhead{\emph{Bibliography}}  % Change the left side page header to "Bibliography"     \bibliographystyle{unsrtnat}  % Use the "unsrtnat" BibTeX style for formatting the Bibliography     \bibliography{Bibliography}  % The references (bibliography) information are stored in the file named "Bibliography.bib"          \end{document}  % The End      This latex file use an external thesis class,               %%     %% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn     %% generated with the docstrip utility.     %%     %% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk          \NeedsTeXFormat{LaTeX2e}[1996/12/01]     \ProvidesClass{Thesis}                   [2007/22/02 v1.0        LaTeX document class]     \def\baseclass{book}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}     \def\@checkoptions#1#2{       \edef\@curroptions{\@ptionlist{\@currname.\@currext}}       \@tempswafalse       \@tfor\@this:=#2\do{         \@expandtwoargs\in@{,\@this,}{,\@curroptions,}         \ifin@ \@tempswatrue \@break@tfor \fi}       \let\@this\@empty       \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi     }     \@checkoptions{11pt}{{10pt}{11pt}{12pt}}     \PassOptionsToClass{a4paper}{\baseclass}     \ProcessOptions\relax     \LoadClass{\baseclass}     \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}          \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}     \usepackage{setspace}     \usepackage{vmargin}     \usepackage{fancyhdr}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage[scriptsize]{subfigure}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{listings}     \usepackage{lstpatch}     \usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,        bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,        colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red},        pdfstartview={FitV},unicode,breaklinks=true]{hyperref}     \pdfstringdefDisableCommands{        \let\\\space     }     \addtocounter{secnumdepth}{1}     \setcounter{tocdepth}{3}       \newcounter{dummy}     \newcommand\addtotoc[1]{     \refstepcounter{dummy}     \addcontentsline{toc}{chapter}{#1}}     \renewcommand\listoffigures{     \btypeout{List of Figures}     \addtotoc{List of Figures}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listfigurename           \@mkboth{\MakeUppercase\listfigurename}                   {\MakeUppercase\listfigurename}}         \@starttoc{lof}         \if@restonecol\twocolumn\fi         \cleardoublepage     }\end{spacing}     }      and the bibtex file               @unpublished{Ackermann02,             author = "Author One",             title = "modelling",             note = "Available at",                     year = 2000}          @book{Esteban04,             author = "Author Two",             title = "Title Two",             publisher = "Publisher 2",             address = "",             year = "2000"     }                     @book{Nguyen12,             author = "Author three",             title = "Title Three",             publisher = "Publisher 3",             address = "",             year = "2000"     }             @article{Remondino06,            author = {Author Four},         journal = {The Photogrammetric Record},            title = {Title four},         volume = {20},         year = {2000}     }             @article{Olsen09,          author = {Author Five},          title = {Title Six},          journal = {Computers and Graphics},                   volume = {31},          year = {2000},          pages = {0--10}     }


title: Odd results using FP package inside table environment

text: I'm trying to create a number of running totals using the FP package. I define a macro for adding numbers to a running total and then I define a macro to output the final value. The problem I'm having is that I receive a different output from the totals macro depending on where I call it. If it's inside the table I receive the correct value however if it's outside then the value doubles. Any ideas?               \documentclass[11pt]{report}          \usepackage{fp}      \usepackage{tabu,longtable}          \FPset\totalone{0}     \FPset\totaltwo{0}          \def\add#1{%       \FPadd\0\totalone{#1}       \global\let\totalone\0       \FPadd\0\totaltwo{#1}         \global\let\totaltwo\0       #1     }          \def\ptotalone{%       \totalone       \FPset\0{0}\global\let\totalone\0     }          \def\ptotaltwo{%       \totaltwo       \FPset\0{0}\global\let\totaltwo\0     }          \begin{document}            \begin{table}[htbp]         \begin{longtabu}{c}           \add{0.25} \\           \add{0.5}  \\           \add{1}    \\           total one: \ptotalone         \end{longtabu}       \end{table}       total two: \ptotaltwo          \end{document}      Example output:               0.25     0.5     1     total one: 1.75     total two: 3.5


title: preview-LaTeX: Specific scaling for graphics

text: I'm using Emacs 23 with AUCTeX/preview-LaTeX for all my LaTeX editing. Mostly I am very happy with this, but I do not like the included graphics previewed in full size. For now my solution is to disable preview for floats and graphics, but what would be really nice would be to get a thumbnail preview of any included graphics. My problem is that I cannot make sense of the description of `\PreviewMacro` included in the `preview-latex` documentation, and in particular it is not clear to me if I can use a clever `\PreviewMacro` to generate a preview thumbnail for `\includegraphics...` by evaluating something like `\parbox{2cm}{\includegraphics...}` (all my graphics is scaled relative to `\linewidth`) or maybe `\includegraphics[width=2cm,...]`.   My only desperate attempt was               \PreviewMacro[{*?[{#{[#1]}{[width=2cm,{#1}]}}{[width=2cm]}{}}]{\includegraphics}      but this went nowhere.   Could this ever work -- and if so, how?


title: Landscape table without creating new page

text: I am having problems with a table in landscape orientation. This table occupies an entire page and it is preceded by a chapter title. Even though there is nothing else on the page, the table is placed on a new page. I already tried to reduce the number of rows on the table, but even if it has only one row, it is still placed on a new page. Here is what I have:               \begin{landscape}          \chapter{Title}          \begin{table}[h]     \centering     \begin{tabular}{|c|l|l|}      ....     \end{tabular}     \end{table}          \end{landscape}      I also tried to have a sidewaystable, but I keep having the same problem. Even without the landscape environment, the title stays on one page and the table is in the next one. So I have one page with a title and nothing else and another one with a table. Can anyone help me understand what the problem is? Thank you.


title: Start pdf viewer in presentation mode

text: Is there a way to let pdf viewers automatically start in presentation mode?


title: How to insert "footline"-style page number into "headline"

text: When inserting page numbers into beamer slides, I usually use:               \setbeamertemplate{footline}[page number]      Is it possible to do this for headline, something like:               \setbeamertemplate{headline}[page number]


title: How to use \pageref{foo} as a number?

text: What I want to do is to show a "progress bar" in the header to show how far you are in the document, by making a rule with width pagenumber divided by total pages times the paper width. This is what I have:               \usepackage{fancyhdr,lastpage}     \pagestyle{fancy}     \lhead{\rule{\value{page}/\value{\pageref{LastPage}}*120mm}{2mm}}      but obviously it doesn't work.


title: Pirate Treasure Map

text: This one is mostly for fun, although seeing the TikZ tricks people come up with is often instructive. While I was looking for examples with torn pages, I ran across a few of these: ![enter image description here](http://i.stack.imgur.com/bYvO3.jpg) Can one draw pirate treasure maps like this in LaTeX, or is it just too far out? If the map itself is too difficult, just the 'burnt paper' edge effect would be interesting (although that should possibly be a separate question).


title: circuit schematic symbol for buffer with control input

text: `circuitikz` has an `op amp` component type with two inputs, output, and `up` and `down` ports, usually used for power supply rails. There's also a `buffer` component type (which I think is provided by `tikz` itself, not the `circuitikz` library) which has one input and one output and no vertical ports. I'm looking for a buffer/amp with one input, one output, and the vertical ports, for use as control pins. My use case is a track-and-hold (aka sample- and-hold) amplifier symbol, but a tri-state buffers are also very common and require a control input. ![circuit exemplifying SHA](http://i.stack.imgur.com/JkSOw.png) Ok, that figure uses a two-input SHA. But I'm sure you can imagine what the one-input version should look like (basically, I'm trying to make a single symbol that hides all that complexity, for a high-level block diagram). ![tristate buffer symbols](http://i.stack.imgur.com/yWtmg.png) Does `tikz` or one of its extension libraries provide such a beast? If not, how can I properly align a vertical wire with the edge of the buffer?


title: Turn Page Numbers into helvet, abbreviations & left flush TOC

text: Maybe someone can help me with these: I have three things I'm trying to finish off for my thesis with the formatting. The first is the page numbering - I've been asked to use arial (helvet in my case) but I notice that while the entire document changes to the new format with no problem, the page numbers stay as the original LaTeX format. Would anyone have a suggestion of how to get these into ? The second is to do with the list of abbreviations. I just can't get it to work. I've tried the nomencl package, the glossary package and the acronym package. In fairness, I got the acronym package to work but it's not ideal as it doesn't put them in alphabetical order. Also, it doesn't suit the format I have for the list of figures/tables. The nomencl package seems to be what I need/give the results I want but in all the examples I read they say something like "makeindex file.glo -s nomencl.ist -o file.gls" or something to that extent. I use TeXworks so I have the option to make the index separately but I get an error that "Can't find Thesis Report Gl.idx". To be honest I'm totally lost with it. Thirdly, the format I have to use requires that the TOC is left justified with the chapter headings bold and the sub-headings as standard with no indent. So far I've not been able to find a way around that. Any examples online just don't suit. I'll give an idea of what the preamble is so far:               \documentclass[pdftex,11pt,a4paper]{report}          \usepackage[T1]{fontenc}     \usepackage[scaled]{helvet}     \renewcommand*\familydefault{\sfdefault}          \usepackage [top=2.5cm,bottom=2.5cm,left=3.0cm,right=2.0cm]{geometry}     \usepackage{pdflscape}     \usepackage[pdftex]{graphicx}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[english]{babel}     \definecolor{grey}{RGB}{187,187,187} %For titlepage     \definecolor{lightgrey}{RGB}{220,220,220} %For titlepage     \definecolor{lightgreen}{RGB}{96,176,80} %For titlepage     \usepackage{textpos} %Image position on title page          \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \usepackage{multirow}     \usepackage{booktabs}          \usepackage{hyperref} % makes things clickable     \usepackage{longtable}     \usepackage{cite}     \usepackage[square]{natbib} %"square" gives square brackets around the citation     \usepackage{fancyhdr}     \pagestyle{fancyplain}     \lhead{Capacity Analysis of}     \rhead{\includegraphics[scale=.25]{IEV.png}}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}          \usepackage[printonlyused]{acronym}               \begin{document}               \input{./title.tex}      In the main body there's nothing too unusual. Tables, figures, equations, a few tikzpictures, citations. The usual basically.


title: How to make a drop down menu

text: Is it possible to make a drop down menu so that following a link, say provided by `\href`, results in a set of choices overlaying the current page?


title: Can (La)TeX be a compelling technology for the humanities, journalism, and other non-technical disciplines?

text: All over the web, I see how LaTeX has been successful as a way of describing mathematical notation, which makes it pretty easy to argue that it is a compelling technology for science, technology, engineering, math, and other highly technical fields. For these fields, the complexity of mathematical notations makes the technicality of writing manuscripts in LaTeX acceptable. This is nice, but it is not interesting for my personal document preparation and typesetting needs. I am very interested in the idea of a very high quality, libre/free typesetting technology for non-technical writing, but the big obstacle I see is that the this level of technicality for STEM authoring is far too high for anything but a niche presence in the humanities, journalism, and other non-technical fields. Can LaTeX or a TeX-based workflow be used for non-technical scholarly writing at an appropriately accessible level? If so, are there examples of widely used TeX-based workflows? If not, what would the best libre/free document preparation and typesetting systems be?


title: issues after verbatim section

text: I'm havin an issue which I cannot solve. If I have a subsubsection containing text with a `verbatim` section in between, the first line after the `verbatim` section is not aligned properly. If I put a `\newline` command after the verbatim, everything works, but it shows the error               There's no line here to end      This is the code:               \subsubsection{Umsetzung}         C: \texttt{if(r1 > r2)$\{$statement;$\}$} \newline         Realisierung in 2 Schritten: zuerst die Register vergleichen, dann auf Grund         von Flags bedingten Sprung ausführen.         \begin{verbatim}             cp r1, r2   ; vergleiche (compare) r1 mit r1             brge L1     ; verzweige falls r1 >= r2 (mit Vorzeichen!)             ...             statement             ...             L1: nop         ; hier geht es weiter         \end{verbatim}              C: \texttt{if(r1 > r2)$\{$statement1;$\}$else$\{$statement2;$\}$} \newline         Assembler:         \begin{verbatim}             cp r1, r2   ; vergleiche (compare) r1 mit r             brge L1     ; verzweige falls r1 >= r2             ...             statement1             ...             rjmp L2             L1: ...             statement2             ...             L2: ...      ; hier geht es weiter         \end{verbatim}      And this is the output: ![enter image description here](http://i.stack.imgur.com/sNaOc.png) Even if I remove the whole verbatim section, the described line stays on a new line and not properly aligned (and this - in my oppinion - is far stranger, shouldn't it just float at the end of the previous sentence since I never tell to break a line?). ![enter image description here](http://i.stack.imgur.com/0ZE9h.png) Note that I slightly formatted the content of the `verbatim` sections here for better legibility, so don't be suprised if the alignment of the Assembler-code isn't like in the picture in case you compile my code.


title: How can I draw nucleosomes with wrapped DNA in tikz or pstricks?

text: The nucleosome is the fundamental unit of DNA packing in cells, and I am trying to generate some figures for regular use in manuscripts and presentations. The nucleosome is commonly abstracted to a drawing in one of two ways. One representation is as it appears in Wikipedia ![Creative Commons nucleosome image by Wikipedia user Darekk2](http://i.stack.imgur.com/DxBvk.png) drawn as a core of eight spheres (representing the core histone octamer), with a two wraps of DNA and a ninth histone (H1). Sometimes the proteins are further abstracted to a cylinder or just a single sphere so that several adjacent nucleosomes packing DNA can be illustrated. That's what I'm trying to achieve. Very often the cylinder is tilted, like in this extremely impoverished tikz attempt. I would be thrilled to keep the multiple histone proteins, but it may be too challenging.                \documentclass{standalone}      \usepackage {tikz}      \usetikzlibrary{shapes}      \begin {document}      \tikzset{nucleosome core/.style={cylinder,           rotate=30,shape aspect=0.5,minimum width=1cm,          minimum height=0.7cm, cylinder uses custom fill,          cylinder end fill=red!50,cylinder body fill=red!25}}      \begin{tikzpicture}      \foreach \i in {0,2,4,6} {         \path node [nucleosome core] at (\i,0) {} edge [bend right] (\i + 1.7,0);      }        \end{tikzpicture}      \end{document}      ![nucleosome](http://i.stack.imgur.com/nvPny.png) Here the DNA linking adjacent nucleosomes is evident, but it is missing the DNA wrapping, which is really essential because that's what the nucleosome _does_. I think to get to something like the Wikipedia version I'd need to use pstricks, though I normally use tikz for figures and would be willing to trade 3D realism for familiarity. At a minimum, I'd like my cylinder-tikz version to include the wrappings. [ **EDIT** : I added a bounty because, while I recognize the particular question may be of limited interest to the larger TeX.SX community, I think I'd learn a lot from better efforts than my current best shot. If more inspiration is needed, here is an example of some nucleosomes as cylinders, and here with epigenetic marks decorating nucleosomes.]