title: Strange PDF issue for Adobe Acrobat on Linux reading a document produced in latex

text: This is probably a well known bug or error, but I don't really know how to search for it. I have a PDF, which I have created on my computer running os X (10.6) in texshop. There are various figures created in tikz. The document displays fine on my computer. However, when I or anyone else accesses it from my department's computers with Adobe Reader, there is an error message and the second page does not display correctly. The computers are running Scientific Linux SL release 5.2 (Boron), and the pdf viewer is Acrobat Reader 9.5.1. Here is a link to the pdf. The page in question is #3, starting at Example 2.3. Here are two screenshots of what happens upon opening the document in Acrobat: ![enter image description here](http://i.stack.imgur.com/1ZUEY.png) ![enter image description here](http://i.stack.imgur.com/Twohb.png) * * * The code which generates the image in question is here:               \begin{figure}[h!]      \begin{tikzpicture}     \begin{scope}[decoration={     markings,     mark=at position 0.5 with {\arrow[scale=0]{>}}}     ]     \begin{scope}[shift={(-5,0)}]         \filldraw (0,0) circle (1pt) node [left = 2pt] {$-$};         \filldraw (2,0) circle (1pt) node [right = 2pt] {$+$};         \filldraw (0,1) circle (1pt) node [left = 2pt] {$-$};         \filldraw (2,1) circle (1pt) node [right = 2pt] {$+$};         \draw [postaction={decorate}] (0,0) -- (2,0);         \draw [postaction={decorate}] (0,1) -- (2,1);     \end{scope}     \begin{scope}         \filldraw (0,0) circle (1pt) node [left = 2pt] {$-$};         \filldraw (2,0) circle (1pt) node [right = 2pt] {$+$};         \filldraw (0,1) circle (1pt) node [left = 2pt] {$-$};         \filldraw (2,1) circle (1pt) node [right = 2pt] {$+$};         \draw [postaction={decorate}]  (0,0) -- (.5,.5);         \draw [postaction={decorate}] (0,1) -- (.5,.5);         \draw [postaction={decorate}] (.5,.5) -- (1.5,.5);         \draw [postaction={decorate}] (1.5,.5) -- (2,0);         \draw [postaction={decorate}] (1.5,.5) -- (2,1);     \end{scope}     \end{scope}     \end{tikzpicture}     \caption{Plateau's problem with different group norms.}  \label{fig:plat-prob-diff-group-norm}     \end{figure}      * * * I doubt that it is the image in question, because this code is exceedingly simple, especially compared to some of the other pictures. I am not running any fancy sort of style or packages, as far as I know. The document style is amsart, and here are the packages that I have included:               \usepackage{hyperref}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{latexsym}     \usepackage{amscd}     \usepackage{xypic}     \usepackage{mathrsfs}     \usepackage[margin=1in]{geometry}     \usepackage{dsfont}      I was suspicious of dsfont, but removing it does not seem to help. I sort of suspect that it is some font issue, but don't know what it could be. * * * So, my question is: what sort of things should I do (in terms of my latex code, I could use a different reader, which seems to work fine, but I'd like it to work on Acrobat) to try to fix this error? * * * I'm aware of the question here, on a similar topic, but it seems that there the user had a lot of strange packages, and it was impossible to suggest anything. I don't think I'm doing anything which is particularly nonstandard, so I'm hoping there is some possibility of pinning down the error.


title: How do I align an image to centre?

text: How do I align an image to centre? In a beamer presentation I have a 2-3 items on a slide followed by an image. The image is not wide enough to cover whole slide, so it leaves around 30% space from right. How do I adjust it to leave enough space on both sides?               \begin{frame}     \frametitle{Outlook}     \begin{itemize}     \item apps     \item apps     \item apps     \includegraphics[scale=0.3]{P2P}         \end{itemize}     \end{frame}


title: How can I set a a4 landscape page with crop marks?

text: I need to set a a4 page in landscape mode with crop marks in every corner of the page. I used the geometry package with the following values,               paperheight=22.76cm,     paperwidth=31.46cm,     a4paper,     landscape,     layoutoffset={1cm},     hmargin={0.15cm,0.15cm},     vmargin={0.15cm,0.15cm},     nomarginpar,     showcrop,     includeheadfoot      But only one crop mark in the upper left corner of page appeared. What's wrong?


title: Can I tell Beamer that `\uncover` should be invisible, not merely grayed out?

text: In Beamer, I'm using `\uncover` because I want the omitted text to take up space. But I _don't_ want the grayed-out default rendering. Is there a way to use `\uncover`, or an equivalent, that will take up the same space as the text but be completely invisible when rendered?


title: option clash for package xcolor

