title: Trouble using ffmpeg to encode a h264 video in a .mp4 container to use with media9

text: I can't get an `ffmpeg` encoded libx264 video in a .mp4 container to work with media9 and beamer. The pdf is created using pdfLaTeX. It seems to be some kind of ffmpeg issue since the following work fine:   * The random.mp4 from the media9 package works   * So is the .flv default in `ffmpeg` though the video quality is naturally not as good              ffmpeg -i Test.mp4  -sameq Test.flv       Any video I encode in ffmpeg using               ffmpeg -i EB_%03d.png -c:v libx264 -x264opts keyint=30 -r 30 -b:v 1000k -s 640x512 Test.mp4      plays flawless in e.g. VLC (and I see the duration bar in the pdf though not the video). `ffmpeg -i Test.mp4` yields for the video stream               Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 640x512, 1021 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc      which is slightly different from `ffmpeg -i random.mp4`               Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 170 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc      Output from `ffmpeg`               ffmpeg version 2.0.2 Copyright (c) 2000-2013 the FFmpeg developers     built on Oct 19 2013 08:34:03 with gcc 4.7 (SUSE Linux)     configuration: --shlibdir=/usr/lib --prefix=/usr --mandir=/usr/share/man      --libdir=/usr/lib --enable-shared --disable-static --enable-debug --disable-stripping      --extra-cflags='-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2      -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_LARGEFILE_SOURCE      -D_FILE_OFFSET_BITS=64 -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3      --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus      --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex      --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb      --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype      --enable-avresample --enable-libtwolame --enable-libvo-aacenc       libavutil      52. 38.100 / 52. 38.100       libavcodec     55. 18.102 / 55. 18.102       libavformat    55. 12.100 / 55. 12.100       libavdevice    55.  3.100 / 55.  3.100       libavfilter     3. 79.101 /  3. 79.101       libavresample   1.  1.  0 /  1.  1.  0       libswscale      2.  3.100 /  2.  3.100       libswresample   0. 17.102 /  0. 17.102       libpostproc    52.  3.100 / 52.  3.100      The code snippet for media9               \begin{frame}     \frametitle{Here should be a .mp4 video}     \framesubtitle{Apparently, something is wrong with my x264 codec}          \includemedia[     width=3.5in,height=2.8in,     activate=pageopen,     addresource=Figures/Test.mp4,     transparent,     flashvars={     source=Figures/Test.mp4&     autoPlay=true&     loop=true&     scaleMode=letterbox     }     ]{\includegraphics{Figures/EB_001}}{VPlayer.swf}     \end{frame}        Ideas anybody?


title: Drop the current page

text: I need to use a command of a 3rd-party package, which inserts multiple pages of content into my document. Is there a way to tell LaTeX to ignore the last of these pages? E.g. the command inserts 3 pages, but I only want the first two. Equivalently, can I tell LaTeX to simply drop the current page, i.e. to go back to the last hard page break (`\newpage`) and forget all the content that has been added since then? Obviously I can easily remove the page from the resulting PDF using external postprocessing, but I'd rather do it directly in the document if that's possible. Note that I cannot modify the 3rd-party package and that not using the command from that package is not an acceptable solution.


title: What is faster? To \RequirePackage{foo} or to check if the user has actually request it and \Require it if so?

text: I'm asking this because the package `lineno` has a thing that leaves a lot of commands in the .aux file (see here)... and I'm not sure if I should `\newcommand` these to empty or if I should just load the package and forget about it. I know the answer is very case dependent, as stated by David Carlisle: > it depends. If the package is `tikz` then it loads 100 files and takes half > an hour doing stuff, if it is `indentfirst` then it doesn't. Conversely > loading `tikz` probably doesn't have an effect other than taking time if no > `tikz` commands are used, whereas loading `indentfirst` in itself changes > the document layout. But I would like to know some other point of views, specially regarding best practices and if there is any approach that should be used for specific cases or with _delicate_ packages.


title: bouquet of n circles with Tikz