text: I'm trying to set some color on my caption like this               \usepackage[svgnames]{xcolor}     \usepackage[labelfont={color=red,bf}]{caption}      But it gives me this error "option clash for package xcolor". But then I look in the live preview it's does indeed to it. What am I doing wrong? This is the hole preample               \documentclass[12pt]{report}     \usepackage[nottoc]{tocbibind}     \usepackage[lmargin=25mm,rmargin=20mm,tmargin=20mm,bmargin=20mm]{geometry}     \usepackage{array}     \usepackage{wrapfig}     \usepackage{hyperref}     \usepackage{natbib}     \usepackage{graphicx} % support the \includegraphics command and options     \usepackage{ucs}     \usepackage[utf8]{inputenc}     \usepackage[danish]{babel}     \usepackage[T1]{fontenc}      \usepackage{listings}     \usepackage{lastpage} % for the number of the last page in the document     \usepackage{fancyhdr}     \usepackage{pdfpages}     \usepackage[document]{ragged2e}     \usepackage{setspace}      \usepackage[svgnames]{xcolor}     \usepackage[labelfont={color=red,bf}]{caption}          \newcommand{\soa}{The Soma Project}     \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     \newcommand\Signature[4]{\par\bigskip     \newcommand{\asp}{ASP.NET }     \newcommand{\aspm}{ASP.Net MVC 3}     \newcommand{\nh}{Nhibernate }            \setlength\tabcolsep{0pt}       \begin{tabular}{@{\hspace{.05\textwidth}}>{\centering\arraybackslash}p{.4\textwidth}           @{\hspace*{.1\textwidth}}>{\centering\arraybackslash}p{.4\textwidth}@{\hspace{.05\textwidth}}}       \multicolumn{2}{c}{#1, \today} \\[10ex]       \rule{.4\textwidth}{0.4pt} & \rule{.4\textwidth}{0.4pt} \\       #2 & #3 \\[10ex]     \end{tabular}     \par     }% for example, change the margins to 2 inches all roundhh          \hypersetup{         colorlinks,         citecolor=black,         filecolor =black,         linkcolor=black,         urlcolor  =black     }          \lstset{literate=%     {æ}{{\ae}}1     {å}{{\aa}}1     {ø}{{\o}}1     {Æ}{{\AE}}1     {Å}{{\AA}}1     {Ø}{{\O}}1     }               \pagestyle{fancy}          \lstset{extendedchars=\true}     \lstset{inputencoding=ansinew}          \fancyhf{}     \lhead{\leftmark}          %\lhead{Morten Starck \& Steffan Jensen}     \rhead{Section \thesection}     %\lfoot{\today}     \rfoot{Page \thepage\ af \pageref{LastPage}}     %\cfoot{\leftmark}     \usepackage{multirow}          \geometry{a4paper}          \usepackage{listings}     \usepackage{textcomp}     \definecolor{listinggray}{gray}{0.9}     \definecolor{lbcolor}{rgb}{0.9,0.9,0.9}     \lstset{         backgroundcolor=\color{lbcolor},         tabsize=4,         rulecolor=,         language=matlab,             basicstyle=\scriptsize,             upquote=true,             aboveskip={1.5\baselineskip},             columns=fixed,             showstringspaces=false,             extendedchars=true,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=single,             showtabs=false,             showspaces=false,             showstringspaces=false,             identifierstyle=\ttfamily,             keywordstyle=\color[rgb]{0,0,1},             commentstyle=\color[rgb]{0.133,0.545,0.133},             stringstyle=\color[rgb]{0.627,0.126,0.941},     }          \lstdefinelanguage{CSharp}     {      morecomment = [l]{//},       morecomment = [l]{///},      morecomment = [s]{/*}{*/},      morestring=[b]",       sensitive = true,      morekeywords = {abstract,  event,  new,  struct,        as,  explicit,  null,  switch,        base,  extern,  object,  this,        bool,  false,  operator,  throw,        break,  finally,  out,  true,        byte,  fixed,  override,  try,        case,  float,  params,  typeof,        catch,  for,  private,  uint,        char,  foreach,  protected,  ulong,        checked,  goto,  public,  unchecked,        class,  if,  readonly,  unsafe,        const,  implicit,  ref,  ushort,        continue,  in,  return,  using,        decimal,  int,  sbyte,  virtual,        default,  interface,  sealed,  volatile,        delegate,  internal,  short,  void,        do,  is,  sizeof,  while,        double,  lock,  stackalloc,           else,  long,  static,           enum,  namespace,  string}     }          \hypersetup{pdfauthor={Morten T. Starck \& Steffan Jensen},     pdftitle={\soa},     pdfsubject={Afsluttende Bachelor Projekt PBA2011},     pdfkeywords={Dette er under copy right 2012 fra Morten Starck \& Steffan Jensen. Samt Virtual Lab APs.},     pdfproducer={Morten Starck \& Steffan Jensen \today},     pdfcreator={pdflatex, \LaTeX}]{hyperref}}          \usepackage[section]{placeins}


title: Is it possible to use \PassOptionsToClass into a package?

text: Context: I'm building a new package for my university. I need to set a lot of options for the document class, like `twoside`, `a4paper`, `12pt`, or `firstpagenum=chapter`. I would like to set them by default in my package without creating a new class. Is it possible?


title: imakeidx: Is it safe to direct \index to an undefined index?

text: I am (still!) writing a `biblatex` style for legal citations. I am about to tackle indexing, and I want to make sure I have a viable plan. It's a pretty critical part of the project. Here's the issue. Legal books use _lots_ of indices. Even a modest work could easily index English cases in one index, EU cases alphabetically in another, EU cases by number in a third, English statutes in a fourth, English secondary legislation in a fifth, rules of court in a sixth, EU directives, regulations and decisions, alphabetically and by number in a seventh, eighth, ninth, tenth, eleventh and twelfth. Using a combination of entrytype, subentrytype and a user field, I can determine what sort of literature I'm dealing with. And assume for present purposes that I can construct indexing "strings" which will enable correct sorting and printing of index entries (actually, not easy, but that's another question). What I'm worrying about at the moment is how to allocate entries to particular indexes. You see, it has to be flexible. If I'm writing a book about (say) English law, I might be quite happy to put all non-English cases in a single index. But if I'm writing a book on comparative law, the prevailing standard would undoubtedly want me to have separate indexes for US, Canadian, Australian cases. I'm planning to (suggest/provide for) the use of `imakeidx`, which I like because it offers what seems a simple and convenient system which will work nicely with `splitindex`, which is likely to be needed, given the number of indexes. My current plan is to "write" to indexes defined by macros. So, for instance, a citation of an EU case would do something like:               \index[\eualphabetical]{title}     \index[\eunumerical]{number@number, title}      And so forth. The user can then `\renewcommand{\eualphabetical}` and so on, to direct entries to appropriate indexes, set up as required for a particular document. So, for instance, if the user wanted statutes and statutory instruments in the same index, s/he could do               \renewcommand{\ukstatutes}{statutes}     \renewcommand{\ukstatutoryinstruments}{statutes}      and set up a suitable `statutes` index, which would be fed data for both types of literature. Here's my question. One likely use case is that a user won't really want every possible index. Suppose we have               \renewcommand{\eunumerical}{dummy}% DUMMY NOT DEFINED      where `dummy` is not defined in any `\makeindex` command. On the face of it this would be very convenient. I've tested it myself, and I don't seem to get errors from `imakeidx` or `splitindex`; but I'm worried that I don't understand enough to be sure that there's not something going on underneath the surface that might bite me later. Is it safe? Or do I need to check for undefined indexes and prevent any attempt to write to them.


title: Equivalent to hypcap for [ruled]{algorithm2e}?

text: I just discovered the hypcap packages which improves the `\ref` link to point before the figures and tables instead of to captions. How can I do the same with my algorithms written with algorithm2e using the `ruled` option? Here is a minimal example where we cannot read the caption after clicking on the ref:               \documentclass{article}     \usepackage[ruled]{algorithm2e}     \usepackage{hyperref}     \usepackage{hypcap}     \begin{document}          \begin{algorithm}[H]       \capstart       \caption{How to write algorithms}       \label{alg:sample}       \KwData{this text}       \KwResult{how to write algorithm with \LaTeX2e }       initialization\;     \end{algorithm}          Text with a ref to algorithm \ref{alg:sample}.          \end{document}


title: How to align two images side by side and to scale them automatically to use whole slide?

text: I have two images. How do I align them side by side and scale them so that both of them together occupy the whole horizontal space in a beamer presentation?               \begin{frame}     \frametitle{Inconsistency}     \begin{itemize}     \item      \begin{center}     \includegraphics[scale=0.3]{peer}     \includegraphics[scale=0.3]{peer-inconsistent}       \end{center}     \end{itemize}     \end{frame}


title: Creating a resume template? A beginner's education

text: I've began learning LaTeX for the expressive purpose of eventually creating a resume template of my own. A business school friend of mine showed a very professionally-looking resume he created from a workshop, and I would like to turn it into a LaTeX template. I know there are already many existing resume templates, but I would like to create my own. I also know that there are many tutorials and guides for LaTeX, but I would like to know if there are any that can lead me towards creating templates, specifically something in resume/cv form. I know that it will be a long and arduous task to learn how to create templates, much less a template for a stylized resume, but I would like to make that my goal for learning the language. Would it be simpler to just modify or tweak a preexisting template?


title: Random unwanted space between paragraphs

text: I generate LaTeX code from XML for a book I'm writing, using pdflatex (Version 3.1415926-1.40.10 (Web2C 2009)) and memoir. Very infrequently, there appears to be an extra blank line between two paragraphs. I have not been able to spot any pattern among these occurrences. All attempts to isolate the problem in a small example result in the problem disappearing (which is possibly a clue, though I haven't been able to make anything of it). Another clue is that the unwanted space seems to appear after **all** the paragraphs on the page when it happens (but it happens so infrequently, that might be a fluke). I suppose it's even possible LaTeX/memoir is deliberately adding the vertical space, though I can't see any benefit to the current or next page from doing so. Lacking a MWE, I've made an example that **doesn't** show the problem, but does when in the context of the full document (mainly in the hopes there's something funky in there I've done but just can't spot). It includes the paragraphs before and after the one that has unwanted vertical space appended. The odd conventions are due to being machine-generated from XML. Problem seems to occur on perhaps 2% of the hundreds of pages in the book. Note that in this example in context, there was no danger of an orphan if LaTeX had squeezed a couple more lines on the page -- there were 9 more lines of paragraph pushed onto the next page. Any ideas for how I might track this down appreciated.               \documentclass{memoir}% http://ctan.org/pkg/memoir     \usepackage[strict=true]{csquotes}     \usepackage{refcount}     \begin{document}     \par{This problem permeates the U.S. today, now aided and abetted by all         the wonderful inventions of computer programmers.         In the past, your doctor was the gatekeeper for information on medical research;         now, you can read a nearly hourly spew of breaking medical research results,         which so often contains contradictions that many people throw up their         hands and conclude that everything known to man is unhealthy.         In the past, peer-reviewed journals were the gatekeeper for information         on a science as specialized as climatology;         now, oil companies can         (\label{id155638}in a modernization of the techniques tobacco companies used         to refute the connection of cancer to cigarettes\setcounter{pagenote}{0}\pagenote[\pageref{id155638}]{{\itshape in a modernization of the techniques tobacco companies used         to refute the connection of cancer to cigarettes}: \citep[]{b:ClimateCoverUp}})         fund and publicize anyone with the slightest scientific credentials         who happens to support the view that preserves their profits.         The ever-increasing specialization of science and technology         long ago overwhelmed the ability of television/radio/print         journalism to act as information gatekeepers,         so it's even possible by financing alone to successfully         project the view that there is little or no consensus on         anything in climatology!         Whether you would like to believe that men have never walked on the moon,         that aliens are routinely abducting us for humiliating probes,         or that the government's High Frequency Active Auroral Research Program         (HAARP) is actually controlling both the weather and people's minds,\footnote{\label{FN:id153808}Google reports 288,000 results for the search phrase \enquote{foil hat,} a popular device for defeating mind controlling radiation             allegedly broadcast by both aliens and the government.             Featured was \label{FN:id153819}the provocative MIT study showing that foil hats may actually \textit{amplify} RF signals             in specific frequency ranges controlled by the government and multi-national corporations.             Google quite fairly also features \label{FN:id153830}the author of a book on tin foil hat construction who disputes the MIT finding.             Thus, Google does act as a kind of gatekeeper for information,             but only in a narrow technical sense;             coherence and meaning-making are not part of their business model,             and would likely only produce sub-optimal profits anyway.}         you are just a few mouse clicks away from vast amounts of information         (and forums of like-minded believers) supporting your inclinations. \setcounterref{pagenote}{FN:id153808}\pagenote[\pageref{FN:id153819}]{{\itshape the provocative MIT study showing that foil hats}: \citep[]{w:EffectivenessFoilHelmets}}\setcounterref{pagenote}{FN:id153808}\pagenote[\pageref{FN:id153830}]{{\itshape the author of a book on tin foil hat construction}: \citep[]{w:AFDBEffectiveness}} More disturbing,         you can now find on the Internet social support for your         darkest impulses; for example, \label{id153840}your teenager can learn that anorexia         is not a psychological disorder, but a healthy lifestyle choice.\setcounter{pagenote}{0}\pagenote[\pageref{id153840}]{{\itshape your teenager can learn that anorexia         is not a psychological disorder, but a healthy lifestyle choice.}: \citep[pp. 199-201]{b:VirtuallyYou}}}%     \par{But the picture of less-educated masses being flummoxed by         too much uncontrolled information from on high is patronizing and incomplete.         The information tsunami disorients all levels of education and expertise.         For example, \label{id153853}the oncogene theory         (that particular cancers are caused by mutations in particular genes)         is a theory in crisis\setcounter{pagenote}{0}\pagenote[\pageref{id153853}]{{\itshape the oncogene theory         (that particular cancers are caused by mutations in particular genes)         is a theory in crisis}: \citep[pp. 45-104]{b:WhatIsLifePertinence}}, being overwhelmed by a flood of new         molecular information.         Alleged oncogenes are now found everywhere, and vary not just         from one cancer type to another, but from one patient to another         (which helps explain why the genetic revolution has been a dismal         failure at reducing cancer mortality).         There is a growing sense, amidst the relentless stream of new information,         that researchers have lost sight of the forest for the trees.         Many modern problems, like cancer,         likely involve complex networks that contain feedback systems,         and information floods make us prone to a neverending         twitchy response to each individual reductionist         piece of the problem as it is uncovered,         unable to stop and see how it all fits together         (partly because it fits together into a complex, messy,         difficult-to-control system.)}%     \par{\label{id153868}Physicist Robert Laughlin         points out that the economics of information is changing,\setcounter{pagenote}{0}\pagenote[\pageref{id153868}]{{\itshape Physicist Robert Laughlin         points out that the economics of information is changing,}: \citep[]{b:CrimeOfReason}} a crescendo that has become much more audible in the years since Postman's death.         When information, once acquired, can be transferred so easily         (often without paying the creator of that information)         then there is more incentive to create less valuable, disposable information.         If the profits from my hard-won, published deep thoughts about programming         decay more quickly due to file sharing,         then the sensible thing to do is publish much         more easily obtained shallow knowledge much more often,         a learned response clearly visible at any local bookstore,         and amplified in the electronic book arena,         where prices are often driven down to the logical extreme of \$0.00.         Evidence of disposable information from the more than         one million titles in Amazon's \enquote{Kindle Store} includes e-books about murderers whose trials are still ongoing.         Software, of course, is also a form of knowledge,         and economics is also driving increasingly disposable information there.         Why spend years trying to create software that could aid         medical research when you can spend a few weeks creating a game         for an \enquote{app store} that might turn out to be the next \enquote{Angry Birds}?         Although some developers chafe at the degree of information control         Apple exerts on their \enquote{app store} (a game that used the built-in accelerometer to let you play \enquote{How High Can I Throw My iPhone?} was rejected),         the fact that Apple approved 14 iPhone fart applications         (with more than one being named \enquote{Pull My Finger})         in a single day reveals the real state of affairs.}%     \end{document}      ![unwanted vspace](http://i.stack.imgur.com/stvvq.jpg)


title: Centering part entries in toc using memoir

text: I'm using memoir for a large document and want to center the toc entries corresponding to parts (page entries are turned off). I read the manual (specifically pp. 161-166) and while I have no problem adjusting the positions of the part number or title separately, I can't figure out how to center the part number and the title together as a whole. The MWE that demonstrates this is as follows:               \documentclass{memoir}          \cftpagenumbersoff{part}          \begin{document}     \tableofcontents*     \part{Part A}     \chapter{Chapter a}     \end{document}      To be more specific, I would like "I Part A" to be horizontally centered. If there were a second part called "B", I would like that to be centered like "II Part B".


title: texStudio export different chapters in pdf

text: I have one tex file format into a book with many chapters. Each chapter must be in separate pdf files. I tried to have the whole pdf file and then re-print the pdf file into chapters using a pdf printer. The problem is the outcome could not be highlighted or edited in a proper way (when the orginal pdf can). May I know how to export the tex file into separate chapters in texstudio. Thank you in advanced.


title: A problem with cjkutf8 and pst-eucl

text: The following MWE cannot be compiled. You can see the error messages by yourself.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{CJKutf8}     \usepackage{pst-eucl}          \def\kor#1{%     \begin{CJK}{UTF8}{mj}     #1%     \end{CJK}}          \begin{document}     \begin{pspicture}(7,8)         \pstGeonode[PointName={\kor{지}},PosAngle=90](3,3){A}         %\rput(3,3){\kor{웅}}     \end{pspicture}          \end{document}      `PointName` cannot accept CJK characters. How to fix it?


title: Changing the color of \alert command in Beamer

text: Is it possible to change the color of `\alert` command in beamer. See, it is not the alertblock! For example, I would like to change to color yellow, because the standard color is red, and my background is dark blue.


title: Contour integrals

text: I checked this post in here Drawing complex integration but what I want is draw the one that exclude zero and negative real numbers instead of positives. I tried to play around with the code in the link above and I couldn't figure it out. I'm a beginner with the drawings in Latex


title: How to put the text at the top in fancyhdr

text: I made a document with 2 pages and headers: ![enter image description here](http://i.stack.imgur.com/LzMUr.png)   1. Can I put "Page 2 of 2" at the top of the 2-nd page, so it was vertically aligned with "Commercial invoice"?   2. How can I manage the padding between the header and the "text"? Without negative `\vspace` if possible. * * * Code:               \documentclass{article}     \usepackage{lastpage}     \usepackage{fancyhdr}     \pagestyle{fancy}     % no line in header area     \renewcommand{\headrulewidth}{0pt}     \setlength{\headheight}{96pt}     \fancyhead[L]{     %Text must be shown only on the 1-st page       \count0 = \thepage       \ifnum \count0 = 1         \begin{center}\Large{\bf{Commercial invoice}}\end{center}         This invoice must be completed in English       \fi       %page number, aligned right on all the pages       \hfill Page \thepage~of~\pageref{LastPage}     }     %no page number at the bottom     \fancyfoot{}     \begin{document}     text     \clearpage     text     \end{document}


title: Beamer - Modifying the headline

text: With `beamer`, I use the theme `Montpellier`, _a sober theme giving basic navigational hints_.               \usetheme{Montpellier}                      \useinnertheme{default}     \useoutertheme{default}     \usecolortheme{default}                  \usefonttheme{professionalfonts}        ![Exampe](http://i.stack.imgur.com/IrRUy.jpg) I would like to reduce the width of the separation lines. Can you help me to perform that task?


title: How to use greek letters in \text environment inside math?

text: I tried something like `$(\lambda x. x\ x)(\lambda x. x\ x) \text{cannot be \beta-reduced to something else}$`. How can I make TeX output a real beta where I want?


title: Why can Bakoma process .tex files so fast?

text: Bakoma is a LaTeX Editor which has the real-time preview on Windows. On Linux, one has Gummi which has a similar feature and on Windows, I use WinEdt with Sumatra PDF together with an AutoIt script to do this. When the `.tex` is small, then both Gummi and my method gives 99.99% real-time preview feature, namely the delay between the typing and the appearance of updated PDF content is less then 0.5 second (even more, 0.2 second, I think). When the `.tex` file gets bigger, the delay gets large also. Furthermore, because the frequent compiling, the CPU becomes much buiser. But Bakoma has no such problems. Anybody knows how Bakoma can process .tex files so fast? Is it possible to make MikTeX or TexLive to speed up by the similar mechanic ? * * * Since someone ask the methods I mentioned, I need to share it by answering my own question, sorry. First of all, for Gummi on Ubuntu: After install Gummi, open `/home/(user account name)/.config/gummi/gummi.cfg` Then change `compile_timer` to 0, but keep `compile_scheme = on_idle`. Now for small .tex files, you have real-time preview. Notice that if you change to `compile_scheme = real-time`, then CPU becomes very busy even the .tex file is small. For WinEdt + SumatraPDF + MiKTeX on Windows ( I use MiKTeX 2.9 on Windows 7 64-bit) :   1. In WinEdt, go `Options\Execution\Modes`. On `Accessories`, choose `PDFLaTeX`. On `Console Attributes` on the right side, choose `Background Window`, `Hidden Window`, `WinEdt Console` but not `Pause / Do not Hide the Windo`. On `Process Folw`, only select `No Interaction` and press `OK`   2. Open `C:\Program Files (x86)\WinEdt Team\WinEdt 6\Exec\ExeCompiler.edt`. Remove the following: `Prompt("Another Application is already running in WinEdt's Console.> Terminate the application or wait for the execution to finish!");` Replace `ShowConsole(1)` by `ShowConsole(-1)`, there are 4 places to replace. Replace `FocusConsole(1);` by `FocusConsole(-1);`, ther are 3 places to replace. Save the file.   1. In WinEdt, go `Options\Options Interface`. `On Menus and Toolbar` choose `Main Menu`. Add `SHORTCUT="120::F9"` after `MACRO="Exe('%b\Exec\TeX\PDFLaTeX.edt');"` and add `SHORTCUT="119::F8"` after `MACRO="SaveDoc;"`. Remember to remove the same shortcuts appear in the original file. Save the file and reload it.    2. Install AutoIt. Create the following script               $size = FileGetSize("C:\test.tex")      While 1          sleep(40)          If WinActive("WinEdt 6.0", "C:\test.tex") Then              Send("{F8}")              $newsize = FileGetSize("C:\test.tex")              If $newsize <> $size AND ProcessExists("pdflatex.exe") = 0 Then                   $size = $newsize                  Send("{F9}")              EndIf          EndIf         WEnd      Then after running this script, when you edit your `C:\test.tex`, you have the real-time preview. One can change the script to get the .tex filename you open, but I haven't done this yet. * * * **Update:** Using the Forward search function, I get a function similar to "Auto Scroll in the viewer" in Gummi. Please check the demonstration video on youtube Demonstration of Real-Time Preview


title: Help with report writing

text: I'm new to LaTeX and I'm creating a report for my project, the problem is that the font is not equivalent in all the PDF, and I inserted a PDF file containing a plot but it's not appearing in the place I put in the LaTeX code, but in another place. One other thing, the margins of the page are so big, so only the page will fit for a small amount of information, and the break line between each line is two lines and not one line. How can I solve these problems? That's my code:                   % !TEX TS-program = pdflatex         % !TEX encoding = UTF-8 Unicode              % This is a simple template for a LaTeX document using the "article" class.         % See "book", "report", "letter" for other types of document.              \documentclass[11pt,a4paper,oneside]{report}         \usepackage{fullpage}         \renewcommand{\baselinestretch}{2}         \author{Unknown}         \title{test}              \usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)              \usepackage{graphicx} % support the \includegraphics command and options              % \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent         \usepackage{amsmath}         \usepackage{float}         %%% PACKAGES              % \usepackage{booktabs} % for much better looking tables         \usepackage{array} % for better arrays (eg matrices) in maths         % \usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)         \usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim         %\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float         % These packages are all incorporated in the memoir class to one degree or another...                   \begin{document}         \maketitle                        %\date{} % Activate to display a given date or no date (if empty),                  % otherwise the current date is printed          \DeclareGraphicsExtensions{.pdf,.png,.jpg}              \section{Introduction}            8 lines of text in here                   \section{Global Analysis}     here is some text before the image         \begin{figure}         \includegraphics[width=400px , height=300px]{ng.pdf}          \caption{image caption}         \end{figure}              \section{Local Analysis}            Here is some text, maybe 6 lines ...


title: BibLaTeX - replace recurrent author by short name or Idem/Eadem in citations

text: I am currently defining a (french) citation style. One thing I haven't managed to do is to replace the name of a recurring author by the short form in the citations. What I would like to do is : >   * Jane Smith, first work, Paris, 1900. [first citation from this author]. >   * J. Smith, other work, Paris, 1901 [if not directly following the > previous one]. > or : >   * Ead., other work, Paris, 1901 [if directly following]. > Is there a way of doing this? I have tried to use `\ifentryseen{author}` but without any success so far. [edit] Here is how I try to do it (but I get an `! extra \else` error):               \newbibmacro*{author-fullnote}{%         \ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}%         {\ifthenelse{\iffieldequals{namehash}{\bbx@lasthash}\AND\NOT\iffirstonpage}            {\bibstring[\mkidem]{idem\thefield{gender}}}            {\ifthenelse{\ifentryseen{author}}{\printnames{labelname}}{            \printnames[upshape][1-10]{author}             \savefield{namehash}{\bbx@lasthash}}}}         {\global\undef\bbx@lasthash}}


title: Beamer - blank black frame

text: I'm making a presentation with LaTeX Beamer package. And I want to have a slide where the screen is all black so I can use other media. Is there a way to insert a black slide simply?


How do I use enumeration arrayed as in the image![enter image description here](http://i.stack.imgur.com/cTduk.jpg)


title: How do I omit the title from the shortened citations in BibLaTeX-Chicago?

text: I am writing a history essay using biblatex-chicago. My TA said that since I am only referencing one work by each author I should omit the title of the work from the shortened citations (each citation after the first one)               \documentclass[12pt,letterpaper]{article}     \usepackage[utf8]{inputenc} %Allows UTF8 input.          %Citation Stuff     \usepackage[german,american]{babel}     \usepackage[babel]{csquotes}     \usepackage[notes,natbib,isbn=false,backend=biber,url=false]{biblatex-chicago}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @BOOK{Example,     title={The Necronomicon},     author={Alhazred, Abdul},     publisher={Miskatonic University Press},     year={738},     city={Arkham}     }          @Book{Tooze,      author = {Tooze, Adam},      title = {The Wages of Destruction: The Making and Breaking of the Nazi Economy},      publisher = {Allen Lane},      year = {2006},      address = {London},      isbn = {9780713995664}      }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          ``Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn''\autocite[6]{Example}          I realized I needed a citation in between them, and didn't want to take the time to make another fake entry\autocite[314]{Tooze}          ``That is not dead which can eternal lie, yet with stranger aeons, even Death may die.''\autocite[616]{Example}          \end{document}      Which vies the output: “Ph’nglui mglw’nafh Cthulhu R’lyeh wgah’nagl fhtagn”1 I realized I needed a citation in between them, and didn’t want to take the time to make another fake entry2 “That is not dead which can eternal lie, yet with stranger aeons, even Death may die.”3 * * *   1. Abdul Alhazred, The Necronomicon (Miskatonic University Press, 738), 6.   2. Adam Tooze, The Wages of Destruction: The Making and Breaking of the Nazi Economy (London: Allen Lane, 2006), 314.   3. Alhazred, The Necronomicon, 616. You see how it automatically shortens the author name, and omits the publisher and year of publication? How do I get it to also omit the title? I know there is a **shorttitle** field I can use to enter a shorter form of the title, which I'll do if I can't get an answer to this (Or the answer is 'this can't be done'), which will help as some of these books have multiple subtitles, but I'd like to follow his suggestion if I can.


title: Why am I getting a frame number of 2?

text: Using tikz/matrix inside beamer, I have several slides with a wrong page/frame count. Why is that so, and how can I avoid it? MWE:               \documentclass[14pt]{beamer}     \usepackage{tikz}     \usetikzlibrary{matrix}          \setbeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}     \begin{document}          \begin{frame}[fragile]       \frametitle{Bar}         \begin{tikzpicture}         \matrix (m) [matrix of math nodes]         {42&42\\23&23\\};       \end{tikzpicture}     \end{frame}          \end{document}      This gives me a frame number of 2/2 even though there is only one slide. I use tikz/matrices to write (category theory-ish) diagrams with arrows because diagrams.sty didn't work in beamer, and then, I use [fragile] for the code to compile because of the `&`. EDIT: I found a way to solve the problem, but I'm still interested in explications (and reproduction of the problem, as it seems not every one has this bug. I'm using TeTex and beamer-3.07, both from the FreeBSD ports, so maybe it's a compatibility bug or an old version issue…)