text: I would like to draw bouquet of n circles. How can i draw it in Tikz? ![enter image description here](http://i.stack.imgur.com/z2YY1.png) rose with four petals is like i want to draw but with n petals.


title: Removing space in itemize environments

text: I have a macro that has itemize environment in it. I'm trying to remove the spaces between items, preceding, and following texts with control commands, but I still have spaces. How can I remove them? (How can I make tighter itemize environment?)               \documentclass{article}     \usepackage{booktabs}     \newcommand{\fuda}[2]{%     Function:%     \begin{itemize}%     #1%     \end{itemize} \topsep0pt \parskip0pt \partopsep0pt \itemsep0pt \parsep0pt     Data:%     \begin{itemize}%     #2%     \end{itemize}%     }     \begin{document}     \noindent     \fuda{%     \item A%     \item B}     {%     \item X%     \item Y     }     \end{document}      ![enter image description here](http://i.stack.imgur.com/kcitU.png)


title: How to make amsart section titles like chapters in Book/Report?

text: I want them to look like this (also in toc): http://www.sharelatex.com/learn- scripts/images/f/f8/SectionsChaptersEx3.png How to achieve this? I'm sorry if this was unclear. I want titles to look like "Kapitel 1 Title" and to show in table of contents as "1.Title". Standard amsart doesn't look like this. And I don't want to use "Book" style, because then everything else breaks down.


title: Variable scoping of edef definitions in a local group (inside an ifx conditional)?

text: Consider this MWE:               \documentclass{article}          \def\testswitch#1{       \def\isA{A}       \def\firstOpt{#1}       \edef\tmpstr{-init-}       { % start local         \edef\tmpstr{-loc defined-}       } % end local       \ifx\firstOpt\isA{%         \typeout{testswitch: Condition A is true; '#1'}         \edef\tmpstr{yes, it is}       }\else{         \typeout{testswitch: Condition false ; '#1'}         \edef\tmpstr{no it is not}       }\fi       \typeout{testswitch: completed, tmpstr is '\tmpstr'}     }          \def\testswitcher#1{       \begingroup       \testswitch{#1}       \typeout{testswitcher: completed, tmpstr is '\tmpstr'}       \endgroup     }          \begin{document}          \def\tmpstr{-master start-}     \testswitcher{A}     \typeout{after testswitcher, tmpstr: '\tmpstr'}     \testswitcher{B}     \typeout{after testswitcher, tmpstr: '\tmpstr'}          \end{document}      It outputs:               testswitch: Condition A is true; 'A'     testswitch: completed, tmpstr is '-init-'     testswitcher: completed, tmpstr is '-init-'     after testswitcher, tmpstr: '-master start-'     testswitch: Condition false ; 'B'     testswitch: completed, tmpstr is '-init-'     testswitcher: completed, tmpstr is '-init-'     after testswitcher, tmpstr: '-master start-'      Basically, when \tmpstr is defined in either any local group - including those that appear in course of usage of the `\ifx` conditional (since, as I remember, `{` and `}` are synonyms for `\bgroup` and `\egroup`) - then it will not have any effect outside of the local group; therefore we always print out the '-init-' value. I'm aware that I can use a `\global\edef` (`\xdef`) or a variant (`\global\let\tmpstr\tmpstr`) inside local group, to have the value preserved - but then, it becomes a global variable - and in this case, I don't want that; I would just want the `\edef`'d token to survive within the context where it is used - in this MWE, that is the `\testswitcher` macro; I would basically want this output:               testswitch: Condition A is true; 'A'     testswitch: completed, tmpstr is 'yes, it is'     testswitcher: completed, tmpstr is 'yes, it is'     after testswitcher, tmpstr: '-master start-'      Can I control this level of variable scoping in Latex - and if so, how?


title: How does fontspec select fonts "by name"?

text: When loading a font _by name_ , what is the search mechanism being used? How is the matching done? (It's marked TODO in the documentation) I have many problems, for example: a "Hoefler Text Engraved" font is replacing the default "Hoefler Text" with bold `\fontspec{Hoefler Text} \textbf{...}`. Some of its metadata in fontforge: PS Names               Family Name: Hoefler Text     Weight: Normal      TTF Names               Family: Hoefler Text Engraved     Styles (Subfamily): Regular     Preferred Family: Hoefler Text     Preferred Styles: Engraved      What does fontspec/fontconfig read in the file to match the requested font? (in this case "Hoefler Text/Bold"


title: Any tool to improve contrast of study materials?

text: I see many slides of my study materials which are done by WYSIWYG and colored with many colours to improve the contrast. To improve contrast with colors, I think is not necessarily the best way to go. I think this kind of text is difficult to read. Is there any package which considers the contrast itself or any guidelines how to reach good standard? I like myself black-and-white and then just bold, italic and underline rarely. **What colours should be used to improve contrast?**


title: Automatic LaTeX parsing to replace text with macros

text: I know this title is pretty bad but I couldnt come up with something better. Basically what I want is to be able to write normal text, but that it displays in PDF in a custom alphabet once compiled. This is different than just using a custom font because for example, if I write "la" it should corresponds to one character, and "lo" to another different character. The point is I want to be able to write it without using ten billion macros myself, for example writing \customLA \customLO instead of la lo would be extremely tedious if I want to write lines and lines. Is there a simple and automatic way to do it with LaTeX? Or should i write my own parsing program in C++ to modifiy the LaTeX file to replace characters combinations with macros?


title: Changing the paper size of a document without changing anything else

text: I found a nice piece of software (pdf2swf) that converts pdf files to browse- able flash files, but prevents them from being downloaded. I have a "book" document that I wrote in LaTeX and I want to host it on a website as an swf file (so that it can be read but not downloaded). The problem I'm having is that the 8.5in x 11in paper size scales very narrow to fit on the screen; I tried manipulating the paper size, but it smashed my text around and some of the text disappeared. Is there a simple way to compile a LaTeX book document so that it will change the paper size but nothing else?


title: Strange behaviour of "underneath" accents and \rowcolor

text: The following example shows the problem using the `\b` command for the "bar- under" accent: it seems to interact in an unexpected way with `\rowcolor`. Uncommenting the appropriate `\renewcommand` line, the example shows also a bad interaction with `\c` (for the "cedilla"), and `\d` (for the "dot-under" accent):               \documentclass{article}     \usepackage[table]{xcolor}          \newcommand*\CRow[1]{\rowcolor{blue!30}\b#1\\}     %\renewcommand*\CRow[1]{\rowcolor{blue!30}\c#1\\}% uncomment for cedilla     %\renewcommand*\CRow[1]{\rowcolor{blue!30}\d#1\\}% uncomment for dot-under          \begin{document}          \begin{tabular}{c}       \CRow{a}       \CRow{b}       \CRow{c}       \CRow{d}       \CRow{e}       \CRow{f}       \CRow{g}       \CRow{h}       \CRow{i}       \CRow{j}       \CRow{k}       \CRow{l}       \CRow{m}       \CRow{n}       \CRow{o}       \CRow{p}       \CRow{q}       \CRow{r}       \CRow{s}       \CRow{t}       \CRow{u}       \CRow{v}       \CRow{w}       \CRow{x}       \CRow{y}       \CRow{z}     \end{tabular}          \end{document}      The output: ![enter image description here](http://i.stack.imgur.com/rWc8F.png) What is causing the problem and how to avoid it?


title: Drawing back to back stem and leaf diagrams?

text: I have drawn a back to back steam and leaf diagram but it looks messy. Is there a code I can use which would make it look professional?


title: Changing caption numbering for algorithm in algorithm2e

text: I am trying to define a new environment that uses the `algorithm` environment from `algorithm2e`. I want to use a separate caption counter for this new environment. As of now, this is what I have, but I don't know how to `\def` or `\renewcommand` the caption variable with the `hdps` counter?               \newcounter{hdps}     \newenvironment{asm}{%     \stepcounter{hdps}%     \renewcommand*{\algorithmcfname}{ASM Spec.}%     \begin{algorithm}}     {%     \def\thealgocf{}%     \end{algorithm}}      Help is much appreciated.


title: Biblatex: How to get "Author (forthcoming)" when pubstate=forthcoming is set, instead of "Author (n.d.)"?

text: I am using biblatex with these options :               \usepackage[backend=biber,natbib=true,style=authoryear,language=english]{biblatex}      I have an entry whose field pubstate is set to "forthcoming". When I cite this reference in the text, I get "Author (n.d.)", and I would like to have "Author (forthcoming)", instead. Pretty much the same thing in the bibliography. I get : Author (n.d.) ... blablabla ... Forthcoming. And I would prefer : Author (Forthcoming): blablabla ... I could set the "year" field to "Forthcoming". However, this is not a good solution because I am writing articles in three languages very often. And I would need to change my bibliography database evry time I start a new article in a different language. Any ideas of how I can have this issue solved ? Thank you very much in advance, Pierric


title: Equations in amsart crash into wrapfigs

text: In the example file below, using amsart and compiling using pdflatex, the equation crashes into the space reserved for the wrapfigure. If I use article instead of amsart, then the problem goes away (the equation is centered in the column of text instead centered in the page). However, I'd like to use amsart... Suggestions?               \documentclass[12pt]{amsart}          \usepackage[top=30mm, bottom=30mm, left=30mm, right=30mm]{geometry}     \usepackage{wrapfig}          \begin{document}          \title{Test File}          \author{Dr Foo Bar}     \date{\today}          \begin{abstract}     A test file.     \end{abstract}     \maketitle          \section{Lorem ipsum}          \subsection{Dolor sit amet}          \begin{wrapfigure}[16]{r}{0.5\textwidth}          \vspace{1.5in}     \caption{Fusce tempor, diam nec hendrerit luctus, purus quam...}     \end{wrapfigure}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus     congue eros a purus vestibulum condimentum. Curabitur pretium lacinia     tempus. Quisque auctor ornare ipsum, ac aliquet nulla tincidunt     eu. Vivamus sit amet metus in erat placerat commodo. Duis blandit     dignissim tempus.     \[     i^2 = j^2 = k^2 = ijk = -1.     %%% Why isn't the centering aware of the wrapfigure?     \]     Proin varius vel eros nec mollis. Vivamus sit amet     ligula a nunc malesuada malesuada mollis eu tellus. Vestibulum     lobortis sapien sit amet lacus tristique, ut facilisis sapien     mollis. Suspendisse placerat ante tortor, molestie blandit arcu     sodales sed. Aliquam vitae ligula nisi. Donec tempor, ante a vehicula     hendrerit, ligula lacus elementum dolor, vitae hendrerit magna justo     in neque.     \end{document}


title: I want \newcommand to replace something in a document by something else

text: I want to define `\newcommand{\B}` in 2 different ways and switch between them in the simplest way – just using a comment mark, `%`. Let's look at the example:               \documentclass[a4paper,9pt]{article}     \usepackage[utf8]{inputenc}          % My 1st definition      \newcommand{\B}[1]{\textbf{#1}}     % My 2nd definition (it’s wrong that’s way I’m asing)     \newcommand{\B}{$\ldots$}          \begin{document}     Let \B{1.345} be           \end{document}      Using first definition the value `1.345` is bolded. If I use second definition I should always get only `$\ldots$` so value `1.345` should be removed. I tried to add spaces (crude solution) but value skipped line below. Any suggestion?


title: Lower case in chapter header

text: I am writing a document using the `book` class. The problem is, that I want the headers to be in lowercase letters. How to force them to be lower case? A sample code is               \documentclass{book}     \usepackage{lipsum}     \begin{document}     \chapter{Chapter one $e^--p^+$}             \lipsum[1-10]     \end{document}      and the ouptut looks like that ![enter image description here](http://i.stack.imgur.com/nY2ut.png)


title: TikZ 3 space between options and named angle in a label no more allowed

text: ## Release comparison In version 2.10 of TikZ you could write:               \coordinate [label={[red] center:$P$}] (x) at (0,0);      but in the latest release (version 3.0.0) you'll get an error (`unknown function 'center'`) unless you write it without any space between the `[options]` and the `<angle>`:               \coordinate [label={[red]center:$P$}] (x) at (0,0);      On the contrary, you can still write it as before if the `<angle>` is a number:               \coordinate [label={[red] 30:$P$}] (x) at (0,0);      ## Question Is this a bug or a desired behaviour? ## MWE               \documentclass[tikz]{standalone}          \begin{document}     \begin{tikzpicture}     %\coordinate [label={[red] center:$P$}] (a) at (0,0); % this doesn't work     \coordinate [label={[red]center:$P$}]  (b) at (1,0);     \coordinate [label={[red] 30:$P$}]     (c) at (2,0);     \end{tikzpicture}     \end{document}


title: Modifying referencing and bibliography style on converted LaTeX file

text: Zotero stuffed up my referencing, so I'm thinking to convert the `.odt` to `.tex` using the export feature of LibreOffice Writer. When I export from LibreOffice Writer, I don't get a bibliography, and half the references are like:               \label{ref:ZOTEROITEMcitationID2cird4ma9fcitationItemsurihttpzoteroorgusers599343itemsTCC6K72BRNDVPoyfZpvsE}(Lin     and Lin).      Whilst the other half are like:               \footnote{Adobe Systems Incorporated (2000). \textit{PDF Reference: Adobe Portable Document Format: Version 1.3}. 2nd ed. Boston: Addison-Wesley. 485.}      Would I then be able to modify the referencing style from subscript Roman- numerals to (Author, Year), and generate a new bibliography in that style?


title: pifont (zapf dingbats) shows wrong letters

text: The following code should print out arrows, but shows completely different letters instead:               \documentclass{scrbook}     \usepackage{lmodern}     \usepackage{pifont}     \begin{document}     \[       \ding{52} \quad \ding{222} \quad \ding{237}      \]     \end{document}      ![enter image description here](http://i.stack.imgur.com/5cAla.png)


title: Percentage symbol with csvsimple package

text: I'm using package `csvsimple` to read `.csv` files. The problem is, in some of the cells I have percentages, like:               a,b     1,10%     3,16%      If I leave the `%`s, everything after the first `%` is omitted, that is, it's behaving like a comment. If I escape `%` with `\%` I get compilation errors. Example:               \documentclass{minimal}     \usepackage{csvsimple}     \begin{document}     \csvautotabular{tab.csv}     \end{document}      where `tab.csv`:               a,b     1,2%     2,5%      The same problem happens with `datatool` package.


title: Why Verdana font symbol: U+0022 is not the same like symbol: "

text: I have a OS Win7/64 and TeXLive 2012 fully updated.   TeXworks is set in preferences: UTF-8/Verdana When I open a new document in TeXWorks Editor,   I would like to get a symbol: " ,which means "dumb" quotation marks.   I do not need to print it, or use in program structure.   I would like to use keyboard sequence to get this symbol:( **"** )   I try to use keyboard: (left **Alt + 0022** on numerical keyboard) and, unfortunately:   I got symbol: ( **Ţ** ). but when I point this character from character table and choose this symbol ( " ) all is well.   Why do I have to use the **character table** , instead of pressing the right combination of keyboard? I changed my previous question because was not very clear.


title: Modify style of \cleardoublepage

text: I'm looking for a solution to put on empty pages generated by `cleardoublepage` a centered text "empty page". What I want is, that all sections open right and I there added a empty page, this page should marked with "empty page".               \documentclass[11pt,a4paper,twoside,openright,                    notitlepage,cleardoublepage=empty,                    ngerman]{article}     \usepackage[a4paper,                 bindingoffset=1cm,margin=2cm,                 includeheadfoot,     %            top=25mm, bottom=25mm,     %            headheight=15mm, headsep=7mm                 ]{geometry}     \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp      \usepackage{verbatim, environ}     \usepackage{lmodern}     \usepackage{amsmath,amsfonts,amssymb}     \usepackage{blindtext}               \begin{document}     \section{eins}     \blindtext     \cleardoublepage     \section{zwei}     \blindtext     \cleardoublepage     \section{drei}     \blindtext     \blindtext     \blindtext     \Blindtext     \cleardoublepage     \section{vier}     \blindtext     \blindtext     \blindtext     \Blindtext     \end{document}       * * * * * * ## 1st modified exsample In attention to your comments here a new example. This shows how it should look like. Only the mark "empty page" is missing. The functionality of cleardoublepage and the head and foot have to be untouched. The functionality I mean is: cleardoublepage only insert a empty page if the last section ends on an odd page (old section: odd page -> cleardoublepage: empty even page -> next section: odd page). In case of a section ends on an even page cleardoublepage hast no effects. (old section: odd page -> cleardoublepage: no page inserted -> next section: odd page)               \documentclass[11pt,a4paper,twoside,                    notitlepage,                    ngerman]{article}     \usepackage[a4paper,                 bindingoffset=1cm,margin=2cm,                 includeheadfoot,                 ]{geometry}     \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp      \usepackage{verbatim, environ}     \usepackage{lmodern}     \usepackage{amsmath,amsfonts,amssymb}          \makeatletter        \def\ps@vakatseite{%          \vspace*{\fill}          \centering This page would be intentionally left blank if we would not wish to inform about that.           \vspace{\fill}        }     \makeatother          \newcommand{\newsection}[1]        {{\cleardoublepage}         \section{#1}        }          \usepackage{fancyhdr}      \pagestyle{fancy}      \fancyhead[OL]{\scshape\leftmark}      \fancyhead[ER]{\scshape\leftmark}      \fancyhead[EL,OR]{\thepage}      \fancyfoot[OL]{\scshape\leftmark}      \fancyfoot[ER]{\scshape\leftmark}      \fancyfoot[EL,OR]{\thepage}      \renewcommand{\footrulewidth}{0.5pt}          \usepackage{blindtext}          \begin{document}     \newsection{eins}     \blindtext     \newsection{zwei}     \blindtext[3]     \newsection{drei}     \blindtext[8]     \newsection{vier}     \blindtext[4]     \end{document}      If I use               \clearpage{\pagestyle{vakatseite}\cleardoublepage}      I will get one or two empty pages with one marked page. I want zero or one page instead... ![printed example](http://i.stack.imgur.com/ne7ov.png) * * * * * * ## Final Code Thanks to Harish Kumar. This solution is fully what I want :)               \documentclass[11pt,a4paper,twoside,                    notitlepage,                    ngerman]{article}     \usepackage[a4paper,                 bindingoffset=1cm,margin=2cm,                 includeheadfoot,                 ]{geometry}     \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp      \usepackage{verbatim, environ}     \usepackage{lmodern}     \usepackage{amsmath,amsfonts,amssymb}          \makeatletter     \def\emptypage@emptypage{%         \hbox{}%          \vspace*{\fill}          \begin{center}          This page would be intentionally left blank\\ if we would not wish to inform about that.          \end{center}          \vspace{\fill}          \newpage%         }%     \def\cleardoublepage{%             \clearpage%             \if@twoside%                 \ifodd\c@page%                     % do nothing                 \else%                     \emptypage@emptypage%                 \fi%             \fi%         }%     \makeatother          \newcommand{\newsection}[1]        {\cleardoublepage         \section{#1}        }          \usepackage{fancyhdr}      \pagestyle{fancy}      \fancyhead[OL]{\scshape\leftmark}      \fancyhead[ER]{\scshape\leftmark}      \fancyhead[EL,OR]{\thepage}      \fancyfoot[OL]{\scshape\leftmark}      \fancyfoot[ER]{\scshape\leftmark}      \fancyfoot[EL,OR]{\thepage}      \renewcommand{\footrulewidth}{0.5pt}          \usepackage{blindtext}               \begin{document}     \newsection{eins}     \blindtext     \newsection{zwei}     \blindtext[3]     \newsection{drei}     \blindtext[7]     \newsection{vier}     \blindtext[4]     \end{document}      ![enter image description here](http://i.stack.imgur.com/fBwI3.png)


title: Annotate Plots in TikZ/PGFplots

text: I have the following piece of code in my tex file.               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}[scale=2]     \tikzstyle{every node}=[font=\scriptsize]     \definecolor{mycolor1}{rgb}{0,0.5,0}          \begin{loglogaxis}[     ultra thick,     xshift=1.7in,     scale only axis,     width=1.2in,     height=1.25in,     xmin=2500, xmax=1000000,     ymin=1, ymax=1e7,     axis on top,     xlabel=Number of unknowns,     xlabel style={at={(0.125,-0.025)},anchor=south west},     ylabel=Time taken in seconds,     ylabel style={at={(0.22,0.125)},anchor=south west},     x tick label style={yshift=-3},     y tick label style={xshift=-2}]          \addplot [     color=red,     solid     ]     coordinates{     (2500, 2)(10000, 6)(62500, 40)(250000, 155)(1000000, 600)     };          \addplot [     color=green,     solid     ]     coordinates{     (2500, 52)(10000, 832)(62500, 32500)(250000, 520000)(1000000, 8320000)     };     \end{loglogaxis}     \end{tikzpicture}     \end{document}      The output is ![enter image description here](http://i.stack.imgur.com/OwOKT.png) I want to indicate on the figure that the red line is $10^4$ times faster than the green line by drawing an arrow between the two lines at the right extreme and writing $\times 10000$. How should I proceed? Thanks


title: Problem with referencing to a newenvironment

text: The reference I'm using below doesn't work. I think I'm missing something in the definition of `myclaim`. Any ideas?               \documentclass{llncs}     \usepackage{amsmath}          \newcounter{claimcounter}     \numberwithin{claimcounter}{theorem}     \newenvironment{myclaim}{\stepcounter{claimcounter}{\par\noindent{\bf Claim \theclaimcounter:}}}{\par}          \begin{document}     Refering to Claim \ref{first-claim}          \begin{theorem}     aa     \end{theorem}          \begin{myclaim}     \label{first-claim}     bb     \end{myclaim}     \end{document}


title: How to ignore hard space (~) in siunitx number parsing

text: I used to format number grouping with a protected space (`~`). Now I'm switching to siunitx's `\num`. According to the package documentation ... > The formatter removes ‘hard’ spaces (`\,` and `~`) but when I surround my numbers with `\num` it produces the following error output               ! siunitx error: "invalid-token-in-number"     ! Invalid token '\protect ' in numerical input.          l.5 \num{60~000}          | Numbers can only contain tokens defined using the 'input-...' options:     | the token '\protect ' is not set up as a valid part of a number.      I tried to include `\protect` to the `input-ignore` option but it just changes the invalid token in the error message to `\unhbox` and `\voidb`. Here is a MWE (Miktex v2.9 and siunitx v2.5s):               \documentclass{article}     \usepackage{siunitx}     %\sisetup{input-ignore={\protect }}     \begin{document}     \num{60~000}     \end{document}      Of course, one could just remove the tilde character in each number but how would I include it into the ignored input tokens? Do I misinterpret the package documentation?


title: Mysteriously fails to compile when I comment a line

text: I set up a github repo with a not-so minimal working environment (sorry for that). As the README at github says, uncommenting the following stupid line solves the problem and makes the `diplomadolgozat.tex` file compilable.               %\begin{figure}[h]\end{figure}      There are other lines which when deleted make the compiler happy, but it's all unpredictable. Until now everything was fine, but this error made my whole writing process unstable: I no longer know when will it break again and when it breaks, why. If you have some time for it, clone the github repo, see it for yourself.


title: Folder structure of your work

text: Users, I am using LaTeX for homework at university. By now, I had always other programs generating some files, that I used in my LaTeX-document. For example MATLAB generated some graphs, Inkscape generated some pictures and so on. I always used a folder structure like this:               /experiment01/matlab/     /experiment02/matlab/     /experiment02/inkscape/     ...          /beamer-presentation01/     /beamer-presentation02/     ...          /fulltext01/     /fulltext02/     ...      With this, I am on the one hand able to use figures again in different versions of presentations and the thesis text. On the other hand, my latex references break, if I rename folders. Also the old presentations do not have a fixed state, because the sketches done by Inkscape might change (if not versioned). What do you recommend? Do you keep your proper work separated from the LaTeX- files? Do you refer to the same figure again in different documents or do you copy it?


title: Image in upper left moved down toward center

text: I'm trying to insert an image at the upper left corner, and then move it down toward the center of the page. Similar questions lead me to try the following:               \documentclass{article}     \usepackage{fullpage}     \usepackage{eso-pic}      \usepackage{graphics}          \AddToShipoutPictureBG{%     \AtPageUpperLeft{\raisebox{-\height}{\hspace*{1cm}\vspace*{-1cm}              \includegraphics[width=1.5in]{/Path/To/Image/animage.png}}}     }     \begin{document}     some words     \end{document}      It works for the horizontal shift, but not the vertical shift. How can I fix this?


title: How to balance binary branches and repair shorthand triangles in LFG style c-trees using tikz-qtree

text: I have modified the example from the `tikz-qtree` documentation to form this LFG style c-tree, but am having difficulty balancing the binary branches in general, and the IP branches and roof/triangle DP 'the cat' in particular. My question is how to control the vertical distance between each mother and daughter node so that branches can be made reasonably parallel to each other when comparing level to level? And how to fix the upside-down shorthand DP triangle, and also shorten the width of both triangles to better match the text width? Would very much appreciate suggestions.               \documentclass[12pt]{article}     \usepackage{tikz-qtree}     \usepackage{tikz-qtree-compat}     \begin{document}     \tikzset{level 1/.style={level distance=10pt,sibling distance=10pt}}     \tikzset{level 2/.style={level distance=20pt,sibling distance=10pt}}     \tikzset{level 3/.style={level distance=40pt,sibling distance=15pt}}          \begin{tikzpicture}[level 1,level 2,level 3]     \tikzset{every tree node/.style={align=center,anchor=north}}     \tikzset{inner ysep=3pt,outer ysep=0pt}     \Tree%         [. {IP} [.\node{Spec=|\\Subj=|\\[-2pt]DP}; \edge[roof]; {the cat} ]                 [.\node{U=D\\VP}; \node{U=D\\V\0\\[-4pt]sat};                         [.\node{Pcase=|\\PP}; [.\node{U=D\\P\0\\[-5pt]on}; ]                         [.\node{Obj=|\\DP}; \edge[roof]; {the mat} ] ] ]         ]%     \end{tikzpicture}     \end{document}      @Alan Munn: Yes, exactly. I would prefer to have the DP of 'the cat' lined up horizontally with the VP just as you say. In general what I would like to do is to make the left branch from IP to DP shorter but parallel with the other leftwards branches: that is, parallel to VP to V-zero and PP to P-zero leftwards branch and ditto with all the rightwards branches. I guess my question is: how do you shorten or lengthen each single branch of the c-tree from each mother node to each daughter node? The code [inner xsep=0pt] etc. works well in reducing the width of the bottom line of the triangle: thank you for that. But the DP triangle 'the cat' is still upside down. Unfortunately I am not allowed to upload a jpg to this site of the c-tree as MikTeX produces it on my computer. It appears that having multiple levels of lines in each node in the style of LFG syntactic theory plays havoc with the binary branches.


title: Unequal letter spacing in 'listings'

text: I am wondering why in the pdf of the example below the letters of the word "function" and the word "sum" seem to have different spacing. This somehow looks ugly. Apart from that, I am wondering if someone has a "nicer-looking"/"easier-to- read" way of displaying `R` code with the `LaTeX` package `listings`.               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[american]{babel}          \usepackage{graphicx}     \usepackage{fancyvrb}     \usepackage{listings}          \lstset{% setup listings         language=R,% set programming language         basicstyle=\small,% basic font style         keywordstyle=\bfseries,% keyword style             commentstyle=\ttfamily\itshape,% comment style         numbers=left,% display line numbers on the left side         numberstyle=\scriptsize,% use small line numbers         numbersep=10pt,% space between line numbers and code         tabsize=3,% sizes of tabs         showstringspaces=false,% do not replace spaces in strings by a certain character         captionpos=b,% positioning of the caption below             breaklines=true,% automatic line breaking             escapeinside={(*}{*)},% escaping to LaTeX             fancyvrb=true,% verbatim code is typset by listings             extendedchars=false,% prohibit extended chars (chars of codes 128--255)             literate={"}{{\texttt{"}}}1{<-}{{$\leftarrow$}}1{<<-}{{$\twoheadleftarrow$}}1             {~}{{$\sim$}}1{<=}{{$\le$}}1{>=}{{$\ge$}}1{!=}{{$\neq$}}1{^}{{$^\wedge$}}1,% item to replace, text, length of chars             alsoletter={.<-},% becomes a letter             alsoother={$},% becomes other             otherkeywords={!=, ~, $, *, \&, \%/\%, \%*\%, \%\%, <-, <<-, /},% other keywords             deletekeywords={c}% remove keywords     }          \begin{document}          \noindent Just some text; see Line \ref{foo}.     \begin{lstlisting}[caption={A first example}, label=list:ex]     x <- c(1, 3, 2)     id <- function(x){         x # just a dummy (*\label{foo}*)     }     3 <= 4     3 != 4     !TRUE     y <- "foo"     (pv <- sum(x*x^x))     y ~ x + a     \end{lstlisting}          \end{document}


title: Flushleft and flushright in the same line (ConTeXt)

text: I have the following macro               \mainlanguage   [de]     \definepapersize[MyBook][A5]     \setuppapersize[MyBook][A5]          \definestartstop[Test][commands=\setups{Test}]     \def\Test{\doTest}     \def\Test[#1]{           \placeongrid[top]{             {\startalignment [flushleft] #1 \stopalignment \startalignment [flushright] (\bf Test Message) \stopalignment}         \blank[big]         }     }          \starttext     \Test[Wrong]     \Test[This one is correct, correct, correct, correct, correct.]     This one is wrong, wrong, wrong, wrong, wrong.     \startalignment [flushright]      (\bf Test Message)      \stopalignment          \stoptext      with three examples. What I want is this: \Test[#1] should produce #1 and #2 with the following properties:   * #1 should be flushleft, #2 flushright   * #2 should never be breaked into two lines   * if they fit into one line, then they should do that, not like the above first example How to do that?


title: breqn package is not working

text: I am using the `breqn` package, but it is not working.               \begin{dmath}          \sqrt {-{\frac {-4\,c-k_{{2}}{x}^{2}+{x}^{2}\sqrt {4\,c+{k_{{2}}}^{2}}}{c}}}\sqrt {{\frac {4\,c+k_{{2}}{x}^{2}+{x}^{2}\sqrt {4\,c+{k_{{2}}}^{2}}}{c}}}{\it EllipticF} \left( 1/2\,x\sqrt {{\frac {-k_{{2}}+ \sqrt {     4\,c+{k_{{2}}}^{2}}}{c}}},1/2\,\sqrt {-{\frac {4\,c+2\,{k_{{2}}}^{2}+2\,k_{{2}}\sqrt {4\,c+{k_{{2}}}^{2}}}{c}}} \right) {\frac {1}{\sqrt {{\frac {-k_{{2}}+\sqrt {4\,c+{k_{{2}}}^{2}}}{c}}}}}{\frac {1}{\sqrt {8\,c-2\,{x}^{4}+4\,k_{{2}}{x}^{2}}}}=t     \end{dmath}


title: Adjust table of content depth in ConTeXt

text: How to create a table of contents in ConTeXt MkIV with dots? In the wiki there is               \title{Inhalt}     \placelist[section]      But the old way to make dots               \setupcombinedlist[content][level=4, alternative=c]     \completecontent      does not work anymore. I need the "level", s.t. only the section are in the toc, and the dots, both.


title: Creating a new type of cross reference and referencing them spelling the same text

text: I would like to create 2 commands               \newcommand\deffeat[1]...     \newcommand\reffeat[1] ...      The `deffeat` command would print out as something like `\textbf{F001}`, and the `reffeat` command would reference the `deffeat` with the same feature name plus have the exact same text. My current experiment is using the following:               \newcounter{thefeatures}     \setcounter{thefeatures}{1}          \newcommand{\deffeat}[1]{         \phantomsection[a]         %XXX: \tag{F~\{cifeatures}}         \label{#1}         \textbf{F~\arabic{thefeatures}}         \addtocounter{thefeatures}{1}     }      It's still missing the spell the same text feature (currently I'm using `\ref`). _edit_ current state:               using cleveref          \newcounter{thefeatures}     \setcounter{thefeatures}{0}          \crefname{thefeatures}{feature}{features}          \newcommand{\deffeat}[1]{         \phantomsection         \refstepcounter{thefeatures}         \label{#1}         \textbf{F\arabic{thefeatures}}     }          \crefformat{thefeatures}{#2F#1#3}


title: hyperref Textfield inside the table cell

text: I have a table cell with an input field inside:               \documentclass{article}     \usepackage[pdftex]{hyperref}     \begin{document}     \begin{Form}       \begin{tabular}{|l|}          \hline          \TextField[name=textfield,width=3cm,height=0.2cm,value=default]{Text} \\          \hline       \end{tabular}     \end{Form}     \end{document}        1. How to create a padding between the table border and input border?   2. How to make the border of all the inputs black and thin? So I won't need to set the property bordercolor={0 0 0} for every input I create. ![enter image description here](http://i.stack.imgur.com/3D4Bk.png)


title: Is it possible to define a command taking an optional star and working in a subscript?

text: _Note_ : this is more or less a cross-post from my blog. I hope this is acceptable, especially that this is a genuine question! I’m currently writing a (longish) document on mathematics. Among other things, I write about the Hausdorff metric, which I denote by `$d_H$`. Since this notation appears quite often, I decided to write a command for it:               \newcommand{\dH}{{d_H}}      The additional braces are there, because sometimes I want to talk about a ball with respect to the Hausdorff metric, denoted by `$B_{d_H}$` – for that, I wanted to write `B_\dH`. Without the extra braces this won’t work (for obvious reasons). So far, so good. But there’s another catch: I want a similar notion to the Hausdorff metric (call it a Haudorff quasimetric), which I denote by `$d_H^*$`. With my definition, `\dH^*` won’t work (I want the star to be above the subscript). So I wanted to be clever, and use an optional star; this way, I could write `\dH` or `\dH*`. I did this:               \newcommand{\dH}{\@ifstar{d_H^*}{d_H}}      But my ability to write `B_\dH` is lost now! And of course, adding braces around `\@ifstar` won’t help: it will then never “see” the star. (Note: I know that `xparse` makes defining commands with optional stars easier, but I expect it won't help with my problem.) Personally, I can see no way out of this dilemma. It’s not a big deal, I can write `B_{\dH}` (which is cleaner LaTeX syntax anyway), but I’m curious whether there’s any way to eat this cake and have it, too.


title: How do I indent ALL lines of a paragraph so that it looks like a blockquote?

text: I understand that there is a `\quote` (correct me if I'm wrong) macro to do this; but I'm using this for something else (not prose). I also want it to obey the right margin. My minimal working example below requires me to guess the `\parbox` width, which is not a best practice. See the line with the `\newcommand{\myquote}...`               \documentclass{article}          \newcommand{\myquote}[1]{\vskip6pt\noindent\hangindent=5em\hangafter=0\parbox{4in}{#1}\vskip6pt}          \begin{document}          The quick brown fox jumps over the lazy dog.          \myquote{The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.          The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.}          The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.          $E=mc^2$ by Einstein          \end{document}


title: TikZ: non-linear tangent curve

text: I'd like to draw a tangent curve from point `(a)` to point `(b)`, intersecting point `(c)` (the center of the square). The curve should be stretched according to the gray lines (being a logarithmic scale). I've played around with `controls`, but I didn't get very far. Is there a better way than using `controls`? My code so far:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}[every node/.style = {draw, circle, fill=white, inner sep=.01cm}]          \draw (0, 1) -- (10, 1) -- (10, -1) -- (0, -1) -- cycle;     \node (a) at (0, -1) {a};   % south-west corner     \node (b) at (10, 1) {b};   % north-east corner     \node (c) at (5, 0) {c};    % center     \foreach \n in {1,...,50} \draw[gray, very thin]             ({10/pow(2, \n/12)}, 1)         --  ({10/pow(2, \n/12)}, -1);          \draw[cyan] (a) -- (b);          \end{tikzpicture}     \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/imdpo.png) What I want to achieve is the following (although the left half of the curve should decrease more rapidly): ![enter image description here](http://i.stack.imgur.com/p0545.png)


title: Opacity for pst-3dplot object

text: How can the opacity of a `pst-3dplot` object be set to be transparent? I have an example where using `opacity` or `strokeopacity` options do not work. I am trying to make an image similar to the following: ![sphere in oil](http://i.stack.imgur.com/RAVwH.jpg) With the hopes of showing more detail inside the sphere such as this: ![drawing](http://i.stack.imgur.com/dPYAs.jpg) However, I cannot get the top portion of the sphere to appear different than the bottom through the opaque surface, or get the sphere to be transparent to see the inner lines/tagging. Here is what I have tried (compiled with XeLatex+MakeIndex+BibTex in TeXWorks):               \documentclass{article}     \usepackage{pst-3dplot}     \usepackage{caption}     \usepackage{subcaption}     \usepackage[nomessages]{fp}% http://ctan.org/pkg/fp          \def \planeLocRatio {.7}     \def \radius {1}     \def \cylLength {5}     \def \planeLen {5}     \FPeval{\theta}{pi/4}     \FPeval{\b}{radius*cos(theta)}     \FPeval{\a}{radius*sin(theta)}     \FPeval{\h}{radius-radius*cos(theta)}               \begin{document}          \begin{figure}[H]         \begin{center}             \begin{subfigure}[b]{0.3\textwidth}                 \begin{pspicture}(-4,-2.25)(2,4.25)                     %\psset{Alpha=45, Beta=0}                     \pstThreeDCoor                     \pstThreeDLine[linewidth=2pt,linecolor=blue,arrows=->] (0,0,0)(0,0,\b)                     \pstThreeDLine[linewidth=2pt,linecolor=blue,arrows=->] (0,0,0)(0,\a,\b)                     \pstThreeDLine[linewidth=2pt,linecolor=green] (0,0,\b)(0,\a,\b)                     \pstThreeDLine[linewidth=2pt,linecolor=black] (0,\a,\b)(0,\radius,\radius)                     \pstThreeDSphere[strokeopacity=0.1](0,0,0){\radius}                     \pstThreeDSquare[fillcolor=blue,fillstyle=solid,opacity=0.9](-5,-5,\planeLocRatio)(0,10,0)(10,0,0)                     %\pstThreeDSquare[fillcolor=blue,fillstyle=solid,opacity=0.5](- \planeLen /2,- \planeLen /2,\planeLocRatio)(0,\planeLen,0)(\planeLen,0,0)                 \end{pspicture}                 \caption{Sphere model}             \end{subfigure}%             \begin{subfigure}[b]{0.3\textwidth}                 \begin{pspicture}(-4,-2.25)(2,4.25)                     \psCylinder[RotX=-15,RotY=45](0,0,0){\radius}{\cylLength}                            %\pstThreeDSquare[fillcolor=blue,fillstyle=solid,opacity=0.5](- \planeLen /2,- \planeLen /2,\planeLocRatio)(0,\planeLen,0)(\planeLen,0,0)                 \end{pspicture}             \caption{Cylinder Model}             \end{subfigure}         \caption{Sphere and cylinder particle models at the interface.}         \end{center}     \end{figure}     \end{document}      Which outputs this at the moment: ![output](http://i.stack.imgur.com/JWk3b.jpg) \-- **Update:** Herbert's answer was good and got many of the main points in for this figure, but I am looking to switch gears due to his answer pointing out that the package does not do hidden lines. Also, I would like to have the top surface in a different coloring than the bottom surface and a different color for the intersection area as well. So here is what I have at the moment, which now has different issues which I will be making other questions about or updating here for future interests in this problem.               \documentclass{article}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{pst-solides3d}     \usepackage{fp}          \pagestyle{empty}               \def \planeLocRatio {.7}            % ratio of z location of plane and radius     \def \radius {0.5}     \def \planeLen {1}              % half of one side of the plane     \FPeval{\contAng}{pi/4}         % angle from z axis to intersection of plane at sphere edge     \FPeval{\a}{radius*cos(contAng)}    % z location at plane intersection     \FPeval{\a2}{a/2}     \FPeval{\b}{radius*sin(contAng)}    % radius of circle at plane intersection     \FPeval{\b2}{b/2}     \FPeval{\h}{radius-radius*cos(contAng)} % z distance from top of sphere to plane     \FPeval{\h2}{h/2}     \FPeval{\imgsize}{planeLen+1}  % maybe increasing this helps /hbox errors?          \begin{document}     \begin{center}         \begin{pspicture}[solidmemory](-\imgsize,-\imgsize)(\imgsize,\imgsize)                  % ==================  VIEW ===================             \psset{                 viewpoint=10 45 20 rtp2xyz,                 lightsrc=viewpoint,                 %lightintensity=1.25                 }                       % ================== POINTS ==================             % origin             \psSolid[object=point,args=0 0 0, name=O, text=O, pos=br]             \psSolid[object=point,args=0 0 \a, name=A, text=A, pos=uc]          %%%%%%% Causes hbox problems             %\psSolid[object=point,args=0 \b \a, name=B, text=B, pos=uc]                  % ================== LINES ==================                  % origin to center of circle at plane intersection             \psSolid[object=line,linecolor=black!50,linewidth=2pt,args=O A, name=OA]             % label the equation to the side of the line midway through the line             %\psProjection[object=point,definition=milieu,args=O A,text=$Rcos \theta$,pos=uc]                  % line from origin to side of sphere intersected with plane             %\psSolid[object=line,linecolor=black!50,linewidth=2pt,args=O B, name=OB]             %\psProjection[object=point,definition=milieu,args=O B,text=$Rsin \theta$,pos=uc]                  % line from A to B             %\psSolid[object=line,linecolor=black!50,linewidth=2pt,args=A B, name=AB]                            % ================== SPHERE ==================             \psSolid[                 object=sphere,                 name=mySphere,                 r=\radius,                 ngrid=30 30,            % number of grid lines across 2 dimensions r                 grid=false,         % remove line edges                 hue=0 0.5,                 opacity=0.4,                 hollow=true,                 intersectiontype=0,                 intersectionplan=0 0 1 \a,                 intersectioncolor=(bleu)                 ](0,0,0)                  % ================== PLANE ==================             \psSolid[                 object=plan,                 name=myPlane,                 definition=solidface,                 args=mySphere 1,                 base=-1 1 -1 1,                 action=draw,                 ](A,,)              \end{pspicture}     \end{center}     \end{document}      which at the moment outputs: ![img](http://i.stack.imgur.com/rhDHl.jpg)


title: incomplete horizontal line with many columns

text: I'm trying to to create a table with many columns, but the horizontal line shows up as incomplete. I also want to have the column width adapt to the content if possible, but I've just been able to adjust it to the width that I want. Any help would be greatly appreciated!               \documentclass{article}               \begin{document}     \SweaveOpts{concordance=TRUE}          \begin{table}[hbtp]     \footnotesize\setlength{\tabcolsep}{2.5pt}     \begin{tabular*}{0.75\textwidth}{| l l c c c c c c c c c c |}     \hline       Regular name & Second name & Code & $p$ & $fp$ & $\fpg$ & $N$ & $p$ & $s$ & $N$ & $\Delta N$\\      \hline     \textit {A} &  A &  A & 0.025 & 0.2  & 0.68& 104 & 0.2  & 0.7 & 108 & 4\\      \textit {B} &  B &  B &     0.01 &  0.09 &  0.29 &  44 &    0.09 &  0.35 &  53 &    9\\     \textit {C} &   C & C &     0.02 &  0.05 &  0.105    & 15 &     0.05 &  0.17 &  25 &    10\\     \textit {D} &   D & D & 0.018 & 0.25 &  0.72 &  109 &   0.25 &  0.74 &  112 &   3\\     \textit {E} &   E & E & 0.023 & 0.6 &   0.99 &  152 &   0.6 &   0.99 &  152 &   0\\     \textit {F} &   F & F & 0.11 &  0.04 &  0.06 &  9 & 0.04 &  0.1 &   14 &    5\\     \textit {G} &   G & G & 0.01 &  0.43 &  0.76 &  116 &   0.43 &  0.77 &  118 &   2\\     \textit {H} &   H & H & 0.01 &  0.54 &  0.98 &  150 &   0.54 &  0.98 &  150 &   0\\     \textit {I} &   I & I & 0.19 &  0.1 &   0.26 &  39 &    0.1 &   0.36 &  55 &    16\\     \textit {J} &   J    & J & 0.023 & 0.23 &   0.73 &  112 &   0.23 &  0.79 &  120 & 8\\      \hline      \end{tabular*}     \caption{title}     \label{tab:tab1}     \end{table}     %          \end{document}


title: How to Make Theorems and Equations Share Numbering

text: How do I make theorems and equations share numbering? The default numbering system goes like this: > Theorem 1. Blah blah blah... > > 1=0+1 (1) > > Theorem 2. More blahs... > > Theorem 3. No more blahs... > > 2=1+1 (2) The numbers in the parenthesis are equation numbers. How do you change the above into this: > Theorem 1. Blah blah blah... > > 1=0+1 (2) > > Theorem 3. More blahs... > > Theorem 4. No more blahs... > > 2=1+1 (5) I am using ntheorem package, but couldn't figure out how. Would I need to use a different package?


title: Resulting document size when Including a graphics file multiple times - pgf vs. graphicx

text: In his answer to the question Tikz: using external images as building blocks. Stefan Kottwitz says: > The pgf way may be preferred if the document size matters and graphics are > multiply used or if masking is desired. When is there a problem regarding large document size caused be multiple inclusions of the same image? With a random photo in jpg-format I get the results below using the following test-files:               \documentclass{article}     \usepackage{graphicx}     \pagestyle{empty}     \begin{document}          \newcount\n     \n=0     \loop\ifnum\n<100 \advance\n by1     \includegraphics[width=5cm]{IMG_1823.JPG}     \newpage     \repeat          \end{document}      and               \documentclass{article}     \usepackage{pgf}     \pgfdeclareimage[width=5cm]{test}{IMG_1823.JPG}     \pagestyle{empty}     \begin{document}          \newcount\n     \n=0     \loop\ifnum\n<100 \advance\n by1     \pgfuseimage{test}     \newpage     \repeat          \end{document}      Compiling with pdfTeX-1.40.10 the resulting document sizes are (output from pdfinfo):               pgf-version:      File size:      1673589 bytes          Graphicx-version:     File size:      1667806 bytes      The photo is about 1.6 Mb:               $ du IMG_1823.JPG      1592    IMG_1823.JPG      Adding `\pdfcompresslevel=0` and inspecting the contents of the pdf-file directly both methods seem (as far as I can tell) to embed the image data once only?


title: How to use \bigtimes without pain

text: I've been fighting with `mathabx` lately and it's not really worth my time, so I tried switching to `MnSymbol` which also modifies some of my regular symbols. Is the best solution just to make my own operator of times that's larger than normal and what's the best way to do this? Or is there a library that adds the various variable sized symbols not covered in the `amsmath` packages.


title: LaTeX for the Lao language

text: > **Possible Duplicate:**   >  Tajik language in LaTeX With a friend, I would like to develop LaTeX in Lao (a language that is close to Thai). There is already a thaitex Babel set so I guess it should not be that difficult. But I am a total novice in developing languages for LaTeX, so I don't even know at which kind of files I should look. Can someone give me some clues?


title: Attempt to export EPS figures from TikZ fails

text: I'm attempting to output EPS figures when using MikTeX 2.8 under Windows XP, and am following Export eps figures from TikZ. My problem is that I can't get the bare example given there to run. The code I'm using was copied from that thread verbatim:               \documentclass{article}     \usepackage{tikz}          % set up externalization     \usetikzlibrary{external}     \tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error     -interaction=batchmode -jobname "\image" "\texsource" &&      dvips -o "\image".ps "\image".dvi}}     \tikzexternalize[shell escape=-enable-write18] % MikTeX uses a -enable-write18 instead of --shell-escape.          \begin{document}     \begin{tikzpicture}     \draw (0,0) circle (1cm);     \end{tikzpicture}     \end{document}      When running I get the following error message:               This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8)     entering extended mode     (C:/junk/untitled-2.tex     LaTeX2e <2009/09/24>     . . .     [Loading MPS to PDF converter (version 2006.09.02).]     )     ===== 'mode=convert with system call': Invoking 'latex -halt-on-error -interaction=batchmode -jobname "untitled-2-figure0" "\def\tikzexternalrealjob{untitled-2}\input{untitled-2}" && dvips -o "untitled-2-figure0".ps "untitled-2-figure0".dvi' ========          ! Package tikz Error: Sorry, the system call 'latex -halt-on-error -interaction=batchmode -jobname "untitled-2-figure0" "\def\tikzexternalrealjob{untitled-2}\input{untitled-2}" && dvips -o "untitled-2-figure0".ps "untitled-2-figure0".dvi' did NOT result in a usable output file 'untitled-2-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'untitled-2-figure0.log'. If you continue now, I'll try to typeset the picture.     See the tikz package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.14 \end{tikzpicture}              ?           Can someone help me over this hurdle? * * * My previous post was written on my Windows XP system using Chrome, where the answer box limited me to about 600 characters and did not accept markup or newlines :-(. I'm writing this on my Windows 7 system with Chrome, and the answer box has all markup bells and whistles I need -- very strange. Following is the compilation output:               This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) entering extended mode ("C:/Documents and Settings/Moshe/My Documents/test.tex" LaTeX2e <2009/09/24> . . .          ===== 'mode=convert with system call': Invoking 'latex -enable-write18 -halt-on     -error -interaction=batchmode -jobname "test-figure0" "\def\tikzexternalrealjob {test}\input{test}" && dvips -o "test-figure0".ps "test-figure0".dvi' ========          ! Package tikz Error: Sorry, the system call 'latex -enable-write18 -halt-on-er ror -interaction=batchmode -jobname "test-figure0" "\def\tikzexternalrealjob{te st}\input{test}" && dvips -o "test-figure0".ps "test-figure0".dvi' did NOT resu lt in a usable output file 'test-figure0' (expected one of .pdf:.jpg:.jpeg:.png :). Please verify that you have enabled system calls. For pdflatex, this is 'pd flatex -shell-escape'. Sometimes it is also named 'write 18' or something like  that. Or maybe the command simply failed? Error messages can be found in 'test- figure0.log'. If you continue now, I'll try to typeset the picture.          See the tikz package documentation for explanation. Type  H <return>  for immediate help.  ...                                                    l.14 \end{tikzpicture} I hope this is easier to read than my previous post :-)


title: Correct way to cite the page number (only) at the end of the citation

text: It seems it is NOT correct to include the page number before the citation: > According to Ferris [2007, p. 166-167]: "To get an accurate indicator of > commercial viability, don't ask people if they would buy—ask them to buy" (Code: `\cite[p.~166-167]{Ferris2007}`) It seems we must include the page number at the end of the citation: > According to Ferris [2007]: "To get an accurate indicator of commercial > viability, don't ask people if they would buy—ask them to buy" [p. 166-167]. How could I do it? I'm using:               \RequirePackage{natbib}     \bibliographystyle{plainnat}       * * * Note: It is correct to use the same code to add that reference at the end: > (...) ask them to buy" [2007, p. 166-167]


title: Can we easily find all the commands, tokens, whatevers defined by a package?

text: This is the reverse question of How to find out where a macro is defined? (and Where do I find out how a command/environment is defined? and How to find a package name by a command name?) and is inspired by the fact that the resolution of Error with cleveref + enumerate + tikz-qtree turned out to be a name clash between two packages. I can see the use of a script that would take a package (for _some_ variant of TeX) and produce a list of all the stuff it defines, with the idea that comparing two of these would help in the hunt for namespace collisions. **First Question:** Does such a script exist? If the answer to that is "No", then it shouldn't be too hard to write such a script; the key is to figure out where things are defined. **Second Question:** What are the **main** ways in which assignments are made? (Note that this could easily be specific to flavour of TeX used.) The word "main" is there because the purpose of such a script is not to be a _necessary and sufficient_ test but a quick test to eliminate obvious possibilities. In particular, a package author who does something like `\let\mydef\def \mydef\something{else}` is probably knowledgeable enough that they are aware of the potential for namespace collisions and know how to avoid them. But `\expandafter\def\csname s()mewe1rd c()mm@nd\endcsname` should probably be allowed for.


title: A simple way of accommodating multiple bibliographies

text: I'd like to accommodate several bibliographies in a document. I am aware of packages like `multibib`, `multibbl` and `bibtopic` to achieve this, but I'd prefer a simple quick-and-dirty solution for a specific purpose. I have a main bibliography which I build with `bibtex`. In addition, in another part of the document I want to put an extra little bibliography. The following MWE tells you what I want to achieve:               \documentclass[a4paper]{report}           \begin{document}          \section{Further Reading}          \subsection*{Journal Papers}          \begin{thebibliography}{9}     \bibitem[Art1]{art1}    J. Doe, ``Fancy title'', {\em {IEEE} Transactions on Signal Processing}, 2010     \bibitem[Art2]{art2}    J. Williams, ``Another title'', {\em {IEEE} Transactions on Magnetics}, 2011     \end{thebibliography}          \subsection*{Conference Papers}          \begin{thebibliography}{9}     \bibitem[Art3]{art3}    A. Clifford, ``Yet another one'', {\em {IEEE} Transactions on Automatic Control}, 2013     \bibitem[Art4]{art4}    B. Jefferson, ``Last one'', {\em {IEEE} Transactions on Information Systems}, 2008     \end{thebibliography}          \end{document}      The problem is that my thesis template (in the above example, I have chosen the `report` documentclass as an equivalent) has its own way of putting bibliographies on different pages. How can I override this behavior locally and avoid a page break?


title: Why use \spaceskip and \xspaceskip here?

text: Plain TeX provides `\centerline` for centering, well, lines of text, but nothing to center a paragraph. LaTeX has `\centering` and the `\center` environment. Looking at the LaTeX code, it appears very similar to what Bechtolsheim proffers in "TeX in Practice":               \rightskip = 1in plus 4em     \leftskip = \rightskip     \spaceskip = .3333em     \xspaceskip = .5em     \parfillskip = 0pt     \noindent     On the other hand there are sometimes cases where you want to have a     sequence of lines, all centered, but you do not want to make the line     breaking decisions all by yourself. So here is a sample where \TeX{}     did all the work.          \bye      Bechtolsheim also gives a begin/end environment-like example using this code. A previous stackexchange question has similar code: A center environment for plain TeX My question is why does Bechtolsheim recommend the use of `\spaceskip` and `\xspaceskip` and how did he come up with those numbers? Why do LaTeX (I believe) and the solution @egreg provides in the previous question eschew them? Admittedly I don't fully understand `\(x)spaceskip` so an explanation of them would be helpful. p.s. I know the TUGboat and Amazon reviews of Bechtolsheim work (TeX in Practice) were only somewhat favorable, but I think the books are awesome. Yes, there are typographical and editing errors, but the content is great and I am finding the verbose examples extremely helpful and valuable. I would definitely encourage anyone who wants to learn the finer details of TeX to check them out. However, one should do at least a first reading of Knuth's "The TeX Book" first (dangerous bends being initially avoided), because Bechtolsheim does make some assumptions that the reader has a basic familiarity with TeX. UPDATE: Great answer and comments. I think the ragged2e latex package documentation explains the issue quite well and points out that the Plain TeX version of ragged is in some ways superior to default LaTeX and attempts to fix it as well as the centering and raggedleft environments by essentially setting the fontdim2 value of a font (if available) to `\spaceskip` which provides optimal spacing while preserving the ability to hyphenate which is unfortunately lost when `fil` is used. I think a good Plain TeX implementation of centering, then should do something similar. It is also somewhat interesting that Schröder's package uses `2em` instead of Bechtolsheim's `4em` in the left/right skip registers.


title: Redefining the citation macro temporarily.

text: I'm new to latex, but it seems you can temporarily redefine some commands? The problem I have is that normally the citation is (SMITH, 2000). But at times, I'd like to have Smith (2000) instead. Anyway I can temporarily redefine it, then use the standard version again after that "block" of code?


title: Custom radical sign with plain XeTeX

text: I would like to use Cambria Math font in mathematical equation, and I have a simple problem here. plain TeX uses many symbols for the root sign, so it can use the proper one depending on context, however the Unicode have only one (or maybe two) that is capable to replace big roots:   If the 3. family is set to Cambria Math, the line `\def\sqrt{\XeTeXradical 3 `\⎷}` does not produces the root sign at the proper place for example `$\sqrt{a\over b}$`.   How can I do this properly?


title: Is it possible to compile a *TeX document with a single command?

text: Let's say I have a document that uses cross-references and also bibtex/biblatex to manage the bibliography. Currently I need to run `pdflatex + bibtex/biber + pdflatex` to generate the final document. It gets kinda boring to do that; is it possible to only need one invocation? Perhaps with the scripting capabilities of LuaTeX? Unlike this question, I'm not interested in abstraction layers, only in making it happen within *TeX itself. EDIT: What about the \write18 command? I know that it is possible to it use to at least avoid one call to `bibtex`. EDIT2: Two people asked me why I don't want an abstraction layer. 1 - Should you need one? It is the most basic functionality of *TeX. It is bloody archaic to have to manage yourself the details of the compilation process. I want to make *TeX better; in this case it means easier to use. 2 - Abstraction layers add complexity and reduce flexibility. You have to worry about its bugs as well (I've been bitten by unreliable error reporting). And what if you want to compile with LuaTeX instead of pdfTeX? Or use biber instead of BibTeX?


title: Drawing a scattering Feynman diagram with TikZ

text: I am trying to produce a scattering diagram with TikZ but I have become stuck. **The Desired Structure** ![enter image description here](http://i.stack.imgur.com/Sct0R.jpg) I am trying to achieve this layout of lines, including their arrow directions. In my diagram. **Minimum Working Example**               \documentclass[11pt]{article}     \usepackage[latin1]{inputenc}     \usepackage{tikz}     \usetikzlibrary{trees}     \usetikzlibrary{decorations.pathmorphing}     \usetikzlibrary{decorations.markings}          \begin{document}          \tikzset{     photon/.style={decorate, decoration={snake}, draw=red},     particle/.style={draw=blue, postaction={decorate},         decoration={markings,mark=at position .5 with {\arrow[draw=blue]{>}}}},     antiparticle/.style={draw=blue, postaction={decorate},         decoration={markings,mark=at position .5 with {\arrow[draw=blue]{<}}}},     gluon/.style={decorate, draw=black,         decoration={coil,amplitude=4pt, segment length=5pt}}      }          \begin{tikzpicture}[         thick,         % Set the overall layout of the tree         level/.style={level distance=1.5cm},         level 2/.style={sibling distance=3.5cm},     ]     \coordinate         child[grow=down]{             edge from parent [antiparticle]             child {             node{$E$}             edge from parent [particle]             }             child {              node{$D$}              edge from parent [gluon]             }             node [above=3pt] {$C$}          }         % I have to insert a dummy child to get the tree to grow         % correctly to the right.         child[grow=right, level distance=0pt] {             child {             node{$A$}             edge from parent [gluon]             }             child {              node{$B$}             edge from parent [particle]                            }         };     \end{tikzpicture}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/i0mBS.jpg) So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled `$A$` should be 'reflected' from where it is by 180 degrees. **Edit** Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is _very_ close to what I wanted:               \begin{document}     \tikzset{     particle/.style={thick,draw=blue, postaction={decorate},         decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},     gluon/.style={decorate, draw=black,         decoration={coil,aspect=0}}      }     \tikzset{     particle/.style={thin,draw=blue, postaction={decorate},     decoration={markings,mark=at position .5 with {\arrow[blue]{stealth}}}},     gluon/.style={decorate, draw=black, decoration={snake=coil}}     }          \begin{tikzpicture}[node distance=1cm and 1.5cm]     \coordinate[label=left:$G$] (e1);     \coordinate[below right=of e1] (aux1);     \coordinate[above right=of aux1,label=right:$N$] (e2);     \coordinate[below=1.25cm of aux1] (aux2);     \coordinate[below left=of aux2,label=left:$N$] (e3);     \coordinate[below right=of aux2,label=right:$G$] (e4);          \draw[gluon] (e1) -- (aux1);     \draw[particle] (aux1) -- (e2);     \draw[particle] (e3) -- (aux2);     \draw[gluon] (aux2) -- (e4);     \draw[particle] (aux2) -- node[label=right:$N$] {} (aux1);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/zdEpp.png) I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.


title: Error when using luaotfload-tool

text: i am trying to install Myriad Pro at my Ubuntu PC to use it with Lualatex and fontspec. The font is correctly installed and can be used in LibreOffice.               fc-list | grep -i myriad     ->         Myriad Pro:style=Italic         Myriad Pro:style=Bold         Myriad Pro:style=Bold Italic         Myriad Pro:style=Regular      When I'm trying to compile a .tex document with               \usepackage{fontspec}     \setmainfont{Myriad Pro}      there is an error:               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ! fontspec error: "font-not-found"     !      ! The font "MyriadPro" cannot be found.     !      ! See the fontspec documentation for further information.     !      ! For immediate help type H <return>.     !...............................................            l.57 \setmainfont{Myriad Pro}      I the tried to use luaotfload-tool and this error appears:               /usr/local/texlive/2014/bin/x86_64-linux/luaotfload-tool:538: '=' expected near 'found'      Same when running mkluatexfontdb. What can i do now ?


title: Pgfplots: How to fill area under a curve in a 3d plot similar to \closedcycle in 2d

text: How can I fill the area under a curve in a 3d plot, similar to the `\closedcycle` command in ordinary 2d plots? Applying this command does a filling which is not rotated. Minimal working example:               \documentclass{article}      \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}       \begin{tikzpicture}          \begin{axis}[         xmin=0,xmax=3,         zmin=0,zmax=2         ]             \addplot3[red,domain=0:1,fill=blue,opacity=0.5,samples y=0] (2,x,x^2) \closedcycle ;          \end{axis}       \end{tikzpicture}     \end{document}      In 2D it looks like this               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}       \begin{tikzpicture}       \begin{axis}[domain=0:1         ]             \addplot[red,domain=0:1,fill=blue,opacity=0.5,samples y=0] {x^2} \closedcycle ;       \end{axis}       \end{tikzpicture}     \end{document}      How can I easily apply this to a 3D plot?


title: Caption below the figure and aligned with left side of figure

text: How do I get my caption below the figure and at the same time aligned with left side of my figure?


title: Overlapping Chinese characters using xeLatex kaiu TrueType Font - Windows

text: I am quite new to using xeCJK and xelatex in general, so please bear with me. I tried the following code: > Code:               \documentclass{article}          \usepackage{graphicx} % for \rotatebox          \usepackage{xeCJK}     \newfontlanguage{Chinese}{CHN}     \setCJKmainfont{kaiu.ttf}     \setCJKfamilyfont{songvert}     [Script=CJK,Language=Chinese, Vertical=RotatedGlyphs]{kaiu.ttf}          \newcommand*\CJKmovesymbol[1]{\raise0.35em\hbox{#1}}     \newcommand*\CJKmove{\punctstyle{plain}% do not modify the spacing between punctuations     \let\CJKsymbol\CJKmovesymbol     \let\CJKpunctsymbol\CJKsymbol}               \begin{document}          屈原《离骚》曰：     \begin{center}     \rotatebox{-90}{     \begin{minipage}{5em}     \CJKfamily{songvert}\CJKmove         你是\\         好     \end{minipage}}     \end{center}          这裡羲和便等于一名馬车夫，因为     他是御日的，诗人生怕太阳赶快落了，就叫羲和慢一点走。　不过话经我     一翻译，显得淘气一点，原文只是一个高贵的身分，另外不表现着什么个性了。          \end{document}      > And got the following results: ![enter image description here](http://i.stack.imgur.com/ZgPml.png) As you can see, the 「好」 is fine, but that first line is messed up (overlapping). This only happened when I used kaiu.ttf, if I were to change it to SimSun, it would be fine. I need to use kaiu.ttf (標楷體), not SimSun Thanks in advanced!


title: Hebrew spellchecking does not work in LyX

text: Hi I've scoured the internet for a solution for my spellchecker problem but with no luck. The problem is that when I write misspelled Hebrew text nothing happens I did follow the guide at their website which explains tow to setup Hebrew in whole and the spellchecker but it just doesn't work. First I'd get the following error                   spell checker has no dictionaries      But then this error disappeared and now when I press F7 it just claims to have reached the end of the document in spite of the document being full of gibberish. I've checked and the relevant files are present (he_IL.aff , he_IL.dic). I've all so added my LyX directory structure to pastebin as well as my languages file content. I've tried:   * Changing the ducument encoding   * Tried to write "Hebrew" and "hebrew" in the spellchecker menu.   * Reinstall the whole thing (voodoo solution do work occasionally).  This is a source of a file containing just 2 words which are both gibberish:                   % Preview source code              %% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.         %% Do not edit unless you really know what you are doing.         \documentclass[english,hebrew]{article}         \usepackage[T1]{fontenc}         \usepackage[latin9,cp1255]{inputenc}         \usepackage{float}              \makeatletter         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.         \usepackage{theorem}         \theorembodyfont{\upshape}         \newtheorem{theorem}{\R{????}}[section]         \AtBeginDocument{\make@lr\thetheorem}              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.         \usepackage{fullpage}              \makeatother              \usepackage{babel}         \begin{document}         טעטעעטעטע שדגשדג         \end{document}      If you need any other information I'd be glad to provide it. **Edit 1:** I'm using LyX 2.0.5.1 with Hunspell.


title: (Framed) Boxes are too long / Textwidth doesn't work

text: I want to create a box/frame (in math mode) with its content centered horizontally and vertically such that I can adjust the height of the box and such the width of the box automatically (!) is the width of the context. The following MWE does almost what I want:               \documentclass[12pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \begin{document}          $\fbox{\parbox[c][4pt][c]{\textwidth}{a first try}}$          $\framebox[\width]{\parbox[c][2pt][c]{\textwidth}{another one}}$          \end{document}      The problems are the following:   * both of the boxes aren't as long as their contents, i.e. as long as "a first try" resp. "another one", so `\textwidth`doesn't seem to work very well. Of course I could manually try to adjust the width to the right size, but I'm going to create boxes very often so fiddling with the width every time to get it right is unfeasible.   * the vertical centering doesn't work very well since in both boxes the text is moved to the top I'm open to different approaches to this, as long as they do what I want, like defining new commands - for example with tikz - that do what I want, as long as I don't have to type very much for using them, since as I said, I will need to create a lot of boxes.   Btw., using to box commands to almost achieving this _is_ a lot of typing - I would be happy if only one command would suffice. **EDIT** The height of the box usually is like this: ![enter image description here](http://i.stack.imgur.com/OUuYK.png) whereas I would like it to be like this: ![enter image description here](http://i.stack.imgur.com/SlLhb.png), i.e. the box should just barely cover it's contents vertically. Decrease the height parameter in \fbox does nothing after a certain point (the first box was created with height of 8pt and decreasing it didn't do anything; to get the second picture I edited the first in some editing program)


title: Making an unfilled circle including a number in a table

text: I wonder is it possible to highlight a number enclosing with an unfilled circle next to a line in a listing or table like the image below?               \documentclass[english,a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{listings}     \usepackage{changepage}          \begin{document}          \clearpage     \begin{table}[ht]     \begin{adjustwidth}{-3.7cm}{}     \begin{tabular}{|p{.6\textwidth}|p{.75\textwidth}|}     \hline     {\begin{lstlisting}[basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,language={Java},     numbersep=18pt,numbers=left,xleftmargin=1.2cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords={class,run}]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     &     {\begin{lstlisting}[     basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,     language={Java},     numbersep=16pt,     numbers=left,     xleftmargin=1cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords ={class,run}     ]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     \\     \hline     \end{tabular}     \end{adjustwidth}     \caption{\label{fig:text}text experiment ent experiment experiment}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/YnPZD.gif)


title: TeXworks: Compile only current document with \includeonly

text: I have a large document with multiple parts: `main.tex`:               \documentclass{article}     \begin{document}     \include{part1}     \end{document}      `part1.tex`:               % !TEX root = main.tex     Hello World!      This way, I can compile the PDF with `part1.tex` open, and I can compile just one part (`\includeonly{part1}`). Is there a way to compile only the current document, i.e., insert `\includeonly{currently opened file}` before compiling? My first idea was to use LuaTeX to insert an `includeonly` depending on command line arguments (using the Lua variable `arg`), but then I still didn't find a way to append the command line parameter.


title: How can I change graphics with timeout in a beamer?

text: Is there a way to include several graphics on the same place on the frame, but at different times? Personally, I would like to roll 3-4 pictures repeatedly changing on every, say, 10 seconds. All of them staying on the same place on the frame. I know how to do this with the command \only, but that would require a user to change to "next frame" in order to display next picture.


title: Adding additional blank lines in Minted

text: I currently have two minted environments in each their minipage environment, so that they can be situated next to each other:               \begin{figure}[!h]     \centering     \begin{minipage}{0.45\linewidth}          \begin{python}       from pycsp_import import *            @process       def producer(cout):         for i in [1,2,3,4,5]:           cout(i)         retire(cout)            @process       def worker(cin):         while True:           print cin()            c = Channel()            Parallel(         producer(-c),         worker(+c)       )     \end{python}          \end{minipage}     \qquad     \begin{minipage}{0.45\linewidth}          \begin{python}       1       2       3       4       Exception                                                                        .     \end{python}          \end{minipage}     \end{figure}      Is there a way to get rid of the need of the `.`. Can I somehow tell minted that there should be 19 lines, so that the two python environments are the same height?


title: Numbered two-column table in apa6 in a portrait page

text: I'm writing a paper using apa6 class and I'd like to have a table as wide as two columns in portrait mode. But I also want this table to be numerated. I've found this in the apa6 manual: "When an image or table is too wide for a single column, use a double-column float, noted with an asterisk after the float environment designation (see the LaTeX book)" So I did this:               \documentclass[jou,draftfirst,floatsintext]{apa6}       \begin{document}         \begin{table*}         \begin{tabular}{|c|c|c|c|c|}         \hline         Blah & Blah Blah & Blah   & Blah & Blah\\         \hline         Blah & Some more text and more Blah Blah  & Blah  & Blah & Blah\\          Blah & Blah Blah BlahBlahBlahBlah  & Blah  & Blah & Blah\\          \hline          \end{tabular}            \vspace*{2em}          \begin{tablenotes}[para,flushleft]          {\small          \textit{Note.}Some notes.          }          \end{tablenotes}         \end{table*}     \end{document}      But then my table doesn't have "Table number" on its top. Any ideas?


title: Suppress page headers in one chapter

text: In a `memoir` document, how can I suppress the page headers for every page in one particular chapter? However, I don't want want to use `\pagestyle{empty}` as recommended this answer, since I want the pages in that chapter to be formatted exactly like the other pages in the document (including having a footer, etc.)--just without the header. Here is my current document:               \documentclass{memoir}          \usepackage{etoolbox}     \usepackage{lipsum}          % Headers and Footers          \nouppercaseheads          \makepagestyle{mystyle}      \setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}     \makerunningwidth{mystyle}{\headwidth}          \makeevenhead{mystyle}{\itshape\leftmark}{}{}     \makeoddhead{mystyle}{}{}{\itshape\leftmark}     \makeevenfoot{mystyle}{\thepage}{}{}     \makeoddfoot{mystyle}{}{}{\thepage}     \makepsmarks{mystyle}{\createmark{chapter}{left}{}{}{}}          \makeatletter     \makepsmarks{mystyle}{\createmark{chapter}{left}{shownumber}{\@chapapp\ }{:\ }}     \makeatother          \makepagestyle{plain}     \makerunningwidth{plain}{\headwidth}     \makeevenfoot{plain}{\thepage}{}{}     \makeoddfoot{plain}{}{}{\thepage}          \pagestyle{mystyle}          \makeatletter     \aliaspagestyle{title}{empty} % suppress the page number after \maketitle     \let\origps@chapter\ps@chapter     \preto\frontmatter{\let\ps@chapter\ps@empty\pagestyle{empty}}     \preto\mainmatter{%       \cleardoublepage       \let\ps@chapter\origps@chapter\pagestyle{mystyle}}     \makeatother          \begin{document}          \chapter{First Chapter}          \lipsum[1-10]          \chapter{Second Chapter}          I want to suppress the header for every page in this chapter.          \lipsum[1-10]          \end{document}


title: Reducing space before chapter works with english but not with hungarian babel package

text: I write my thesis recently and I want to reduce the spaces before chapters. I find the solution, but it isn't working for me with `\usepackage[magyar]{babel}` I use the following codes:               \documentclass[a4paper,12pt]{report}          % Switch between these babel languages to see the difference     \usepackage[magyar]{babel}     %\usepackage[english]{babel}          \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage[margin=2.5cm]{geometry}          \usepackage{showframe,lipsum}     \usepackage{etoolbox}          \makeatletter     \patchcmd{\@makechapterhead}{\vspace*{50\p@}}{}{}{}     \patchcmd{\@makeschapterhead}{\vspace*{50\p@}}{}{}{}     \makeatother          \title{Reducing space before chapter}          \begin{document}          \chapter{Lorem ipsum}          \lipsum[1]          \chapter*{Lorem ipsum}          \lipsum[1]          \end{document}      Can you help me?


title: Center align 2 column tables between columns

text: I currently have a table which has 2 columns: the left one is right-justified and the right one is left-justified. I'd like to center the table relative to between the two columns: that is, have the divider between the 2 columns in the center of the page. How would I do this?


title: Undefined control sequence by reference LYX, MikTex

text: For each reference I put in to the document, I get the following error message. What should I do?               Undefined control sequence          Document Class: scrreprt 2013/12/19 v3.12 KOMA-Script document class (report)              \usepackage{color}         \usepackage{fancyhdr}         \pagestyle{fancy}         \fancyhead[R]{\nouppercase{\leftmark}}         \lhead{}         \chead{}         \cfoot{\thepage}           ! Undefined control sequence.         <argument> ...hr mit den H�nden ber�hren.``\citet                                                            {DMS Aplizieren}         l.1333 ...�nden ber�hren.``\citet{DMS Aplizieren}}              The control sequence at the end of the top line         of your error message was never \def'ed. If you have         misspelled it (e.g., `\hobx'), type `I' and the correct         spelling (e.g., `I\hbox'). Otherwise just continue,         and I'll forget about whatever was undefined.


title: Make all pages odd

text: I have a `memoir` document, with custom settings for margins, headers and footers, etc. I just found out it is being printed single-sided instead of double-sided, and I was wondering if there is a simple command to treat all pages as odd pages. How can I tell `memoir` to format the even pages exactly as it would the odd pages?


title: Should running-text numbers be typeset with math mode?

text: Should I typeset numbers in a running text with math mode?               I read $4795$ pages.          I read 4705 pages.      I tried it out with the default font, and there does seem to be tiny differences in kerning. That could just be my imagination, though.


title: Have some figures show up in two listofs: list of figures and list of special figures

text: I have a number of figures in my dissertation. Out of those figures, there are some that I want to be included simultaneously in _two_ listof's: the standard "List of Figures" and a non-standard "List of Study Systems." For example, I have the following figure that is a study system. Therefore, it should be in the List of Figures and also in the List of Study Systems. Note different captions in two lists. ![figure](http://i.stack.imgur.com/SSss7.png) I want it to appear in the standard List of Figures, as shown below: ![Lof](http://i.stack.imgur.com/Uz2ey.png) and at the same time appear in a custom List of Study Systems, as shown below: ![LoSS](http://i.stack.imgur.com/lQaXA.png)


title: ClassicThesis: override options of a previously loaded classicthesis package

text: I have recently upgraded from Ubuntu 11.04 to Ubuntu 11.10. I also installed "vanilla" TexLive 2011 (instead of the old TexLive 2009 from the repositories) and upgraded it with `sudo tlmgr update --self -all` so all the packages are in the latest version. I currently need TexLive to write my PhD thesis and I use `classicthessis` package to do it. In the new version of the `classicthesis`, v.3.0 that comes with TexLive 2011 the package is used by issuing just               \usepackage {classicthesis-preamble}      which is loaded as the first package in the preamble and then it sets everything and loads the `classicthesis` package (it is in the last line). My question now is: **Is there a way to pass options to the`classicthesis` package and/or how can I disable some of the default options that `classicthesis-preamble` passes to the `classicthesis` package - FROM MY PREAMBLE (i.e. without altering the installed classicthesis files or creating their copies in my document folder and altering those?** For example, classicthesis-preamble passes `drafting` option to the `classicthesis`               \PassOptionsToPackage{....,drafting,...}{classicthesis}      and I want to compile the my document without that option - but would prefer to do it from the preamble of my own document. I tried reloading the `classicthesis` after `classisthesis-preamble` with my own set of options, expecting some error because `classicthesis` would be already called from the `classicthesis-preamble`:               \usepackage{classicthesis-preamble}     \usepackage[<some,option,set,that,does,not,contain,"drafting">]{classicthesis}      but there was no error, but no change in the options either. I tried using `\PassOptionsToPackage` but it can just _add additional options_ to the existing ones. I tried googling for similar command that can _replace_ instead of _add_ options, but did not find one.


title: Table/tabular problem: vertical centering of long text + increase the row height

text: I already checked this post in this site: Vertical centering of text within a table What I am asking is quite similar to that question:   1. I want all the cells to be vertically centered. This can be achieved by using the `array` package and the `m{20em}` descriptor.   2. I want to add extra space to the rows; namely, I want the heights of the rows to be larger than default. This can be done by using              \renewcommand{\arraystretch}{3}      or              \setlength{\extrarowheight}{3em}      Each of the above two requirements can be easily satisfied separately. However, if I want both effects, problems occur. The cells are not vertically centered, and the table looks really awkward as a whole! To see the problem, the `\extrarowheight` needs to be set to a large value, `3em` for example. Any suggestions are welcome! Here is an example:               \documentclass{article}     \usepackage{array}          \begin{document}          \setlength{\extrarowheight}{3em}           %without the above command, the table looks fine.          \begin{center}          \begin{tabular}{r m{6em}}          \hline          Item 0 & bla bla \\\\          Item 1 & Long description of item 1 blaaaaaa blaaaaaaa blaaaaaaaa blaaaaaaaa blaaaaa blaaa blaaaaaaaaaa \\\\          Item 2 & blaaaaaaaaaaaa blaaaaaaa blaaaaaaaaaa \\\\          \hline          \end{tabular}          \end{center}          \end{document}


title: Prettying up this equation from Mathematica

text: I like to type in 2d maths into Mathematica and then generate latex code for it. It has been working fine so far until I attempted this expression:               TeXForm[HoldForm[       S (k*L) = (4*l + 1)/         2 (Integrate[           LegendreP[2*l, x]*SphericalBesselJ[0, 1/2*kl*x], {x, -1, 1}])^2/         Integrate[SphericalBesselJ[0, 1/2*kl*x]^2, {x, -1, 1}]]]      The output latex is               S (k L)=\frac{(4 l+1) \left(\int_{-1}^1 P_{2 l}(x) j_0\left(\frac{\text{kl} x}{2}\right) \,        dx\right){}^2}{2 \int_{-1}^1 j_0\left(\frac{\text{kl} x}{2}\right){}^2 \, dx}      Which looks like this when compiled. ![Mathematica generated code](http://i.stack.imgur.com/NyHi1.png) As you can see there are many style errors (in my opinon). The Integral signs are too small with limits too big, the brackets look weird. The ^2 does not seem in the right place. The problem is if I were to type this out by hand, I come to pretty much the same code as mathematica. Any help on making this equation beautiful is greatly appreciated. Thanks


title: Conditional column break in ConTeXt

text: # Background Trying to determine whether a column break must be inserted on a two-column page. There are multiple sections on the page. Before the last section on the page, I want to insert a column break, but only if within the first column and only if there is sufficient space in the second column (i.e., without forcing a page break). # Problem The following code illustrates the problem:               \starttext         \startcolumns[n=2, balance=no]         \startsection[title=Section1]         \input knuth         \stopsection         \startsection[title=Section2]         \input zapf         \stopsection         \column         \startsection[title=Section3]         \input knuth         \stopsection              \stopcolumns     \stoptext      The `\column` break should not be applied because section 3 is in the second column, which causes an undesired page break. To clarify, the condition to determine whether or not to break the column should be independent of the text itself. For example, something like:               \setuphead[chapter][       before={\startcolumns[n=2, balance=no,]},       after={\stopcolumns},     ]          % If the section is the last section in the chapter     % *and* the section is not in the last column *and*     % inserting a column break does not cause pagination...     \setuphead[section][       before={%         \if_last_section{%           \if_not_last_column{%             \if_fits_in_last_column_without_pagination{\columnbreak}           }         }       },     ]          \starttext       \startchapter         \startsection[title=Section1]         \input knuth         \stopsection         \startsection[title=Section2]         \input zapf         \stopsection         \startsection[title=Section3]         \input knuth         \stopsection       \stopchapter     \stoptext      # Question How do you force ConTeXt to insert a column break if a section is in the first column, but not if the section is in the second column? # Related Very similar question for LaTeX:   * Column break only if within first column of multicol Using LaTeX, the following code -- part of the document class -- helped dynamically determine whether or not a column break should be present:               \def\columnbreakunlesslast{%       \docolaction{\typeout{in first column}\inlastfalse}%                   {\typeout{in middle column}\inlasttrue}%                   {\typeout{in last column}\inlasttrue}%       \unless \ifinlast \columnbreak \fi     }      This allowed documents to be written such that manually inserting column breaks was not necessary.


title: Intersection of two tkz-fct funktions

text: Is it possible to mark the intersection point of two `tkz-fct` functions and print it's coordinates? For example in this case:               \documentclass{article}               \usepackage{tkz-fct}     \begin{document}     \begin{tikzpicture}     \tkzInit[ymax=15,xmax=4,ystep=5]     \tkzAxeXY     \tkzFct[color=red,domain=0:4]{2*x**2+5}     \tkzFct[color=blue,domain=0:4]{-x**3+15}     \end{tikzpicture}     \end{document}      ![intersection](http://i.stack.imgur.com/SinIi.png)


title: Short equals sign

text: I don't know much about font encodings in LaTeX, and I'm not running Xe(La)TeX. Does anyone know where I could find a shorter (as in: not as wide) equals sign? I use it in text, not in math, and it would be nice if it were as long as the hyphen symbol. I generally just use the standard Computer Modern fonts, but if the answer is to switch fonts or move to XeLaTex, I'd consider doing so.