title: epspdfconversion isn't working

text: I'm with a problem with the package `epspdfconversion`. I use the following preamble:               \documentclass[pdftex,12pt,a4paper,openany]{memoir}     \usepackage[brazil]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{indentfirst}     \usepackage{latexsym}     \usepackage{amsmath,amssymb,amsfonts,wasysym}     \usepackage{graphicx}     \usepackage[help]{epspdfconversion}     \usepackage[left=3cm,right=2cm,top=3cm,bottom=2cm]{geometry}     \usepackage[center]{caption}     \usepackage{color}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \usepackage[pdftex, colorlinks=true, linkcolor=black, citecolor=black, urlcolor=black]{hyperref}      \usepackage[all]{hypcap}      and when I try to add a figure:               \begin{figure}     \includegraphics[scale=0.5]{ocupfd.eps}     \caption{a}     \end{figure}      the program gives me the following error:               Package pdftex.def Error: File `ocupfd-epspdf-to.pdf' not found      What should I do?


title: Position of Exponent Relative to Base

text: I'm having a problem in that the position of an exponent, relative to the base, is too low. For example, with capital letters or mathbb the top of the exponent is almost in line with the top of the base. With mathbb the exponent is slightly lower (!) than the base. That is, `\mathbb{R}^n` produces a result such that the top of the "n" is a little lower than the top of the "R". The size is correct, but the alignment is just off. It looks OK when small characters are exponentiated. I'm sure there's a setting somewhere I'm just missing, but I'm not using any exotic packages or configurations. What can I do to fix this? This is a picture of what the example provided by Mico looks like on my system. ![enter image description here](http://i.stack.imgur.com/YlBMT.png) Update: Something in with the AMS book document class was causing this. Once I changed the document class to the standard `{book}` that problem (and many other annoying conventions) went away.


title: Where is the error that i can not run?

text: \documentclass[12pt,a4paper]{article}     \usepackage{amsmath}\usepackage{amssymb}     \textwidth=16.5cm  \oddsidemargin=-0.10cm \evensidemargin=-0.10cm  \topmargin=-1.0cm \textheight=24.5cm          \newcommand{\piRsquare}{\pi r^2}                  \title{The small amplitude expansion: The class of theoritical considered}     \author{xxx }            \date{January 26, 2013}                      \begin{document} \baselineskip=18pt     \section{Introduction}     \section{Reconstruction of the article equation(15) }          Given, $$\phi_1= p_1cos(\tau+\alpha)$$     $$\nabla\phi_1= -p_1sin(\tau+\alpha) \nabla \alpha+\nabla p_1cos(\tau+\alpha)$$     $$\Delta\phi_1= -p_1 \nabla \alpha \cos(\tau+\alpha) \nabla \alpha-p_1 sin(\tau+\alpha) \Delta\alpha -\nabla \alpha \sin(\tau+\alpha)\nabla p_1-\nabla p_1 \nabla \alpha sin(\tau+ \alpha)+\Delta p_1cos(\tau+\alpha)$$     $$\Delta\phi_1= \cos(\tau+\alpha) [-p_1 \Delta \alpha + \Delta p_1]- sin(\tau+\alpha) [p_1\Delta \alpha+2\nabla \alpha \nabla p_1]$$      Differentiating $\phi_1$,     $$\phi_1= p_1cos(\tau+\alpha)$$     $$\dot\phi_1= -p_1 sin(\tau+\alpha)$$     $$\ddot\phi_1= -p_1cos(\tau+\alpha)$$     Again,     $$\phi_2 = p_2\cos(\tau + \alpha) + q_2\sin(\tau + \alpha) + \frac{g_2}{6}p_1^2[\cos(2\tau + 2\alpha) - 3] $$     $\omega_1=0$ for the bounding conditions.     $$\dot\phi_2 = -p_2\sin(\tau + \alpha) + q_2\cos(\tau + \alpha) + \frac{g_2}{6}p_1^2[-2 \sin(2\tau + 2\alpha) ] $$     $$\ddot\phi_2 = -p_2\cos(\tau + \alpha)- q_2\sin(\tau + \alpha) - \frac{4g_2}{6}p_1^2[\cos(2\tau + 2\alpha) ] $$     Putting these values in equation,     \begin{align*}      &\ddot\phi_3+\phi_3+2g_2\phi_1\phi_2+g_3\phi_1^3-\ddot\phi_1-\Delta\phi_1        +\omega_1\ddot\phi_2+\omega_2\ddot\phi_1 =0     \\[\bigskipamount]     &\begin{aligned}      &\ddot\phi_3+\phi_3+2g_2p_1 \cos(\tau+\alpha)       [p_2\cos(\tau + \alpha)  + q_2\sin(\tau + \alpha) +        \frac{g_2}{6}p_1^2[\cos(2\tau + 2\alpha) - 3]] \\       &\quad{}+g_3p^3_1\cos^3(\tau+\alpha)         +p_1\cos(\tau+\alpha)-\cos(\tau+\alpha) [-p_1 \Delta \alpha+\Delta p_1] \\       &\quad {}-\sin(\tau+\alpha) [p_1\Delta \alpha+2\nabla \alpha \nabla p_1]         +\omega_2p_1\cos(\tau+\alpha)=0 \\     \end{aligned}     \\[\bigskipamount]     &\begin{aligned}      &\ddot\phi_3+\phi_3+g_2p_1 p_2 [1+\cos2(\tau+\alpha)]       + g_2p_1 q_2\sin2(\tau+\alpha) \\      &\quad{} + \frac{2 g_2^2 p_1^3}{6} \cos(\tau +\alpha)[2\cos^2(\tau+\alpha)-4] \\      &\quad{} + g_3p_1^3[\frac{1}{4}(3\cos(\tau +\alpha)+\cos3(\tau+\alpha))]               + p_1\cos(\tau+\alpha) \\      &\quad{} -\cos(\tau+\alpha)[\Delta p_1-p_1 \Delta\alpha]               +\sin(\tau+\alpha)[p_1\Delta \alpha+2 \nabla p_1 \nabla \alpha]                \omega_2p_1\cos(\tau+\alpha) =0     \end{aligned}     \\[\bigskipamount]     &\begin{aligned}      & \ddot\phi_3+\phi_3+g_2p_1 p_2 + g_2p_1 p_2  cos2(\tau+\alpha)] + g_2p_1 q_2sin2(\tau+\alpha)  \\      &\quad{} + \frac{2 g_2^2 p_1^3}{3} cos^3(\tau +\alpha)-\frac{8 g_2^2 p_1^3}{6} cos(\tau +\alpha)+g_3p_1^3[\frac{1}{4}(3cos(\tau +\alpha)+cos3(\tau+\alpha))] \\      &\quad{} +p_1cos(\tau+\alpha)-cos(\tau+\alpha)[\Delta p_1-p_1 \Delta \alpha]+sin(\tau+\alpha)[p_1\Delta \alpha+2 \nabla p_1 \nabla \alpha]+\omega_2p_1cos(\tau+\alpha)=0     \end{aligned}     \\[\bigskipamount]     &\begin{aligned}      & \ddot\phi_3+\phi_3+g_2p_1 p_2 + g_2p_1 p_2  cos2(\tau+\alpha)] + g_2p_1 q_2sin2(\tau+\alpha)  \\      &\quad{} + \frac{2 g_2^2 p_1^3}{3}[\frac{1}{4}(3cos(\tau +\alpha)+cos3(\tau+\alpha))] -\frac{8 g_2^2 p_1^3}{6} cos(\tau +\alpha)+g_3p_1^3[\frac{1}{4}(3cos(\tau +\alpha)+cos3(\tau+\alpha))] \\      &\quad{} +p_1cos(\tau+\alpha)-cos(\tau+\alpha)[\Delta p_1-p_1 \Delta\ alpha]+sin(\tau+\alpha)[p_1\Delta \alpha+2 \nabla p_1 \nabla \alpha]+\omega_2p_1cos(\tau+\alpha)=0 \\     \end{aligned}     \\[\bigskipamount]     &\begin{aligned}      & \ddot\phi_3+\phi_3+sin(\tau+\alpha)[p_1\Delta \alpha+2 \nabla p_1 \nabla \alpha] -cox(\tau+ \alpha)[\nabla p_1\\      &\quad{} -p_1\nabla \alpha+\frac{5}{6}g_2^2p_1^3- \frac{3}{4}g_3p_1^3-p_1 +\omega_2 p_1] \\      &\quad{} +\frac{ p_1^3}{12}(2g_2^2+3g_3)cos3(\tau + \alpha)+g_2 p_1 [p_2+ p_2 cos2(\tau +\alpha)+q_2 sin2(\tau+\alpha)] =0\\     \end{aligned}     \\[\bigskipamount]     &\begin{aligned}      & \ddot\phi_3+\phi_3+sin(\tau+\alpha)[p_1\Delta \alpha+2 \nabla p_1 \nabla \alpha] -cox(\tau+ \alpha)[\Delta p_1-p_1\nabla \alpha \\      &\quad{} + \lambda p_1^3-p_1+\omega_2 p_1] +\frac{p_1^3}{12}(2g_2^2+3g_3)cos3(\tau + \alpha) \\      &\quad{} +g_2 p_1 [p_2+ p_2 cos2(\tau +\alpha)+q_2 sin2(\tau+\alpha)]=0     \end{aligned}     \end{align*}     \end{document}


title: Beginner's problem - Undefined control sequence

text: I'm trying to produce the following result: > [/ or ?] - Search for a pattern of text, jump to it by hitting Enter Then, I tried the following:   `\item [\/ or \?] - Search for a pattern of text, jump to it by hitting Enter` But then, I get an "Undefined control sequence." What am I doing wrong?


title: Memoir: removing headrule in chapter page

text: How to remove headrule in chapter page without remove of footrule, eg, rule only in foot page in all pages, but without on chapter page, but headrule in others pages.               \documentclass[a4paper]{memoir}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \copypagestyle{rgstyle}{headings}     \makeoddhead{rgstyle}{}{}{\slshape\rightmark}     \makeevenhead{rgstyle}{\slshape\leftmark}{}{}     \makeoddfoot{rgstyle}{R\'egis $\smiley$ \the\year}{}{\thepage}     \makeevenfoot{rgstyle}{\thepage}{}{R\'egis $\smiley$ \the\year}     % add line     \makeheadrule{headings}{\textwidth}{\normalrulethickness}     \makefootrule{headings}{\textwidth}{\normalrulethickness}{\footruleskip}     % fix plain     \copypagestyle{plain}{rgstyle} % overwrite plain with rgstyle     \makeoddhead{plain}{}{}{} % remove right header     \makeevenhead{plain}{}{}{} % remove left header     \pagestyle{rgstyle}          \begin{document}          \chapter{Memoir without headrule in chapter page}          \lipsum          \end{document}      ![enter image description here](http://i.stack.imgur.com/b4UhL.png)


title: pgfplots and exp(x) throws error: Dimension too large

text: I hope, someone can help me. I've the following problem: I want to draw a Graph like this ![exp Problem](http://i.stack.imgur.com/cMsKZ.jpg) The picture shows the following graphs: exp(x), ln(x), x my code is:               \begin{tikzpicture}          \draw[ultra thin,color=gray] (-0.1,-0.1) grid (5,5);         \draw[->] (-0.2,0) -- (5.2,0) node[below] {$x$};          \draw[->] (0,-0.2) -- (0,5.2) node[above] {$y$};              \draw (0,0)--(5,5);              \draw[color=blue, samples=150, thick, domain=0:1.6095]                    plot (\x,{exp(\x r)}) node[right] {$f(x) = exp x$};         \draw[color=cyan, samples=150, thick, domain=1:5]                 plot (\x,{ln(\x r)}) node[right] {$f(x) = ln x$};     \end{tikzpicture}      My LaTeX Compliler throws me the follwoing message: > plot (\x,{exp(\x r)}) > > node[right] {$f(x) = exp x$}; I can't work with sizes bigger than about 19 > feet. Continue and I'll use the > > largest value I can. The Domain Value for exp(x) is 1.6095 because exp(1.6095) = 5 I hope, you can help me.


title: How to write an environment wrapping document environment

text: I'm working on wrapping up some patterns used in my research group for creating posters. Since we're using beamer and beamerposter to make these, all documents go essentially like this:               \documentclass{beamer}          \begin{document}     \begin{frame}          \end{frame}     \end{document}      I'd like to simplify this to like:               \documentclass{ourposter}          \begin{poster}          \end{poster}      So I tried to implement the poster environment as `\newenvironment{poster}{\begin{document}\begin{frame}}{\end{frame}\end{document}}`. Unfortunately, that seems to be the wrong thing to do, since `latex` responds with: LaTeX Error: \begin{poster} on input line 10 ended by \end{document}. I can work around it by replacing the begin/end document with `\document`/`\enddocument`, but I'm a bit wary of that. Is the right approach to just sidestep the LaTeX environment stuff and use the commands directly, or is there a better approach here?


title: Fill the area determined by two pgfplots graphs

text: I need to fill the region determined by two (Gaussian) curves and the right red line (the region is brushed in green in the figure below). I also wonder what is the best way to draw vertical line which goes through the intersection of both graphs (the left red line on the figure). Any pointers would be greatly appreciated. ![bayes_error](http://i.stack.imgur.com/RQLmW.png) My initial attemt is pasted below.               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}          \pgfmathdeclarefunction{dnorm}{2}{%       \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }          \begin{tikzpicture}     \begin{axis}[domain=0:12, samples=100, height=5cm, width=10cm]     % Fill aread under the curves     \addplot [fill=red!20, draw=none, domain=0:6] {dnorm(6.5,1.5)} \closedcycle;     \addplot [fill=blue!20, draw=none, domain=6:10] {dnorm(4,1)} \closedcycle;     % Draw curves     \addplot [thick] {dnorm(4,1)};     \addplot [thick] {dnorm(6.5,1.5)};     \end{axis}     \end{tikzpicture}          \end{document}      **My solution** A picture is worth a thousand words. Code is pasted below. ![bayes_error](http://i.stack.imgur.com/BETr8.png)               \documentclass{article}     \usepackage{tkz-fct}     \usetikzlibrary{intersections}          \begin{document}          \tikzset{        name plot/.style={every path/.style={name path global=#1}}     }          % Extract coordinates for point X     \makeatletter     \newcommand{\gettikzxy}[3]{%       \tikz@scan@one@point\pgfutil@firstofone#1\relax       \edef#2{\the\pgf@x}%       \edef#3{\the\pgf@y}%     }     \makeatother          % Dimlines     \def\Dimline[#1][#2][#3][#4]{     \begin{scope}[thin, >=stealth'] % redefine as flechas     \draw let \p1=#1, \p2=#2, \n0={veclen(\x2-\x1,\y2-\y1)} in [|<->|,     decoration={markings,mark=at position .5 with {\node[#3] at (0,0)     {#4};},     },     postaction=decorate] #1 -- #2 ;     \end{scope}     }          \begin{tikzpicture}[scale=1,font=\small]     \tkzInit[xmin=0,xmax=12,ymin=0,ymax=.3,ystep=.05]     % Draw coordinates     \draw[>=stealth', <->] (0,6) node[above] {$y$} -- (0,0) --  (12.5,0) node[right] {$x$};     % Draw functions and areas     \tkzFct[name plot=A,thick,color=red,domain=0:12]{1/(1.5*sqrt(2*pi))*exp(-((x-4.5)**2)/(2*1.5**1))}     \tkzDrawArea[opacity=.3,color=blue,domain = 7:12]     \tkzFct[name plot=B,thick,color=blue,domain=0:12]{1/(2*sqrt(2*pi))*exp(-((x-7)**2)/(2*2**1))}     \tkzDrawArea[opacity=.3,color=red,domain=0:7]     \tkzDrawAreafg[between=b and a,opacity=.3,color=green,domain = 0:7]     % Intersection between curves     \path [name intersections={of=A and B,by=C}];     % Extract coordinates of C     \gettikzxy{(C)}{\cx}{\cy}     % Vertical lines     \draw [thick,dashed, black] (\cx,0) -- (\cx,5.5) node [above] {$x_{0}$};     \draw [thick,dashed, black] (7,0) -- (7,5.5) node [above] {$\hat{x}$};     % Define regions     \Dimline[($(0,0)+(0,-.6)$)][($(7,0)+(0,-.6)$)][above,black][$\mathcal{R}_{1}$];     \Dimline[($(7,0)+(0,-.6)$)][($(12,0)+(0,-.6)$)][above, black][$\mathcal{R}_{2}$];     \end{tikzpicture}          \end{document}


title: How to define package options in a command (for reuse)?

text: I need some options of the `listings` package several times in my document. I am thus wondering if one can define (and later change) these options once somewhere in the preamble via a command/macro, for example, and use the command/macro later on if required? I tried the `keyval` package, but wasn't successful.               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[american]{babel}     \usepackage{xcolor}     \usepackage{listings}     \usepackage{keyval}     \usepackage{filecontents}          % write dummy R file     \begin{filecontents*}{foo.R}     f <- function(x){       t <- exp(-x) # just some dummy example       sqrt(t) # return value     }     \end{filecontents*}          % general listings settings     \lstset{       language=R,       basicstyle=\ttfamily\small,       keywords={if, else, repeat, while, function, for, in, next, break},       otherkeywords={}     }          % define my own listings settings which frequently appear     \newcommand{\mylstset}{\setkeys{keywordstyle=\color{blue}, commentstyle=\itshape\color{red}}}          % specific listing environment     \xdefinecolor{blue}{RGB}{58, 95, 205}%     \xdefinecolor{red}{RGB}{178, 34, 34}%     \lstnewenvironment{Rinput}[1][]{%       \lstset{\mylstset}% my listings settings       #1% content     }{}          \begin{document}     Show \texttt{foo.R}:     \lstinputlisting[\mylstset]{foo.R}% my listings settings     \end{document}


title: Can several TeXworks users in a network use one common copy of the Hunspell dictionary stored on a server?

text: Can different TeXworks users, working in a network, have a central place for storing the Hunspell dictionary, instead of all having a local copy on their computer? The reason is we need to add new words to the Hunspell dictionary. That would be much easier if we have only one copy of Hunspell in the network.


title: Mechnical drawing, Tikz, damper + spring + 2 masses

text: I have the following tikz code which I based on http://tex.stackexchange.com/a/13952/15360. Now I want to have the spring, the damper and the 3 arrows have labels. Like for example, F for force and k as spring constant, and d as damper constant. Do I have to use fixed coordinates? `\node[draw] at (0,0) {$F$};`? Or can I do this more clever? Because at the moment the spring is not a node so I have no coordinates of it...               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings}          \begin{document}     \begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick}]          \tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre length=0.3cm,post     length=0.3cm,segment length=6}]          \tikzstyle{damper}=[thick,decoration={markings,         mark connection node=dmp,       mark=at position 0.5 with        {         \node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum     width=15pt,minimum height=3pt,draw=none] {};         \draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south     west) -- ($(dmp.north west)+(2pt,0)$);         \draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);       }     }, decorate]          \tikzstyle{ground}=[fill,pattern=north east lines,draw=none,minimum     width=0.75cm,minimum height=0.3cm]          \node (M1) [minimum width=1.5cm, minimum height=1.5cm] {$m_1$};     \node (M2) at (3,0) [minimum width=1.5cm, minimum height=1.5cm] {$m_2$};     \draw[spring] ($(M1.east) - (0,0.5)$) -- ($(M2.west) - (0,0.5)$);     \draw[damper] ($(M1.east) + (0,0.5)$) -- ($(M2.west) + (0,0.5)$);     \draw[thick, dashed] ($(M1.north west)$) -- ($(M1.north west) + (0,1)$);     \draw[thick, dashed] ($(M2.north west)$) -- ($(M2.north west) + (0,1)$);     \draw[ultra thick, -latex] ($(M2.north west) + (0,0.75)$) --                                 ($(M2.north west) + (1,0.75)$);     \draw[ultra thick, -latex] ($(M1.north west) + (0,0.75)$) --                                 ($(M1.north west) + (1,0.75)$);     \draw[ultra thick, -latex] ($(M1.west) - (1,0)$) -- ($(M1.west)$);           \end{tikzpicture}          \end{document}


title: \hfill in math mode

text: Is there any easy way of declaring a new command which emulates `\hfill` in math mode. I don't want `flalign` or something similar. I want to use the command in the same way (and with the same freedom) I use `\hfill`. Is that possible? i.e. this is an example:               \begin{align*}         a + b + c &= a + b + c + d + e + f + g + h + i \\         & \mathhfill \text{(foo)}      \end{align*}      where I want `(foo)` to be right aligned (under `\+ h + i` and here               \begin{align*}         a + b + c + d + e + f + g + h + i &= a + b + c \\         \text{(foo)} \mathhfill &     \end{align*}      I want the text aligned on the left (just under the `a + b +`. But I don't want `flalign` or other solutions. Because there are lots of situations (this is a minimal example). And I would like to see a solution which work just as `\hfill`. **EDIT:** well, as Carlisle said, it works in `$a \hfill b$`, but I would like to see it working in `align`, i.e. **EDIT2:** The answers solved my needs. But it would be great if somebody would give a command which works exactly like `\hfill` or i.e. `\dotfill` in `align`.


title: How to iteratively draw a path e.g. with foreach

text: I have a long path and want to draw parts of it in an iterative manner               \documentclass{article}     \usepackage{tikz}     \begin{document}          \usetikzlibrary{shapes,arrows}     \usetikzlibrary{calc}     \usetikzlibrary{shapes,arrows}               \begin{tikzpicture}      \newcommand{\room}{     \coordinate (a) at  (0,0) ;     \coordinate (b) at (5,0);     \coordinate (c) at   (5,5);     \coordinate (d) at (0,4);     \coordinate (e) at (1,3);     \coordinate (f) at  (1.4,3) ;     \coordinate (g) at (1.4,2.6)    ;     \coordinate (h) at (1,2.6)  ;     \coordinate (i) at (1,3)    ;     }          \begin{scope}[xshift= 0cm]     \room     \draw plot coordinates{(a) (b)};     \end{scope}          \begin{scope}[xshift= 6cm]     \room     \draw plot coordinates{(a) (b) (c)};     \end{scope}          \begin{scope}[xshift= 12cm]     \room     \draw plot coordinates{(a) (b) (c) (d)};     \end{scope}          %... more plots to come here          \end{tikzpicture}     \end{document}


title: No indentation after \paragraph command not working

text: I'm trying to create a new command called `\domanda{}`, that makes use of the `\paragraph{}` to create a series of questions with **Q:** in-built, together with their answers on a _new line_ , **WITHOUT** indentation. However this is not giving the expected results. Can you help me find a solution? Please refer to the extensive code below.               \documentclass[a4paper, 10pt]{article}          \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[T1]{fontenc}          \usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry}     \usepackage[italian]{babel}     \usepackage{hyperref}     \hypersetup{pdfstartview=FitH} %fits pdf to width, FitV= fits pdf to hight     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{booktabs}     \usepackage{graphicx}     \usepackage{tabularx}     \usepackage{caption}     \usepackage{textcomp}     \usepackage{marvosym}          \newcommand{\domanda}[1]{\paragraph{Q: #1\newline}}     \setlength\parindent{0pt}      ...        \begin{document}     \input{somefile.tex}      \end{document}      The new sentence I type after the `\paragraph{}` start on a new line but **WITH** indentation.


title: Fitting TikZ graphs into a small space

text: I am trying to produce a graph of the kind at the end of Kanamori's textbook - "The Higher Infinite": ![Large Cardinal diagram](https://lh6.googleusercontent.com/-LZX2UULRODU/T03KDd9_MLI/AAAAAAAAF08/XCF0tQOGYiY/w506-h523/diagram.jpg) It would be nice to have a method that extends to any graph of implications, so rather than put everything in manually, I was looking at the PGF `graphdrawing` library. This is a very useful tool, but I am producing this diagram for a presentation using `beamer`, and the output doesn't readily fit on a slide. Shrinking it would make it a bit unreadable, so I was trying other tricks. Here's what I've got (uses graphdrawing, so needs `LuaTeX` and `PGF 3.0`):               \documentclass{beamer}     \usepackage{tikz}     \renewcommand{\Tiny}{\tiny}     \usetikzlibrary{graphs}     \usetikzlibrary{graphdrawing}     \usegdlibrary{force, layered, trees}     \begin{document}          \begin{frame}         \begin{tikzpicture}[every node/.style={minimum size=5mm}]             \graph [layered layout, minimum layers=1, grow=down, level distance=5mm, sibling distance=1cm] {                 { [same layer] 0=1 -> "I0-I3" -> "n-huge" } ->                 { [same layer] superhuge -> huge -> "almost huge" } ->                 { "Vopenka's Principle" -> [second] extendible } ->                 supercompact -> {strongly compact, superstrong} ->                 { [same layer] Woodin -> strong -> "$0^\dagger$" exists } ->                 measurable ->                 { [same layer] Ramsey -> Rowbottom -> "J\'onsson" } ->                 "$0^\sharp$ exists" ->                 { [same layer] indescribable -> weakly compact -> Mahlo} ->                 inaccessible ->                 ZFC             };         \end{tikzpicture}     \end{frame}          \begin{frame}         \begin{tikzpicture}[every node/.style={minimum size=5mm}]             \graph [layered layout, minimum layers=1, grow=down, level distance=5mm, sibling distance=1cm] {                 { [same layer] 0=1 -> "I0-I3" -> "n-huge" } ->                 { [same layer] superhuge -> huge -> "almost huge" } ->                 { "Vopenka's Principle" -> [second] extendible } ->                 supercompact -> {strongly compact, superstrong} ->                 { [same layer] Woodin -> strong -> "$0^\dagger$" exists } ->                 measurable ->             };         \end{tikzpicture}     \end{frame}          \end{document}      The first frame shows best what's going wrong, the second shows that it has potential. ![Bad](http://i.stack.imgur.com/8kyp2.jpg) ![OK](http://i.stack.imgur.com/9Ihoo.jpg) The issue is clear: I don't know how to change the direction things in the same layer appear in. I tried to use the `desired at` key to line things up, but this seems to make the algorithm go haywire. Seeing any kind of solution would be good since I know so little about the library. But in particular I'd like to keep it fairly geometric and regular, which so far I wasn't able to get with the `spring layout`, never mind keep it on the page.


title: Is it possible to break the following aligned?

text: I don't want to use the displayed math environment for which `\allowdisplaybreak` is designed. Shortly speaking, is it possible to break the following `alined` by defining something like `\allowinlinebreak`? ![enter image description here](http://i.stack.imgur.com/O4tqy.gif)               \documentclass{article}     \usepackage[a6paper,vmargin=15mm,hmargin=5mm]{geometry}     \usepackage{times}     \usepackage{helvet}     \usepackage{courier}     \usepackage[T1]{fontenc}     \usepackage{mathtools}     \allowdisplaybreaks     \usepackage{tcolorbox}     \usepackage{microtype}               \tcbuselibrary{breakable}     \newcounter{exercise}[subsection]     \@addtoreset{exercise}{section}               \renewcommand{\theexercise}{%         \ifnum\value{subsection}>0\relax             \thesubsection         \else             \thesection         \fi         .\arabic{exercise}%     }          \newenvironment{exercise}     {\par\smallskip\refstepcounter{exercise}     \begin{tcolorbox}[breakable,title=Exercise \theexercise,left=0mm,lefttitle=2mm]\ignorespaces}     {\end{tcolorbox}\par\smallskip\ignorespacesafterend}          \newif\ifinitialized     \initializedfalse     \newlength\EWD     \newlength\HWD          \def\Initializer{%         \ifinitialized         \else             \initializedtrue             \settowidth{\EWD}{${}={}$}%             \setlength{\HWD}{0.5\dimexpr\linewidth-\EWD\relax}%         \fi}          \AtBeginDocument{%         \expandafter\def\expandafter\item\expandafter{%             \expandafter\Initializer\item}%     }          \newenvironment{multi}     {\multlined[t][\HWD]}     {\endmultlined}          \begin{document}     \begin{exercise}     Simplify the following     \begin{enumerate}         \item $\frac{3x-2}{2(x-1)}-\frac{3(x+1)}{x+2}$     \end{enumerate}     \tcblower     \begin{enumerate}     \item      $\!     \begin{aligned}[t]     \frac{3x-2}{2(x-1)}-\frac{3(x+1)}{x+2}         &= \begin{multi}                     \frac{3x-2}{2(x-1)}\times\frac{x+2}{x+2}\\                     {}-\frac{3(x+1)}{x+2}\times\frac{2(x-1)}{2(x-1)}              \end{multi}\\         &= \begin{multi}                     \frac{(3x-2)(x+2)}{2(x-1)(x+2)}\\                     {}-\frac{6(x+1)(x-1)}{2(x+2)(x-1)}              \end{multi}\\         &= \begin{multi}                     \frac{3x^2 +6x -2x -4}{2(x-1)(x+2)}\\                     {}-\frac{6(x^2 -x +x -1)}{2(x+2)(x-1)}              \end{multi}\\         &= \begin{multi}                     \frac{3x^2 +4x -4}{2(x-1)(x+2)}\\                     {}-\frac{6(x^2 -1)}{2(x+2)(x-1)}              \end{multi}\\         &= \begin{multi}                     \frac{3x^2 +4x -4}{2(x-1)(x+2)}\\                     {}-\frac{6x^2 -6}{2(x+2)(x-1)}              \end{multi}\\         &= \begin{multi}                     \frac{3x^2 +4x -4}{2(x-1)(x+2)}\\                     {}+\frac{-(6x^2 -6)}{2(x+2)(x-1)}              \end{multi}\\         &= \frac{3x^2 +4x -4 -(6x^2 -6)}{2(x-1)(x+2)}\\         &= \frac{3x^2 +4x -4 -6x^2 +6}{2(x-1)(x+2)}\\         &= \frac{-3x^2 +4x +2}{2(x-1)(x+2)}     \end{aligned}     $     \end{enumerate}     \end{exercise}     \end{document}


title: How to center the name of nomencl?

text: I am writing my thesis and need to use the `nomenclature` package to make a list of symbols. Initially I get a list of symbols, making the entire procedure that specifies the help of this package. But I need is center the name of the nomenclature as follows:                                List of Symbols             A  Symbol A        B  Symbol B               How can I achieve this alignment?


title: Visualizing functions on the integers

text: I want to give a good visualization of two functions on the integers. Is there a way to write something that looks like this: ![enter image description here](http://i.stack.imgur.com/9G4tx.jpg) I thought of using tikz, but I am not sure how.


title: Difference between LaTeX and Word in setting font size

text: I am working in LyX (compiled with MiKTeX) on Windows. I am a newbie so I am wondering how can I manually set the font (like entering in a number as you would in Microsoft Word).


title: awk script for coverting BibTeX to XHTML

text: I found several nawk and gawk scripts scattered all over the Internet for converting BibTeX files to HTML mostly written in 90s. A quick look into source code indicates, not surprisingly, that some of them will not produce valid XHTML 1.0 strict tags. Before I try to clear up somebody's nawk script (I do not use gawk) can anyone recommend me a script which works well from your own experience? I am OK with gawk as long as I do not have to fix anything. I would also consider a nice Perl or Python script. I must shamefully admit that I have not investigated Perl and Python solutions properly.


title: Creating a Gantt chart error

text: Comes up with error pgfkeys:I do not know the key /pgfgantt/group peaks. I for the life of me cant seem to find what is wrong. Can anybody help me with this please? Thanks               % Out line proposal          \documentclass{article}     \usepackage{pgfgantt}     \usepackage{rotating}     \title{Outline Proposal}     \author{Teresa Green}          % End of preamble, beginning of proposal outline document          \begin{document}     \maketitle\     begin{figure}[ftbp]     \section{Workplan}     \begin{sideways}     \begin{minipage}{20cm}     \begin{center}     \begin{ganttchart}[y unit title=0.4cm,     y unit chart=0.5cm,     vgrid,hgrid,      title label anchor/.style={below=-1.6ex},     title left shift=.05,     title right shift=-.05,     title height=1,     bar/.style={fill=gray!50},     incomplete/.style={fill=white},     progress label text={},     bar height=0.7,     group right shift=0,     group top shift=.6,     group height=.3,     group peaks={}{}{.2}]{34}          %labels          \gantttitle{Project}{34} \\     \gantttitle{Sep}{1}      \gantttitle{Oct}{4}      \gantttitle{Nov}{4}      \gantttitle{Dec}{4}      \gantttitle{Jan}{4}      \gantttitle{Feb}{4}      \gantttitle{Mar}{4}      \gantttitle{Apr}{4}      \gantttitle{May}{4}       \gantttitle{Jun}{1}\\          %tasks          \ganttbar{Outline Proposal}{1}{2} \\     \ganttbar{Research}{3}{8} \\     \ganttbar{Literature Review}{9}{10} \\     \ganttbar{Ethics Test}{11}{15} \\     \ganttbar[progress=33]{Progress Report}{20}{22} \\     \ganttbar{Final Report}{18}{19} \\     \ganttbar{task 7}{16}{18} \\     \ganttbar[progress=0]{Demonstration}{21}{34}          %relations          \ganttlink{elem0}{elem1}      \ganttlink{elem0}{elem3}      \ganttlink{elem1}{elem2}      \ganttlink{elem3}{elem4}      \ganttlink{elem1}{elem5}      \ganttlink{elem3}{elem5}      \ganttlink{elem2}{elem6}      \ganttlink{elem3}{elem6}      \ganttlink{elem5}{elem7}      \end{ganttchart}     \end{center}     \caption{Gantt Chart - Workplan}     \end{minipage}     \end{sideways}     \end{figure}     \end{document}


title: Are there any other methods left to create a spiral of equidistant segments?

text: I want to create a spiral that is composed of equidistant segments as shown in the following figure. I tried to draw it with various methods. The colors are used to distinguish each method from the others. ![enter image description here](http://i.stack.imgur.com/vs2k1.gif) The methods I used are: ## `\translate(!CP \tx@UserCoor)` with `\multido` and `\lineto` It is my original idea.               \makeatletter     \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=red]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\lineto(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}     \makeatother      ## `\translate(!CP \tx@UserCoor)` with `\multido` and `\psline` It is my original idea.               \makeatletter     \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=green]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\psline(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}     \makeatother      ## `\rlineto` with `\multido` It is my original idea.               \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=blue]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\rlineto(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}      ## `\psVector` with `\multido` It is Herbert's idea.               \begin{pspicture}[showgrid](-5,-5)(5,5)         \psset{showpoints,dotstyle=o,dotscale=2,linecolor=red}         \psStartPoint(0,0)         \multido{\r=0.1+0.1}{89}{\psVector[arrows=-](!1 \r\space sqrt 700 mul PtoC)}     \end{pspicture}      ## `\psnline` with `\multido`, concatenated `\points` and `\expandafter` It is Jake's idea.               \begin{pspicture}[showgrid](-5,-5)(5,5)     \def\points{(0,0)}%     \multido{\r=0.1+0.1}{89}{\xdef\points{\points(!1 \r\space sqrt 700 mul PtoC)}}     \psset{linecolor=green}     \expandafter\psrline\points     \end{pspicture}      ## `\curvepnodes` with temporary variables It is Christoph's idea.               \begin{pspicture}[showgrid](-5,-5)(5,5)       \pstVerb{tx@NodeDict begin /myX -1 def /myY 0 def end }%       \curvepnodes[plotpoints=90]{0}{89}{%         myX myY         t 0.1 mul sqrt 700 mul 1 exch PtoC         3 -1 roll add 3 1 roll add exch         2 copy /myY ED /myX ED       }{P}       \psnline[linecolor=blue](0,\Pnodecount){P}      \end{pspicture}      ## `\psparametricplot` with temporary variables It is Christoph's idea applied to `\psparametricplot`.               \begin{pspicture}[showgrid](-5,-5)(5,5)       \pstVerb{/myX -1 def /myY 0 def}%       \psparametricplot[plotpoints=90,linecolor=red]{0}{89}{%         myX myY         t 0.1 mul sqrt 700 mul 1 exch PtoC         3 -1 roll add 3 1 roll add exch         2 copy /myY ED /myX ED       }     \end{pspicture}      ## `\curvepnodes` with `for` loop It is Christoph's idea.               \begin{pspicture}[showgrid](-5,-5)(5,5)       \curvepnodes[plotpoints=90]{0}{89}{%         -1 0              0 1 t             {                 0.1 mul sqrt 700 mul 1 exch PtoC                 3 -1 roll add 3 1 roll add exch         } for        }{P}       \psnline[linecolor=green](0,\Pnodecount){P}      \end{pspicture}      ## `\psparametricplot` with `for` loop It is Christoph's idea applied to `\psparametricplot`.               \begin{pspicture}[showgrid](-5,-5)(5,5)       \psparametricplot[plotpoints=90,linecolor=blue]{0}{89}{%         -1 0              0 1 t             {                 0.1 mul sqrt 700 mul 1 exch PtoC                 3 -1 roll add 3 1 roll add exch         } for        }      \end{pspicture}      ## The complete code               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}     \psset{showpoints,dotstyle=o,dotscale=2}          \begin{document}               \makeatletter     \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=red]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\lineto(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}     \makeatother                    \makeatletter     \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=green]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\translate(!CP \tx@UserCoor)\psline(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}     \makeatother               \begin{pspicture}[showgrid](-5,-5)(5,5)     \pscustom[linecolor=blue]     {         \moveto(0,0)         \multido{\r=0.1+0.1}{89}{\rlineto(!1 \r\space sqrt 700 mul PtoC)}     }     \end{pspicture}               \begin{pspicture}[showgrid](-5,-5)(5,5)         \psset{showpoints,dotstyle=o,dotscale=2,linecolor=red}         \psStartPoint(0,0)         \multido{\r=0.1+0.1}{89}{\psVector[arrows=-](!1 \r\space sqrt 700 mul PtoC)}     \end{pspicture}               \begin{pspicture}[showgrid](-5,-5)(5,5)     \def\points{(0,0)}%     \multido{\r=0.1+0.1}{89}{\xdef\points{\points(!1 \r\space sqrt 700 mul PtoC)}}     \psset{linecolor=green}     \expandafter\psrline\points     \end{pspicture}               \begin{pspicture}[showgrid](-5,-5)(5,5)       \pstVerb{tx@NodeDict begin /myX -1 def /myY 0 def end }%       \curvepnodes[plotpoints=90]{0}{89}{%         myX myY         t 0.1 mul sqrt 700 mul 1 exch PtoC         3 -1 roll add 3 1 roll add exch         2 copy /myY ED /myX ED       }{P}       \psnline[linecolor=blue](0,\Pnodecount){P}      \end{pspicture}          \begin{pspicture}[showgrid](-5,-5)(5,5)       \pstVerb{/myX -1 def /myY 0 def}%       \psparametricplot[plotpoints=90,linecolor=red]{0}{89}{%         myX myY         t 0.1 mul sqrt 700 mul 1 exch PtoC         3 -1 roll add 3 1 roll add exch         2 copy /myY ED /myX ED       }     \end{pspicture}          \begin{pspicture}[showgrid](-5,-5)(5,5)       \curvepnodes[plotpoints=90]{0}{89}{%         -1 0              0 1 t             {                 0.1 mul sqrt 700 mul 1 exch PtoC                 3 -1 roll add 3 1 roll add exch         } for        }{P}       \psnline[linecolor=green](0,\Pnodecount){P}      \end{pspicture}          \begin{pspicture}[showgrid](-5,-5)(5,5)       \psparametricplot[plotpoints=90,linecolor=blue]{0}{89}{%         -1 0              0 1 t             {                 0.1 mul sqrt 700 mul 1 exch PtoC                 3 -1 roll add 3 1 roll add exch         } for        }      \end{pspicture}          \end{document}      ## Questions   1. How to use `\psplot` here?   2. Are there any other methods left?   3. When using `\lineto`, `\psline` and `\rlineto`, how to make `showpoints` work?


title: local extrema pgfplots - smooth

text: Is it possible to change this code for a "smooth" plot? How can I automatically mark local extrema with pgfplots and scatter? MWE               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     \usepackage{pgfplots}               %-min/max-code http://tex.stackexchange.com/questions/55349/how-can-i-automatically-mark-local-extrema-with-pgfplots-and-scatter          \begin{document}          \begin{tikzpicture}      \begin{axis}[axis lines*=middle,after end axis/.code={\draw [thick, dashed, gray] (maximum) --({axis cs:0,0}-|maximum);}]     \addplot +[mark max,smooth,no markers] file {titra.dat};      \end{axis}     \end{tikzpicture}               \end{document}      titra.dat               0 5     2 5.5     4 5     4.2 5     4.4 10     4.6 15     4.8 25     5 60     5.2 100     5.4 225     5.6 315     5.8 300     6 100     6.2 35     6.4 8.33      ![](http://s7.directupload.net/images/130506/wdd5npyt.png)


title: Alternative Enumeration Environment

text: I have a theorem which lists a bunch of properties, and then I prove them one- by-one. Because the proofs are long, it looks awkward when every line is automatically indented by the `enumerate` environment. Is it possible to define a new environment, call it `enumproof`, which is exactly the same as the `enumerate` environment, but _without the indentation_? Bonus challenge: Is it possible to re-define the `enumerate` environment so that it knows when it is inside the `proof` environment (from the `amsthm` package)--and in that case, it automatically switches to act like the `enumproof` environment (meaning, without the indentation)?               \documentclass{article}          \usepackage{amsthm}     \usepackage{enumitem}          \begin{document}          \noindent I want this enumeration to look normal:     \begin{enumerate}     \item Hello     \item to     \item you     \end{enumerate}          \begin{proof}     But I want this enumeration to have no extra indentation:     \begin{enumerate}     \item Hello     \item to     \item you     \end{enumerate}     \end{proof}          \end{document}


title: paragraphs not automatically indenting

text: with the following code my paragraphs aren't automatically indenting... I'm confused as to why because I've done a decent bit of LaTeXing before with very similar packages and with the same article class yet it's always done it for me automatically after two returns. Here's the .tex file code:               \documentclass[12pt]{article}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage[greek,english]{babel}     \usepackage{color}     \usepackage{listings}     \usepackage{float}               \begin{document}          \flushleft{     name\\     class\\     12.11.12\\     \section*{Radix Trees}     }          \subsection*{Introduction}          adfkhjasdhfashdfkj akdjsfhkashdfkja.          just gibberish, adfsjhakjsdfhkjasdf askdfhjkashfd          test sakdfhaijsfdhkjsf          \end{document}        I'm sure I'm missing something obvious, I know the first para won't indent but as to why the second two don't I have no idea. They get a newline but no indent. Any help would be much appreciated, thanks.


title: How to output a curly brace, which is interpreted only as a character?

text: > **Possible Duplicate:**   >  Writing { and } to a file with LaTeX I want to output a curly brace, which will not be interpreted as a group delimiter. My attempt does not work:               \def\aa{\string}}      I want that calling `\aa` will output `}`. **EDIT** As egreg mentionned, my aim is to have a brace that can be later on written into a file. The proposed solution `\\{` outputs correctly a brace, but attempting to write it in a file fails :               \newwrite\tempfile     \immediate\openout\tempfile="nico.txt"     \def\aa{\{}     \immediate\write\tempfile{blabla blabla \a blabla}


title: Excel2LaTeX code not working in LaTeX

text: % Table generated by Excel2LaTeX from sheet 'Sheet1'     \begin{table}[htbp]       \centering       \caption{Add caption}         \begin{tabular}{ccccccc}         \toprule         \multirow{2}[4]{*}{\textbf{Gauge Number}} & \multicolumn{6}{c}{\textbf{Load (N)}} \\         \midrule               & \textbf{0} & \textbf{100} & \textbf{200} & \textbf{300} & \textbf{400} & \textbf{500} \\         1     & -128  & -230  & -332  & -434  & -538  & -649 \\         2     & 35    & -37   & -108  & -179  & -252  & -329 \\         3     & 1089  & 1089  & 1089  & 1089  & 1049  & 973 \\         4     & 5     & -9    & -22   & -36   & -48   & -63 \\         5     & 1088  & 1088  & 1088  & 1088  & 1088  & 1088 \\         6     & 77    & 96    & 116   & 134   & 156   & 175 \\         7     & 731   & 751   & 771   & 792   & 814   & 836 \\         8     & 129   & 172   & 217   & 261   & 309   & 355 \\         9     & 58    & 104   & 149   & 195   & 243   & 293 \\         \bottomrule         \end{tabular}%       \label{tab:addlabel}%     \end{table}%      Excel2LaTeX produced the following code but I keep getting errors saying 'undefined control sequence \toprule' among other undefined control sequences. I'm new to LaTeX so are there certain packages I need to load before using this code?


title: TeXStudio: ! LaTeX Error: File `apacite.sty' not found

text: I have a file in which I (want to) use `apacite` for my references. However, TeXStudio does not seem to be able to find the package, while I know it is installed on the system.               apt-file -x search '/apacite.sty$'      returns:               /usr/share/texmf-texlive/tex/latex/apacite/apacite.sty      so I know it is installed. Then on Windows 7 TeXStudio has no problem finding the package (running MiKTeX 2.something for package management) and the file compiles without errors. So my question would be: How do I convince TeXStudio to also check for packages in texmf-texlive?


title: Adding space in an electronic BibTeX

text: I am using JabRef to create my references. I want to put a note for the for the access date (for electronic references) Here is an example:               @ELECTRONIC{qwest,       url = {http://gigaom.com/cleantech/smart-grid-dsl-current-and-qwest-team-up/  [Accessed: Nov, 2012]},     }      However, if I use the one above, it looks bad since there is no space between `up/` and `[A`. How can I make it look better?


title: Generated PDF is blank when using epstopdf

text: I'm writing a TeX document in which graphics are converted from `.eps` to `.pdf` using `epstopdf`. For the most part, everything works fine, but for two of the figures, the pdf that is generated from the eps file (i.e. `figure-eps-converted-to.pdf`) is completely blank. The result is a normal document but with a blank image in place of these two graphics. EDIT: The figures were both created in MatLab, before subsequent editing in Adobe Illustrator. Does anyone know of an element of the package `epstopdf` that would stop it from properly converting my `.eps` file? The TeX code to include these graphics is exactly the same as for the those that work fine. ![Fig 1](http://i.stack.imgur.com/faxfl.png) ![Fig 2](http://i.stack.imgur.com/dCFmR.png)


title: Showcase of fonts that looks great together

text: There is LaTeX font catalogue available here. But there only the list of fonts, no comparison and recommendation of fonts, to use together. The list of fonts pairs: for text (many sans fonts have serif version and vice verse) and for math, - (or triples, with monospace one) would be great.


title: Accessing other slides' titles in Beamer

text: Suppose I'm making a custom theme for Beamer presentations, and on each frame I'd like to display not only the frame's title itself, but also the titles of the previous and next frames (de-emphasized in some manner, of course). Does anyone know whether there's some way to construct a macro that I can use to access the title of a neighboring frame? Or whether this has already been done somewhere?


title: Bookmark tables and figures

text: I'm trying to generate bookmarks for all Tables and Figures in a document using the code below. However, with this code, the Table 1 bookmark points to Figure 1 and the Figure 2 bookmark points to Table 2 and I cannot find why the Figure and Table numbers get mixed up. Also, with this code, the entire caption is included in the bookmark. I would prefer to only have the short caption in the bookmark, but fail to figure out how to get the short caption. Any help with this problem would be much appreciated. Thanks!               % needs two runs      \documentclass{article}      \usepackage{caption}      \usepackage{hyperref}           \DeclareCaptionTextFormat{Tablebookmark}{\belowpdfbookmark{Table \thetable: #1}{\thetable}#1}       \captionsetup[table]{textformat=Tablebookmark}      \DeclareCaptionTextFormat{Figurebookmark}{\belowpdfbookmark{Figure \thefigure: #1}{\thefigure}#1}       \captionsetup[figure]{textformat=Figurebookmark}          \begin{document}     \null\newpage          \begin{figure}[ht]      \centering      \rule{6cm}{3cm}      \caption{Figure caption text}     \end{figure}          \newpage          \begin{table}[ht]      \begin{tabular}{cc}      Header & Header \\      1&2\\      \end{tabular}      \caption[Table caption text]{This is a table with a very long caption text and it would be nice to use the short caption in the bookmark}     \end{table}          \newpage          \begin{table}[ht]      \begin{tabular}{cc}      Header & Header \\      1&2\\      \end{tabular}      \caption{Another caption text 2}     \end{table}          \newpage          \begin{figure}[ht]       \centering       \rule{6cm}{3cm}       \caption{Caption text}     \end{figure}          \newpage %added two blank pages to make it easier to see bookmark targets     blank      \newpage     blank          \end{document}


title: Preventing space instead of linebreaks

text: How to prevent space at a line break?               a     b     c      produces: `a b c` I want `abc`.


title: Change line spacing in algorithm2e

text: I'm using the `algorithm2e` package. In one algorithm with several math formulae in consecutive lines I would like to increase line spacing. I've already searched `algorithm2e`'s documentation but could not figure out how to change line spacing. Does anybody know?


title: Change BibTeX output formatting?

text: I am using the bibliography style "plain", which in a Technical Report, formats "Technical report" in roman font. However, my publishers want "Technical Report" to be capitalised, and in italics. How can I do this? Thanks!


title: PGFPlots slow down compilation when plotting from external files

text: I am writing a report containing multiple plots of spectroscopic data by way of PGFplots which is fetching data from external files. It used to do the work, and after a few minutes of compilation it would render a pdf, but as I added more results to be plotted it slowed down and now it does not appear to ever finish. (I have waited for about an hour now) The code I use is pretty much a repeat of this for thirteen different csv files, ranging between two columns and ten.               \documentclass{article}       \usepackage{graphicx,tikz}                       \usepackage{pgfplots}       \pgfplotsset{compat=newest}       \begin{document}       \begin{tikzpicture}     \begin{axis}[xlabel near ticks,axis background/.style={        fill=gray!70},width=\textwidth,height=0.4\textwidth,xticklabel=eV,        ymin=0,enlargelimits=false,ylabel=Counts,no marks,grid,cycle list name=color list]       \addplot table[x index=1,y index=2,col sep=space,row sep=crcr] {spectroscopy_data.csv};       \addlegendentry{C$_{\text{K}\alpha}$}       \addplot table[x index=1,y index=3,col sep=space,row sep=crcr] {spectroscopy_data.csv};       \addlegendentry{O$_{\text{K}\alpha}$}     \end{axis}     \end{tikzpicture}       \end{document}


title: Change theorem numbering from Roman to Arabic

text: I am trying to number my theorems according to section number. I use the following in the preamble, which works:               \newtheorem{theorem}{Theorem}[section]      However, since my section is numbered as roman numeral, my theorem numbering ends up being like > Theorem IV.1 Which is really ugly. I would like to keep my section numbering as Roman numerals but my theorem numbering as Arabic. I've tried stuff like               \newtheorem{theorem}{Theorem}[\arabic{section}]      But this wouldn't compile. I've also looked around online but couldn't find the answer. Pleas let me know if you know a solution to this problem. Thank you!!


title: Calculating the minimum height for a node based on the size of other nodes

text: Consider the following example:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc}          \usepackage{xcolor}          \begin{document}          \def\mydist{1mm}     \begin{tikzpicture}[             mystyle/.style={                 rectangle,                 rounded corners,                 draw=black,                  very thick,                 text width=2cm,             }         ]         \node [mystyle] (A) {A\\text\\text\\text};         \node [mystyle, anchor=north] (B) at ($(A.south) - (0,\mydist)$) {B\\text\\text};         \node [mystyle, anchor=south west] (C) at ($(B.south east) + (\mydist,0)$) {C\\text};              % here is the problem         \node [mystyle, anchor=south, red] (D) at ($(C.north)  + (0,\mydist)$) {D\\???};     \end{tikzpicture}          \end{document}      How can I calculate the `minimum height` for node D so that the upper edges of the nodes A and D are aligned? Or should I use a different approach?


title: pdflatexmk compiles \glossaries fine but neglects \glsaddall

text: I'm using TeXShop and the pdflatexmk script. When I link at least one entry of the glossary with `\gls{label}` the glossary compiles fine and all works well (working code example). However I want to use the `\glsaddall` command such that I don't have to link to all glossary entries. Unfortunately pdflatexmk neglects this option (malfunctioning code example). Why does it do that? I know I can run the makeglossaries command in the terminal, but I would rather have it work with pdflatexmk. How can I solve this? Is there a newer pdflatexmk script that addresses this issue? A working example is shown below. ## Working code: mentioning at least one glossary item with \gls{label}:               % !TEX TS-program = pdflatexmk     \documentclass[12pt,a4paper,titlepage,final]{report}     \usepackage[toc, nonumberlist]{glossaries}          \makeglossaries          \begin{document}     \title{Title}     \author{Author}     \date{\today}     \tableofcontents     \printglossaries          \chapter{Chapatare Uno}     \newglossaryentry{One}     {name=One, description={First number after zero}}     Body text for chapter one mentioning the glossary item \gls{One}          \chapter{Chapter Deux}     \newglossaryentry{Open}     {name=Open, description={Opposite of closed}}     Body text for chapter two mentioning the glossary item \gls{Open}          \end{document}      ## Malfunctioning code: using \glsaddall to print entries without mention               % !TEX TS-program = pdflatexmk     \documentclass[12pt,a4paper,titlepage,final]{report}     \usepackage[toc, nonumberlist]{glossaries}          \makeglossaries          \begin{document}     \title{Title}     \author{Author}     \date{\today}     \tableofcontents     \glsaddall     \printglossaries          \chapter{Chapatare Uno}     \newglossaryentry{One}     {name=One, description={First number after zero}}     Body text for chapter one NOT mentioning the glossary item           \chapter{Chapter Deux}     \newglossaryentry{Open}     {name=Open, description={Opposite of closed}}     Body text for chapter two NOT mentioning the glossary item          \end{document}


title: Plotting a 2D gaussian sample

text: Can you please help me with making a 2D Guassian sample with specified means and variances? I only know how to make a guassian curve :D               \documentclass{article}     \usepackage{paralist,pst-func, pst-plot, pst-math, pstricks-add,pgfplots}     \usetikzlibrary{patterns,matrix,arrows}     \begin{document}     \begin{tikzpicture}         \begin{axis}[hide axis,clip=false,xmin=-4,xmax=4,xlabel={X},ymin=0,ymax=1]          \addplot[color=lime, samples=100] {1/sqrt(2)*exp(-(x+1)^2/1)} ;         \end{axis}     \end{tikzpicture}     \end{document}      And here is the formula for it: ![enter image description here](http://i.stack.imgur.com/Ntqmb.png) And this would be an example of three normal distributions together: ![enter image description here](http://i.stack.imgur.com/l0jh1.jpg)


title: Subtract height from column

text: The following latex example is kicking the third table down to the second page. But I don't need it on the second page, I need it all on the first and currently it's set at `3.5in` but I really need it like 4 or 4.5.               \documentclass[12pt]{article}          \usepackage[paperwidth=5.375in,paperheight=8.375in,margin=1.69in]{geometry}          \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{wallpaper}     \CenterWallPaper{1}{fac.png}          \pagestyle{empty}          \setlength{\parindent}{0pt}          \begin{document}          \begin{tabular}{ @{} p{1.65in} l @{} }     \hspace{-0.75in}\textbf{date} & \textbf{date}\vspace{-0.06in} \\     \multicolumn{2}{ l }{\hspace{-0.75in}\textbf{to}\vspace{-0.07in}} \\     \multicolumn{2}{ l }{\hspace{-1.05in}\textbf{letters}} \\     \end{tabular}          \vspace{0.70in}          \hspace{-1.2in}\begin{tabular}{ @{} p{0.5in} p{3.25in} p{0.5in} @{} }     \textbf{date} & \hspace{-0.25in}\textbf{date} & \textbf{date} \\     \end{tabular}          \vspace{3.5in}          \begin{tabular}{ @{} p{0.5in} p{0.5in} @{} }     \textbf{date} & \textbf{date} \\     \end{tabular}          \end{document}      It's the `.5` that does it as with `.4` it doesn't. Any hints?


title: Node base error

text: Encountering a strange issue here: I have a node style that I have been using for many flow-charts. It's base has always been in the exact center of the shape, but now i'ts been translated up about 1/4 toward the north anchor. The blue and red lines clearly show it's moved north, but the `diamond`'s base is still in the exact center. What gives? ![node base](http://i.stack.imgur.com/9o8vC.png)               \documentclass{article}          \usepackage{tikz}     \usepackage[margin=0.5in]{geometry}     \pagestyle{empty}          \begin{document}          %\input{../tikz-setup.tex}     \usetikzlibrary{shapes, arrows, calc, positioning, matrix}          % Define block styles     \tikzstyle{state}   = [ rounded rectangle,                              draw,                              text centered,                              minimum height=3em ,                             minimum width = 6em,                             inner sep = 5pt                           ]     \tikzstyle{test}    = [ diamond,                              draw,                              shape aspect=2,                              inner sep = 0pt,                             text width = 7em,                             text centered                           ]     \tikzstyle{action}  = [ rectangle, draw,                             text width=8em,                             inner sep = 3pt,                              minimum height=5em                           ]     \tikzstyle{data}    = [ trapezium,                              draw,                              trapezium left angle=60,                              trapezium right angle=120pt,                             minimum height = 6em,                              text width = 5em,                             inner xsep = 0pt                            ]     \tikzstyle{line}    = [ draw, -triangle 45 ]          \tikzstyle{list}  = [ rectangle, draw,                             minimum width = 6em                                                 ]          \tikzstyle{ptr-box}  = [ rectangle,                              text width = 8em                                                 ]          \begin{center}     \begin{tikzpicture}[align = flush center, font = \small]              \matrix [matrix of nodes, column sep = 1em, row sep = 2em,                     nodes={},                     ] (end-mtrx)         {              |[action] (a)| Lorem ipsum dolor sit amet, consectetur adipiscing elit \\         |[test] (b)| Lorem ipsum dolo  \\                 |[test] (c)| Lorem ipsum  \\          |[test] (d)| Lorem ipsum dolor & |[action] (e)| Lorem ipsum dolor sit amet, consectetur adipiscing elit \\         |[state] (f)| Lorem ipsum d & |[state] (g)| Lorem ipsum dolor  & |[state] (bad-sd)| Lorem ipsum dolo\\          };               \path[draw, red, line width=5pt] (d.base) -- (e.base);               \path[draw, blue, line width=5pt] (a.base) -- +(3,0);               \end{tikzpicture}     \end{center}     \end{document}